From d2bbf46c10d85e97bf465dc66b9f17880e3b3bc4 Mon Sep 17 00:00:00 2001 From: awsp Date: Sun, 17 Jan 2016 22:49:34 -1000 Subject: [PATCH 1/4] version 0.12.3 --- .versions | 4 +- README.md | 16 +- awsp:handsontable.js | 0 bower.json | 4 +- bower_components/handsontable/.bower.json | 10 +- bower_components/handsontable/README.md | 8 +- bower_components/handsontable/bower.json | 2 +- .../handsontable/dist/handsontable.full.js | 417 +- .../dist/handsontable.full.min.js | 34 +- .../handsontable/dist/handsontable.js | 417 +- .../handsontable/dist/handsontable.min.js | 26 +- .../handsontable/handsontable.jquery.json | 2 +- bower_components/handsontable/package.json | 10 +- .../removeRow/handsontable.removeRow.css | 4 + bower_components/moment/.bower.json | 8 +- bower_components/moment/CHANGELOG.md | 37 +- bower_components/moment/LICENSE | 2 +- bower_components/moment/README.md | 6 +- bower_components/moment/locale/af.js | 5 +- bower_components/moment/locale/ar-ma.js | 5 +- bower_components/moment/locale/ar-sa.js | 5 +- bower_components/moment/locale/ar-tn.js | 5 +- bower_components/moment/locale/ar.js | 5 +- bower_components/moment/locale/az.js | 5 +- bower_components/moment/locale/be.js | 36 +- bower_components/moment/locale/bg.js | 5 +- bower_components/moment/locale/bn.js | 17 +- bower_components/moment/locale/bo.js | 5 +- bower_components/moment/locale/br.js | 5 +- bower_components/moment/locale/bs.js | 5 +- bower_components/moment/locale/ca.js | 7 +- bower_components/moment/locale/cs.js | 19 +- bower_components/moment/locale/cv.js | 5 +- bower_components/moment/locale/cy.js | 5 +- bower_components/moment/locale/da.js | 5 +- bower_components/moment/locale/de-at.js | 12 +- bower_components/moment/locale/de.js | 12 +- bower_components/moment/locale/dv.js | 99 + bower_components/moment/locale/el.js | 11 +- bower_components/moment/locale/en-au.js | 5 +- bower_components/moment/locale/en-ca.js | 5 +- bower_components/moment/locale/en-gb.js | 5 +- bower_components/moment/locale/en-ie.js | 67 + bower_components/moment/locale/en-nz.js | 66 + bower_components/moment/locale/eo.js | 5 +- bower_components/moment/locale/es.js | 17 +- bower_components/moment/locale/et.js | 5 +- bower_components/moment/locale/eu.js | 5 +- bower_components/moment/locale/fa.js | 5 +- bower_components/moment/locale/fi.js | 5 +- bower_components/moment/locale/fo.js | 5 +- bower_components/moment/locale/fr-ca.js | 5 +- bower_components/moment/locale/fr-ch.js | 62 + bower_components/moment/locale/fr.js | 5 +- bower_components/moment/locale/fy.js | 5 +- bower_components/moment/locale/gd.js | 76 + bower_components/moment/locale/gl.js | 5 +- bower_components/moment/locale/he.js | 5 +- bower_components/moment/locale/hi.js | 5 +- bower_components/moment/locale/hr.js | 10 +- bower_components/moment/locale/hu.js | 5 +- bower_components/moment/locale/hy-am.js | 33 +- bower_components/moment/locale/id.js | 5 +- bower_components/moment/locale/is.js | 5 +- bower_components/moment/locale/it.js | 7 +- bower_components/moment/locale/ja.js | 5 +- bower_components/moment/locale/jv.js | 5 +- bower_components/moment/locale/ka.js | 37 +- bower_components/moment/locale/kk.js | 87 + bower_components/moment/locale/km.js | 7 +- bower_components/moment/locale/ko.js | 5 +- bower_components/moment/locale/lb.js | 5 +- bower_components/moment/locale/lo.js | 69 + bower_components/moment/locale/lt.js | 35 +- bower_components/moment/locale/lv.js | 5 +- bower_components/moment/locale/me.js | 5 +- bower_components/moment/locale/mk.js | 11 +- bower_components/moment/locale/ml.js | 5 +- bower_components/moment/locale/mr.js | 68 +- bower_components/moment/locale/ms-my.js | 5 +- bower_components/moment/locale/ms.js | 5 +- bower_components/moment/locale/my.js | 5 +- bower_components/moment/locale/nb.js | 17 +- bower_components/moment/locale/ne.js | 35 +- bower_components/moment/locale/nl.js | 5 +- bower_components/moment/locale/nn.js | 11 +- bower_components/moment/locale/pl.js | 7 +- bower_components/moment/locale/pt-br.js | 5 +- bower_components/moment/locale/pt.js | 5 +- bower_components/moment/locale/ro.js | 5 +- bower_components/moment/locale/ru.js | 81 +- bower_components/moment/locale/se.js | 61 + bower_components/moment/locale/si.js | 6 +- bower_components/moment/locale/sk.js | 13 +- bower_components/moment/locale/sl.js | 5 +- bower_components/moment/locale/sq.js | 5 +- bower_components/moment/locale/sr-cyrl.js | 5 +- bower_components/moment/locale/sr.js | 5 +- bower_components/moment/locale/sv.js | 5 +- bower_components/moment/locale/sw.js | 58 + bower_components/moment/locale/ta.js | 39 +- bower_components/moment/locale/te.js | 88 + bower_components/moment/locale/th.js | 5 +- bower_components/moment/locale/tl-ph.js | 5 +- bower_components/moment/locale/tlh.js | 119 + bower_components/moment/locale/tr.js | 5 +- bower_components/moment/locale/tzl.js | 25 +- bower_components/moment/locale/tzm-latn.js | 5 +- bower_components/moment/locale/tzm.js | 5 +- bower_components/moment/locale/uk.js | 24 +- bower_components/moment/locale/uz.js | 7 +- bower_components/moment/locale/vi.js | 5 +- bower_components/moment/locale/zh-cn.js | 5 +- bower_components/moment/locale/zh-tw.js | 5 +- bower_components/moment/min/locales.js | 1213 +- bower_components/moment/min/locales.min.js | 46 +- .../moment/min/moment-with-locales.js | 2361 +- .../moment/min/moment-with-locales.min.js | 48 +- bower_components/moment/min/moment.min.js | 6 +- bower_components/moment/min/tests.js | 21338 +++++++----- bower_components/moment/moment.js | 985 +- .../moment/src/lib/create/check-overflow.js | 8 +- .../moment/src/lib/create/date-from-array.js | 8 +- .../moment/src/lib/create/from-anything.js | 7 +- .../moment/src/lib/create/from-array.js | 36 +- .../moment/src/lib/create/from-object.js | 5 +- .../src/lib/create/from-string-and-format.js | 2 + .../moment/src/lib/create/from-string.js | 79 +- .../moment/src/lib/duration/create.js | 6 +- .../moment/src/lib/duration/humanize.js | 10 +- .../moment/src/lib/format/format.js | 2 +- .../moment/src/lib/locale/calendar.js | 4 +- .../moment/src/lib/locale/locales.js | 5 +- .../moment/src/lib/locale/prototype.js | 18 +- .../moment/src/lib/locale/relative.js | 6 +- bower_components/moment/src/lib/locale/set.js | 4 +- .../moment/src/lib/moment/add-subtract.js | 6 + .../moment/src/lib/moment/calendar.js | 6 +- .../moment/src/lib/moment/compare.js | 46 +- .../moment/src/lib/moment/constructor.js | 23 +- .../moment/src/lib/moment/creation-data.js | 9 + .../moment/src/lib/moment/diff.js | 16 +- .../moment/src/lib/moment/format.js | 3 +- .../moment/src/lib/moment/from.js | 8 +- .../moment/src/lib/moment/get-set.js | 10 +- .../moment/src/lib/moment/min-max.js | 13 +- .../moment/src/lib/moment/moment.js | 2 + bower_components/moment/src/lib/moment/now.js | 3 + .../moment/src/lib/moment/prototype.js | 78 +- .../moment/src/lib/moment/to-type.js | 5 + bower_components/moment/src/lib/moment/to.js | 8 +- .../moment/src/lib/parse/regex.js | 23 +- .../moment/src/lib/units/constants.js | 2 + .../moment/src/lib/units/day-of-week.js | 44 +- .../moment/src/lib/units/day-of-year.js | 17 - bower_components/moment/src/lib/units/hour.js | 60 +- .../moment/src/lib/units/month.js | 94 +- .../moment/src/lib/units/offset.js | 34 +- .../moment/src/lib/units/quarter.js | 2 +- .../src/lib/units/week-calendar-utils.js | 65 + .../moment/src/lib/units/week-year.js | 45 +- bower_components/moment/src/lib/units/week.js | 29 +- bower_components/moment/src/lib/units/year.js | 8 + .../moment/src/lib/utils/deprecate.js | 7 +- .../moment/src/lib/utils/is-function.js | 3 + .../moment/src/lib/utils/is-undefined.js | 3 + bower_components/moment/src/locale/be.js | 31 +- bower_components/moment/src/locale/bn.js | 12 +- bower_components/moment/src/locale/ca.js | 2 +- bower_components/moment/src/locale/cs.js | 14 + bower_components/moment/src/locale/de-at.js | 8 +- bower_components/moment/src/locale/de.js | 8 +- bower_components/moment/src/locale/dv.js | 89 + bower_components/moment/src/locale/el.js | 3 +- bower_components/moment/src/locale/en-ie.js | 58 + bower_components/moment/src/locale/en-nz.js | 56 + bower_components/moment/src/locale/es.js | 12 +- bower_components/moment/src/locale/fr-ch.js | 53 + bower_components/moment/src/locale/gd.js | 67 + bower_components/moment/src/locale/hr.js | 5 +- bower_components/moment/src/locale/hy-am.js | 28 +- bower_components/moment/src/locale/it.js | 2 +- bower_components/moment/src/locale/ka.js | 32 +- bower_components/moment/src/locale/kk.js | 77 + bower_components/moment/src/locale/km.js | 2 +- bower_components/moment/src/locale/lo.js | 60 + bower_components/moment/src/locale/lt.js | 30 +- bower_components/moment/src/locale/mk.js | 6 +- bower_components/moment/src/locale/mr.js | 63 +- bower_components/moment/src/locale/nb.js | 12 +- bower_components/moment/src/locale/ne.js | 30 +- bower_components/moment/src/locale/nn.js | 6 +- bower_components/moment/src/locale/pl.js | 2 +- bower_components/moment/src/locale/ru.js | 77 +- bower_components/moment/src/locale/se.js | 51 + bower_components/moment/src/locale/sk.js | 8 - bower_components/moment/src/locale/sw.js | 49 + bower_components/moment/src/locale/ta.js | 34 + bower_components/moment/src/locale/te.js | 78 + bower_components/moment/src/locale/tlh.js | 109 + bower_components/moment/src/locale/tzl.js | 18 +- bower_components/moment/src/locale/uk.js | 19 +- bower_components/moment/src/locale/uz.js | 2 +- bower_components/moment/src/moment.js | 7 +- bower_components/moment/templates/default.js | 5 + .../moment/templates/locale-header.js | 5 +- .../moment/templates/test-header.js | 5 +- lib/handsontable.meteor.0.20.3.css | 1392 + lib/handsontable.meteor.0.20.3.js | 27842 ++++++++++++++++ package.js | 7 +- 210 files changed, 49965 insertions(+), 10133 deletions(-) delete mode 100644 awsp:handsontable.js create mode 100644 bower_components/moment/locale/dv.js create mode 100644 bower_components/moment/locale/en-ie.js create mode 100644 bower_components/moment/locale/en-nz.js create mode 100644 bower_components/moment/locale/fr-ch.js create mode 100644 bower_components/moment/locale/gd.js create mode 100644 bower_components/moment/locale/kk.js create mode 100644 bower_components/moment/locale/lo.js create mode 100644 bower_components/moment/locale/se.js create mode 100644 bower_components/moment/locale/sw.js create mode 100644 bower_components/moment/locale/te.js create mode 100644 bower_components/moment/locale/tlh.js create mode 100644 bower_components/moment/src/lib/moment/creation-data.js create mode 100644 bower_components/moment/src/lib/moment/now.js create mode 100644 bower_components/moment/src/lib/units/week-calendar-utils.js create mode 100644 bower_components/moment/src/lib/utils/is-function.js create mode 100644 bower_components/moment/src/lib/utils/is-undefined.js create mode 100644 bower_components/moment/src/locale/dv.js create mode 100644 bower_components/moment/src/locale/en-ie.js create mode 100644 bower_components/moment/src/locale/en-nz.js create mode 100644 bower_components/moment/src/locale/fr-ch.js create mode 100644 bower_components/moment/src/locale/gd.js create mode 100644 bower_components/moment/src/locale/kk.js create mode 100644 bower_components/moment/src/locale/lo.js create mode 100644 bower_components/moment/src/locale/se.js create mode 100644 bower_components/moment/src/locale/sw.js create mode 100644 bower_components/moment/src/locale/te.js create mode 100644 bower_components/moment/src/locale/tlh.js create mode 100644 bower_components/moment/templates/default.js create mode 100644 lib/handsontable.meteor.0.20.3.css create mode 100644 lib/handsontable.meteor.0.20.3.js diff --git a/.versions b/.versions index 2c5499b..f4a1e85 100644 --- a/.versions +++ b/.versions @@ -1,4 +1,4 @@ -awsp:handsontable@0.12.2 +awsp:handsontable@0.12.3 base64@1.0.3 binary-heap@1.0.3 callback-hook@1.0.3 @@ -9,7 +9,7 @@ geojson-utils@1.0.3 id-map@1.0.3 jquery@1.11.3_2 json@1.0.3 -local-test:awsp:handsontable@0.12.2 +local-test:awsp:handsontable@0.12.3 logging@1.0.7 meteor@1.1.6 minimongo@1.0.8 diff --git a/README.md b/README.md index c229827..f95a036 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# Meteor Handsontable (@version 0.12.2) -This package uses the latest version of Handsontable (currently @version 0.20.2) in MeteorJS. +# Meteor Handsontable (@version 0.12.3) +This package uses the latest version of Handsontable (currently @version 0.20.3) in MeteorJS. ## Installation @@ -15,7 +15,7 @@ meteor add awsp:handsontable ## Important Notes -This package contains the latest yet slightly modified version of Handsontable (version 0.20.2). Minor change has been made to the UI as well. +This package contains the latest yet slightly modified version of Handsontable (version 0.20.3). Minor change has been made to the UI as well. The new version of Handsontable no longer necessary requires jQuery to work. In order to introduce the latest Handsontable to Meteor, a minimum of modification was made to Handsontable in this package to fix some of the conflicts when used in Meteor. @@ -57,8 +57,8 @@ Starting from package version 0.7.0, you could also enable formulas in Handsonta This package uses the default styling from Handsontable and RuleJS. However, you can always customize to your own by changing the following 2 classes in CSS. -* `td.formulas` -* `td.formula-error` +* `td.formulas` +* `td.formula-error` ```js $("#hot3").handsontable({ @@ -76,7 +76,9 @@ For more details on usage and supported formulas, + ## Release Notes +* Version 0.12.3 - Update Handsontable version to 0.20.3. * Version 0.12.2 - Update Handsontable version to 0.20.2. * Version 0.12.1 - Update Handsontable version to 0.20.1. * Version 0.12.0 - Update Handsontable version to 0.20.0. @@ -88,7 +90,7 @@ For more details on usage and supported formulas, * Version 0.7.0 - Add formulas support. Add Handsontable license. Change package summary for Handsontable. * Version 0.6.1 - Update to the latest version of Handsontable (0.15.1) * Version 0.6.0 - Bump Handsontable to version 0.15.0. Removed shadow fixes as 0.15.0 no longer have that. Minor UI tweaked. - Removed unnecessary libraries as Handsontable had already included them. + Removed unnecessary libraries as Handsontable had already included them. * Version 0.5.2 - Remove table edge shadow as this is hurting performance especially dealing with large data. Until Handsontable version 0.15.x is stable, shall remove related styles. @@ -100,7 +102,7 @@ https://github.com/awsp/handsontable-meteor ## Versions Tracking -* Handsontable - 0.20.2 [Release Notes](https://github.com/handsontable/handsontable/releases) +* Handsontable - 0.20.3 [Release Notes](https://github.com/handsontable/handsontable/releases) [New license](http://handsontable.com/static/licenses/v1/open-source-license.pdf?_ga=1.992503.778804082.1429430347) * ruleJS - 0.0.5 diff --git a/awsp:handsontable.js b/awsp:handsontable.js deleted file mode 100644 index e69de29..0000000 diff --git a/bower.json b/bower.json index a17016a..5226702 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "awsp:handsontable", "main": "package.js", - "version": "0.12.2", + "version": "0.12.3", "homepage": "https://github.com/awsp/handsontable-meteor", "authors": [ "awsp " @@ -21,6 +21,6 @@ "tests" ], "dependencies": { - "handsontable": "~0.20.2" + "handsontable": "~0.20.3" } } diff --git a/bower_components/handsontable/.bower.json b/bower_components/handsontable/.bower.json index 2aea777..34312d0 100644 --- a/bower_components/handsontable/.bower.json +++ b/bower_components/handsontable/.bower.json @@ -1,7 +1,7 @@ { "name": "handsontable", "description": "Spreadsheet-like data grid editor that provides copy/paste functionality compatible with Excel/Google Docs", - "version": "0.20.2", + "version": "0.20.3", "main": [ "./dist/handsontable.js", "./dist/handsontable.css" @@ -46,13 +46,13 @@ "devDependencies": { "chroma-js": "~0.5.6" }, - "_release": "0.20.2", + "_release": "0.20.3", "_resolution": { "type": "version", - "tag": "0.20.2", - "commit": "c10835f033c78df9bc16013acda97fe8a880ee0f" + "tag": "0.20.3", + "commit": "87c8f6b1842d56c99c1fc702bbf1f236a4b223b4" }, "_source": "git://github.com/handsontable/handsontable.git", - "_target": "~0.20.2", + "_target": "~0.20.3", "_originalSource": "handsontable" } \ No newline at end of file diff --git a/bower_components/handsontable/README.md b/bower_components/handsontable/README.md index 890db5d..a591780 100644 --- a/bower_components/handsontable/README.md +++ b/bower_components/handsontable/README.md @@ -45,9 +45,9 @@ Check out the demos at http://handsontable.com/examples.html or fork the example ### API Reference -- [Core methods](http://docs.handsontable.com/0.17.0/Core.html) -- [Options](http://docs.handsontable.com/0.17.0/Options.html) -- [Hooks](http://docs.handsontable.com/0.17.0/Hooks.html) +- [Core methods](http://docs.handsontable.com/Core.html) +- [Options](http://docs.handsontable.com/Options.html) +- [Hooks](http://docs.handsontable.com/Hooks.html) ### Troubleshooting @@ -78,4 +78,4 @@ The MIT License (see the [LICENSE](https://github.com/handsontable/handsontable/ ### Contact -You can contact us at hello@handsontable.com. \ No newline at end of file +You can contact us at hello@handsontable.com. diff --git a/bower_components/handsontable/bower.json b/bower_components/handsontable/bower.json index 42d76a8..57f98f5 100644 --- a/bower_components/handsontable/bower.json +++ b/bower_components/handsontable/bower.json @@ -1,7 +1,7 @@ { "name": "handsontable", "description": "Spreadsheet-like data grid editor that provides copy/paste functionality compatible with Excel/Google Docs", - "version": "0.20.2", + "version": "0.20.3", "main": ["./dist/handsontable.js", "./dist/handsontable.css"], "homepage": "http://handsontable.com/", "repository": { diff --git a/bower_components/handsontable/dist/handsontable.full.js b/bower_components/handsontable/dist/handsontable.full.js index 3c9c26a..2ebaecf 100644 --- a/bower_components/handsontable/dist/handsontable.full.js +++ b/bower_components/handsontable/dist/handsontable.full.js @@ -628,7 +628,9 @@ var $WalkontableViewportColumnsCalculator = WalkontableViewportColumnsCalculator this.stretchAllColumnsWidth = []; this.needVerifyLastColumnWidth = true; } else if (this.stretch === 'last' && totalWidth !== Infinity) { - this.stretchLastWidth = -remainingSize + this._getColumnWidth(totalColumns - 1); + var columnWidth$__1 = this._getColumnWidth(totalColumns - 1); + var lastColumnWidth = -remainingSize + columnWidth$__1; + this.stretchLastWidth = lastColumnWidth >= 0 ? lastColumnWidth : columnWidth$__1; } }, getStretchedColumnWidth: function(column, baseWidth) { @@ -1306,15 +1308,16 @@ function WalkontableEvent(instance) { } }, 30); }; - var lastMouseOver; var onMouseOver = function(event) { var table, - td; + td, + mainWOT; if (that.instance.hasSetting('onCellMouseOver')) { table = that.instance.wtTable.TABLE; td = closest(event.realTarget, ['TD', 'TH'], table); - if (td && td !== lastMouseOver && isChildOf(td, table)) { - lastMouseOver = td; + mainWOT = that.instance.cloneSource || that.instance; + if (td && td !== mainWOT.lastMouseOver && isChildOf(td, table)) { + mainWOT.lastMouseOver = td; that.instance.getSetting('onCellMouseOver', event, that.instance.wtTable.getCoords(td), td, that.instance); } } @@ -1518,13 +1521,13 @@ var WalkontableOverlay = function WalkontableOverlay(wotInstance) { defineGetter(this, 'wot', wotInstance, {writable: false}); this.instance = this.wot; this.type = ''; + this.mainTableScrollableElement = null; this.TABLE = this.wot.wtTable.TABLE; this.hider = this.wot.wtTable.hider; this.spreader = this.wot.wtTable.spreader; this.holder = this.wot.wtTable.holder; this.wtRootElement = this.wot.wtTable.wtRootElement; this.trimmingContainer = getTrimmingContainer(this.hider.parentNode.parentNode); - this.mainTableScrollableElement = getScrollableElement(this.wot.wtTable.TABLE); this.needFullRender = this.shouldBeRendered(); this.areElementSizesAdjusted = false; }; @@ -1548,6 +1551,12 @@ var $WalkontableOverlay = WalkontableOverlay; clone.appendChild(clonedTable); this.type = direction; this.wot.wtTable.wtRootElement.parentNode.appendChild(clone); + var preventOverflow = this.wot.getSetting('preventOverflow'); + if (preventOverflow === true || preventOverflow === 'horizontal' && this.type === $WalkontableOverlay.CLONE_TOP || preventOverflow === 'vertical' && this.type === $WalkontableOverlay.CLONE_LEFT) { + this.mainTableScrollableElement = window; + } else { + this.mainTableScrollableElement = getScrollableElement(this.wot.wtTable.TABLE); + } return new Walkontable({ cloneSource: this.wot, cloneOverlay: this, @@ -1650,6 +1659,7 @@ var $__0 = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47 getWindowScrollTop = $__0.getWindowScrollTop, hasClass = $__0.hasClass, outerWidth = $__0.outerWidth, + innerHeight = $__0.innerHeight, removeClass = $__0.removeClass, setOverlayPosition = $__0.setOverlayPosition; var WalkontableOverlay = ($___95_base__ = require("_base"), $___95_base__ && $___95_base__.__esModule && $___95_base__ || {default: $___95_base__}).WalkontableOverlay; @@ -1668,7 +1678,8 @@ var $WalkontableLeftOverlay = WalkontableLeftOverlay; } var overlayRoot = this.clone.wtTable.holder.parentNode; var headerPosition = 0; - if (this.trimmingContainer === window) { + var preventOverflow = this.wot.getSetting('preventOverflow'); + if (this.trimmingContainer === window && (!preventOverflow || preventOverflow !== 'horizontal')) { var box = this.wot.wtTable.hider.getBoundingClientRect(); var left = Math.ceil(box.left); var right = Math.ceil(box.right); @@ -1724,9 +1735,12 @@ var $WalkontableLeftOverlay = WalkontableLeftOverlay; var scrollbarHeight = masterHolder.clientHeight === masterHolder.offsetHeight ? 0 : getScrollbarWidth(); var overlayRoot = this.clone.wtTable.holder.parentNode; var overlayRootStyle = overlayRoot.style; + var preventOverflow = this.wot.getSetting('preventOverflow'); var tableWidth; - if (this.trimmingContainer !== window) { - overlayRootStyle.height = this.wot.wtViewport.getWorkspaceHeight() - scrollbarHeight + 'px'; + if (this.trimmingContainer !== window || preventOverflow === 'vertical') { + var height = this.wot.wtViewport.getWorkspaceHeight() - scrollbarHeight; + height = Math.min(height, innerHeight(this.wot.wtTable.wtRootElement)); + overlayRootStyle.height = height + 'px'; } this.clone.wtTable.holder.style.height = overlayRootStyle.height; tableWidth = outerWidth(this.clone.wtTable.TABLE); @@ -1783,11 +1797,12 @@ var $WalkontableLeftOverlay = WalkontableLeftOverlay; this.setScrollPosition(newX); }, getTableParentOffset: function() { - if (this.trimmingContainer === window) { - return this.wot.wtTable.holderOffset.left; - } else { - return 0; + var preventOverflow = this.wot.getSetting('preventOverflow'); + var offset = 0; + if (!preventOverflow && this.trimmingContainer === window) { + offset = this.wot.wtTable.holderOffset.left; } + return offset; }, getScrollPosition: function() { return getScrollLeft(this.mainTableScrollableElement); @@ -1833,6 +1848,7 @@ var $__0 = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47 getWindowScrollLeft = $__0.getWindowScrollLeft, hasClass = $__0.hasClass, outerHeight = $__0.outerHeight, + innerWidth = $__0.innerWidth, removeClass = $__0.removeClass, setOverlayPosition = $__0.setOverlayPosition; var WalkontableOverlay = ($___95_base__ = require("_base"), $___95_base__ && $___95_base__.__esModule && $___95_base__ || {default: $___95_base__}).WalkontableOverlay; @@ -1851,7 +1867,8 @@ var $WalkontableTopOverlay = WalkontableTopOverlay; } var overlayRoot = this.clone.wtTable.holder.parentNode; var headerPosition = 0; - if (this.wot.wtOverlays.leftOverlay.trimmingContainer === window) { + var preventOverflow = this.wot.getSetting('preventOverflow'); + if (this.trimmingContainer === window && (!preventOverflow || preventOverflow !== 'vertical')) { var box = this.wot.wtTable.hider.getBoundingClientRect(); var top = Math.ceil(box.top); var bottom = Math.ceil(box.bottom); @@ -1908,9 +1925,12 @@ var $WalkontableTopOverlay = WalkontableTopOverlay; var scrollbarWidth = masterHolder.clientWidth === masterHolder.offsetWidth ? 0 : getScrollbarWidth(); var overlayRoot = this.clone.wtTable.holder.parentNode; var overlayRootStyle = overlayRoot.style; + var preventOverflow = this.wot.getSetting('preventOverflow'); var tableHeight; - if (this.trimmingContainer !== window) { - overlayRootStyle.width = this.wot.wtViewport.getWorkspaceWidth() - scrollbarWidth + 'px'; + if (this.trimmingContainer !== window || preventOverflow === 'horizontal') { + var width = this.wot.wtViewport.getWorkspaceWidth() - scrollbarWidth; + width = Math.min(width, innerWidth(this.wot.wtTable.wtRootElement)); + overlayRootStyle.width = width + 'px'; } this.clone.wtTable.holder.style.width = overlayRootStyle.width; tableHeight = outerHeight(this.clone.wtTable.TABLE); @@ -1984,7 +2004,7 @@ var $WalkontableTopOverlay = WalkontableTopOverlay; if (this.wot.getSetting('fixedRowsTop') === 0 && this.wot.getSetting('columnHeaders').length > 0) { var masterParent = this.wot.wtTable.holder.parentNode; var previousState = hasClass(masterParent, 'innerBorderTop'); - if (position) { + if (position || this.wot.getSetting('totalRows') === 0) { addClass(masterParent, 'innerBorderTop'); } else { removeClass(masterParent, 'innerBorderTop'); @@ -2039,23 +2059,24 @@ var $WalkontableTopLeftCornerOverlay = WalkontableTopLeftCornerOverlay; var overlayRoot = this.clone.wtTable.holder.parentNode; var tableHeight = outerHeight(this.clone.wtTable.TABLE); var tableWidth = outerWidth(this.clone.wtTable.TABLE); + var preventOverflow = this.wot.getSetting('preventOverflow'); if (this.trimmingContainer === window) { var box = this.wot.wtTable.hider.getBoundingClientRect(); var top = Math.ceil(box.top); var left = Math.ceil(box.left); var bottom = Math.ceil(box.bottom); var right = Math.ceil(box.right); - var finalLeft; - var finalTop; - if (left < 0 && (right - overlayRoot.offsetWidth) > 0) { - finalLeft = -left + 'px'; - } else { - finalLeft = '0'; + var finalLeft = '0'; + var finalTop = '0'; + if (!preventOverflow || preventOverflow === 'vertical') { + if (left < 0 && (right - overlayRoot.offsetWidth) > 0) { + finalLeft = -left + 'px'; + } } - if (top < 0 && (bottom - overlayRoot.offsetHeight) > 0) { - finalTop = -top + 'px'; - } else { - finalTop = '0'; + if (!preventOverflow || preventOverflow === 'horizontal') { + if (top < 0 && (bottom - overlayRoot.offsetHeight) > 0) { + finalTop = -top + 'px'; + } } setOverlayPosition(overlayRoot, finalLeft, finalTop); } @@ -2092,7 +2113,7 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { this.eventManager = new EventManager(this.wot); this.wot.update('scrollbarWidth', getScrollbarWidth()); this.wot.update('scrollbarHeight', getScrollbarWidth()); - this.mainTableScrollableElement = getScrollableElement(this.wot.wtTable.TABLE); + this.scrollableElement = getScrollableElement(this.wot.wtTable.TABLE); this.topOverlay = WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP, this.wot); if (typeof WalkontableBottomOverlay === 'undefined') { this.bottomOverlay = {needFullRender: false}; @@ -2170,9 +2191,16 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { this.eventManager.addEventListener(document, 'visibilitychange', (function() { return $__3.onKeyUp(); })); - this.eventManager.addEventListener(this.mainTableScrollableElement, 'scroll', (function(event) { + var topOverlayScrollable = this.topOverlay.mainTableScrollableElement; + var leftOverlayScrollable = this.leftOverlay.mainTableScrollableElement; + this.eventManager.addEventListener(topOverlayScrollable, 'scroll', (function(event) { return $__3.onTableScroll(event); })); + if (topOverlayScrollable !== leftOverlayScrollable) { + this.eventManager.addEventListener(leftOverlayScrollable, 'scroll', (function(event) { + return $__3.onTableScroll(event); + })); + } if (this.topOverlay.needFullRender) { this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder, 'scroll', (function(event) { return $__3.onTableScroll(event); @@ -2223,8 +2251,13 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { if (Handsontable.mobileBrowser) { return; } - if (this.keyPressed && this.mainTableScrollableElement !== window && !event.target.contains(this.mainTableScrollableElement)) { - return; + var masterHorizontal = this.leftOverlay.mainTableScrollableElement; + var masterVertical = this.topOverlay.mainTableScrollableElement; + var target = event.target; + if (this.keyPressed) { + if ((masterVertical !== window && target !== window && !event.target.contains(masterVertical)) || (masterHorizontal !== window && target !== window && !event.target.contains(masterHorizontal))) { + return; + } } if (event.type === 'scroll') { this.syncScrollPositions(event); @@ -2273,7 +2306,8 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { this.syncScrollWithMaster(); return; } - var master = this.mainTableScrollableElement; + var masterHorizontal = this.leftOverlay.mainTableScrollableElement; + var masterVertical = this.topOverlay.mainTableScrollableElement; var target = event.target; var tempScrollValue = 0; var scrollValueChanged = false; @@ -2281,6 +2315,7 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { var leftOverlay; var bottomOverlay; var delegatedScroll = false; + var preventOverflow = this.wot.getSetting('preventOverflow'); if (this.topOverlay.needFullRender) { topOverlay = this.topOverlay.clone.wtTable.holder; } @@ -2293,19 +2328,23 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { if (target === document) { target = window; } - if (target === master) { - tempScrollValue = getScrollLeft(target); + if (target === masterHorizontal || target === masterVertical) { + if (preventOverflow) { + tempScrollValue = getScrollLeft(this.scrollableElement); + } else { + tempScrollValue = getScrollLeft(target); + } if (this.overlayScrollPositions.master.left !== tempScrollValue) { this.horizontalScrolling = true; this.overlayScrollPositions.master.left = tempScrollValue; scrollValueChanged = true; if (topOverlay) { topOverlay.scrollLeft = tempScrollValue; - delegatedScroll = (this.mainTableScrollableElement !== window); + delegatedScroll = (masterHorizontal !== window); } if (bottomOverlay) { bottomOverlay.scrollLeft = tempScrollValue; - delegatedScroll = (this.mainTableScrollableElement !== window); + delegatedScroll = (masterHorizontal !== window); } } tempScrollValue = getScrollTop(target); @@ -2315,7 +2354,7 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { scrollValueChanged = true; if (leftOverlay) { leftOverlay.scrollTop = tempScrollValue; - delegatedScroll = (this.mainTableScrollableElement !== window); + delegatedScroll = (masterVertical !== window); } } } else if (target === bottomOverlay) { @@ -2324,11 +2363,11 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { this.horizontalScrolling = true; this.overlayScrollPositions.bottom.left = tempScrollValue; scrollValueChanged = true; - master.scrollLeft = tempScrollValue; + masterHorizontal.scrollLeft = tempScrollValue; } if (fakeScrollValue !== null) { scrollValueChanged = true; - master.scrollTop += fakeScrollValue; + masterVertical.scrollTop += fakeScrollValue; } } else if (target === topOverlay) { tempScrollValue = getScrollLeft(target); @@ -2336,11 +2375,11 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { this.horizontalScrolling = true; this.overlayScrollPositions.top.left = tempScrollValue; scrollValueChanged = true; - master.scrollLeft = tempScrollValue; + masterHorizontal.scrollLeft = tempScrollValue; } if (fakeScrollValue !== null) { scrollValueChanged = true; - master.scrollTop += fakeScrollValue; + masterVertical.scrollTop += fakeScrollValue; } } else if (target === leftOverlay) { tempScrollValue = getScrollTop(target); @@ -2348,11 +2387,11 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { this.verticalScrolling = true; this.overlayScrollPositions.left.top = tempScrollValue; scrollValueChanged = true; - master.scrollTop = tempScrollValue; + masterVertical.scrollTop = tempScrollValue; } if (fakeScrollValue !== null) { scrollValueChanged = true; - master.scrollLeft += fakeScrollValue; + masterVertical.scrollLeft += fakeScrollValue; } } if (!this.keyPressed && scrollValueChanged && event.type === 'scroll') { @@ -2458,41 +2497,181 @@ Object.defineProperties(exports, { }}, __esModule: {value: true} }); +var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47__46__46__47_helpers_47_number__; +var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}), + innerHeight = $__0.innerHeight, + innerWidth = $__0.innerWidth, + getScrollLeft = $__0.getScrollLeft, + getScrollTop = $__0.getScrollTop, + offset = $__0.offset; +var $__1 = ($___46__46__47__46__46__47__46__46__47_helpers_47_number__ = require("helpers/number"), $___46__46__47__46__46__47__46__46__47_helpers_47_number__ && $___46__46__47__46__46__47__46__46__47_helpers_47_number__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_number__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_number__}), + rangeEach = $__1.rangeEach, + rangeEachReverse = $__1.rangeEachReverse; var WalkontableScroll = function WalkontableScroll(wotInstance) { this.wot = wotInstance; this.instance = wotInstance; }; -($traceurRuntime.createClass)(WalkontableScroll, {scrollViewport: function(coords) { +($traceurRuntime.createClass)(WalkontableScroll, { + scrollViewport: function(coords) { if (!this.wot.drawn) { return; } - var totalRows = this.wot.getSetting('totalRows'); - var totalColumns = this.wot.getSetting('totalColumns'); - var fixedRowsTop = this.instance.getSetting('fixedRowsTop'); - var fixedRowsBottom = this.instance.getSetting('fixedRowsBottom'); - var fixedColumnsLeft = this.instance.getSetting('fixedColumnsLeft'); + var $__3 = this._getVariables(), + topOverlay = $__3.topOverlay, + leftOverlay = $__3.leftOverlay, + totalRows = $__3.totalRows, + totalColumns = $__3.totalColumns, + fixedRowsTop = $__3.fixedRowsTop, + fixedRowsBottom = $__3.fixedRowsBottom, + fixedColumnsLeft = $__3.fixedColumnsLeft; if (coords.row < 0 || coords.row > totalRows - 1) { - throw new Error('row ' + coords.row + ' does not exist'); + throw new Error(("row " + coords.row + " does not exist")); } if (coords.col < 0 || coords.col > totalColumns - 1) { - throw new Error('column ' + coords.col + ' does not exist'); + throw new Error(("column " + coords.col + " does not exist")); + } + if (coords.row >= fixedRowsTop && coords.row < this.getFirstVisibleRow()) { + topOverlay.scrollTo(coords.row); + } else if (coords.row > this.getLastVisibleRow() && coords.row < totalRows - fixedRowsBottom) { + topOverlay.scrollTo(coords.row, true); + } + if (coords.col >= fixedColumnsLeft && coords.col < this.getFirstVisibleColumn()) { + leftOverlay.scrollTo(coords.col); + } else if (coords.col > this.getLastVisibleColumn()) { + leftOverlay.scrollTo(coords.col, true); + } + }, + getFirstVisibleRow: function() { + var $__3 = this._getVariables(), + topOverlay = $__3.topOverlay, + wtTable = $__3.wtTable, + wtViewport = $__3.wtViewport, + totalRows = $__3.totalRows, + fixedRowsTop = $__3.fixedRowsTop; + var firstVisibleRow = wtTable.getFirstVisibleRow(); + if (topOverlay.mainTableScrollableElement === window) { + var rootElementOffset = offset(wtTable.wtRootElement); + var totalTableHeight = innerHeight(wtTable.hider); + var windowHeight = innerHeight(window); + var windowScrollTop = getScrollTop(window); + if (rootElementOffset.top + totalTableHeight - windowHeight <= windowScrollTop) { + var rowsHeight = wtViewport.getColumnHeaderHeight(); + rowsHeight += topOverlay.sumCellSizes(0, fixedRowsTop); + rangeEachReverse(totalRows, 1, (function(row) { + rowsHeight += topOverlay.sumCellSizes(row - 1, row); + if (rootElementOffset.top + totalTableHeight - rowsHeight <= windowScrollTop) { + firstVisibleRow = row; + return false; + } + })); + } } - if (coords.row > this.instance.wtTable.getLastVisibleRow() && coords.row < totalRows - fixedRowsBottom) { - this.wot.wtOverlays.topOverlay.scrollTo(coords.row, true); - } else if (coords.row >= fixedRowsTop && coords.row < this.instance.wtTable.getFirstVisibleRow()) { - this.wot.wtOverlays.topOverlay.scrollTo(coords.row); + return firstVisibleRow; + }, + getLastVisibleRow: function() { + var $__3 = this._getVariables(), + topOverlay = $__3.topOverlay, + wtTable = $__3.wtTable, + wtViewport = $__3.wtViewport, + totalRows = $__3.totalRows; + var lastVisibleRow = wtTable.getLastVisibleRow(); + if (topOverlay.mainTableScrollableElement === window) { + var rootElementOffset = offset(wtTable.wtRootElement); + var windowHeight = innerHeight(window); + var windowScrollTop = getScrollTop(window); + if (rootElementOffset.top > windowScrollTop) { + var rowsHeight = wtViewport.getColumnHeaderHeight(); + rangeEach(1, totalRows, (function(row) { + rowsHeight += topOverlay.sumCellSizes(row - 1, row); + if (rootElementOffset.top + rowsHeight - windowScrollTop >= windowHeight) { + lastVisibleRow = row - 2; + return false; + } + })); + } } - if (coords.col > this.instance.wtTable.getLastVisibleColumn()) { - this.wot.wtOverlays.leftOverlay.scrollTo(coords.col, true); - } else if (coords.col >= fixedColumnsLeft && coords.col < this.instance.wtTable.getFirstVisibleColumn()) { - this.wot.wtOverlays.leftOverlay.scrollTo(coords.col); + return lastVisibleRow; + }, + getFirstVisibleColumn: function() { + var $__3 = this._getVariables(), + leftOverlay = $__3.leftOverlay, + wtTable = $__3.wtTable, + wtViewport = $__3.wtViewport, + totalColumns = $__3.totalColumns, + fixedColumnsLeft = $__3.fixedColumnsLeft; + var firstVisibleColumn = wtTable.getFirstVisibleColumn(); + if (leftOverlay.mainTableScrollableElement === window) { + var rootElementOffset = offset(wtTable.wtRootElement); + var totalTableWidth = innerWidth(wtTable.hider); + var windowWidth = innerWidth(window); + var windowScrollLeft = getScrollLeft(window); + if (rootElementOffset.left + totalTableWidth - windowWidth <= windowScrollLeft) { + var columnsWidth = wtViewport.getRowHeaderWidth(); + rangeEachReverse(totalColumns, 1, (function(column) { + columnsWidth += leftOverlay.sumCellSizes(column - 1, column); + if (rootElementOffset.left + totalTableWidth - columnsWidth <= windowScrollLeft) { + firstVisibleColumn = column; + return false; + } + })); + } } - }}, {}); + return firstVisibleColumn; + }, + getLastVisibleColumn: function() { + var $__3 = this._getVariables(), + leftOverlay = $__3.leftOverlay, + wtTable = $__3.wtTable, + wtViewport = $__3.wtViewport, + totalColumns = $__3.totalColumns; + var lastVisibleColumn = wtTable.getLastVisibleColumn(); + if (leftOverlay.mainTableScrollableElement === window) { + var rootElementOffset = offset(wtTable.wtRootElement); + var windowWidth = innerWidth(window); + var windowScrollLeft = getScrollLeft(window); + if (rootElementOffset.left > windowScrollLeft) { + var columnsWidth = wtViewport.getRowHeaderWidth(); + rangeEach(1, totalColumns, (function(column) { + columnsWidth += leftOverlay.sumCellSizes(column - 1, column); + if (rootElementOffset.left + columnsWidth - windowScrollLeft >= windowWidth) { + lastVisibleColumn = column - 2; + return false; + } + })); + } + } + return lastVisibleColumn; + }, + _getVariables: function() { + var wot = this.wot; + var topOverlay = wot.wtOverlays.topOverlay; + var leftOverlay = wot.wtOverlays.leftOverlay; + var wtTable = wot.wtTable; + var wtViewport = wot.wtViewport; + var totalRows = wot.getSetting('totalRows'); + var totalColumns = wot.getSetting('totalColumns'); + var fixedRowsTop = wot.getSetting('fixedRowsTop'); + var fixedRowsBottom = wot.getSetting('fixedRowsBottom'); + var fixedColumnsLeft = wot.getSetting('fixedColumnsLeft'); + return { + topOverlay: topOverlay, + leftOverlay: leftOverlay, + wtTable: wtTable, + wtViewport: wtViewport, + totalRows: totalRows, + totalColumns: totalColumns, + fixedRowsTop: fixedRowsTop, + fixedRowsBottom: fixedRowsBottom, + fixedColumnsLeft: fixedColumnsLeft + }; + } +}, {}); ; window.WalkontableScroll = WalkontableScroll; //# -},{}],18:[function(require,module,exports){ +},{"helpers/dom/element":45,"helpers/number":49}],18:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { WalkontableSelection: {get: function() { @@ -2641,6 +2820,9 @@ var WalkontableSettings = function WalkontableSettings(wotInstance, settings) { stretchH: 'none', currentRowClassName: null, currentColumnClassName: null, + preventOverflow: function() { + return false; + }, data: void 0, fixedColumnsLeft: 0, fixedRowsTop: 0, @@ -2850,8 +3032,11 @@ var WalkontableTable = function WalkontableTable(wotInstance, table) { if (!this.isWorkingOnClone()) { this.holder.parentNode.style.position = 'relative'; if (trimmingElement === window) { - this.holder.style.overflow = 'visible'; - this.wtRootElement.style.overflow = 'visible'; + var preventOverflow = this.wot.getSetting('preventOverflow'); + if (!preventOverflow) { + this.holder.style.overflow = 'visible'; + this.wtRootElement.style.overflow = 'visible'; + } } else { this.holder.style.width = getStyle(trimmingElement, 'width'); this.holder.style.height = getStyle(trimmingElement, 'height'); @@ -3123,7 +3308,8 @@ var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = empty = $__0.empty, getScrollbarWidth = $__0.getScrollbarWidth, hasClass = $__0.hasClass, - innerHeight = $__0.innerHeight; + innerHeight = $__0.innerHeight, + outerWidth = $__0.outerWidth; var WalkontableTableRenderer = function WalkontableTableRenderer(wtTable) { this.wtTable = wtTable; this.wot = wtTable.instance; @@ -3183,6 +3369,11 @@ var WalkontableTableRenderer = function WalkontableTableRenderer(wtTable) { this.markOversizedRows(); this.wot.wtViewport.createVisibleCalculators(); this.wot.wtOverlays.refresh(false); + var hiderWidth = outerWidth(this.wtTable.hider); + var tableWidth = outerWidth(this.wtTable.TABLE); + if (hiderWidth !== 0 && (tableWidth !== hiderWidth)) { + this.adjustColumnWidths(columnsToRender); + } this.wot.wtOverlays.applyToDOM(); if (workspaceWidth !== this.wot.wtViewport.getWorkspaceWidth()) { this.wot.wtViewport.containerWidth = null; @@ -3565,11 +3756,15 @@ var WalkontableViewport = function WalkontableViewport(wotInstance) { }, getWorkspaceWidth: function() { var width; - var totalColumns = this.instance.getSetting('totalColumns'); + var totalColumns = this.wot.getSetting('totalColumns'); var trimmingContainer = this.instance.wtOverlays.leftOverlay.trimmingContainer; var overflow; - var stretchSetting = this.instance.getSetting('stretchH'); + var stretchSetting = this.wot.getSetting('stretchH'); var docOffsetWidth = document.documentElement.offsetWidth; + var preventOverflow = this.wot.getSetting('preventOverflow'); + if (preventOverflow) { + return outerWidth(this.instance.wtTable.wtRootElement); + } if (Handsontable.freezeOverlays) { width = Math.min(docOffsetWidth - this.getWorkspaceOffset().left, docOffsetWidth); } else { @@ -3699,7 +3894,7 @@ var WalkontableViewport = function WalkontableViewport(wotInstance) { } else { height = this.getViewportHeight(); } - pos = getScrollTop(this.wot.wtOverlays.mainTableScrollableElement) - this.wot.wtOverlays.topOverlay.getTableParentOffset(); + pos = this.wot.wtOverlays.topOverlay.getScrollPosition() - this.wot.wtOverlays.topOverlay.getTableParentOffset(); if (pos < 0) { pos = 0; } @@ -3848,9 +4043,9 @@ var domHelpers = ($__helpers_47_dom_47_element__ = require("helpers/dom/element" var domEventHelpers = ($__helpers_47_dom_47_event__ = require("helpers/dom/event"), $__helpers_47_dom_47_event__ && $__helpers_47_dom_47_event__.__esModule && $__helpers_47_dom_47_event__ || {default: $__helpers_47_dom_47_event__}); var HELPERS = [arrayHelpers, browserHelpers, dataHelpers, functionHelpers, mixedHelpers, numberHelpers, objectHelpers, settingHelpers, stringHelpers, unicodeHelpers]; var DOM = [domHelpers, domEventHelpers]; -Handsontable.buildDate = 'Fri Dec 04 2015 11:56:12 GMT+0100 (CET)'; +Handsontable.buildDate = 'Fri Jan 08 2016 13:02:33 GMT+0100 (CET)'; Handsontable.packageName = 'handsontable'; -Handsontable.version = '0.20.2'; +Handsontable.version = '0.20.3'; var baseVersion = '@@baseVersion'; if (!/^@@/.test(baseVersion)) { Handsontable.baseVersion = baseVersion; @@ -4105,8 +4300,8 @@ Handsontable.Core = function Core(rootElement, userSettings) { instance.getSettings().fixedRowsTop -= Math.min(amount, fixedRowsTop - index); } var fixedRowsBottom = instance.getSettings().fixedRowsBottom; - if (fixedRowsBottom && totalRows - fixedRowsBottom <= index + 1) { - instance.getSettings().fixedRowsBottom -= Math.min(amount, fixedRowsBottom - index); + if (fixedRowsBottom && index >= totalRows - fixedRowsBottom) { + instance.getSettings().fixedRowsBottom -= Math.min(amount, fixedRowsBottom); } grid.adjustRowsAndCols(); selection.refreshBorders(); @@ -5703,7 +5898,8 @@ DefaultSettings.prototype = { correctFormat: false, defaultDate: void 0, strict: void 0, - renderAllRows: void 0 + renderAllRows: void 0, + preventOverflow: false }; Handsontable.DefaultSettings = DefaultSettings; @@ -10753,6 +10949,11 @@ var $AutoColumnSize = AutoColumnSize; if (this.enabled) { return; } + var setting = this.hot.getSettings().autoColumnSize; + var samplingRatio = setting && setting.hasOwnProperty('samplingRatio') ? this.hot.getSettings().autoColumnSize.samplingRatio : void 0; + if (samplingRatio && !isNaN(samplingRatio)) { + this.samplesGenerator.customSampleCount = parseInt(samplingRatio, 10); + } this.addHook('afterLoadData', (function() { return $__10.onAfterLoadData(); })); @@ -11023,6 +11224,11 @@ var $AutoRowSize = AutoRowSize; if (this.enabled) { return; } + var setting = this.hot.getSettings().autoRowSize; + var samplingRatio = setting && setting.hasOwnProperty('samplingRatio') ? this.hot.getSettings().autoRowSize.samplingRatio : void 0; + if (samplingRatio && !isNaN(samplingRatio)) { + this.samplesGenerator.customSampleCount = parseInt(samplingRatio, 10); + } this.addHook('afterLoadData', (function() { return $__9.onAfterLoadData(); })); @@ -13305,7 +13511,7 @@ var _predefinedItems = ($__4 = {}, Object.defineProperty($__4, SEPARATOR, { }, disabled: function() { var selected = getValidSelection(this); - if (!selected) { + if (!selected || this.countRows() >= this.getSettings().maxRows) { return true; } var rowCount = this.countRows(); @@ -13328,7 +13534,7 @@ var _predefinedItems = ($__4 = {}, Object.defineProperty($__4, SEPARATOR, { }, disabled: function() { var selected = getValidSelection(this); - if (!selected) { + if (!selected || this.countRows() >= this.getSettings().maxRows) { return true; } var rowCount = this.countRows(); @@ -13828,9 +14034,6 @@ function getValidSelection(hot) { if (selected[0] < 0) { return null; } - if (hot.countRows() >= hot.getSettings().maxRows) { - return null; - } return selected; } function prepareVerticalAlignClass(className, alignment) { @@ -18253,6 +18456,7 @@ var WalkontableSelection = ($__3rdparty_47_walkontable_47_src_47_selection__ = r var Walkontable = ($__3rdparty_47_walkontable_47_src_47_core__ = require("3rdparty/walkontable/src/core"), $__3rdparty_47_walkontable_47_src_47_core__ && $__3rdparty_47_walkontable_47_src_47_core__.__esModule && $__3rdparty_47_walkontable_47_src_47_core__ || {default: $__3rdparty_47_walkontable_47_src_47_core__}).Walkontable; Handsontable.TableView = TableView; function TableView(instance) { + var $__6 = this; var that = this; this.eventManager = eventManagerObject(instance); this.instance = instance; @@ -18403,6 +18607,9 @@ function TableView(instance) { }, externalRowCalculator: this.instance.getPlugin('autoRowSize') && this.instance.getPlugin('autoRowSize').isEnabled(), table: table, + preventOverflow: (function() { + return $__6.settings.preventOverflow; + }), stretchH: this.settings.stretchH, data: instance.getDataAtCell, totalRows: (function() { @@ -18625,11 +18832,11 @@ TableView.prototype.isTextSelectionAllowed = function(el) { return false; }; TableView.prototype.isSelectedOnlyCell = function() { - var $__6 = this.instance.getSelected() || [], - row = $__6[0], - col = $__6[1], - rowEnd = $__6[2], - colEnd = $__6[3]; + var $__7 = this.instance.getSelected() || [], + row = $__7[0], + col = $__7[1], + rowEnd = $__7[2], + colEnd = $__7[3]; return row !== void 0 && row === rowEnd && col === colEnd; }; TableView.prototype.isCellEdited = function() { @@ -18980,9 +19187,20 @@ var stringify = ($___46__46__47_helpers_47_mixed__ = require("helpers/mixed"), $ var SamplesGenerator = function SamplesGenerator(dataFactory) { this.samples = null; this.dataFactory = dataFactory; + this.customSampleCount = null; }; var $SamplesGenerator = SamplesGenerator; -($traceurRuntime.createClass)(SamplesGenerator, ($__7 = {}, Object.defineProperty($__7, "generateRowSamples", { +($traceurRuntime.createClass)(SamplesGenerator, ($__7 = {}, Object.defineProperty($__7, "getSampleCount", { + value: function() { + if (this.customSampleCount) { + return this.customSampleCount; + } + return $SamplesGenerator.SAMPLE_COUNT; + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__7, "generateRowSamples", { value: function(rowRange, colRange) { return this.generateSamples('row', colRange, rowRange); }, @@ -19019,6 +19237,7 @@ var $SamplesGenerator = SamplesGenerator; value: function(type, range, specifierValue) { var $__5 = this; var samples = new Map(); + var sampledValues = []; rangeEach(range.from, range.to, (function(index) { var $__7; var value; @@ -19035,25 +19254,29 @@ var $SamplesGenerator = SamplesGenerator; var len = value.length; if (!samples.has(len)) { samples.set(len, { - needed: $SamplesGenerator.SAMPLE_COUNT, + needed: $__5.getSampleCount(), strings: [] }); } var sample = samples.get(len); if (sample.needed) { - var computedKey = type === 'row' ? 'col' : 'row'; - sample.strings.push(($__7 = {}, Object.defineProperty($__7, "value", { - value: value, - configurable: true, - enumerable: true, - writable: true - }), Object.defineProperty($__7, computedKey, { - value: index, - configurable: true, - enumerable: true, - writable: true - }), $__7)); - sample.needed--; + var duplicate = sampledValues.indexOf(value) > -1; + if (!duplicate) { + var computedKey = type === 'row' ? 'col' : 'row'; + sample.strings.push(($__7 = {}, Object.defineProperty($__7, "value", { + value: value, + configurable: true, + enumerable: true, + writable: true + }), Object.defineProperty($__7, computedKey, { + value: index, + configurable: true, + enumerable: true, + writable: true + }), $__7)); + sampledValues.push(value); + sample.needed--; + } } })); return samples; diff --git a/bower_components/handsontable/dist/handsontable.full.min.js b/bower_components/handsontable/dist/handsontable.full.min.js index f5b8466..e7b1e80 100644 --- a/bower_components/handsontable/dist/handsontable.full.min.js +++ b/bower_components/handsontable/dist/handsontable.full.min.js @@ -24,31 +24,31 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Handsontable=e()}}(function(){var e;return function(e,t,n){return function o(e,t,n){function r(a,l){if(!t[a]){if(!e[a]){var u="function"==typeof require&&require;if(!l&&u)return u(a,!0);if(i)return i(a,!0);if(s[a]&&"undefined"!=typeof window[s[a]])return window[s[a]];var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var d=t[a]={exports:{}};e[a][0].call(d.exports,function(t){var n=e[a][1][t];return r(n?n:t)},d,d.exports,o,e,t,n)}return t[a].exports}for(var i="function"==typeof require&&require,s=JSON.parse('{"zeroclipboard":"ZeroClipboard","moment":"moment","pikaday":"Pikaday"}')||{},a=0;a1)for(t=1,o=arguments.length;o>t;t++)r.push(arguments[t]);if(l){if("undefined"==typeof l[e])throw new Error("Handsontable do not provide action: "+e);i=l[e].apply(l,r),"destroy"===e&&a.removeData()}return i}}(window,jQuery,Handsontable)},{}],2:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableBorder:{get:function(){return b}},__esModule:{value:!0}});var o,r,i,s,a,l=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),u=l.getComputedStyle,c=l.getTrimmingContainer,d=l.innerWidth,h=l.innerHeight,f=l.offset,p=l.outerHeight,g=l.outerWidth,m=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}).stopImmediatePropagation,v=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,w=(s=e("cell/coords"),s&&s.__esModule&&s||{"default":s}).WalkontableCellCoords,y=(a=e("overlay/_base.js"),a&&a.__esModule&&a||{"default":a}).WalkontableOverlay,b=function(e,t){t&&(this.eventManager=new v(e),this.instance=e,this.wot=e,this.settings=t,this.mouseDown=!1,this.main=null,this.top=null,this.left=null,this.bottom=null,this.right=null,this.topStyle=null,this.leftStyle=null,this.bottomStyle=null,this.rightStyle=null,this.cornerDefaultStyle={width:"5px",height:"5px",borderWidth:"2px",borderStyle:"solid",borderColor:"#FFF"},this.corner=null,this.cornerStyle=null,this.createBorders(t),this.registerListeners())};$traceurRuntime.createClass(b,{registerListeners:function(){var e=this;this.eventManager.addEventListener(document.body,"mousedown",function(){return e.onMouseDown()}),this.eventManager.addEventListener(document.body,"mouseup",function(){return e.onMouseUp()});for(var t=this,n=function(n,o){t.eventManager.addEventListener(t.main.childNodes[n],"mouseenter",function(t){return e.onMouseEnter(t,e.main.childNodes[n])})},o=0,r=this.main.childNodes.length;r>o;o++)n(o,r)},onMouseDown:function(){this.mouseDown=!0},onMouseUp:function(){this.mouseDown=!1},onMouseEnter:function(e,t){function n(e){return e.clientYMath.ceil(i.top+i.height)?!0:e.clientXMath.ceil(i.left+i.width)?!0:void 0}function o(e){n(e)&&(r.eventManager.removeEventListener(document.body,"mousemove",o),t.style.display="block")}if(this.mouseDown&&this.wot.getSetting("hideBorderOnMouseDownOver")){e.preventDefault(),m(e);var r=this,i=t.getBoundingClientRect();t.style.display="none",this.eventManager.addEventListener(document.body,"mousemove",o)}},createBorders:function(e){this.main=document.createElement("div");var t=["top","left","bottom","right","corner"],n=this.main.style;n.position="absolute",n.top=0,n.left=0;for(var o=0;5>o;o++){var r=t[o],i=document.createElement("div");i.className="wtBorder "+(this.settings.className||""),this.settings[r]&&this.settings[r].hide&&(i.className+=" hidden"),n=i.style,n.backgroundColor=this.settings[r]&&this.settings[r].color?this.settings[r].color:e.border.color,n.height=this.settings[r]&&this.settings[r].width?this.settings[r].width+"px":e.border.width+"px",n.width=this.settings[r]&&this.settings[r].width?this.settings[r].width+"px":e.border.width+"px",this.main.appendChild(i)}this.top=this.main.childNodes[0],this.left=this.main.childNodes[1],this.bottom=this.main.childNodes[2],this.right=this.main.childNodes[3],this.topStyle=this.top.style,this.leftStyle=this.left.style,this.bottomStyle=this.bottom.style,this.rightStyle=this.right.style,this.corner=this.main.childNodes[4],this.corner.className+=" corner",this.cornerStyle=this.corner.style,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.height=this.cornerDefaultStyle.height,this.cornerStyle.border=[this.cornerDefaultStyle.borderWidth,this.cornerDefaultStyle.borderStyle,this.cornerDefaultStyle.borderColor].join(" "),Handsontable.mobileBrowser&&this.createMultipleSelectorHandles(),this.disappear(),this.wot.wtTable.bordersHolder||(this.wot.wtTable.bordersHolder=document.createElement("div"),this.wot.wtTable.bordersHolder.className="htBorders",this.wot.wtTable.spreader.appendChild(this.wot.wtTable.bordersHolder)),this.wot.wtTable.bordersHolder.insertBefore(this.main,this.wot.wtTable.bordersHolder.firstChild)},createMultipleSelectorHandles:function(){this.selectionHandles={topLeft:document.createElement("DIV"),topLeftHitArea:document.createElement("DIV"),bottomRight:document.createElement("DIV"),bottomRightHitArea:document.createElement("DIV")};var e=10,t=40;this.selectionHandles.topLeft.className="topLeftSelectionHandle",this.selectionHandles.topLeftHitArea.className="topLeftSelectionHandle-HitArea",this.selectionHandles.bottomRight.className="bottomRightSelectionHandle",this.selectionHandles.bottomRightHitArea.className="bottomRightSelectionHandle-HitArea",this.selectionHandles.styles={topLeft:this.selectionHandles.topLeft.style,topLeftHitArea:this.selectionHandles.topLeftHitArea.style,bottomRight:this.selectionHandles.bottomRight.style,bottomRightHitArea:this.selectionHandles.bottomRightHitArea.style};var n={position:"absolute",height:t+"px",width:t+"px","border-radius":parseInt(t/1.5,10)+"px"};for(var o in n)n.hasOwnProperty(o)&&(this.selectionHandles.styles.bottomRightHitArea[o]=n[o],this.selectionHandles.styles.topLeftHitArea[o]=n[o]);var r={position:"absolute",height:e+"px",width:e+"px","border-radius":parseInt(e/1.5,10)+"px",background:"#F5F5FF",border:"1px solid #4285c8"};for(var i in r)r.hasOwnProperty(i)&&(this.selectionHandles.styles.bottomRight[i]=r[i],this.selectionHandles.styles.topLeft[i]=r[i]);this.main.appendChild(this.selectionHandles.topLeft),this.main.appendChild(this.selectionHandles.bottomRight),this.main.appendChild(this.selectionHandles.topLeftHitArea),this.main.appendChild(this.selectionHandles.bottomRightHitArea)},isPartRange:function(e,t){return!this.wot.selections.area.cellRange||e==this.wot.selections.area.cellRange.to.row&&t==this.wot.selections.area.cellRange.to.col?!1:!0},updateMultipleSelectionHandlesPosition:function(e,t,n,o,r,i){var s=parseInt(this.selectionHandles.styles.topLeft.width,10),a=parseInt(this.selectionHandles.styles.topLeftHitArea.width,10);this.selectionHandles.styles.topLeft.top=parseInt(n-s,10)+"px",this.selectionHandles.styles.topLeft.left=parseInt(o-s,10)+"px",this.selectionHandles.styles.topLeftHitArea.top=parseInt(n-a/4*3,10)+"px",this.selectionHandles.styles.topLeftHitArea.left=parseInt(o-a/4*3,10)+"px",this.selectionHandles.styles.bottomRight.top=parseInt(n+i,10)+"px",this.selectionHandles.styles.bottomRight.left=parseInt(o+r,10)+"px",this.selectionHandles.styles.bottomRightHitArea.top=parseInt(n+i-a/4,10)+"px",this.selectionHandles.styles.bottomRightHitArea.left=parseInt(o+r-a/4,10)+"px",this.settings.border.multipleSelectionHandlesVisible&&this.settings.border.multipleSelectionHandlesVisible()?(this.selectionHandles.styles.topLeft.display="block",this.selectionHandles.styles.topLeftHitArea.display="block",this.isPartRange(e,t)?(this.selectionHandles.styles.bottomRight.display="none",this.selectionHandles.styles.bottomRightHitArea.display="none"):(this.selectionHandles.styles.bottomRight.display="block",this.selectionHandles.styles.bottomRightHitArea.display="block")):(this.selectionHandles.styles.topLeft.display="none",this.selectionHandles.styles.bottomRight.display="none",this.selectionHandles.styles.topLeftHitArea.display="none",this.selectionHandles.styles.bottomRightHitArea.display="none"),e==this.wot.wtSettings.getSetting("fixedRowsTop")||t==this.wot.wtSettings.getSetting("fixedColumnsLeft")?(this.selectionHandles.styles.topLeft.zIndex="9999",this.selectionHandles.styles.topLeftHitArea.zIndex="9999"):(this.selectionHandles.styles.topLeft.zIndex="",this.selectionHandles.styles.topLeftHitArea.zIndex="")},appear:function(e){if(!this.disabled){var t,n,o,r,i,s,a,l,m,v,b,C,R,_,S,E,T,O,M;M=y.isOverlayTypeOf(this.wot.cloneOverlay,y.CLONE_TOP)||y.isOverlayTypeOf(this.wot.cloneOverlay,y.CLONE_TOP_LEFT_CORNER)?this.wot.getSetting("fixedRowsTop"):y.isOverlayTypeOf(this.wot.cloneOverlay,y.CLONE_BOTTOM)||y.isOverlayTypeOf(this.wot.cloneOverlay,y.CLONE_BOTTOM_LEFT_CORNER)?this.wot.getSetting("fixedRowsBottom"):this.wot.wtTable.getRenderedRowsCount();for(var k=0;M>k;k++){var H=this.wot.wtTable.rowFilter.renderedToSource(k);if(H>=e[0]&&H<=e[2]){R=H;break}}for(var D=M-1;D>=0;D--){var A=this.wot.wtTable.rowFilter.renderedToSource(D);if(A>=e[0]&&A<=e[2]){S=A;break}}M=this.wot.wtTable.getRenderedColumnsCount();for(var x=0;M>x;x++){var P=this.wot.wtTable.columnFilter.renderedToSource(x);if(P>=e[1]&&P<=e[3]){_=P;break}}for(var N=M-1;N>=0;N--){var L=this.wot.wtTable.columnFilter.renderedToSource(N);if(L>=e[1]&&L<=e[3]){E=L;break}}if(void 0===R||void 0===_)return void this.disappear();t=R!==S||_!==E,n=this.wot.wtTable.getCell(new w(R,_)),o=t?this.wot.wtTable.getCell(new w(S,E)):n,r=f(n),i=t?f(o):r,s=f(this.wot.wtTable.TABLE),l=r.top,b=i.top+p(o)-l,v=r.left,C=i.left+g(o)-v,a=l-s.top-1,m=v-s.left-1;var W=u(n);parseInt(W.borderTopWidth,10)>0&&(a+=1,b=b>0?b-1:0),parseInt(W.borderLeftWidth,10)>0&&(m+=1,C=C>0?C-1:0),this.topStyle.top=a+"px",this.topStyle.left=m+"px",this.topStyle.width=C+"px",this.topStyle.display="block",this.leftStyle.top=a+"px",this.leftStyle.left=m+"px",this.leftStyle.height=b+"px",this.leftStyle.display="block";var I=Math.floor(this.settings.border.width/2);this.bottomStyle.top=a+b-I+"px",this.bottomStyle.left=m+"px",this.bottomStyle.width=C+"px",this.bottomStyle.display="block",this.rightStyle.top=a+"px",this.rightStyle.left=m+C-I+"px",this.rightStyle.height=b+1+"px",this.rightStyle.display="block",Handsontable.mobileBrowser||!this.hasSetting(this.settings.border.cornerVisible)||this.isPartRange(S,E)?this.cornerStyle.display="none":(this.cornerStyle.top=a+b-4+"px",this.cornerStyle.left=m+C-4+"px",this.cornerStyle.borderRightWidth=this.cornerDefaultStyle.borderWidth,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.display="block",T=c(this.wot.wtTable.TABLE),E===this.wot.getSetting("totalColumns")-1&&(O=o.offsetLeft+g(o)>=d(T),O&&(this.cornerStyle.left=Math.floor(m+C-3-parseInt(this.cornerDefaultStyle.width)/2)+"px",this.cornerStyle.borderRightWidth=0)),S===this.wot.getSetting("totalRows")-1&&(O=o.offsetTop+p(o)>=h(T),O&&(this.cornerStyle.top=Math.floor(a+b-3-parseInt(this.cornerDefaultStyle.height)/2)+"px",this.cornerStyle.borderBottomWidth=0))),Handsontable.mobileBrowser&&this.updateMultipleSelectionHandlesPosition(R,_,a,m,C,b)}},disappear:function(){this.topStyle.display="none",this.leftStyle.display="none",this.bottomStyle.display="none",this.rightStyle.display="none",this.cornerStyle.display="none",Handsontable.mobileBrowser&&(this.selectionHandles.styles.topLeft.display="none",this.selectionHandles.styles.bottomRight.display="none")},hasSetting:function(e){return"function"==typeof e?e():!!e}},{}),window.WalkontableBorder=b},{"cell/coords":5,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"overlay/_base.js":11}],3:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableViewportColumnsCalculator:{get:function(){return r}},__esModule:{value:!0}});var o=new WeakMap,r=function(e,t,n,r,i,s,a){o.set(this,{viewportWidth:e,scrollOffset:t,totalColumns:n,columnWidthFn:r,overrideFn:i,onlyFullyVisible:s}),this.count=0,this.startColumn=null,this.endColumn=null,this.startPosition=null,this.stretchAllRatio=0,this.stretchLastWidth=0,this.stretch=a,this.totalTargetWidth=0,this.needVerifyLastColumnWidth=!0,this.stretchAllColumnsWidth=[],this.calculate()},i=r;$traceurRuntime.createClass(r,{calculate:function(){for(var e,t=0,n=!0,r=[],i=o.get(this),s=i.onlyFullyVisible,a=i.overrideFn,l=i.scrollOffset,u=i.totalColumns,c=i.viewportWidth,d=0;u>d;d++)if(e=this._getColumnWidth(d),l>=t&&!s&&(this.startColumn=d),t>=l&&l+c>=t+e&&(null==this.startColumn&&(this.startColumn=d),this.endColumn=d),r.push(t),t+=e,s||(this.endColumn=d),t>=l+c){n=!1;break}if(this.endColumn===u-1&&n)for(this.startColumn=this.endColumn;this.startColumn>0;){var h=r[this.endColumn]+e-r[this.startColumn-1];if((c>=h||!s)&&this.startColumn--,h>c)break}null!==this.startColumn&&a&&a(this),this.startPosition=r[this.startColumn],void 0==this.startPosition&&(this.startPosition=null),null!==this.startColumn&&(this.count=this.endColumn-this.startColumn+1)},refreshStretching:function(e){if("none"!==this.stretch){for(var t,n,r=0,i=o.get(this),s=i.totalColumns,a=0;s>a;a++)t=this._getColumnWidth(a),r+=t;this.totalTargetWidth=e,n=r-e,"all"===this.stretch&&0>n?(this.stretchAllRatio=e/r,this.stretchAllColumnsWidth=[],this.needVerifyLastColumnWidth=!0):"last"===this.stretch&&e!==1/0&&(this.stretchLastWidth=-n+this._getColumnWidth(s-1))}},getStretchedColumnWidth:function(e,t){var n=null;return"all"===this.stretch&&0!==this.stretchAllRatio?n=this._getStretchedAllColumnWidth(e,t):"last"===this.stretch&&0!==this.stretchLastWidth&&(n=this._getStretchedLastColumnWidth(e)),n},_getStretchedAllColumnWidth:function(e,t){var n=0,r=o.get(this),i=r.totalColumns;if(this.stretchAllColumnsWidth[e]||(this.stretchAllColumnsWidth[e]=Math.round(t*this.stretchAllRatio)),this.stretchAllColumnsWidth.length===i&&this.needVerifyLastColumnWidth){this.needVerifyLastColumnWidth=!1;for(var s=0;sf;f++){var p=l(f);if(void 0===p&&(p=i.DEFAULT_HEIGHT),u>=e&&!s&&(this.startRow=f),e>=u&&u+d-h>=e+p&&(null===this.startRow&&(this.startRow=f),this.endRow=f),n.push(e),e+=p,s||(this.endRow=f),e>=u+d-h){t=!1;break}}if(this.endRow===c-1&&t)for(this.startRow=this.endRow;this.startRow>0;){var g=n[this.endRow]+p-n[this.startRow-1];if((d-h>=g||!s)&&this.startRow--,g>=d-h)break}null!==this.startRow&&a&&a(this),this.startPosition=n[this.startRow],void 0==this.startPosition&&(this.startPosition=null),null!==this.startRow&&(this.count=this.endRow-this.startRow+1)}},{get DEFAULT_HEIGHT(){return 23}}),window.WalkontableViewportRowsCalculator=r},{}],5:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableCellCoords:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t){"undefined"!=typeof e&&"undefined"!=typeof t?(this.row=e,this.col=t):(this.row=null,this.col=null)};$traceurRuntime.createClass(o,{isValid:function(e){return this.row<0||this.col<0?!1:this.row>=e.getSetting("totalRows")||this.col>=e.getSetting("totalColumns")?!1:!0},isEqual:function(e){return e===this?!0:this.row===e.row&&this.col===e.col},isSouthEastOf:function(e){return this.row>=e.row&&this.col>=e.col},isNorthWestOf:function(e){return this.row<=e.row&&this.col<=e.col},isSouthWestOf:function(e){return this.row>=e.row&&this.col<=e.col},isNorthEastOf:function(e){return this.row<=e.row&&this.col>=e.col}},{}),window.WalkontableCellCoords=o},{}],6:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableCellRange:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("cell/coords"),o&&o.__esModule&&o||{"default":o}).WalkontableCellCoords,i=function(e,t,n){this.highlight=e,this.from=t,this.to=n},s=i;$traceurRuntime.createClass(i,{isValid:function(e){return this.from.isValid(e)&&this.to.isValid(e)},isSingle:function(){return this.from.row===this.to.row&&this.from.col===this.to.col},getHeight:function(){return Math.max(this.from.row,this.to.row)-Math.min(this.from.row,this.to.row)+1},getWidth:function(){return Math.max(this.from.col,this.to.col)-Math.min(this.from.col,this.to.col)+1},includes:function(e){var t=this.getTopLeftCorner(),n=this.getBottomRightCorner();return e.row<0&&(e.row=0),e.col<0&&(e.col=0),t.row<=e.row&&n.row>=e.row&&t.col<=e.col&&n.col>=e.col},includesRange:function(e){return this.includes(e.getTopLeftCorner())&&this.includes(e.getBottomRightCorner())},isEqual:function(e){return Math.min(this.from.row,this.to.row)==Math.min(e.from.row,e.to.row)&&Math.max(this.from.row,this.to.row)==Math.max(e.from.row,e.to.row)&&Math.min(this.from.col,this.to.col)==Math.min(e.from.col,e.to.col)&&Math.max(this.from.col,this.to.col)==Math.max(e.from.col,e.to.col)},overlaps:function(e){return e.isSouthEastOf(this.getTopLeftCorner())&&e.isNorthWestOf(this.getBottomRightCorner())},isSouthEastOf:function(e){return this.getTopLeftCorner().isSouthEastOf(e)||this.getBottomRightCorner().isSouthEastOf(e)},isNorthWestOf:function(e){return this.getTopLeftCorner().isNorthWestOf(e)||this.getBottomRightCorner().isNorthWestOf(e)},expand:function(e){var t=this.getTopLeftCorner(),n=this.getBottomRightCorner();return e.rown.row||e.col>n.col?(this.from=new r(Math.min(t.row,e.row),Math.min(t.col,e.col)),this.to=new r(Math.max(n.row,e.row),Math.max(n.col,e.col)),!0):!1},expandByRange:function(e){if(this.includesRange(e)||!this.overlaps(e))return!1;var t=this.getTopLeftCorner(),n=this.getBottomRightCorner(),o=(this.getTopRightCorner(),this.getBottomLeftCorner(),e.getTopLeftCorner()),i=e.getBottomRightCorner(),a=Math.min(t.row,o.row),l=Math.min(t.col,o.col),u=Math.max(n.row,i.row),c=Math.max(n.col,i.col),d=new r(a,l),h=new r(u,c),f=new s(d,d,h).isCorner(this.from,e),p=e.isEqual(new s(d,d,h));return f&&!p&&(this.from.col>d.col&&(d.col=c,h.col=l),this.from.row>d.row&&(d.row=u,h.row=a)),this.from=d,this.to=h,!0},getDirection:function(){return this.from.isNorthWestOf(this.to)?"NW-SE":this.from.isNorthEastOf(this.to)?"NE-SW":this.from.isSouthEastOf(this.to)?"SE-NW":this.from.isSouthWestOf(this.to)?"SW-NE":void 0},setDirection:function(e){switch(e){case"NW-SE":this.from=this.getTopLeftCorner(),this.to=this.getBottomRightCorner();break;case"NE-SW":this.from=this.getTopRightCorner(),this.to=this.getBottomLeftCorner();break;case"SE-NW":this.from=this.getBottomRightCorner(),this.to=this.getTopLeftCorner();break;case"SW-NE":this.from=this.getBottomLeftCorner(),this.to=this.getTopRightCorner()}},getTopLeftCorner:function(){return new r(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))},getBottomRightCorner:function(){return new r(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))},getTopRightCorner:function(){return new r(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))},getBottomLeftCorner:function(){return new r(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))},isCorner:function(e,t){return t&&t.includes(e)&&(this.getTopLeftCorner().isEqual(new r(t.from.row,t.from.col))||this.getTopRightCorner().isEqual(new r(t.from.row,t.to.col))||this.getBottomLeftCorner().isEqual(new r(t.to.row,t.from.col))||this.getBottomRightCorner().isEqual(new r(t.to.row,t.to.col)))?!0:e.isEqual(this.getTopLeftCorner())||e.isEqual(this.getTopRightCorner())||e.isEqual(this.getBottomLeftCorner())||e.isEqual(this.getBottomRightCorner())},getOppositeCorner:function(e,t){if(!(e instanceof r))return!1;if(t&&t.includes(e)){if(this.getTopLeftCorner().isEqual(new r(t.from.row,t.from.col)))return this.getBottomRightCorner();if(this.getTopRightCorner().isEqual(new r(t.from.row,t.to.col)))return this.getBottomLeftCorner();if(this.getBottomLeftCorner().isEqual(new r(t.to.row,t.from.col)))return this.getTopRightCorner();if(this.getBottomRightCorner().isEqual(new r(t.to.row,t.to.col)))return this.getTopLeftCorner()}return e.isEqual(this.getBottomRightCorner())?this.getTopLeftCorner():e.isEqual(this.getTopLeftCorner())?this.getBottomRightCorner():e.isEqual(this.getTopRightCorner())?this.getBottomLeftCorner():e.isEqual(this.getBottomLeftCorner())?this.getTopRightCorner():void 0},getBordersSharedWith:function(e){if(!this.includesRange(e))return[];var t={top:Math.min(this.from.row,this.to.row),bottom:Math.max(this.from.row,this.to.row),left:Math.min(this.from.col,this.to.col),right:Math.max(this.from.col,this.to.col)},n={top:Math.min(e.from.row,e.to.row),bottom:Math.max(e.from.row,e.to.row),left:Math.min(e.from.col,e.to.col),right:Math.max(e.from.col,e.to.col)},o=[];return t.top==n.top&&o.push("top"),t.right==n.right&&o.push("right"),t.bottom==n.bottom&&o.push("bottom"),t.left==n.left&&o.push("left"),o},getInner:function(){for(var e=this.getTopLeftCorner(),t=this.getBottomRightCorner(),n=[],o=e.row;o<=t.row;o++)for(var i=e.col;i<=t.col;i++)this.from.row===o&&this.from.col===i||this.to.row===o&&this.to.col===i||n.push(new r(o,i));return n},getAll:function(){for(var e=this.getTopLeftCorner(),t=this.getBottomRightCorner(),n=[],o=e.row;o<=t.row;o++)for(var i=e.col;i<=t.col;i++)e.row===o&&e.col===i?n.push(e):t.row===o&&t.col===i?n.push(t):n.push(new r(o,i));return n},forAll:function(e){for(var t=this.getTopLeftCorner(),n=this.getBottomRightCorner(),o=t.row;o<=n.row;o++)for(var r=t.col;r<=n.col;r++){var i=e(o,r);if(i===!1)return}}},{}),window.WalkontableCellRange=i},{"cell/coords":5}],7:[function(e,t,n){"use strict";Object.defineProperties(n,{Walkontable:{get:function(){return A}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c,d,h,f,p,g,m,v=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),w=v.addClass,y=v.fastInnerText,b=v.isVisible,C=v.removeClass,R=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).objectEach,_=(i=e("helpers/string"),i&&i.__esModule&&i||{"default":i}),S=_.toUpperCaseFirst,E=_.randomString,T=(s=e("event"),s&&s.__esModule&&s||{"default":s}).WalkontableEvent,O=(a=e("overlays"),a&&a.__esModule&&a||{"default":a}).WalkontableOverlays,M=(l=e("scroll"),l&&l.__esModule&&l||{"default":l}).WalkontableScroll,k=(u=e("settings"),u&&u.__esModule&&u||{"default":u}).WalkontableSettings,H=(c=e("table"),c&&c.__esModule&&c||{"default":c}).WalkontableTable,D=(d=e("viewport"),d&&d.__esModule&&d||{"default":d}).WalkontableViewport,A=((h=e("overlay/_base.js"),h&&h.__esModule&&h||{"default":h}).WalkontableOverlay,(f=e("overlay/top.js"),f&&f.__esModule&&f||{"default":f}).WalkontableTopOverlay,(p=e("overlay/left.js"),p&&p.__esModule&&p||{"default":p}).WalkontableLeftOverlay,(g=e("overlay/debug.js"),g&&g.__esModule&&g||{"default":g}).WalkontableDebugOverlay,(m=e("overlay/topLeftCorner.js"),m&&m.__esModule&&m||{"default":m}).WalkontableTopLeftCornerOverlay,function(e){var t=[];if(this.guid="wt_"+E(),e.cloneSource?(this.cloneSource=e.cloneSource,this.cloneOverlay=e.cloneOverlay,this.wtSettings=e.cloneSource.wtSettings,this.wtTable=new H(this,e.table,e.wtRootElement),this.wtScroll=new M(this),this.wtViewport=e.cloneSource.wtViewport,this.wtEvent=new T(this),this.selections=this.cloneSource.selections):(this.wtSettings=new k(this,e),this.wtTable=new H(this,e.table),this.wtScroll=new M(this),this.wtViewport=new D(this),this.wtEvent=new T(this),this.selections=this.getSetting("selections"),this.wtOverlays=new O(this),this.exportSettingsAsClassNames()),this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(var n=0,o=this.wtTable.THEAD.childNodes[0].childNodes.length;o>n;n++)t.push(this.wtTable.THEAD.childNodes[0].childNodes[n].innerHTML);this.getSetting("columnHeaders").length||this.update("columnHeaders",[function(e,n){y(n,t[e])}])}this.drawn=!1,this.drawInterrupted=!1});$traceurRuntime.createClass(A,{draw:function(){var e=void 0!==arguments[0]?arguments[0]:!1;return this.drawInterrupted=!1,e||b(this.wtTable.TABLE)?this.wtTable.draw(e):this.drawInterrupted=!0,this},getCell:function(e){var t=void 0!==arguments[1]?arguments[1]:!1;if(!t)return this.wtTable.getCell(e);var n=this.wtSettings.getSetting("totalRows"),o=this.wtSettings.getSetting("fixedRowsTop"),r=this.wtSettings.getSetting("fixedRowsBottom"),i=this.wtSettings.getSetting("fixedColumnsLeft");if(e.row=n-r){if(this.wtOverlays.bottomLeftCornerOverlay.clone)return this.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell(e)}else{if(e.coln-r&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)},update:function(e,t){return this.wtSettings.update(e,t)},scrollVertical:function(e){return this.wtOverlays.topOverlay.scrollTo(e),this.getSetting("onScrollVertically"),this},scrollHorizontal:function(e){return this.wtOverlays.leftOverlay.scrollTo(e),this.getSetting("onScrollHorizontally"),this},scrollViewport:function(e){return this.wtScroll.scrollViewport(e),this},getViewport:function(){return[this.wtTable.getFirstVisibleRow(),this.wtTable.getFirstVisibleColumn(),this.wtTable.getLastVisibleRow(),this.wtTable.getLastVisibleColumn()]},getOverlayName:function(){return this.cloneOverlay?this.cloneOverlay.type:"master"},exportSettingsAsClassNames:function(){var e=this,t={rowHeaders:["array"],columnHeaders:["array"]},n=[],o=[];R(t,function(t,r){t.indexOf("array")>-1&&e.getSetting(r).length&&o.push("ht"+S(r)),n.push("ht"+S(r))}),C(this.wtTable.wtRootElement.parentNode,n),w(this.wtTable.wtRootElement.parentNode,o)},getSetting:function(e,t,n,o,r){return this.wtSettings.getSetting(e,t,n,o,r)},hasSetting:function(e){return this.wtSettings.has(e)},destroy:function(){this.wtOverlays.destroy(),this.wtEvent.destroy()}},{}),window.Walkontable=A},{event:8,"helpers/dom/element":45,"helpers/object":50,"helpers/string":52,"overlay/_base.js":11,"overlay/debug.js":12,"overlay/left.js":13,"overlay/top.js":14,"overlay/topLeftCorner.js":15,overlays:16,scroll:17,settings:19,table:20,viewport:22}],8:[function(e,t,n){"use strict";function o(e){var t=this,n=c(e);this.instance=e;var o=[null,null];this.dblClickTimeout=[null,null];var r,i,s=function(e){var n=t.parentCell(e.realTarget);l(e.realTarget,"corner")?t.instance.getSetting("onCellCornerMouseDown",e,e.realTarget):n.TD&&t.instance.hasSetting("onCellMouseDown")&&t.instance.getSetting("onCellMouseDown",e,n.coords,n.TD,t.instance),2!==e.button&&n.TD&&(o[0]=n.TD,clearTimeout(t.dblClickTimeout[0]),t.dblClickTimeout[0]=setTimeout(function(){o[0]=null},1e3))},d=function(e){t.instance.touchMoving=!0},h=function(e){n.addEventListener(this,"touchmove",d),t.checkIfTouchMove=setTimeout(function(){return t.instance.touchMoving===!0?(t.instance.touchMoving=void 0,void n.removeEventListener("touchmove",d,!1)):void s(e)},30)},f=function(e){var n,o;t.instance.hasSetting("onCellMouseOver")&&(n=t.instance.wtTable.TABLE,o=a(e.realTarget,["TD","TH"],n),o&&o!==i&&u(o,n)&&(i=o,t.instance.getSetting("onCellMouseOver",e,t.instance.wtTable.getCoords(o),o,t.instance)))},p=function(e){if(2!==e.button){var n=t.parentCell(e.realTarget);n.TD===o[0]&&n.TD===o[1]?(l(e.realTarget,"corner")?t.instance.getSetting("onCellCornerDblClick",e,n.coords,n.TD,t.instance):t.instance.getSetting("onCellDblClick",e,n.coords,n.TD,t.instance),o[0]=null,o[1]=null):n.TD===o[0]&&(o[1]=n.TD,clearTimeout(t.dblClickTimeout[1]),t.dblClickTimeout[1]=setTimeout(function(){o[1]=null},500))}},g=function(e){clearTimeout(r),e.preventDefault(),p(e)};if(n.addEventListener(this.instance.wtTable.holder,"mousedown",s),n.addEventListener(this.instance.wtTable.TABLE,"mouseover",f),n.addEventListener(this.instance.wtTable.holder,"mouseup",p),this.instance.wtTable.holder.parentNode.parentNode&&Handsontable.mobileBrowser&&!t.instance.wtTable.isWorkingOnClone()){var m="."+this.instance.wtTable.holder.parentNode.className.split(" ").join(".");n.addEventListener(this.instance.wtTable.holder,"touchstart",function(e){t.instance.touchApplied=!0,u(e.target,m)&&h.call(e.target,e)}),n.addEventListener(this.instance.wtTable.holder,"touchend",function(e){t.instance.touchApplied=!1,u(e.target,m)&&g.call(e.target,e)}),t.instance.momentumScrolling||(t.instance.momentumScrolling={}),n.addEventListener(this.instance.wtTable.holder,"scroll",function(e){clearTimeout(t.instance.momentumScrolling._timeout),t.instance.momentumScrolling.ongoing||t.instance.getSetting("onBeforeTouchScroll"),t.instance.momentumScrolling.ongoing=!0,t.instance.momentumScrolling._timeout=setTimeout(function(){t.instance.touchApplied||(t.instance.momentumScrolling.ongoing=!1,t.instance.getSetting("onAfterMomentumScroll"))},200)})}n.addEventListener(window,"resize",function(){"none"!==t.instance.getSetting("stretchH")&&t.instance.draw()}),this.destroy=function(){clearTimeout(this.dblClickTimeout[0]),clearTimeout(this.dblClickTimeout[1]),n.destroy()}}Object.defineProperties(n,{WalkontableEvent:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),a=s.closest,l=s.hasClass,u=s.isChildOf,c=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager;o.prototype.parentCell=function(e){var t={},n=this.instance.wtTable.TABLE,o=a(e,["TD","TH"],n);return o&&u(o,n)?(t.coords=this.instance.wtTable.getCoords(o),t.TD=o):l(e,"wtBorder")&&l(e,"current")?(t.coords=this.instance.selections.current.cellRange.highlight,t.TD=this.instance.wtTable.getCell(t.coords)):l(e,"wtBorder")&&l(e,"area")&&this.instance.selections.area.cellRange&&(t.coords=this.instance.selections.area.cellRange.to,t.TD=this.instance.wtTable.getCell(t.coords)),t},window.WalkontableEvent=o},{eventManager:41,"helpers/dom/element":45}],9:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableColumnFilter:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t,n){this.offset=e,this.total=t,this.countTH=n};$traceurRuntime.createClass(o,{offsetted:function(e){return e+this.offset},unOffsetted:function(e){return e-this.offset},renderedToSource:function(e){return this.offsetted(e)},sourceToRendered:function(e){return this.unOffsetted(e)},offsettedTH:function(e){return e-this.countTH},unOffsettedTH:function(e){return e+this.countTH},visibleRowHeadedColumnToSourceColumn:function(e){return this.renderedToSource(this.offsettedTH(e))},sourceColumnToVisibleRowHeadedColumn:function(e){return this.unOffsettedTH(this.sourceToRendered(e))}},{}),window.WalkontableColumnFilter=o; -},{}],10:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableRowFilter:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t,n){this.offset=e,this.total=t,this.countTH=n};$traceurRuntime.createClass(o,{offsetted:function(e){return e+this.offset},unOffsetted:function(e){return e-this.offset},renderedToSource:function(e){return this.offsetted(e)},sourceToRendered:function(e){return this.unOffsetted(e)},offsettedTH:function(e){return e-this.countTH},unOffsettedTH:function(e){return e+this.countTH},visibleColHeadedRowToSourceRow:function(e){return this.renderedToSource(this.offsettedTH(e))},sourceRowToVisibleColHeadedRow:function(e){return this.unOffsettedTH(this.sourceToRendered(e))}},{}),window.WalkontableRowFilter=o},{}],11:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableOverlay:{get:function(){return h}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=s.getScrollableElement,l=s.getTrimmingContainer,u=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).defineGetter,c=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,d={},h=function(e){u(this,"wot",e,{writable:!1}),this.instance=this.wot,this.type="",this.TABLE=this.wot.wtTable.TABLE,this.hider=this.wot.wtTable.hider,this.spreader=this.wot.wtTable.spreader,this.holder=this.wot.wtTable.holder,this.wtRootElement=this.wot.wtTable.wtRootElement,this.trimmingContainer=l(this.hider.parentNode.parentNode),this.mainTableScrollableElement=a(this.wot.wtTable.TABLE),this.needFullRender=this.shouldBeRendered(),this.areElementSizesAdjusted=!1},f=h;$traceurRuntime.createClass(h,{shouldBeRendered:function(){return!0},makeClone:function(e){if(-1===f.CLONE_TYPES.indexOf(e))throw new Error('Clone type "'+e+'" is not supported.');var t=document.createElement("DIV"),n=document.createElement("TABLE");return t.className="ht_clone_"+e+" handsontable",t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.overflow="hidden",n.className=this.wot.wtTable.TABLE.className,t.appendChild(n),this.type=e,this.wot.wtTable.wtRootElement.parentNode.appendChild(t),new Walkontable({cloneSource:this.wot,cloneOverlay:this,table:n})},refresh:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=this.shouldBeRendered();this.clone&&(this.needFullRender||t)&&this.clone.draw(e),this.needFullRender=t},destroy:function(){c(this.clone).destroy()}},{get CLONE_TOP(){return"top"},get CLONE_BOTTOM(){return"bottom"},get CLONE_LEFT(){return"left"},get CLONE_TOP_LEFT_CORNER(){return"top_left_corner"},get CLONE_BOTTOM_LEFT_CORNER(){return"bottom_left_corner"},get CLONE_DEBUG(){return"debug"},get CLONE_TYPES(){return[f.CLONE_TOP,f.CLONE_BOTTOM,f.CLONE_LEFT,f.CLONE_TOP_LEFT_CORNER,f.CLONE_BOTTOM_LEFT_CORNER,f.CLONE_DEBUG]},registerOverlay:function(e,t){if(-1===f.CLONE_TYPES.indexOf(e))throw new Error("Unsupported overlay ("+e+").");d[e]=t},createOverlay:function(e,t){return new d[e](t)},isOverlayTypeOf:function(e,t){return e&&d[t]?e instanceof d[t]:!1}}),window.WalkontableOverlay=h},{eventManager:41,"helpers/dom/element":45,"helpers/object":50}],12:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableDebugOverlay:{get:function(){return a}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).addClass,s=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,a=function(e){$traceurRuntime.superConstructor(l).call(this,e),this.clone=this.makeClone(s.CLONE_DEBUG),this.clone.wtTable.holder.style.opacity=.4,this.clone.wtTable.holder.style.textShadow="0 0 2px #ff0000",i(this.clone.wtTable.holder.parentNode,"wtDebugVisible")},l=a;$traceurRuntime.createClass(a,{},{},s),window.WalkontableDebugOverlay=a,s.registerOverlay(s.CLONE_DEBUG,a)},{_base:11,"helpers/dom/element":45}],13:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableLeftOverlay:{get:function(){return g}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.addClass,a=i.getScrollbarWidth,l=i.getScrollLeft,u=i.getWindowScrollTop,c=i.hasClass,d=i.outerWidth,h=i.removeClass,f=i.setOverlayPosition,p=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,g=function(e){$traceurRuntime.superConstructor(m).call(this,e),this.clone=this.makeClone(p.CLONE_LEFT)},m=g;$traceurRuntime.createClass(g,{shouldBeRendered:function(){return this.wot.getSetting("fixedColumnsLeft")||this.wot.getSetting("rowHeaders").length?!0:!1},resetFixedPosition:function(){if(this.needFullRender&&this.wot.wtTable.holder.parentNode){var e=this.clone.wtTable.holder.parentNode,t=0;if(this.trimmingContainer===window){var n,o,r=this.wot.wtTable.hider.getBoundingClientRect(),i=Math.ceil(r.left),s=Math.ceil(r.right);o=this.wot.wtTable.hider.style.top,o=""===o?0:o,n=0>i&&s-e.offsetWidth>0?-i:0,t=n,n+="px",f(e,n,o)}else t=this.getScrollPosition();this.adjustHeaderBordersPosition(t),this.adjustElementsSize()}},setScrollPosition:function(e){this.mainTableScrollableElement===window?window.scrollTo(e,u()):this.mainTableScrollableElement.scrollLeft=e},onScroll:function(){this.wot.getSetting("onScrollVertically")},sumCellSizes:function(e,t){for(var n=0,o=this.wot.wtSettings.defaultColumnWidth;t>e;)n+=this.wot.wtTable.getStretchedColumnWidth(e)||o,e++;return n},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1;(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize(),e||(this.areElementSizesAdjusted=!0))},adjustRootElementSize:function(){var e,t=this.wot.wtTable.holder,n=t.clientHeight===t.offsetHeight?0:a(),o=this.clone.wtTable.holder.parentNode,r=o.style;this.trimmingContainer!==window&&(r.height=this.wot.wtViewport.getWorkspaceHeight()-n+"px"),this.clone.wtTable.holder.style.height=r.height,e=d(this.clone.wtTable.TABLE),r.width=(0===e?e:e+4)+"px"},adjustRootChildrenSize:function(){var e=a();this.clone.wtTable.hider.style.height=this.hider.style.height,this.clone.wtTable.holder.style.height=this.clone.wtTable.holder.parentNode.style.height,0===e&&(e=30),this.clone.wtTable.holder.style.width=parseInt(this.clone.wtTable.holder.parentNode.style.width,10)+e+"px"},applyToDOM:function(){var e=this.wot.getSetting("totalColumns");if(this.areElementSizesAdjusted||this.adjustElementsSize(),"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition)this.spreader.style.left=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the columnsRenderCalculator");this.spreader.style.left="0"}this.spreader.style.right="",this.needFullRender&&this.syncOverlayOffset()},syncOverlayOffset:function(){"number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px":this.clone.wtTable.spreader.style.top=""},scrollTo:function(e,t){var n=this.getTableParentOffset(),o=this.wot.cloneSource?this.wot.cloneSource:this.wot,r=o.wtTable.holder,i=0;t&&r.offsetWidth!==r.clientWidth&&(i=a()),t?(n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportWidth()):n+=this.sumCellSizes(this.wot.getSetting("fixedColumnsLeft"),e),n+=i,this.setScrollPosition(n)},getTableParentOffset:function(){return this.trimmingContainer===window?this.wot.wtTable.holderOffset.left:0},getScrollPosition:function(){return l(this.mainTableScrollableElement)},adjustHeaderBordersPosition:function(e){var t=this.wot.wtTable.holder.parentNode,n=this.wot.getSetting("rowHeaders"),o=this.wot.getSetting("fixedColumnsLeft");if(o&&!n.length)s(t,"innerBorderLeft");else if(!o&&n.length){var r=c(t,"innerBorderLeft");e?s(t,"innerBorderLeft"):h(t,"innerBorderLeft"),(!r&&e||r&&!e)&&this.wot.wtOverlays.adjustElementsSize()}}},{},p),window.WalkontableLeftOverlay=g,p.registerOverlay(p.CLONE_LEFT,g)},{_base:11,"helpers/dom/element":45}],14:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableTopOverlay:{get:function(){return g}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.addClass,a=i.getScrollbarWidth,l=i.getScrollTop,u=i.getWindowScrollLeft,c=i.hasClass,d=i.outerHeight,h=i.removeClass,f=i.setOverlayPosition,p=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,g=function(e){$traceurRuntime.superConstructor(m).call(this,e),this.clone=this.makeClone(p.CLONE_TOP)},m=g;$traceurRuntime.createClass(g,{shouldBeRendered:function(){return this.wot.getSetting("fixedRowsTop")||this.wot.getSetting("columnHeaders").length?!0:!1},resetFixedPosition:function(){if(this.needFullRender&&this.wot.wtTable.holder.parentNode){var e=this.clone.wtTable.holder.parentNode,t=0;if(this.wot.wtOverlays.leftOverlay.trimmingContainer===window){var n,o,r=this.wot.wtTable.hider.getBoundingClientRect(),i=Math.ceil(r.top),s=Math.ceil(r.bottom);n=this.wot.wtTable.hider.style.left,n=""===n?0:n,o=0>i&&s-e.offsetHeight>0?-i:0,t=o,o+="px",f(e,n,o)}else t=this.getScrollPosition();this.adjustHeaderBordersPosition(t),this.adjustElementsSize()}},setScrollPosition:function(e){this.mainTableScrollableElement===window?window.scrollTo(u(),e):this.mainTableScrollableElement.scrollTop=e},onScroll:function(){this.wot.getSetting("onScrollHorizontally")},sumCellSizes:function(e,t){for(var n=0,o=this.wot.wtSettings.settings.defaultRowHeight;t>e;){var r=this.wot.wtTable.getRowHeight(e);n+=void 0===r?o:r,e++}return n},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1;(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize(),e||(this.areElementSizesAdjusted=!0))},adjustRootElementSize:function(){var e,t=this.wot.wtTable.holder,n=t.clientWidth===t.offsetWidth?0:a(),o=this.clone.wtTable.holder.parentNode,r=o.style;this.trimmingContainer!==window&&(r.width=this.wot.wtViewport.getWorkspaceWidth()-n+"px"),this.clone.wtTable.holder.style.width=r.width,e=d(this.clone.wtTable.TABLE),r.height=(0===e?e:e+4)+"px"},adjustRootChildrenSize:function(){var e=a();this.clone.wtTable.hider.style.width=this.hider.style.width,this.clone.wtTable.holder.style.width=this.clone.wtTable.holder.parentNode.style.width,0===e&&(e=30),this.clone.wtTable.holder.style.height=parseInt(this.clone.wtTable.holder.parentNode.style.height,10)+e+"px"},applyToDOM:function(){var e=this.wot.getSetting("totalRows");if(this.areElementSizesAdjusted||this.adjustElementsSize(),"number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition)this.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.top="0"}this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()},syncOverlayOffset:function(){"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.left=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px":this.clone.wtTable.spreader.style.left=""},scrollTo:function(e,t){var n=this.getTableParentOffset(),o=this.wot.cloneSource?this.wot.cloneSource:this.wot,r=o.wtTable.holder,i=0;if(t&&r.offsetHeight!==r.clientHeight&&(i=a()),t){var s=this.wot.getSetting("fixedRowsBottom"),l=(this.wot.getSetting("fixedRowsTop"),this.wot.getSetting("totalRows"));n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportHeight()-this.sumCellSizes(l-s,l),n+=1}else n+=this.sumCellSizes(this.wot.getSetting("fixedRowsTop"),e);n+=i,this.setScrollPosition(n)},getTableParentOffset:function(){return this.mainTableScrollableElement===window?this.wot.wtTable.holderOffset.top:0},getScrollPosition:function(){return l(this.mainTableScrollableElement)},adjustHeaderBordersPosition:function(e){if(0===this.wot.getSetting("fixedRowsTop")&&this.wot.getSetting("columnHeaders").length>0){var t=this.wot.wtTable.holder.parentNode,n=c(t,"innerBorderTop");e?s(t,"innerBorderTop"):h(t,"innerBorderTop"),(!n&&e||n&&!e)&&this.wot.wtOverlays.adjustElementsSize()}if(0===this.wot.getSetting("rowHeaders").length){var o=this.clone.wtTable.THEAD.querySelectorAll("th:nth-of-type(2)");if(o)for(var r=0;rc&&h-e.offsetWidth>0?-c+"px":"0",r=0>u&&d-e.offsetHeight>0?-u+"px":"0",l(e,o,r)}e.style.height=(0===t?t:t+4)+"px",e.style.width=(0===n?n:n+4)+"px"}}},{},u),window.WalkontableTopLeftCornerOverlay=c,u.registerOverlay(u.CLONE_TOP_LEFT_CORNER,c)},{_base:11,"helpers/dom/element":45}],16:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableOverlays:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=s.getScrollableElement,l=s.getScrollbarWidth,u=s.getScrollLeft,c=s.getScrollTop,d=(r=e("helpers/unicode"),r&&r.__esModule&&r||{"default":r}).isKey,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,f=function(e){this.wot=e,this.instance=this.wot,this.eventManager=new h(this.wot),this.wot.update("scrollbarWidth",l()),this.wot.update("scrollbarHeight",l()),this.mainTableScrollableElement=a(this.wot.wtTable.TABLE),this.topOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP,this.wot),"undefined"==typeof WalkontableBottomOverlay?this.bottomOverlay={needFullRender:!1}:this.bottomOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM,this.wot),this.leftOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_LEFT,this.wot),this.topOverlay.needFullRender&&this.leftOverlay.needFullRender&&(this.topLeftCornerOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP_LEFT_CORNER,this.wot)),this.bottomOverlay.needFullRender&&this.leftOverlay.needFullRender&&"undefined"!=typeof WalkontableBottomLeftCornerOverlay?this.bottomLeftCornerOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER,this.wot):this.bottomLeftCornerOverlay={needFullRender:!1},this.wot.getSetting("debug")&&(this.debug=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_DEBUG,this.wot)),this.destroyed=!1,this.keyPressed=!1,this.spreaderLastSize={width:null,height:null},this.overlayScrollPositions={master:{top:0,left:0},top:{top:null,left:0},bottom:{top:null,left:0},left:{top:0,left:null}},this.verticalScrolling=!1,this.horizontalScrolling=!1,this.delegatedScrollCallback=!1,this.registerListeners()};$traceurRuntime.createClass(f,{refreshAll:function(){if(this.wot.drawn){if(!this.wot.wtTable.holder.parentNode)return void this.destroy();this.wot.draw(!0),this.verticalScrolling&&this.leftOverlay.onScroll(),this.horizontalScrolling&&this.topOverlay.onScroll(),this.verticalScrolling=!1,this.horizontalScrolling=!1}},registerListeners:function(){var e=this;this.eventManager.addEventListener(document.documentElement,"keydown",function(t){return e.onKeyDown(t)}),this.eventManager.addEventListener(document.documentElement,"keyup",function(){return e.onKeyUp()}),this.eventManager.addEventListener(document,"visibilitychange",function(){return e.onKeyUp()}),this.eventManager.addEventListener(this.mainTableScrollableElement,"scroll",function(t){return e.onTableScroll(t)}),this.topOverlay.needFullRender&&(this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.bottomOverlay.needFullRender&&(this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.leftOverlay.needFullRender&&(this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.topOverlay.trimmingContainer!==window&&this.leftOverlay.trimmingContainer!==window&&this.eventManager.addEventListener(window,"wheel",function(t){var n,o=t.wheelDeltaY||t.deltaY,r=t.wheelDeltaX||t.deltaX;e.topOverlay.clone.wtTable.holder.contains(t.realTarget)?n="top":e.bottomOverlay.clone&&e.bottomOverlay.clone.wtTable.holder.contains(t.realTarget)?n="bottom":e.leftOverlay.clone.wtTable.holder.contains(t.realTarget)&&(n="left"),"top"==n&&0!==o?t.preventDefault():"left"==n&&0!==r?t.preventDefault():"bottom"==n&&0!==o&&t.preventDefault()})},onTableScroll:function(e){Handsontable.mobileBrowser||(!this.keyPressed||this.mainTableScrollableElement===window||e.target.contains(this.mainTableScrollableElement))&&("scroll"===e.type?this.syncScrollPositions(e):this.translateMouseWheelToScroll(e))},onKeyDown:function(e){this.keyPressed=d(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")},onKeyUp:function(){this.keyPressed=!1},translateMouseWheelToScroll:function(e){for(var t,n=this.topOverlay.clone.wtTable.holder,o=this.bottomOverlay.clone?this.bottomOverlay.clone.wtTable.holder:null,r=this.leftOverlay.clone.wtTable.holder,i={type:"wheel"},s=e.target,a=e.wheelDeltaY||-1*e.deltaY,l=e.wheelDeltaX||-1*e.deltaX;s!=document&&null!=s;){if(s.className.indexOf("wtHolder")>-1){t=s;break}s=s.parentNode}return i.target=t,t==n?this.syncScrollPositions(i,-.2*a):t==o?this.syncScrollPositions(i,-.2*a):t==r&&this.syncScrollPositions(i,-.2*l),!1},syncScrollPositions:function(e){var t=void 0!==arguments[1]?arguments[1]:null;if(!this.destroyed){if(0===arguments.length)return void this.syncScrollWithMaster();var n,o,r,i=this.mainTableScrollableElement,s=e.target,a=0,l=!1,d=!1;this.topOverlay.needFullRender&&(n=this.topOverlay.clone.wtTable.holder),this.bottomOverlay.needFullRender&&(r=this.bottomOverlay.clone.wtTable.holder),this.leftOverlay.needFullRender&&(o=this.leftOverlay.clone.wtTable.holder),s===document&&(s=window),s===i?(a=u(s),this.overlayScrollPositions.master.left!==a&&(this.horizontalScrolling=!0,this.overlayScrollPositions.master.left=a,l=!0,n&&(n.scrollLeft=a,d=this.mainTableScrollableElement!==window),r&&(r.scrollLeft=a,d=this.mainTableScrollableElement!==window)),a=c(s),this.overlayScrollPositions.master.top!==a&&(this.verticalScrolling=!0,this.overlayScrollPositions.master.top=a,l=!0,o&&(o.scrollTop=a,d=this.mainTableScrollableElement!==window))):s===r?(a=u(s),this.overlayScrollPositions.bottom.left!==a&&(this.horizontalScrolling=!0,this.overlayScrollPositions.bottom.left=a,l=!0,i.scrollLeft=a),null!==t&&(l=!0,i.scrollTop+=t)):s===n?(a=u(s),this.overlayScrollPositions.top.left!==a&&(this.horizontalScrolling=!0,this.overlayScrollPositions.top.left=a,l=!0,i.scrollLeft=a),null!==t&&(l=!0,i.scrollTop+=t)):s===o&&(a=c(s),this.overlayScrollPositions.left.top!==a&&(this.verticalScrolling=!0,this.overlayScrollPositions.left.top=a,l=!0,i.scrollTop=a),null!==t&&(l=!0,i.scrollLeft+=t)),!this.keyPressed&&l&&"scroll"===e.type&&(this.delegatedScrollCallback?this.delegatedScrollCallback=!1:this.refreshAll(),d&&(this.delegatedScrollCallback=!0))}},syncScrollWithMaster:function(){var e=this.topOverlay.mainTableScrollableElement;this.topOverlay.needFullRender&&(this.topOverlay.clone.wtTable.holder.scrollLeft=e.scrollLeft),this.leftOverlay.needFullRender&&(this.leftOverlay.clone.wtTable.holder.scrollTop=e.scrollTop)},destroy:function(){this.eventManager.destroy(),this.topOverlay.destroy(),this.bottomOverlay.clone&&this.bottomOverlay.destroy(),this.leftOverlay.destroy(),this.topLeftCornerOverlay&&this.topLeftCornerOverlay.destroy(),this.bottomLeftCornerOverlay&&this.bottomLeftCornerOverlay.clone&&this.bottomLeftCornerOverlay.destroy(),this.debug&&this.debug.destroy(),this.destroyed=!0},refresh:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(this.topOverlay.areElementSizesAdjusted&&this.leftOverlay.areElementSizesAdjusted){var t=this.wot.wtTable.wtRootElement.parentNode||this.wot.wtTable.wtRootElement,n=t.clientWidth,o=t.clientHeight;(n!==this.spreaderLastSize.width||o!==this.spreaderLastSize.height)&&(this.spreaderLastSize.width=n,this.spreaderLastSize.height=o,this.adjustElementsSize())}this.bottomOverlay.clone&&this.bottomOverlay.refresh(e),this.leftOverlay.refresh(e),this.topOverlay.refresh(e),this.topLeftCornerOverlay&&this.topLeftCornerOverlay.refresh(e),this.bottomLeftCornerOverlay&&this.bottomLeftCornerOverlay.clone&&this.bottomLeftCornerOverlay.refresh(e),this.debug&&this.debug.refresh(e)},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=this.wot.getSetting("totalColumns"),n=this.wot.getSetting("totalRows"),o=this.wot.wtViewport.getRowHeaderWidth(),r=this.wot.wtViewport.getColumnHeaderHeight(),i=this.wot.wtTable.hider.style;i.width=o+this.leftOverlay.sumCellSizes(0,t)+"px",i.height=r+this.topOverlay.sumCellSizes(0,n)+1+"px",this.topOverlay.adjustElementsSize(e),this.leftOverlay.adjustElementsSize(e),this.bottomOverlay.clone&&this.bottomOverlay.adjustElementsSize(e)},applyToDOM:function(){this.topOverlay.areElementSizesAdjusted&&this.leftOverlay.areElementSizesAdjusted||this.adjustElementsSize(),this.topOverlay.applyToDOM(),this.bottomOverlay.clone&&this.bottomOverlay.applyToDOM(),this.leftOverlay.applyToDOM()}},{}),window.WalkontableOverlays=f},{eventManager:41,"helpers/dom/element":45,"helpers/unicode":53}],17:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableScroll:{get:function(){return o}},__esModule:{value:!0}});var o=function(e){this.wot=e,this.instance=e};$traceurRuntime.createClass(o,{scrollViewport:function(e){if(this.wot.drawn){var t=this.wot.getSetting("totalRows"),n=this.wot.getSetting("totalColumns"),o=this.instance.getSetting("fixedRowsTop"),r=this.instance.getSetting("fixedRowsBottom"),i=this.instance.getSetting("fixedColumnsLeft");if(e.row<0||e.row>t-1)throw new Error("row "+e.row+" does not exist");if(e.col<0||e.col>n-1)throw new Error("column "+e.col+" does not exist");e.row>this.instance.wtTable.getLastVisibleRow()&&e.row=o&&e.rowthis.instance.wtTable.getLastVisibleColumn()?this.wot.wtOverlays.leftOverlay.scrollTo(e.col,!0):e.col>=i&&e.colu;u++)o=e.wtTable.columnFilter.renderedToSource(u),o>=l[1]&&o<=l[3]&&(r=e.wtTable.getColumnHeader(o),r&&this.settings.highlightColumnClassName&&a(r,this.settings.highlightColumnClassName));for(var c=0;i>c;c++){n=e.wtTable.rowFilter.renderedToSource(c),n>=l[0]&&n<=l[2]&&(r=e.wtTable.getRowHeader(n),r&&this.settings.highlightRowClassName&&a(r,this.settings.highlightRowClassName));for(var d=0;s>d;d++)o=e.wtTable.columnFilter.renderedToSource(d),n>=l[0]&&n<=l[2]&&o>=l[1]&&o<=l[3]?this.settings.className&&this.addClassAtCoords(e,n,o,this.settings.className):n>=l[0]&&n<=l[2]?this.settings.highlightRowClassName&&this.addClassAtCoords(e,n,o,this.settings.highlightRowClassName):o>=l[1]&&o<=l[3]&&this.settings.highlightColumnClassName&&this.addClassAtCoords(e,n,o,this.settings.highlightColumnClassName)}if(e.getSetting("onBeforeDrawBorders",l,this.settings.className),this.settings.border){var h=this.getBorder(e);h&&h.appear(l)}}}},{}),window.WalkontableSelection=d},{border:2,"cell/coords":5,"cell/range":6,"helpers/dom/element":45}],19:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableSettings:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).fastInnerText,i=function(e,t){var n=this;this.wot=e,this.instance=e,this.defaults={table:void 0,debug:!1,externalRowCalculator:!1,stretchH:"none",currentRowClassName:null,currentColumnClassName:null,data:void 0,fixedColumnsLeft:0,fixedRowsTop:0,fixedRowsBottom:0,minSpareRows:0,rowHeaders:function(){return[]},columnHeaders:function(){return[]},totalRows:void 0,totalColumns:void 0,cellRenderer:function(e,t,o){var i=n.getSetting("data",e,t);r(o,void 0===i||null===i?"":i)},columnWidth:function(e){},rowHeight:function(e){},defaultRowHeight:23,defaultColumnWidth:50,selections:null,hideBorderOnMouseDownOver:!1,viewportRowCalculatorOverride:null,viewportColumnCalculatorOverride:null,onCellMouseDown:null,onCellMouseOver:null,onCellDblClick:null,onCellCornerMouseDown:null,onCellCornerDblClick:null,beforeDraw:null,onDraw:null,onBeforeDrawBorders:null,onScrollVertically:null,onScrollHorizontally:null,onBeforeTouchScroll:null,onAfterMomentumScroll:null,scrollbarWidth:10,scrollbarHeight:10,renderAllRows:!1,groups:!1},this.settings={};for(var o in this.defaults)if(this.defaults.hasOwnProperty(o))if(void 0!==t[o])this.settings[o]=t[o];else{if(void 0===this.defaults[o])throw new Error('A required setting "'+o+'" was not provided');this.settings[o]=this.defaults[o]}};$traceurRuntime.createClass(i,{update:function(e,t){if(void 0===t)for(var n in e)e.hasOwnProperty(n)&&(this.settings[n]=e[n]);else this.settings[e]=t;return this.wot},getSetting:function(e,t,n,o,r){return"function"==typeof this.settings[e]?this.settings[e](t,n,o,r):void 0!==t&&Array.isArray(this.settings[e])?this.settings[e][t]:this.settings[e]},has:function(e){return!!this.settings[e]}},{}),window.WalkontableSettings=i},{"helpers/dom/element":45}],20:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableTable:{get:function(){return C}},__esModule:{value:!0}});var o,r,i,s,a,l,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),c=u.getStyle,d=u.getTrimmingContainer,h=u.hasClass,f=u.index,p=u.offset,g=u.removeClass,m=u.removeTextNodes,v=(u.overlayContainsElement,(r=e("cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords),w=((i=e("cell/range"),i&&i.__esModule&&i||{"default":i}).WalkontableCellRange,(s=e("filter/column"),s&&s.__esModule&&s||{"default":s}).WalkontableColumnFilter),y=(a=e("filter/row"),a&&a.__esModule&&a||{"default":a}).WalkontableRowFilter,b=(l=e("tableRenderer"),l&&l.__esModule&&l||{"default":l}).WalkontableTableRenderer,C=function(e,t){this.wot=e,this.instance=this.wot,this.TABLE=t,this.TBODY=null,this.THEAD=null,this.COLGROUP=null,this.tableOffset=0,this.holderOffset=0,m(this.TABLE),this.spreader=this.createSpreader(this.TABLE),this.hider=this.createHider(this.spreader),this.holder=this.createHolder(this.hider),this.wtRootElement=this.holder.parentNode,this.alignOverlaysWithTrimmingContainer(),this.fixTableDomTree(),this.colgroupChildrenLength=this.COLGROUP.childNodes.length,this.theadChildrenLength=this.THEAD.firstChild?this.THEAD.firstChild.childNodes.length:0,this.tbodyChildrenLength=this.TBODY.childNodes.length,this.rowFilter=null,this.columnFilter=null};$traceurRuntime.createClass(C,{fixTableDomTree:function(){this.TBODY=this.TABLE.querySelector("tbody"),this.TBODY||(this.TBODY=document.createElement("tbody"),this.TABLE.appendChild(this.TBODY)),this.THEAD=this.TABLE.querySelector("thead"),this.THEAD||(this.THEAD=document.createElement("thead"),this.TABLE.insertBefore(this.THEAD,this.TBODY)),this.COLGROUP=this.TABLE.querySelector("colgroup"),this.COLGROUP||(this.COLGROUP=document.createElement("colgroup"),this.TABLE.insertBefore(this.COLGROUP,this.THEAD)),this.wot.getSetting("columnHeaders").length&&!this.THEAD.childNodes.length&&this.THEAD.appendChild(document.createElement("TR"))},createSpreader:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.className="wtSpreader",n&&n.insertBefore(t,e),t.appendChild(e)),t.style.position="relative",t},createHider:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.className="wtHider",n&&n.insertBefore(t,e),t.appendChild(e)),t},createHolder:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.style.position="relative",t.className="wtHolder",n&&n.insertBefore(t,e),this.isWorkingOnClone()||(t.parentNode.className+="ht_master handsontable"),t.appendChild(e)),t},alignOverlaysWithTrimmingContainer:function(){var e=d(this.wtRootElement);this.isWorkingOnClone()||(this.holder.parentNode.style.position="relative",e===window?(this.holder.style.overflow="visible",this.wtRootElement.style.overflow="visible"):(this.holder.style.width=c(e,"width"),this.holder.style.height=c(e,"height"),this.holder.style.overflow=""))},isWorkingOnClone:function(){return!!this.wot.cloneSource},draw:function(e){var t=this.instance.getSetting("totalRows");if(this.isWorkingOnClone()||(this.holderOffset=p(this.holder),e=this.wot.wtViewport.createRenderCalculators(e)),e)this.isWorkingOnClone()||this.wot.wtViewport.createVisibleCalculators(),this.wot.wtOverlays&&this.wot.wtOverlays.refresh(!0);else{this.isWorkingOnClone()?this.tableOffset=this.wot.cloneSource.wtTable.tableOffset:this.tableOffset=p(this.TABLE);var n;n=WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)?0:WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?t-this.wot.getSetting("fixedRowsBottom"):this.wot.wtViewport.rowsRenderCalculator.startRow; -var o;o=WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_LEFT)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?0:this.wot.wtViewport.columnsRenderCalculator.startColumn,this.rowFilter=new y(n,t,this.wot.getSetting("columnHeaders").length),this.columnFilter=new w(o,this.wot.getSetting("totalColumns"),this.wot.getSetting("rowHeaders").length),this._doDraw(),this.alignOverlaysWithTrimmingContainer()}return this.refreshSelections(e),this.isWorkingOnClone()||(this.wot.wtOverlays.topOverlay.resetFixedPosition(),this.wot.wtOverlays.bottomOverlay.clone&&this.wot.wtOverlays.bottomOverlay.resetFixedPosition(),this.wot.wtOverlays.leftOverlay.resetFixedPosition(),this.wot.wtOverlays.topLeftCornerOverlay&&this.wot.wtOverlays.topLeftCornerOverlay.resetFixedPosition(),this.instance.wtOverlays.bottomLeftCornerOverlay&&this.instance.wtOverlays.bottomLeftCornerOverlay.clone&&this.wot.wtOverlays.bottomLeftCornerOverlay.resetFixedPosition()),this.wot.drawn=!0,this},_doDraw:function(){var e=new b(this);e.render()},removeClassFromCells:function(e){for(var t=this.TABLE.querySelectorAll("."+e),n=0,o=t.length;o>n;n++)g(t[n],e)},refreshSelections:function(e){if(this.wot.selections){var t=this.wot.selections.length;if(e)for(var n=0;t>n;n++)this.wot.selections[n].settings.className&&this.removeClassFromCells(this.wot.selections[n].settings.className),this.wot.selections[n].settings.highlightRowClassName&&this.removeClassFromCells(this.wot.selections[n].settings.highlightRowClassName),this.wot.selections[n].settings.highlightColumnClassName&&this.removeClassFromCells(this.wot.selections[n].settings.highlightColumnClassName);for(var o=0;t>o;o++)this.wot.selections[o].draw(this.wot,e)}},getCell:function(e){if(this.isRowBeforeRenderedRows(e.row))return-1;if(this.isRowAfterRenderedRows(e.row))return-2;var t=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e.row)];return t?t.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e.col)]:void 0},getColumnHeader:function(e){var t=void 0!==arguments[1]?arguments[1]:0,n=this.THEAD.childNodes[t];return n?n.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]:void 0},getRowHeader:function(e){if(0===this.columnFilter.sourceColumnToVisibleRowHeadedColumn(0))return null;var t=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)];return t?t.childNodes[0]:void 0},getCoords:function(e){var t=e.parentNode,n=f(t);n=t.parentNode===this.THEAD?this.rowFilter.visibleColHeadedRowToSourceRow(n):this.rowFilter.renderedToSource(n);var o=this.columnFilter.visibleRowHeadedColumnToSourceColumn(e.cellIndex);return new v(n,o)},getTrForRow:function(e){return this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)]},getFirstRenderedRow:function(){return this.wot.wtViewport.rowsRenderCalculator.startRow},getFirstVisibleRow:function(){return this.wot.wtViewport.rowsVisibleCalculator.startRow},getFirstRenderedColumn:function(){return this.wot.wtViewport.columnsRenderCalculator.startColumn},getFirstVisibleColumn:function(){return this.wot.wtViewport.columnsVisibleCalculator.startColumn},getLastRenderedRow:function(){return this.wot.wtViewport.rowsRenderCalculator.endRow},getLastVisibleRow:function(){return this.wot.wtViewport.rowsVisibleCalculator.endRow},getLastRenderedColumn:function(){return this.wot.wtViewport.columnsRenderCalculator.endColumn},getLastVisibleColumn:function(){return this.wot.wtViewport.columnsVisibleCalculator.endColumn},isRowBeforeRenderedRows:function(e){return this.rowFilter.sourceToRendered(e)<0&&e>=0},isRowAfterViewport:function(e){return this.rowFilter.sourceToRendered(e)>this.getLastVisibleRow()},isRowAfterRenderedRows:function(e){return this.rowFilter.sourceToRendered(e)>this.getLastRenderedRow()},isColumnBeforeViewport:function(e){return this.columnFilter.sourceToRendered(e)<0&&e>=0},isColumnAfterViewport:function(e){return this.columnFilter.sourceToRendered(e)>this.getLastVisibleColumn()},isLastRowFullyVisible:function(){return this.getLastVisibleRow()===this.getLastRenderedRow()},isLastColumnFullyVisible:function(){return this.getLastVisibleColumn()===this.getLastRenderedColumn()},getRenderedColumnsCount:function(){return WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)?this.wot.getSetting("totalColumns"):WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_LEFT)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?this.wot.getSetting("fixedColumnsLeft"):this.wot.wtViewport.columnsRenderCalculator.count},getRenderedRowsCount:function(){return WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)?this.wot.getSetting("totalRows"):WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)?this.wot.getSetting("fixedRowsTop"):WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?this.instance.getSetting("fixedRowsBottom"):this.wot.wtViewport.rowsRenderCalculator.count},getVisibleRowsCount:function(){return this.wot.wtViewport.rowsVisibleCalculator.count},allRowsInViewport:function(){return this.wot.getSetting("totalRows")==this.getVisibleRowsCount()},getRowHeight:function(e){var t=this.wot.wtSettings.settings.rowHeight(e),n=this.wot.wtViewport.oversizedRows[e];return void 0!==n&&(t=void 0===t?n:Math.max(t,n)),t},getColumnHeaderHeight:function(e){var t=this.wot.wtSettings.settings.defaultRowHeight,n=this.wot.wtViewport.oversizedColumnHeaders[e];return void 0!==n&&(t=t?Math.max(t,n):n),t},getVisibleColumnsCount:function(){return this.wot.wtViewport.columnsVisibleCalculator.count},allColumnsInViewport:function(){return this.wot.getSetting("totalColumns")==this.getVisibleColumnsCount()},getColumnWidth:function(e){var t=this.wot.wtSettings.settings.columnWidth;return"function"==typeof t?t=t(e):"object"==typeof t&&(t=t[e]),t||this.wot.wtSettings.settings.defaultColumnWidth},getStretchedColumnWidth:function(e){var t=this.getColumnWidth(e),n=-1===[void 0,null].indexOf(t)?t:this.instance.wtSettings.settings.defaultColumnWidth,o=this.wot.wtViewport.columnsRenderCalculator;if(o){var r=o.getStretchedColumnWidth(e,n);r&&(n=r)}return n}},{}),window.WalkontableTable=C},{"cell/coords":5,"cell/range":6,"filter/column":9,"filter/row":10,"helpers/dom/element":45,tableRenderer:21}],21:[function(e,t,n){"use strict";function o(e,t){var n=document.createElement("TH");return t.insertBefore(n,e),t.removeChild(e),n}function r(e,t){var n=document.createElement("TD");return t.insertBefore(n,e),t.removeChild(e),n}Object.defineProperties(n,{WalkontableTableRenderer:{get:function(){return h}},__esModule:{value:!0}});var i,s=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),a=s.addClass,l=s.empty,u=s.getScrollbarWidth,c=s.hasClass,d=s.innerHeight,h=function(e){this.wtTable=e,this.wot=e.instance,this.instance=e.instance,this.rowFilter=e.rowFilter,this.columnFilter=e.columnFilter,this.TABLE=e.TABLE,this.THEAD=e.THEAD,this.TBODY=e.TBODY,this.COLGROUP=e.COLGROUP,this.rowHeaders=[],this.rowHeaderCount=0,this.columnHeaders=[],this.columnHeaderCount=0,this.fixedRowsTop=0,this.fixedRowsBottom=0};$traceurRuntime.createClass(h,{render:function(){this.wtTable.isWorkingOnClone()||this.wot.getSetting("beforeDraw",!0),this.rowHeaders=this.wot.getSetting("rowHeaders"),this.rowHeaderCount=this.rowHeaders.length,this.fixedRowsTop=this.wot.getSetting("fixedRowsTop"),this.fixedRowsBottom=this.wot.getSetting("fixedRowsBottom"),this.columnHeaders=this.wot.getSetting("columnHeaders"),this.columnHeaderCount=this.columnHeaders.length;var e,t=this.wtTable.getRenderedColumnsCount(),n=this.wtTable.getRenderedRowsCount(),o=this.wot.getSetting("totalColumns"),r=this.wot.getSetting("totalRows"),i=!1;if((WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER))&&(this.columnHeaders=[],this.columnHeaderCount=0),o>0&&(this.adjustAvailableNodes(),i=!0,this.renderColumnHeaders(),this.renderRows(r,n,t),this.wtTable.isWorkingOnClone()||(e=this.wot.wtViewport.getWorkspaceWidth(),this.wot.wtViewport.containerWidth=null),this.adjustColumnHeaderHeights(),this.adjustColumnWidths(t),this.markOversizedColumns()),i||this.adjustAvailableNodes(),this.removeRedundantRows(n),this.wtTable.isWorkingOnClone()){if(WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)){var s=this.wot.cloneOverlay.instance;this.wot.cloneOverlay.markOversizedFixedBottomRows(),s.wtOverlays.adjustElementsSize()}}else{if(this.markOversizedRows(),this.wot.wtViewport.createVisibleCalculators(),this.wot.wtOverlays.refresh(!1),this.wot.wtOverlays.applyToDOM(),e!==this.wot.wtViewport.getWorkspaceWidth()){this.wot.wtViewport.containerWidth=null;for(var a=this.wtTable.getFirstRenderedColumn(),l=this.wtTable.getLastRenderedColumn(),u=a;l>u;u++){var c=this.wtTable.getStretchedColumnWidth(u),d=this.columnFilter.sourceToRendered(u);this.COLGROUP.childNodes[d+this.rowHeaderCount].style.width=c+"px"}}this.wot.getSetting("onDraw",!0)}},removeRedundantRows:function(e){for(;this.wtTable.tbodyChildrenLength>e;)this.TBODY.removeChild(this.TBODY.lastChild),this.wtTable.tbodyChildrenLength--},renderRows:function(e,t,n){for(var o,r,i=0,s=this.rowFilter.renderedToSource(i),a=this.wtTable.isWorkingOnClone();e>s&&s>=0&&(i>1e3&&console.error("Security brake: Too much TRs. Please define height for your table, which will enforce scrollbars."),void 0===t||i!==t);){if(r=this.getOrCreateTrForRow(i,r),this.renderRowHeaders(s,r),this.adjustColumns(r,n+this.rowHeaderCount),o=this.renderCells(s,r,n),(!a||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM))&&this.resetOversizedRow(s),r.firstChild){var l=this.wot.wtTable.getRowHeight(s);l?(l--,r.firstChild.style.height=l+"px"):r.firstChild.style.height=""}i++,s=this.rowFilter.renderedToSource(i)}},resetOversizedRow:function(e){this.wot.getSetting("externalRowCalculator")||this.wot.wtViewport.oversizedRows&&this.wot.wtViewport.oversizedRows[e]&&(this.wot.wtViewport.oversizedRows[e]=void 0)},markOversizedRows:function(){if(!this.wot.getSetting("externalRowCalculator")){var e,t,n,o,r,i=this.instance.wtTable.TBODY.childNodes.length,s=i*this.instance.wtSettings.settings.defaultRowHeight,a=d(this.instance.wtTable.TBODY)-1;this.instance.getSetting("totalRows");if(s!==a||this.instance.getSetting("fixedRowsBottom"))for(;i;)i--,n=this.instance.wtTable.rowFilter.renderedToSource(i),e=this.instance.wtTable.getRowHeight(n),o=this.instance.wtTable.getTrForRow(n),r=o.querySelector("th"),t=r?d(r):d(o)-1,(!e&&this.instance.wtSettings.settings.defaultRowHeighte)&&(this.instance.wtViewport.oversizedRows[n]=++t)}},markOversizedColumns:function(){var e=this.wot.getOverlayName();if(this.columnHeaderCount&&!this.wot.wtViewport.isMarkedOversizedColumn[e]&&!this.wtTable.isWorkingOnClone()){for(var t=this.wtTable.getRenderedColumnsCount(),n=0;no;o++)this.markIfOversizedColumnHeader(o);this.wot.wtViewport.isMarkedOversizedColumn[e]=!0}},adjustColumnHeaderHeights:function(){for(var e=this.wot.getSetting("columnHeaders"),t=this.wot.wtTable.THEAD.childNodes,n=this.wot.wtViewport.oversizedColumnHeaders,o=0,r=e.length;r>o;o++)if(n[o]){if(0===t[o].childNodes.length)return;t[o].childNodes[0].style.height=n[o]+"px"}},markIfOversizedColumnHeader:function(e){for(var t,n,o,r=this.wot.wtTable.columnFilter.renderedToSource(e),i=this.columnHeaderCount,s=this.wot.wtSettings.settings.defaultRowHeight;i;)i--,t=this.wot.wtTable.getColumnHeaderHeight(i),n=this.wot.wtTable.getColumnHeader(r,i),n&&(o=d(n),(!t&&o>s||o>t)&&(this.wot.wtViewport.oversizedColumnHeaders[i]=o))},renderCells:function(e,t,n){for(var o,i,s=0;n>s;s++)i=this.columnFilter.renderedToSource(s),o=0===s?t.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(i)]:o.nextSibling,"TH"==o.nodeName&&(o=r(o,t)),c(o,"hide")||(o.className=""),o.removeAttribute("style"),this.wot.wtSettings.settings.cellRenderer(e,i,o);return o},adjustColumnWidths:function(e){var t=0,n=this.wot.cloneSource?this.wot.cloneSource:this.wot,o=n.wtTable.holder;o.offsetHeightr;r++){var i=this.wtTable.getStretchedColumnWidth(this.columnFilter.renderedToSource(r));this.COLGROUP.childNodes[r+this.rowHeaderCount].style.width=i+"px"}},appendToTbody:function(e){this.TBODY.appendChild(e),this.wtTable.tbodyChildrenLength++},getOrCreateTrForRow:function(e,t){var n;return e>=this.wtTable.tbodyChildrenLength?(n=this.createRow(),this.appendToTbody(n)):n=0===e?this.TBODY.firstChild:t.nextSibling,n.className&&n.removeAttribute("class"),n},createRow:function(){for(var e=document.createElement("TR"),t=0;to;o++){var r=this.columnFilter.renderedToSource(o);this.renderColumnHeader(t,r,n.childNodes[o+this.rowHeaderCount])}},adjustColGroups:function(){for(var e=this.wtTable.getRenderedColumnsCount();this.wtTable.colgroupChildrenLengthe+this.rowHeaderCount;)this.COLGROUP.removeChild(this.COLGROUP.lastChild),this.wtTable.colgroupChildrenLength--;this.rowHeaderCount&&a(this.COLGROUP.childNodes[0],"rowHeader")},adjustThead:function(){var e=this.wtTable.getRenderedColumnsCount(),t=this.THEAD.firstChild;if(this.columnHeaders.length){for(var n=0,o=this.columnHeaders.length;o>n;n++){for(t=this.THEAD.childNodes[n],t||(t=document.createElement("TR"),this.THEAD.appendChild(t)),this.theadChildrenLength=t.childNodes.length;this.theadChildrenLengthe+this.rowHeaderCount;)t.removeChild(t.lastChild),this.theadChildrenLength--}var r=this.THEAD.childNodes.length;if(r>this.columnHeaders.length)for(var i=this.columnHeaders.length;r>i;i++)this.THEAD.removeChild(this.THEAD.lastChild)}else t&&l(t)},getTrForColumnHeaders:function(e){return this.THEAD.childNodes[e]},renderColumnHeader:function(e,t,n){return n.className="",n.removeAttribute("style"),this.columnHeaders[e](t,n,e)},adjustColumns:function(e,t){for(var n=e.childNodes.length;t>n;){var o=document.createElement("TD");e.appendChild(o),n++}for(;n>t;)e.removeChild(e.lastChild),n--},removeRedundantColumns:function(e){for(;this.wtTable.tbodyChildrenLength>e;)this.TBODY.removeChild(this.TBODY.lastChild),this.wtTable.tbodyChildrenLength--}},{}),window.WalkontableTableRenderer=h},{"helpers/dom/element":45}],22:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableViewport:{get:function(){return v}},__esModule:{value:!0}});var o,r,i,s,a=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),l=a.getScrollbarWidth,u=a.getScrollTop,c=a.getStyle,d=a.offset,h=a.outerHeight,f=a.outerWidth,p=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,g=(i=e("calculator/viewportColumns"),i&&i.__esModule&&i||{"default":i}).WalkontableViewportColumnsCalculator,m=(s=e("calculator/viewportRows"),s&&s.__esModule&&s||{"default":s}).WalkontableViewportRowsCalculator,v=function(e){var t=this;this.wot=e,this.instance=this.wot,this.oversizedRows=[],this.oversizedColumnHeaders=[],this.isMarkedOversizedColumn={},this.clientHeight=0,this.containerWidth=NaN,this.rowHeaderWidth=NaN,this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,this.eventManager=new p(this.wot),this.eventManager.addEventListener(window,"resize",function(){t.clientHeight=t.getWorkspaceHeight()})};$traceurRuntime.createClass(v,{getWorkspaceHeight:function(){var e,t=this.instance.wtOverlays.topOverlay.trimmingContainer,n=0;return t===window?n=document.documentElement.clientHeight:(e=h(t),n=e>0&&t.clientHeight>0?t.clientHeight:1/0),n},getWorkspaceWidth:function(){var e,t,n=this.instance.getSetting("totalColumns"),o=this.instance.wtOverlays.leftOverlay.trimmingContainer,r=this.instance.getSetting("stretchH"),i=document.documentElement.offsetWidth;return e=Handsontable.freezeOverlays?Math.min(i-this.getWorkspaceOffset().left,i):Math.min(this.getContainerFillWidth(),i-this.getWorkspaceOffset().left,i),o===window&&n>0&&this.sumColumnWidths(0,n-1)>e?document.documentElement.clientWidth:o!==window&&(t=c(this.instance.wtOverlays.leftOverlay.trimmingContainer,"overflow"),"scroll"==t||"hidden"==t||"auto"==t)?Math.max(e,o.clientWidth):"none"!==r&&r?e:Math.max(e,f(this.instance.wtTable.TABLE))},hasVerticalScroll:function(){return this.getWorkspaceActualHeight()>this.getWorkspaceHeight()},hasHorizontalScroll:function(){return this.getWorkspaceActualWidth()>this.getWorkspaceWidth()},sumColumnWidths:function(e,t){for(var n=0;t>e;)n+=this.wot.wtTable.getColumnWidth(e),e++;return n},getContainerFillWidth:function(){if(this.containerWidth)return this.containerWidth;var e,t,n=this.instance.wtTable.holder;return t=document.createElement("div"),t.style.width="100%",t.style.height="1px",n.appendChild(t),e=t.offsetWidth,this.containerWidth=e,n.removeChild(t),e},getWorkspaceOffset:function(){return d(this.wot.wtTable.TABLE)},getWorkspaceActualHeight:function(){return h(this.wot.wtTable.TABLE)},getWorkspaceActualWidth:function(){return f(this.wot.wtTable.TABLE)||f(this.wot.wtTable.TBODY)||f(this.wot.wtTable.THEAD)},getColumnHeaderHeight:function(){return isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=h(this.wot.wtTable.THEAD)),this.columnHeaderHeight},getViewportHeight:function(){var e,t=this.getWorkspaceHeight();return t===1/0?t:(e=this.getColumnHeaderHeight(),e>0&&(t-=e),t)},getRowHeaderWidth:function(){if(this.wot.cloneSource)return this.wot.cloneSource.wtViewport.getRowHeaderWidth();if(isNaN(this.rowHeaderWidth)){var e=this.instance.getSetting("rowHeaders");if(e.length){var t=this.instance.wtTable.TABLE.querySelector("TH");this.rowHeaderWidth=0;for(var n=0,o=e.length;o>n;n++)t?(this.rowHeaderWidth+=f(t),t=t.nextSibling):this.rowHeaderWidth+=50}else this.rowHeaderWidth=0}return this.rowHeaderWidth},getViewportWidth:function(){var e,t=this.getWorkspaceWidth();return t===1/0?t:(e=this.getRowHeaderWidth(),e>0?t-e:t)},createRowsCalculator:function(){var e,t,n,o,r,i,s,a=void 0!==arguments[0]?arguments[0]:!1,c=this;return this.rowHeaderWidth=NaN,e=this.wot.wtSettings.settings.renderAllRows?1/0:this.getViewportHeight(),t=u(this.wot.wtOverlays.mainTableScrollableElement)-this.wot.wtOverlays.topOverlay.getTableParentOffset(),0>t&&(t=0),n=this.wot.getSetting("fixedRowsTop"),r=this.wot.getSetting("fixedRowsBottom"),s=this.wot.getSetting("totalRows"),n&&(i=this.wot.wtOverlays.topOverlay.sumCellSizes(0,n),t+=i,e-=i),r&&this.wot.wtOverlays.bottomOverlay.clone&&(i=this.wot.wtOverlays.bottomOverlay.sumCellSizes(s-r,s),e-=i),o=this.wot.wtTable.holder.clientHeight===this.wot.wtTable.holder.offsetHeight?0:l(),new m(e,t,this.wot.getSetting("totalRows"),function(e){return c.wot.wtTable.getRowHeight(e)},a?null:this.wot.wtSettings.settings.viewportRowCalculatorOverride,a,o)},createColumnsCalculator:function(){var e,t,n=void 0!==arguments[0]?arguments[0]:!1,o=this,r=this.getViewportWidth();if(this.columnHeaderHeight=NaN,e=this.wot.wtOverlays.leftOverlay.getScrollPosition()-this.wot.wtOverlays.leftOverlay.getTableParentOffset(),0>e&&(e=0),t=this.wot.getSetting("fixedColumnsLeft")){var i=this.wot.wtOverlays.leftOverlay.sumCellSizes(0,t);e+=i,r-=i}return this.wot.wtTable.holder.clientWidth!==this.wot.wtTable.holder.offsetWidth&&(r-=l()),new g(r,e,this.wot.getSetting("totalColumns"),function(e){return o.wot.wtTable.getColumnWidth(e)},n?null:this.wot.wtSettings.settings.viewportColumnCalculatorOverride,n,this.wot.getSetting("stretchH"))},createRenderCalculators:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(e){var t=this.createRowsCalculator(!0),n=this.createColumnsCalculator(!0);this.areAllProposedVisibleRowsAlreadyRendered(t)&&this.areAllProposedVisibleColumnsAlreadyRendered(n)||(e=!1)}return e||(this.rowsRenderCalculator=this.createRowsCalculator(),this.columnsRenderCalculator=this.createColumnsCalculator()),this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,e},createVisibleCalculators:function(){this.rowsVisibleCalculator=this.createRowsCalculator(!0),this.columnsVisibleCalculator=this.createColumnsCalculator(!0)},areAllProposedVisibleRowsAlreadyRendered:function(e){return this.rowsVisibleCalculator?e.startRow0?!1:e.endRow>this.rowsRenderCalculator.endRow||e.endRow===this.rowsRenderCalculator.endRow&&e.endRow0?!1:e.endColumn>this.columnsRenderCalculator.endColumn||e.endColumn===this.columnsRenderCalculator.endColumn&&e.endColumn=0;s--)if(null===e[s])e.splice(s,1);else{var a=e[s][0],l=d.propToCol(e[s][1]),u=m.runHooks("modifyCol",l),c=m.getCellMeta(a,u);if("numeric"===c.type&&"string"==typeof e[s][3]&&e[s][3].length>0&&(/^-?[\d\s]*(\.|\,)?\d*$/.test(e[s][3])||c.format)){var h=e[s][3].length;"undefined"==typeof c.language?R.language("en"):e[s][3].indexOf(".")===h-3&&-1===e[s][3].indexOf(",")?R.language("en"):R.language(c.language),R.validate(e[s][3])&&(e[s][3]=R().unformat(e[s][3]))}m.getCellValidator(c)&&(i.addValidatorToQueue(),m.validateCell(e[s][3],c,function(t,n){return function(o){if("boolean"!=typeof o)throw new Error("Validation error: result is not boolean");o===!1&&n.allowInvalid===!1&&(e.splice(t,1),n.valid=!0,--t),i.removeValidatorFormQueue(); -}}(s,c),t))}i.checkIfQueueIsEmpty()}function r(e,t){var n=e.length-1;if(!(0>n)){for(;n>=0;n--)if(null!==e[n]){if(null!=e[n][2]||null!=e[n][3]){if(c.settings.allowInsertRow)for(;e[n][0]>m.countRows()-1;)d.createRow();if("array"===m.dataType&&c.settings.allowInsertColumn)for(;d.propToCol(e[n][1])>m.countCols()-1;)d.createCol();d.set(e[n][0],e[n][1],e[n][3])}}else e.splice(n,1);m.forceFullRender=!0,f.adjustRowsAndCols(),Handsontable.hooks.run(m,"beforeChangeRender",e,t),p.refreshBorders(null,!0),m.view.wt.wtOverlays.adjustElementsSize(),Handsontable.hooks.run(m,"afterChange",e,t||"edit")}}function i(e,t,n){return"object"==typeof e?e:[[e,t,n]]}function s(e){if(e.hasOwnProperty("type")){var t,n={};if("object"==typeof e.type)t=e.type;else if("string"==typeof e.type&&(t=Handsontable.cellTypes[e.type],void 0===t))throw new Error('You declared cell type "'+e.type+'" as a string that is not mapped to a known object. Cell type must be an object or a string mapped to an object in Handsontable.cellTypes');for(var o in t)t.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&(n[o]=t[o]);return n}}function a(e){return Handsontable.hooks.run(m,"modifyRow",e)}function l(e){return Handsontable.hooks.run(m,"modifyCol",e)}function u(){throw new Error("This method cannot be called because this Handsontable instance has been destroyed")}var c,d,h,f,p,g,m=this,v=function(){},w=D(m);x(v.prototype,Z.prototype),x(v.prototype,t),x(v.prototype,s(t)),this.rootElement=e,this.isHotTableEnv=T(this.rootElement),Handsontable.eventManager.isHotTableEnv=this.isHotTableEnv,this.container=document.createElement("DIV"),this.renderCall=!1,e.insertBefore(this.container,e.firstChild),this.guid="ht_"+B(),this.rootElement.id&&"ht_"!==this.rootElement.id.substring(0,3)||(this.rootElement.id=this.guid),c={cellSettings:[],columnSettings:[],columnsSettingConflicts:["data","width"],settings:new v,selRange:null,isPopulated:null,scrollable:null,firstRun:!0},f={alter:function(e,t,n,o,r){var i;switch(n=n||1,e){case"insert_row":if(m.getSettings().maxRows===m.countSourceRows())return;i=d.createRow(t,n),i&&(p.isSelected()&&c.selRange.from.row>=t?(c.selRange.from.row=c.selRange.from.row+i,p.transformEnd(i,0)):p.refreshBorders());break;case"insert_col":if(i=d.createCol(t,n)){if(Array.isArray(m.getSettings().colHeaders)){var s=[t,0];s.length+=i,Array.prototype.splice.apply(m.getSettings().colHeaders,s)}p.isSelected()&&c.selRange.from.col>=t?(c.selRange.from.col=c.selRange.from.col+i,p.transformEnd(0,i)):p.refreshBorders()}break;case"remove_row":d.removeRow(t,n),c.cellSettings.splice(t,n);var a=m.countRows(),l=m.getSettings().fixedRowsTop;l>=t+1&&(m.getSettings().fixedRowsTop-=Math.min(n,l-t));var u=m.getSettings().fixedRowsBottom;u&&t+1>=a-u&&(m.getSettings().fixedRowsBottom-=Math.min(n,u-t)),f.adjustRowsAndCols(),p.refreshBorders();break;case"remove_col":d.removeCol(t,n);for(var h=0,g=d.getAll().length;g>h;h++)h in c.cellSettings&&c.cellSettings[h].splice(t,n);var v=m.getSettings().fixedColumnsLeft;v>=t+1&&(m.getSettings().fixedColumnsLeft-=Math.min(n,v-t)),Array.isArray(m.getSettings().colHeaders)&&("undefined"==typeof t&&(t=-1),m.getSettings().colHeaders.splice(t,n)),f.adjustRowsAndCols(),p.refreshBorders();break;default:throw new Error('There is no such action "'+e+'"')}r||f.adjustRowsAndCols()},adjustRowsAndCols:function(){if(c.settings.minRows){var e=m.countRows();if(et;t++)d.createRow(m.countRows(),1,!0)}if(c.settings.minSpareRows){var o=m.countEmptyRows(!0);if(oi-1?(l=i-1,a=!0,h>l&&(h=l)):h>i-1&&(h=i-1,a=!0,l>h&&(l=h)),u>s-1?(u=s-1,a=!0,f>u&&(f=u)):f>s-1&&(f=s-1,a=!0,u>f&&(u=f)),a&&m.selectCell(l,u,h,f)}m.view&&m.view.wt.wtOverlays.adjustElementsSize()},populateFromArray:function(e,t,n,o,r,i,s){var a,l,u,d,h=[],f={};if(l=t.length,0===l)return!1;var p,g,v,w;({row:null===n?null:n.row,col:null===n?null:n.col});switch(r){case"shift_down":for(p=n?n.col-e.col+1:0,g=n?n.row-e.row+1:0,t=U(t),u=0,d=t.length,v=Math.max(d,p);v>u;u++)if(d>u){for(a=0,l=t[u].length;g-l>a;a++)t[u].push(t[u][a%l]);t[u].unshift(e.col+u,e.row,0),m.spliceCol.apply(m,t[u])}else t[u%d][0]=e.col+u,m.spliceCol.apply(m,t[u%d]);break;case"shift_right":for(p=n?n.col-e.col+1:0,g=n?n.row-e.row+1:0,a=0,l=t.length,w=Math.max(l,g);w>a;a++)if(l>a){for(u=0,d=t[a].length;p-d>u;u++)t[a].push(t[a][u%d]);t[a].unshift(e.row+a,e.col,0),m.spliceRow.apply(m,t[a])}else t[a%l][0]=e.row+a,m.spliceRow.apply(m,t[a%l]);break;case"overwrite":default:f.row=e.row,f.col=e.col;var y,b={row:n&&e?n.row-e.row+1:1,col:n&&e?n.col-e.col+1:1},C=0,R=0,_=!0,S=function(e){var n=void 0!==arguments[1]?arguments[1]:null,o=t[e%t.length];return null!==n?o[n%o.length]:o},E=t.length,T=n?n.row-e.row+1:0;for(l=n?T:Math.max(E,T),a=0;l>a&&!(n&&f.row>n.row&&T>E||!c.settings.allowInsertRow&&f.row>m.countRows()-1||f.row>=c.settings.maxRows);a++){var O=a-C,M=S(O).length,k=n?n.col-e.col+1:0;if(d=n?k:Math.max(M,k),f.col=e.col,y=m.getCellMeta(f.row,f.col),"paste"!==o&&"autofill"!==o||!y.skipRowOnPaste){for(R=0,u=0;d>u&&!(n&&f.col>n.col&&k>M||!c.settings.allowInsertColumn&&f.col>m.countCols()-1||f.col>=c.settings.maxCols);u++)if(y=m.getCellMeta(f.row,f.col),"paste"!==o&&"autofill"!==o||!y.skipColumnOnPaste)if(y.readOnly)f.col++;else{var H=u-R,D=S(O,H),A=m.getDataAtCell(f.row,f.col),x={row:O,col:H};if("autofill"===o){var W=m.runHooks("beforeAutofillInsidePopulate",x,i,t,s,{},b);W&&(D="undefined"==typeof W.value?D:W.value)}if(null!==D&&"object"==typeof D)if(null===A||"object"!=typeof A)_=!1;else{var I=P(A[0]||A),j=P(D[0]||D);N(I,j)?D=L(D):_=!1}else null!==A&&"object"==typeof A&&(_=!1);_&&h.push([f.row,f.col,D]),_=!0,f.col++}else R++,f.col++,d++;f.row++}else C++,f.row++,l++}m.setDataAtCell(h,null,null,o||"populateFromArray")}}},this.selection=p={inProgress:!1,selectedHeader:{cols:!1,rows:!1},setSelectedHeaders:function(e,t){m.selection.selectedHeader.rows=e,m.selection.selectedHeader.cols=t},begin:function(){m.selection.inProgress=!0},finish:function(){var e=m.getSelected();Handsontable.hooks.run(m,"afterSelectionEnd",e[0],e[1],e[2],e[3]),Handsontable.hooks.run(m,"afterSelectionEndByProp",e[0],m.colToProp(e[1]),e[2],m.colToProp(e[3])),m.selection.inProgress=!1},isInProgress:function(){return m.selection.inProgress},setRangeStart:function(e,t){Handsontable.hooks.run(m,"beforeSetRangeStart",e),c.selRange=new X(e,e,e),p.setRangeEnd(e,null,t)},setRangeEnd:function(e,t,n){if(null!==c.selRange){var o,r=!1,i=!0,s=m.view.wt.wtTable.getFirstVisibleRow(),a=m.view.wt.wtTable.getFirstVisibleColumn(),l={row:null,col:null};Handsontable.hooks.run(m,"beforeSetRangeEnd",e),m.selection.begin(),l.row=e.row<0?s:e.row,l.col=e.col<0?a:e.col,c.selRange.to=new K(l.row,l.col),c.settings.multiSelect||(c.selRange.from=e),m.view.wt.selections.current.clear(),o=m.getCellMeta(c.selRange.highlight.row,c.selRange.highlight.col).disableVisualSelection,"string"==typeof o&&(o=[o]),(o===!1||Array.isArray(o)&&-1===o.indexOf("current"))&&m.view.wt.selections.current.add(c.selRange.highlight),m.view.wt.selections.area.clear(),(o===!1||Array.isArray(o)&&-1===o.indexOf("area"))&&p.isMultiple()&&(m.view.wt.selections.area.add(c.selRange.from),m.view.wt.selections.area.add(c.selRange.to)),(c.settings.currentRowClassName||c.settings.currentColClassName)&&(m.view.wt.selections.highlight.clear(),m.view.wt.selections.highlight.add(c.selRange.from),m.view.wt.selections.highlight.add(c.selRange.to)),Handsontable.hooks.run(m,"afterSelection",c.selRange.from.row,c.selRange.from.col,c.selRange.to.row,c.selRange.to.col),Handsontable.hooks.run(m,"afterSelectionByProp",c.selRange.from.row,d.colToProp(c.selRange.from.col),c.selRange.to.row,d.colToProp(c.selRange.to.col)),(0===c.selRange.from.row&&c.selRange.to.row===m.countRows()-1&&m.countRows()>1||0===c.selRange.from.col&&c.selRange.to.col===m.countCols()-1&&m.countCols()>1)&&(r=!0),(e.row<0||e.col<0)&&(i=!1),t!==!1&&!r&&i&&(c.selRange.from&&!p.isMultiple()?m.view.scrollViewport(c.selRange.from):m.view.scrollViewport(e)),p.refreshBorders(null,n)}},refreshBorders:function(e,t){t||g.destroyEditor(e),m.view.render(),p.isSelected()&&!t&&g.prepareEditor()},isMultiple:function(){var e=!(c.selRange.to.col===c.selRange.from.col&&c.selRange.to.row===c.selRange.from.row),t=Handsontable.hooks.run(m,"afterIsMultipleSelection",e);return e?t:void 0},transformStart:function(e,t,n,o){var r,i,s,a,l=new K(e,t),u=0,d=0;m.runHooks("modifyTransformStart",l),r=m.countRows(),i=m.countCols(),a=m.getSettings().fixedRowsBottom,c.selRange.highlight.row+e>r-1?n&&c.settings.minSpareRows>0&&!(a&&c.selRange.highlight.row>=r-a-1)?(m.alter("insert_row",r),r=m.countRows()):c.settings.autoWrapCol&&(l.row=1-r,l.col=c.selRange.highlight.col+l.col==i-1?1-i:1):c.settings.autoWrapCol&&c.selRange.highlight.row+l.row<0&&c.selRange.highlight.col+l.col>=0&&(l.row=r-1,l.col=c.selRange.highlight.col+l.col==0?i-1:-1),c.selRange.highlight.col+l.col>i-1?n&&c.settings.minSpareCols>0?(m.alter("insert_col",i),i=m.countCols()):c.settings.autoWrapRow&&(l.row=c.selRange.highlight.row+l.row==r-1?1-r:1,l.col=1-i):c.settings.autoWrapRow&&c.selRange.highlight.col+l.col<0&&c.selRange.highlight.row+l.row>=0&&(l.row=c.selRange.highlight.row+l.row==0?r-1:-1,l.col=i-1),s=new K(c.selRange.highlight.row+l.row,c.selRange.highlight.col+l.col),s.row<0?(u=-1,s.row=0):s.row>0&&s.row>=r&&(u=1,s.row=r-1),s.col<0?(d=-1,s.col=0):s.col>0&&s.col>=i&&(d=1,s.col=i-1),m.runHooks("afterModifyTransformStart",s,u,d),p.setRangeStart(s,o)},transformEnd:function(e,t){var n,o,r,i=new K(e,t),s=0,a=0;m.runHooks("modifyTransformEnd",i),n=m.countRows(),o=m.countCols(),r=new K(c.selRange.to.row+i.row,c.selRange.to.col+i.col),r.row<0?(s=-1,r.row=0):r.row>0&&r.row>=n&&(s=1,r.row=n-1),r.col<0?(a=-1,r.col=0):r.col>0&&r.col>=o&&(a=1,r.col=o-1),m.runHooks("afterModifyTransformEnd",r,s,a),p.setRangeEnd(r,!0)},isSelected:function(){return null!==c.selRange},inInSelection:function(e){return p.isSelected()?c.selRange.includes(e):!1},deselect:function(){p.isSelected()&&(m.selection.inProgress=!1,c.selRange=null,m.view.wt.selections.current.clear(),m.view.wt.selections.area.clear(),(c.settings.currentRowClassName||c.settings.currentColClassName)&&m.view.wt.selections.highlight.clear(),g.destroyEditor(),p.refreshBorders(),Handsontable.hooks.run(m,"afterDeselect"))},selectAll:function(){c.settings.multiSelect&&(p.setRangeStart(new K(0,0)),p.setRangeEnd(new K(m.countRows()-1,m.countCols()-1),!1))},empty:function(){if(p.isSelected()){var e,t,n=c.selRange.getTopLeftCorner(),o=c.selRange.getBottomRightCorner(),r=[];for(e=n.row;e<=o.row;e++)for(t=n.col;t<=o.col;t++)m.getCellMeta(e,t).readOnly||r.push([e,t,""]);m.setDataAtCell(r)}}},this.init=function(){h=new z(m,c.settings.data),Handsontable.hooks.run(m,"beforeInit"),Handsontable.mobileBrowser&&S(m.rootElement,"mobile"),this.updateSettings(c.settings,!0),this.view=new V(this),g=new H(m,c,p,d),this.forceFullRender=!0,Handsontable.hooks.run(m,"init"),this.view.render(),"object"==typeof c.firstRun&&(Handsontable.hooks.run(m,"afterChange",c.firstRun[0],c.firstRun[1]),c.firstRun=!1),Handsontable.hooks.run(m,"afterInit")},this.validateCell=function(e,t,n,o){function r(e){var o=t.physicalCol,r=t.physicalRow,i=m.getCell(r,o,!0);i&&m.view.wt.wtSettings.settings.cellRenderer(r,o,i),n(e)}var i=m.getCellValidator(t);"[object RegExp]"===Object.prototype.toString.call(i)&&(i=function(e){return function(t,n){n(e.test(t))}}(i)),"function"==typeof i?(e=Handsontable.hooks.run(m,"beforeValidate",e,t.row,t.prop,o),m._registerTimeout(setTimeout(function(){i.call(t,e,function(n){n=Handsontable.hooks.run(m,"afterValidate",n,e,t.row,t.prop,o),t.valid=n,r(n),Handsontable.hooks.run(m,"postAfterValidate",n,e,t.row,t.prop,o)})},0))):(t.valid=!0,r(t.valid))},this.setDataAtCell=function(e,t,n,s){var a,l,u,c=i(e,t,n),h=[];for(a=0,l=c.length;l>a;a++){if("object"!=typeof c[a])throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if("number"!=typeof c[a][1])throw new Error("Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`");u=d.colToProp(c[a][1]),h.push([c[a][0],u,d.get(c[a][0],u),c[a][2]])}s||"object"!=typeof e||(s=t),o(h,s,function(){r(h,s)})},this.setDataAtRowProp=function(e,t,n,s){var a,l,u=i(e,t,n),c=[];for(a=0,l=u.length;l>a;a++)c.push([u[a][0],u[a][1],d.get(u[a][0],u[a][1]),u[a][2]]);s||"object"!=typeof e||(s=t),o(c,s,function(){r(c,s)})},this.listen=function(){Handsontable.activeGuid=m.guid},this.unlisten=function(){Handsontable.activeGuid=null},this.isListening=function(){return Handsontable.activeGuid===m.guid},this.destroyEditor=function(e){p.refreshBorders(e)},this.populateFromArray=function(e,t,n,o,r,i,s,a,l){var u;if("object"!=typeof n||"object"!=typeof n[0])throw new Error("populateFromArray parameter `input` must be an array of arrays");return u="number"==typeof o?new K(o,r):null,f.populateFromArray(new K(e,t),n,u,i,s,a,l)},this.spliceCol=function(e,t,n){return d.spliceCol.apply(d,arguments)},this.spliceRow=function(e,t,n){return d.spliceRow.apply(d,arguments)},this.getSelected=function(){return p.isSelected()?[c.selRange.from.row,c.selRange.from.col,c.selRange.to.row,c.selRange.to.col]:void 0},this.getSelectedRange=function(){return p.isSelected()?c.selRange:void 0},this.render=function(){m.view&&(m.renderCall=!0,m.forceFullRender=!0,p.refreshBorders(null,!0))},this.loadData=function(e){function t(){c.cellSettings.length=0}if("object"==typeof e&&null!==e)e.push&&e.splice||(e=[e]);else{if(null!==e)throw new Error("loadData only accepts array of objects or array of arrays ("+typeof e+" given)");e=[];for(var n,o=0,r=c.settings.startRows;r>o;o++){n=[];for(var i=0,s=c.settings.startCols;s>i;i++)n.push(null);e.push(n)}}c.isPopulated=!1,v.prototype.data=e,Array.isArray(c.settings.dataSchema)||Array.isArray(e[0])?m.dataType="array":"function"==typeof c.settings.dataSchema?m.dataType="function":m.dataType="object",d=new k(m,c,v),h.data=e,h.dataType=m.dataType,h.colToProp=d.colToProp.bind(d),h.propToCol=d.propToCol.bind(d),t(),f.adjustRowsAndCols(),Handsontable.hooks.run(m,"afterLoadData",c.firstRun),c.firstRun?c.firstRun=[null,"loadData"]:(Handsontable.hooks.run(m,"afterChange",null,"loadData"),m.render()),c.isPopulated=!0},this.getData=function(e,t,n,o){return"undefined"==typeof e?d.getAll():d.getRange(new K(e,t),new K(n,o),d.DESTINATION_RENDERER)},this.getCopyableText=function(e,t,n,o){return d.getCopyableText(new K(e,t),new K(n,o))},this.getCopyableData=function(e,t){return d.getCopyable(e,d.colToProp(t))},this.getSchema=function(){return d.getSchema()},this.updateSettings=function(e,t){var n,o;if("undefined"!=typeof e.rows)throw new Error('"rows" setting is no longer supported. do you mean startRows, minRows or maxRows?');if("undefined"!=typeof e.cols)throw new Error('"cols" setting is no longer supported. do you mean startCols, minCols or maxCols?');for(n in e)"data"!==n&&(Handsontable.hooks.getRegistered().indexOf(n)>-1?("function"==typeof e[n]||Array.isArray(e[n]))&&m.addHook(n,e[n]):!t&&e.hasOwnProperty(n)&&(v.prototype[n]=e[n]));if(void 0===e.data&&void 0===c.settings.data?m.loadData(null):void 0!==e.data?m.loadData(e.data):void 0!==e.columns&&d.createMap(),o=m.countCols(),c.cellSettings.length=0,o>0){var r,i;for(n=0;o>n;n++)c.columnSettings[n]=M(v,c.columnsSettingConflicts),r=c.columnSettings[n].prototype,v.prototype.columns&&(i=v.prototype.columns[n],x(r,i),x(r,s(i)))}if("undefined"!=typeof e.cell)for(n in e.cell)if(e.cell.hasOwnProperty(n)){var a=e.cell[n];m.setCellMetaObject(a.row,a.col,a)}if(Handsontable.hooks.run(m,"afterCellMetaReset"),"undefined"!=typeof e.className&&(v.prototype.className&&O(m.rootElement,v.prototype.className),e.className&&S(m.rootElement,e.className)),"undefined"!=typeof e.height){var l=e.height;"function"==typeof l&&(l=l()),m.rootElement.style.height=l+"px"}if("undefined"!=typeof e.width){var u=e.width;"function"==typeof u&&(u=u()),m.rootElement.style.width=u+"px"}l&&(m.rootElement.style.overflow="hidden"),t||Handsontable.hooks.run(m,"afterUpdateSettings"),f.adjustRowsAndCols(),m.view&&!c.firstRun&&(m.forceFullRender=!0,p.refreshBorders(null,!0))},this.getValue=function(){var e=m.getSelected();if(v.prototype.getValue){if("function"==typeof v.prototype.getValue)return v.prototype.getValue.call(m);if(e)return m.getData()[e[0]][v.prototype.getValue]}else if(e)return m.getDataAtCell(e[0],e[1])},this.getSettings=function(){return c.settings},this.clear=function(){p.selectAll(),p.empty()},this.alter=function(e,t,n,o,r){f.alter(e,t,n,o,r)},this.getCell=function(e,t,n){return m.view.getCellAtCoords(new K(e,t),n)},this.getCoords=function(e){return this.view.wt.wtTable.getCoords.call(this.view.wt.wtTable,e)},this.colToProp=function(e){return d.colToProp(e)},this.propToCol=function(e){return d.propToCol(e)},this.getDataAtCell=function(e,t){return d.get(e,d.colToProp(t))},this.getDataAtRowProp=function(e,t){return d.get(e,t)},this.getDataAtCol=function(e){var t=[];return t.concat.apply(t,d.getRange(new K(0,e),new K(c.settings.data.length-1,e),d.DESTINATION_RENDERER))},this.getDataAtProp=function(e){var t,n=[];return t=d.getRange(new K(0,d.propToCol(e)),new K(c.settings.data.length-1,d.propToCol(e)),d.DESTINATION_RENDERER),n.concat.apply(n,t)},this.getSourceData=function(e,t,n,o){var r;return r=void 0===e?h.getData():h.getByRange(new K(e,t),new K(n,o))},this.getSourceDataAtCol=function(e){return h.getAtColumn(e)},this.getSourceDataAtRow=function(e){return h.getAtRow(e)},this.getSourceDataAtCell=function(e,t){return h.getAtCell(e,t)},this.getDataAtRow=function(e){var t=d.getRange(new K(e,0),new K(e,this.countCols()-1),d.DESTINATION_RENDERER);return t[0]},this.getDataType=function(e,t,n,o){var r=this,i=null,s=null;void 0===e&&(e=0,n=this.countRows(),t=0,o=this.countCols()),void 0===n&&(n=e),void 0===o&&(o=t);var a="mixed";return F(Math.min(e,n),Math.max(e,n),function(e){var n=!0;return F(Math.min(t,o),Math.max(t,o),function(t){var o=r.getCellMeta(e,t);return s=o.type,i?n=i===s:i=s,n}),a=n?s:"mixed",n}),a},this.removeCellMeta=function(e,t,n){var o=m.getCellMeta(e,t);void 0!=o[n]&&delete c.cellSettings[e][t][n]},this.setCellMetaObject=function(e,t,n){if("object"==typeof n)for(var o in n)if(n.hasOwnProperty(o)){var r=n[o];this.setCellMeta(e,t,o,r)}},this.setCellMeta=function(e,t,n,o){c.cellSettings[e]||(c.cellSettings[e]=[]),c.cellSettings[e][t]||(c.cellSettings[e][t]=new c.columnSettings[t]),c.cellSettings[e][t][n]=o,Handsontable.hooks.run(m,"afterSetCellMeta",e,t,n,o)},this.getCellsMeta=function(){return W(c.cellSettings)},this.getCellMeta=function(e,t){var n,o=d.colToProp(t),r=e,i=t;if(e=a(e),t=l(t),c.columnSettings[t]||(c.columnSettings[t]=M(v,c.columnsSettingConflicts)),c.cellSettings[e]||(c.cellSettings[e]=[]),c.cellSettings[e][t]||(c.cellSettings[e][t]=new c.columnSettings[t]),n=c.cellSettings[e][t],n.row=e,n.col=t,n.physicalRow=r,n.physicalCol=i,n.prop=o,n.instance=m,Handsontable.hooks.run(m,"beforeGetCellMeta",e,t,n),x(n,s(n)),n.cells){var u=n.cells.call(n,e,t,o);u&&(x(n,u),x(n,s(u)))}return Handsontable.hooks.run(m,"afterGetCellMeta",e,t,n),n},this.isColumnModificationAllowed=function(){return!("object"===m.dataType||m.getSettings().columns)};var y=G("renderer");this.getCellRenderer=function(e,t){var n=y.call(this,e,t);return j(n)},this.getCellEditor=G("editor"),this.getCellValidator=G("validator"),this.validateCells=function(e){var t=new n;t.onQueueEmpty=e;for(var o=m.countRows()-1;o>=0;){for(var r=m.countCols()-1;r>=0;)t.addValidatorToQueue(),m.validateCell(m.getDataAtCell(o,r),m.getCellMeta(o,r),function(e){if("boolean"!=typeof e)throw new Error("Validation error: result is not boolean");e===!1&&(t.valid=!1),t.removeValidatorFormQueue()},"validateCells"),r--;o--}t.checkIfQueueIsEmpty()},this.getRowHeader=function(e){var t=c.settings.rowHeaders;return void 0!==e&&(e=Handsontable.hooks.run(m,"modifyRowHeader",e)),void 0===e?(t=[],F(m.countRows()-1,function(e){t.push(m.getRowHeader(e))})):Array.isArray(t)&&void 0!==t[e]?t=t[e]:"function"==typeof t?t=t(e):t&&"string"!=typeof t&&"number"!=typeof t&&(t=e+1),t},this.hasRowHeaders=function(){return!!c.settings.rowHeaders},this.hasColHeaders=function(){if(void 0!==c.settings.colHeaders&&null!==c.settings.colHeaders)return!!c.settings.colHeaders;for(var e=0,t=m.countCols();t>e;e++)if(m.getColHeader(e))return!0;return!1},this.getColHeader=function(e){if(e=Handsontable.hooks.run(m,"modifyColHeader",e),void 0===e){for(var t=[],n=0,o=m.countCols();o>n;n++)t.push(m.getColHeader(n));return t}var r=e;return e=Handsontable.hooks.run(m,"modifyCol",e),c.settings.columns&&c.settings.columns[e]&&c.settings.columns[e].title?c.settings.columns[e].title:Array.isArray(c.settings.colHeaders)&&void 0!==c.settings.colHeaders[e]?c.settings.colHeaders[e]:"function"==typeof c.settings.colHeaders?c.settings.colHeaders(e):c.settings.colHeaders&&"string"!=typeof c.settings.colHeaders&&"number"!=typeof c.settings.colHeaders?$(r):c.settings.colHeaders},this._getColWidthFromSettings=function(e){var t=m.getCellMeta(0,e),n=t.width;if((void 0===n||n===c.settings.width)&&(n=t.colWidths),void 0!==n&&null!==n){switch(typeof n){case"object":n=n[e];break;case"function":n=n(e)}"string"==typeof n&&(n=parseInt(n,10))}return n},this.getColWidth=function(e){var t=m._getColWidthFromSettings(e);return t=Handsontable.hooks.run(m,"modifyColWidth",t,e),void 0===t&&(t=q.DEFAULT_WIDTH),t},this._getRowHeightFromSettings=function(e){var t=c.settings.rowHeights;if(void 0!==t&&null!==t){switch(typeof t){case"object":t=t[e];break;case"function":t=t(e)}"string"==typeof t&&(t=parseInt(t,10))}return t},this.getRowHeight=function(e){var t=m._getRowHeightFromSettings(e);return t=Handsontable.hooks.run(m,"modifyRowHeight",t,e)},this.countSourceRows=function(){return m.getSourceData()?m.getSourceData().length:0},this.countRows=function(){return d.getLength()},this.countCols=function(){return"object"===m.dataType||"function"===m.dataType?c.settings.columns&&c.settings.columns.length?c.settings.columns.length:d.colToPropCache.length:"array"===m.dataType?c.settings.columns&&c.settings.columns.length?c.settings.columns.length:c.settings.data&&c.settings.data[0]&&c.settings.data[0].length?c.settings.data[0].length:0:void 0},this.getColspanOffset=function(e,t){var n=0;if(m.colspanArray){for(var o=0;e>o;o++)n+=m.colspanArray[t][o]-1||0;return n}for(var n=0,r=m.view.wt.wtTable.THEAD.childNodes.length-t-1,i=m.view.wt.wtTable.THEAD.querySelector("tr:nth-child("+parseInt(r+1,10)+")"),s=m.view.wt.wtSettings.settings.rowHeaders().length,o=s;s+e>o;o++)i.childNodes[o].hasAttribute("colspan")&&(n+=parseInt(i.childNodes[o].getAttribute("colspan"),10)-1);return n},this.getHeaderColspan=function(e,t){var n=m.view.wt.wtTable.THEAD.childNodes.length-t-1,o=m.view.wt.wtSettings.settings.rowHeaders().length,r=m.view.wt.wtTable.THEAD.querySelector("tr:nth-child("+parseInt(n+1,10)+")"),i=o+e-m.view.wt.wtViewport.columnsRenderCalculator.startColumn;return r.childNodes[i].hasAttribute("colspan")?parseInt(r.childNodes[i].getAttribute("colspan"),10):0},this.rowOffset=function(){return m.view.wt.wtTable.getFirstRenderedRow()},this.colOffset=function(){return m.view.wt.wtTable.getFirstRenderedColumn()},this.countRenderedRows=function(){return m.view.wt.drawn?m.view.wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return m.view.wt.drawn?m.view.wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return m.view.wt.drawn?m.view.wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return m.view.wt.drawn?m.view.wt.wtTable.getVisibleColumnsCount():-1},this.countEmptyRows=function(e){for(var t,n=m.countRows()-1,o=0;n>=0;){if(t=Handsontable.hooks.run(this,"modifyRow",n),m.isEmptyRow(t))o++;else if(e)break;n--}return o},this.countEmptyCols=function(e){if(m.countRows()<1)return 0;for(var t=m.countCols()-1,n=0;t>=0;){if(m.isEmptyCol(t))n++;else if(e)break;t--}return n},this.isEmptyRow=function(e){return c.settings.isEmptyRow.call(m,e)},this.isEmptyCol=function(e){return c.settings.isEmptyCol.call(m,e)},this.selectCell=function(e,t,n,o,r,i){var s;if(i="undefined"==typeof i||i===!0,"number"!=typeof e||0>e||e>=m.countRows())return!1;if("number"!=typeof t||0>t||t>=m.countCols())return!1;if("undefined"!=typeof n){if("number"!=typeof n||0>n||n>=m.countRows())return!1;if("number"!=typeof o||0>o||o>=m.countCols())return!1}return s=new K(e,t),c.selRange=new X(s,s,s),i&&m.listen(),"undefined"==typeof n?p.setRangeEnd(c.selRange.from,r):p.setRangeEnd(new K(n,o),r),m.selection.finish(),!0},this.selectCellByProp=function(e,t,n,o,r){return arguments[1]=d.propToCol(arguments[1]),"undefined"!=typeof arguments[3]&&(arguments[3]=d.propToCol(arguments[3])),m.selectCell.apply(m,arguments)},this.deselectCell=function(){p.deselect()},this.destroy=function(){m._clearTimeouts(),m.view&&m.view.destroy(),h&&h.destroy(),h=null,E(m.rootElement),w.destroy(),Handsontable.hooks.run(m,"afterDestroy"),Handsontable.hooks.destroy(m);for(var e in m)m.hasOwnProperty(e)&&("function"==typeof m[e]?m[e]=u:"guid"!==e&&(m[e]=null));c=null,d=null,f=null,p=null,g=null,m=null,v=null},this.getActiveEditor=function(){return g.getActiveEditor()},this.getPlugin=function(e){return I(this,e)},this.getInstance=function(){return m},this.addHook=function(e,t){Handsontable.hooks.add(e,t,m)},this.hasHook=function(e){return Handsontable.hooks.has(e,m)},this.addHookOnce=function(e,t){Handsontable.hooks.once(e,t,m)},this.removeHook=function(e,t){Handsontable.hooks.remove(e,t,m)},this.runHooks=function(e,t,n,o,r,i,s){return Handsontable.hooks.run(m,e,t,n,o,r,i,s)},this.timeouts=[],this._registerTimeout=function(e){this.timeouts.push(e)},this._clearTimeouts=function(){for(var e=0,t=this.timeouts.length;t>e;e++)clearTimeout(this.timeouts[e])},this.version=Handsontable.version,Handsontable.hooks.run(m,"construct")};var Z=function(){};Z.prototype={data:void 0,dataSchema:void 0,width:void 0,height:void 0,startRows:5,startCols:5,rowHeaders:null,colHeaders:null,colWidths:void 0,rowHeights:void 0,columns:void 0,cells:void 0,cell:[],comments:!1,customBorders:!1,minRows:0,minCols:0,maxRows:1/0,maxCols:1/0,minSpareRows:0,minSpareCols:0,allowInsertRow:!0,allowInsertColumn:!0,allowRemoveRow:!0,allowRemoveColumn:!0,multiSelect:!0,fillHandle:!0,fixedRowsTop:0,fixedRowsBottom:0,fixedColumnsLeft:0,outsideClickDeselects:!0,enterBeginsEditing:!0,enterMoves:{row:1,col:0},tabMoves:{row:0,col:1},autoWrapRow:!1,autoWrapCol:!1,copyRowsLimit:1e3,copyColsLimit:1e3,pasteMode:"overwrite",persistentState:!1,currentRowClassName:void 0,currentColClassName:void 0,className:void 0,tableClassName:void 0,stretchH:"none",isEmptyRow:function(e){var t,n,o,r;for(t=0,n=this.countCols();n>t;t++)if(o=this.getDataAtCell(e,t),""!==o&&null!==o&&"undefined"!=typeof o)return"object"==typeof o?(r=this.getCellMeta(e,t),N(this.getSchema()[r.prop],o)):!1;return!0},isEmptyCol:function(e){var t,n,o;for(t=0,n=this.countRows();n>t;t++)if(o=this.getDataAtCell(t,e),""!==o&&null!==o&&"undefined"!=typeof o)return!1;return!0},observeDOMVisibility:!0,allowInvalid:!0,invalidCellClassName:"htInvalid",placeholder:!1,placeholderCellClassName:"htPlaceholder",readOnlyCellClassName:"htDimmed",renderer:void 0,commentedCellClassName:"htCommentCell",fragmentSelection:!1,readOnly:!1,skipColumnOnPaste:!1,search:!1,type:"text",copyable:!0,editor:void 0,autoComplete:void 0,visibleRows:10,trimDropdown:!0,debug:!1,wordWrap:!0,noWordWrapClassName:"htNoWrap",contextMenu:void 0,contextMenuCopyPaste:void 0,copyPaste:void 0,undo:void 0,columnSorting:void 0,manualColumnMove:void 0,manualColumnResize:void 0,manualRowMove:void 0,manualRowResize:void 0,mergeCells:!1,viewportRowRenderingOffset:"auto",viewportColumnRenderingOffset:"auto",validator:void 0,disableVisualSelection:!1,sortIndicator:!1,manualColumnFreeze:void 0,trimWhitespace:!0,settings:void 0,source:void 0,title:void 0,checkedTemplate:void 0,uncheckedTemplate:void 0,label:void 0,format:void 0,language:void 0,selectOptions:void 0,autoColumnSize:void 0,autoRowSize:void 0,dateFormat:void 0,correctFormat:!1,defaultDate:void 0,strict:void 0,renderAllRows:void 0},Handsontable.DefaultSettings=Z},{"3rdparty/walkontable/src/calculator/viewportColumns":3,"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/selection":18,dataMap:26,dataSource:27,editorManager:28,eventManager:41,"helpers/array":42,"helpers/data":44,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/setting":51,"helpers/string":52,numeral:"numeral",plugins:57,renderers:88,tableView:97}],26:[function(e,t,n){"use strict";function o(e,t,n){this.instance=e,this.priv=t,this.GridSettings=n,this.dataSource=this.instance.getSettings().data,this.dataSource[0]?this.duckSchema=this.recursiveDuckSchema(this.dataSource[0]):this.duckSchema={},this.createMap()}Object.defineProperties(n,{DataMap:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l,u,c,d=(r=e("SheetClip"),r&&r.__esModule&&r||{"default":r})["default"],h=(i=e("helpers/data"),i&&i.__esModule&&i||{"default":i}).cellMethodLookupFactory,f=(s=e("helpers/setting"),s&&s.__esModule&&s||{"default":s}).columnFactory,p=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),g=p.duckSchema,m=p.deepExtend,v=(l=e("helpers/array"),l&&l.__esModule&&l||{"default":l}),w=v.extendArray,y=v.to2dArray,b=(u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}).rangeEach,C=(c=e("multiMap"),c&&c.__esModule&&c||{"default":c}).MultiMap;o.prototype.DESTINATION_RENDERER=1,o.prototype.DESTINATION_CLIPBOARD_GENERATOR=2,o.prototype.recursiveDuckSchema=function(e){return g(e)},o.prototype.recursiveDuckColumns=function(e,t,n){var o,r;if("undefined"==typeof t&&(t=0,n=""),"object"==typeof e&&!Array.isArray(e))for(r in e)e.hasOwnProperty(r)&&(null===e[r]?(o=n+r,this.colToPropCache.push(o),this.propToColCache.set(o,t),t++):t=this.recursiveDuckColumns(e[r],t,r+"."));return t},o.prototype.createMap=function(){var e,t,n=this.getSchema();if("undefined"==typeof n)throw new Error("trying to create `columns` definition but you didnt' provide `schema` nor `data`");this.colToPropCache=[],this.propToColCache=new C;var o=this.instance.getSettings().columns;if(o)for(e=0,t=o.length;t>e;e++)"undefined"!=typeof o[e].data&&(this.colToPropCache[e]=o[e].data,this.propToColCache.set(o[e].data,e));else this.recursiveDuckColumns(n)},o.prototype.colToProp=function(e){return e=Handsontable.hooks.run(this.instance,"modifyCol",e),this.colToPropCache&&"undefined"!=typeof this.colToPropCache[e]?this.colToPropCache[e]:e},o.prototype.propToCol=function(e){var t;return t="undefined"==typeof this.propToColCache.get(e)?e:this.propToColCache.get(e),t=Handsontable.hooks.run(this.instance,"modifyCol",t)},o.prototype.getSchema=function(){var e=this.instance.getSettings().dataSchema;return e?"function"==typeof e?e():e:this.duckSchema},o.prototype.createRow=function(e,t,n){var o,r,i=this.instance.countCols(),s=0;t||(t=1),("number"!=typeof e||e>=this.instance.countSourceRows())&&(e=this.instance.countSourceRows()),r=e;for(var a=this.instance.getSettings().maxRows;t>s&&this.instance.countSourceRows()l;l++)o.push(null)}else"function"===this.instance.dataType?o=this.instance.getSettings().dataSchema(e):(o={}, -m(o,this.getSchema()));e===this.instance.countSourceRows()?this.dataSource.push(o):this.dataSource.splice(e,0,o),s++,r++}return Handsontable.hooks.run(this.instance,"afterCreateRow",e,s,n),this.instance.forceFullRender=!0,s},o.prototype.createCol=function(e,t,n){if(!this.instance.isColumnModificationAllowed())throw new Error("Cannot create new column. When data source in an object, you can only have as much columns as defined in first data row, data schema or in the 'columns' setting.If you want to be able to add new columns, you have to use array datasource.");var o,r,i=this.instance.countSourceRows(),s=this.dataSource,a=0;t||(t=1),r=e;for(var l=this.instance.getSettings().maxCols;t>a&&this.instance.countCols()=this.instance.countCols()){for(var u=0;i>u;u++)"undefined"==typeof s[u]&&(s[u]=[]),s[u].push(null);this.priv.columnSettings.push(o)}else{for(var u=0;i>u;u++)s[u].splice(r,0,null);this.priv.columnSettings.splice(r,0,o)}a++,r++}return Handsontable.hooks.run(this.instance,"afterCreateCol",e,a,n),this.instance.forceFullRender=!0,a},o.prototype.removeRow=function(e,t){t||(t=1),"number"!=typeof e&&(e=-t),e=(this.instance.countSourceRows()+e)%this.instance.countSourceRows();var n=this.physicalRowsToLogical(e,t),o=Handsontable.hooks.run(this.instance,"beforeRemoveRow",e,t,n);if(o!==!1){var r=this.dataSource,i=r.filter(function(e,t){return-1==n.indexOf(t)});r.length=0,Array.prototype.push.apply(r,i),Handsontable.hooks.run(this.instance,"afterRemoveRow",e,t,n),this.instance.forceFullRender=!0}},o.prototype.removeCol=function(e,t){if("object"===this.instance.dataType||this.instance.getSettings().columns)throw new Error("cannot remove column with object data source or columns option specified");t||(t=1),"number"!=typeof e&&(e=-t),e=(this.instance.countCols()+e)%this.instance.countCols();var n=Handsontable.hooks.run(this.instance,"beforeRemoveCol",e,t);if(n!==!1){for(var o=this.dataSource,r=0,i=this.instance.countSourceRows();i>r;r++)o[r].splice(e,t);this.priv.columnSettings.splice(e,t),Handsontable.hooks.run(this.instance,"afterRemoveCol",e,t),this.instance.forceFullRender=!0}},o.prototype.spliceCol=function(e,t,n){var o=4<=arguments.length?[].slice.call(arguments,3):[],r=this.instance.getDataAtCol(e),i=r.slice(t,t+n),s=r.slice(t+n);w(o,s);for(var a=0;n>a;)o.push(null),a++;return y(o),this.instance.populateFromArray(t,e,o,null,null,"spliceCol"),i},o.prototype.spliceRow=function(e,t,n){var o=4<=arguments.length?[].slice.call(arguments,3):[],r=this.instance.getSourceDataAtRow(e),i=r.slice(t,t+n),s=r.slice(t+n);w(o,s);for(var a=0;n>a;)o.push(null),a++;return this.instance.populateFromArray(e,t,[o],null,null,"spliceRow"),i},o.prototype.get=function(e,t){if(e=Handsontable.hooks.run(this.instance,"modifyRow",e),"string"==typeof t&&t.indexOf(".")>-1){var n=t.split("."),o=this.dataSource[e];if(!o)return null;for(var r=0,i=n.length;i>r;r++)if(o=o[n[r]],"undefined"==typeof o)return null;return o}return"function"==typeof t?t(this.dataSource.slice(e,e+1)[0]):this.dataSource[e]&&this.dataSource[e].hasOwnProperty&&this.dataSource[e].hasOwnProperty(t)?this.dataSource[e][t]:null};var R=h("copyable",!1);o.prototype.getCopyable=function(e,t){return R.call(this.instance,e,this.propToCol(t))?this.get(e,t):""},o.prototype.set=function(e,t,n,o){if(e=Handsontable.hooks.run(this.instance,"modifyRow",e,o||"datamapGet"),"string"==typeof t&&t.indexOf(".")>-1){for(var r=t.split("."),i=this.dataSource[e],s=0,a=r.length-1;a>s;s++)"undefined"==typeof i[r[s]]&&(i[r[s]]={}),i=i[r[s]];i[r[s]]=n}else"function"==typeof t?t(this.dataSource.slice(e,e+1)[0],n):this.dataSource[e][t]=n},o.prototype.physicalRowsToLogical=function(e,t){for(var n,o=this.instance.countSourceRows(),r=(o+e)%o,i=[],s=t;o>r&&s;)n=Handsontable.hooks.run(this.instance,"modifyRow",r),i.push(n),s--,r++;return i},o.prototype.clear=function(){for(var e=0;e=o;o++){a=[];var c=Handsontable.hooks.run(this.instance,"modifyRow",o);for(i=Math.min(e.col,t.col);s>=i;i++){if(null===c)break;a.push(u.call(this,o,this.colToProp(i)))}null!==c&&l.push(a)}return l},o.prototype.getText=function(e,t){return d.stringify(this.getRange(e,t,this.DESTINATION_RENDERER))},o.prototype.getCopyableText=function(e,t){return d.stringify(this.getRange(e,t,this.DESTINATION_CLIPBOARD_GENERATOR))},Handsontable.DataMap=o},{SheetClip:"SheetClip","helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51,multiMap:55}],27:[function(e,t,n){"use strict";Object.defineProperties(n,{DataSource:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s,a,l=((o=e("helpers/data"),o&&o.__esModule&&o||{"default":o}).cellMethodLookupFactory,(r=e("helpers/setting"),r&&r.__esModule&&r||{"default":r}).columnFactory,i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}),u=(l.duckSchema,l.deepExtend,l.getProperty),c=(s=e("helpers/array"),s&&s.__esModule&&s||{"default":s}),d=(c.extendArray,c.arrayEach),h=(a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}).rangeEach,f=function(e,t){this.hot=e,this.data=t,this.dataType="array",this.colToProp=function(){},this.propToCol=function(){}};$traceurRuntime.createClass(f,{getData:function(){return this.data},getAtColumn:function(e){var t=this,n=[];return d(this.data,function(o){var r=t.colToProp(e);o="string"==typeof r?u(o,r):o[r],n.push(o)}),n},getAtRow:function(e){return this.data[e]},getAtCell:function(e,t){return this.data[e][this.colToProp(t)]},getByRange:function(e,t){var n=this,o=Math.min(e.row,t.row),r=Math.min(e.col,t.col),i=Math.max(e.row,t.row),s=Math.max(e.col,t.col),a=[];return h(o,i,function(e){var t,o=n.getAtRow(e);"array"===n.dataType?t=o.slice(r,s):"object"===n.dataType&&(t={},h(r,s,function(e){var r=n.colToProp(e);t[r]=o[r]})),a.push(t)}),a},destroy:function(){this.data=null,this.hot=null}},{})},{"helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51}],28:[function(e,t,n){"use strict";function o(e,t,n){function o(e){var o="function"==typeof t.settings.enterMoves?t.settings.enterMoves(event):t.settings.enterMoves;e?n.transformStart(-o.row,-o.col):n.transformStart(o.row,o.col,!0)}function r(e){e?n.transformEnd(-1,0):n.transformStart(-1,0)}function i(e){e?n.transformEnd(1,0):n.transformStart(1,0)}function s(e){e?n.transformEnd(0,1):n.transformStart(0,1)}function a(e){e?n.transformEnd(0,-1):n.transformStart(0,-1)}function l(l){var c,p;if(e.isListening()&&(Handsontable.hooks.run(e,"beforeKeyDown",l),!C&&!v(l)&&(t.lastKeyCode=l.keyCode,n.isSelected()))){if(c=(l.ctrlKey||l.metaKey)&&!l.altKey,y&&!y.isWaiting()&&!(h(l.keyCode)||f(l.keyCode)||c||b.isEditorOpened()))return void b.openEditor("",l);switch(p=l.shiftKey?n.setRangeEnd:n.setRangeStart,l.keyCode){case d.A:!b.isEditorOpened()&&c&&(n.selectAll(),l.preventDefault(),g(l));break;case d.ARROW_UP:b.isEditorOpened()&&!y.isWaiting()&&b.closeEditorAndSaveChanges(c),r(l.shiftKey),l.preventDefault(),g(l);break;case d.ARROW_DOWN:b.isEditorOpened()&&!y.isWaiting()&&b.closeEditorAndSaveChanges(c),i(l.shiftKey),l.preventDefault(),g(l);break;case d.ARROW_RIGHT:b.isEditorOpened()&&!y.isWaiting()&&b.closeEditorAndSaveChanges(c),s(l.shiftKey),l.preventDefault(),g(l);break;case d.ARROW_LEFT:b.isEditorOpened()&&!y.isWaiting()&&b.closeEditorAndSaveChanges(c),a(l.shiftKey),l.preventDefault(),g(l);break;case d.TAB:var w="function"==typeof t.settings.tabMoves?t.settings.tabMoves(l):t.settings.tabMoves;l.shiftKey?n.transformStart(-w.row,-w.col):n.transformStart(w.row,w.col,!0),l.preventDefault(),g(l);break;case d.BACKSPACE:case d.DELETE:n.empty(l),b.prepareEditor(),l.preventDefault();break;case d.F2:b.openEditor(null,l),y&&y.enableFullEditMode(),l.preventDefault();break;case d.ENTER:b.isEditorOpened()?(y&&y.state!==Handsontable.EditorState.WAITING&&b.closeEditorAndSaveChanges(c),o(l.shiftKey)):e.getSettings().enterBeginsEditing?(b.openEditor(null,l),y&&y.enableFullEditMode()):o(l.shiftKey),l.preventDefault(),m(l);break;case d.ESCAPE:b.isEditorOpened()&&b.closeEditorAndRestoreOriginalValue(c),l.preventDefault();break;case d.HOME:p(l.ctrlKey||l.metaKey?new u(0,t.selRange.from.col):new u(t.selRange.from.row,0)),l.preventDefault(),g(l);break;case d.END:p(l.ctrlKey||l.metaKey?new u(e.countRows()-1,t.selRange.from.col):new u(t.selRange.from.row,e.countCols()-1)),l.preventDefault(),g(l);break;case d.PAGE_UP:n.transformStart(-e.countVisibleRows(),0),l.preventDefault(),g(l);break;case d.PAGE_DOWN:n.transformStart(e.countVisibleRows(),0),l.preventDefault(),g(l)}}}function c(){function t(e,t,n){"TD"==n.nodeName&&(b.openEditor(),y&&y.enableFullEditMode())}e.addHook("afterDocumentKeyDown",l),p.addEventListener(document.documentElement,"keydown",function(t){e.runHooks("afterDocumentKeyDown",t)}),e.view.wt.update("onCellDblClick",t),e.addHook("afterDestroy",function(){C=!0})}var p,y,b=this,C=!1;p=w(e),this.destroyEditor=function(e){this.closeEditor(e)},this.getActiveEditor=function(){return y},this.prepareEditor=function(){var n,o,r,i,s,a,l;return y&&y.isWaiting()?void this.closeEditor(!1,!1,function(e){e&&b.prepareEditor()}):(n=t.selRange.highlight.row,o=t.selRange.highlight.col,r=e.colToProp(o),i=e.getCell(n,o),s=e.getDataAtCell(n,o),a=e.getCellMeta(n,o),l=e.getCellEditor(a),void(l?(y=Handsontable.editors.getEditor(l,e),y.prepare(n,o,r,i,s,a)):y=void 0))},this.isEditorOpened=function(){return y&&y.isOpened()},this.openEditor=function(e,t){y&&!y.cellProperties.readOnly?y.beginEditing(e,t):y&&y.cellProperties.readOnly&&t&&t.keyCode===d.ENTER&&o()},this.closeEditor=function(e,t,n){y?y.finishEditing(e,t,n):n&&n(!1)},this.closeEditorAndSaveChanges=function(e){return this.closeEditor(!1,e)},this.closeEditorAndRestoreOriginalValue=function(e){return this.closeEditor(!0,e)},c()}Object.defineProperties(n,{EditorManager:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l,u=(r=e("3rdparty/walkontable/src/cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords,c=(i=e("helpers/unicode"),i&&i.__esModule&&i||{"default":i}),d=c.KEY_CODES,h=c.isMetaKey,f=c.isCtrlKey,p=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=p.stopPropagation,m=p.stopImmediatePropagation,v=p.isImmediatePropagationStopped,w=((a=e("editors"),a&&a.__esModule&&a||{"default":a}).getEditor,(l=e("eventManager"),l&&l.__esModule&&l||{"default":l}).eventManager);Handsontable.EditorManager=o},{"3rdparty/walkontable/src/cell/coords":5,editors:29,eventManager:41,"helpers/dom/event":46,"helpers/unicode":53}],29:[function(e,t,n){"use strict";function o(e){var t,n;n={},t=e,this.getConstructor=function(){return e},this.getInstance=function(e){return e.guid in n||(n[e.guid]=new t(e)),n[e.guid]}}function r(e,t){var n=new o(t);"string"==typeof e&&(c[e]=n,Handsontable.editors[u(e)+"Editor"]=t),d.set(t,n)}function i(e,t){var n;if("function"==typeof e)d.get(e)||r(null,e),n=d.get(e);else{if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter ');n=c[e]}if(!n)throw Error('No editor registered under name "'+e+'"');return n.getInstance(t)}function s(e){var t;if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter ');if(t=c[e],!t)throw Error('No editor registered under name "'+e+'"');return t.getConstructor()}function a(e){return c[e]?!0:!1}Object.defineProperties(n,{registerEditor:{get:function(){return r}},getEditor:{get:function(){return i}},hasEditor:{get:function(){return a}},getEditorConstructor:{get:function(){return s}},__esModule:{value:!0}});var l,u=(l=e("helpers/string"),l&&l.__esModule&&l||{"default":l}).toUpperCaseFirst,c={},d=new WeakMap;Handsontable.editors=Handsontable.editors||{},Handsontable.editors.registerEditor=r,Handsontable.editors.getEditor=i},{"helpers/string":52}],30:[function(e,t,n){"use strict";function o(e){this.instance=e,this.state=Handsontable.EditorState.VIRGIN,this._opened=!1,this._fullEditMode=!1,this._closeCallback=null,this.init()}Object.defineProperties(n,{BaseEditor:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/mixed"),r&&r.__esModule&&r||{"default":r}).stringify,a=(i=e("3rdparty/walkontable/src/cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords;Handsontable.editors=Handsontable.editors||{},Handsontable.editors.BaseEditor=o,Handsontable.EditorState={VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"},o.prototype._fireCallbacks=function(e){this._closeCallback&&(this._closeCallback(e),this._closeCallback=null)},o.prototype.init=function(){},o.prototype.getValue=function(){throw Error("Editor getValue() method unimplemented")},o.prototype.setValue=function(e){throw Error("Editor setValue() method unimplemented")},o.prototype.open=function(){throw Error("Editor open() method unimplemented")},o.prototype.close=function(){throw Error("Editor close() method unimplemented")},o.prototype.prepare=function(e,t,n,o,r,i){this.TD=o,this.row=e,this.col=t,this.prop=n,this.originalValue=r,this.cellProperties=i,this.instance.view.isMouseDown()&&document.activeElement&&document.activeElement!==document.body?document.activeElement.blur():document.activeElement||document.body.focus(),this.state=Handsontable.EditorState.VIRGIN},o.prototype.extend=function(){function e(){n.apply(this,arguments)}function t(e,t){function n(){}return n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e}var n=this.constructor;return t(e,n)},o.prototype.saveValue=function(e,t){var n,o;t?(n=this.instance.getSelected(),n[0]>n[2]&&(o=n[0],n[0]=n[2],n[2]=o),n[1]>n[3]&&(o=n[1],n[1]=n[3],n[3]=o),this.instance.populateFromArray(n[0],n[1],e,n[2],n[3],"edit")):this.instance.populateFromArray(this.row,this.col,e,null,null,"edit")},o.prototype.beginEditing=function(e,t){this.state==Handsontable.EditorState.VIRGIN&&(this.instance.view.scrollViewport(new a(this.row,this.col)),this.instance.view.render(),this.state=Handsontable.EditorState.EDITING,e="string"==typeof e?e:this.originalValue,this.setValue(s(e)),this.open(t),this._opened=!0,this.focus(),this.instance.view.render())},o.prototype.finishEditing=function(e,t,n){var o,r=this;if(n){var i=this._closeCallback;this._closeCallback=function(e){i&&i(e),n(e)}}if(!this.isWaiting()){if(this.state==Handsontable.EditorState.VIRGIN)return void this.instance._registerTimeout(setTimeout(function(){r._fireCallbacks(!0)},0));if(this.state==Handsontable.EditorState.EDITING){if(e)return this.cancelChanges(),void this.instance.view.render();o=this.instance.getSettings().trimWhitespace?[["string"==typeof this.getValue()?String.prototype.trim.call(this.getValue()||""):this.getValue()]]:[[this.getValue()]],this.state=Handsontable.EditorState.WAITING,this.saveValue(o,t),this.instance.getCellValidator(this.cellProperties)?this.instance.addHookOnce("postAfterValidate",function(e){r.state=Handsontable.EditorState.FINISHED,r.discardEditor(e)}):(this.state=Handsontable.EditorState.FINISHED,this.discardEditor(!0))}}},o.prototype.cancelChanges=function(){this.state=Handsontable.EditorState.FINISHED,this.discardEditor()},o.prototype.discardEditor=function(e){this.state===Handsontable.EditorState.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.instance.selectCell(this.row,this.col),this.focus(),this.state=Handsontable.EditorState.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=Handsontable.EditorState.VIRGIN,this._fireCallbacks(!0)))},o.prototype.enableFullEditMode=function(){this._fullEditMode=!0},o.prototype.isInFullEditMode=function(){return this._fullEditMode},o.prototype.isOpened=function(){return this._opened},o.prototype.isWaiting=function(){return this.state===Handsontable.EditorState.WAITING},o.prototype.checkEditorSection=function(){var e=this.instance.countRows(),t="";return this.row=e-this.instance.getSettings().fixedRowsBottom?t=this.col"+a+"")))},autoColumnSize:!0,modifyColWidth:function(e,t){var o=this.getPlugin("autoColumnSize").widths;return o[t]&&(e=o[t]),n?e:e+15}}),this.htEditor.view.wt.wtTable.holder.parentNode.style["padding-right"]=w()+2+"px",T&&(T=!1),t.instance._registerTimeout(setTimeout(function(){t.queryChoices(t.TEXTAREA.value)},0))},E.prototype.close=function(){S.prototype.close.apply(this,arguments)},E.prototype.queryChoices=function(e){if(this.query=e,"function"==typeof this.cellProperties.source){var t=this;this.cellProperties.source(e,function(e){t.updateChoicesList(e)})}else if(Array.isArray(this.cellProperties.source)){var n;if(e&&this.cellProperties.filter!==!1){var o=this.cellProperties.filteringCaseSensitive===!0,r=e.toLowerCase();n=this.cellProperties.source.filter(function(t){return o?-1!=t.indexOf(e):-1!=t.toLowerCase().indexOf(r)})}else n=this.cellProperties.source;this.updateChoicesList(n)}else this.updateChoicesList([])},E.prototype.updateChoicesList=function(e){var t,n=v(this.TEXTAREA),o=y(this.TEXTAREA),r=E.sortByRelevance(this.getValue(),e,this.cellProperties.filteringCaseSensitive);if(0==this.cellProperties.filter)t=r[0];else{for(var i=[],s=0,a=r.length;a>s;s++)i.push(e[r[s]]);t=0,e=i}this.choices=e,this.htEditor.loadData(p([e])),this.updateDropdownHeight(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(t),this.instance.listen(),this.TEXTAREA.focus(),C(this.TEXTAREA,n,n==o?void 0:o)},E.prototype.updateDropdownHeight=function(){var e=this.htEditor.getColWidth(0)+w()+2,t=void 0===this.cellProperties.trimDropdown?!0:this.cellProperties.trimDropdown;this.htEditor.updateSettings({height:this.getDropdownHeight(),width:t?void 0:e}),this.htEditor.view.wt.wtTable.alignOverlaysWithTrimmingContainer()},E.prototype.finishEditing=function(e){e||this.instance.removeHook("beforeKeyDown",o),S.prototype.finishEditing.apply(this,arguments)},E.prototype.highlightBestMatchingChoice=function(e){"number"==typeof e?this.htEditor.selectCell(e,0):this.htEditor.deselectCell()},E.sortByRelevance=function(e,t,n){var o,r,i,s,a,l=[],u=e.length,c=[];if(0===u){for(s=0,a=t.length;a>s;s++)c.push(s);return c}for(s=0,a=t.length;a>s;s++)o=f(t[s]),r=n?o.indexOf(e):o.toLowerCase().indexOf(e.toLowerCase()),-1!=r&&(i=o.length-r-u,l.push({baseIndex:s,index:r,charsLeft:i,value:o}));for(l.sort(function(e,t){return-1===t.index?-1:-1===e.index?1:e.indext.charsLeft?1:0:void 0}),s=0,a=l.length;a>s;s++)c.push(l[s].baseIndex);return c},E.prototype.getDropdownHeight=function(){var e=this.htEditor.getInstance().getRowHeight(0)||23,t=this.cellProperties.visibleRows;return this.choices.length>=t?t*e:this.choices.length*e+8},E.prototype.allowKeyEventPropagation=function(e){var t={row:this.htEditor.getSelectedRange()?this.htEditor.getSelectedRange().from.row:-1},n=!1;return e===d.ARROW_DOWN&&t.row-1&&(n=!0),n},_("autocomplete",E)},{editors:29,handsontableEditor:35,"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/unicode":53}],32:[function(e,t,n){"use strict";Object.defineProperties(n,{CheckboxEditor:{get:function(){return u}},__esModule:{value:!0}});var o,r,i,s=(o=e("editors"),o&&o.__esModule&&o||{"default":o}).registerEditor,a=(r=e("_baseEditor"),r&&r.__esModule&&r||{"default":r}).BaseEditor,l=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).hasClass,u=function(){$traceurRuntime.superConstructor(c).apply(this,arguments)},c=u;$traceurRuntime.createClass(u,{beginEditing:function(){var e=this.TD.querySelector('input[type="checkbox"]');l(e,"htBadValue")||e.click()},finishEditing:function(){},init:function(){},open:function(){},close:function(){},getValue:function(){},setValue:function(){},focus:function(){}},{},a),s("checkbox",u)},{_baseEditor:30,editors:29,"helpers/dom/element":45}],33:[function(e,t,n){"use strict";Object.defineProperties(n,{DateEditor:{get:function(){return S}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c,d,h=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),f=h.addClass,p=h.outerHeight,g=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).deepExtend,m=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,v=(s=e("editors"),s&&s.__esModule&&s||{"default":s}),w=(v.getEditor,v.registerEditor),y=(a=e("helpers/unicode"),a&&a.__esModule&&a||{"default":a}).isMetaKey,b=(l=e("helpers/dom/event"),l&&l.__esModule&&l||{"default":l}).stopPropagation,C=(u=e("textEditor"),u&&u.__esModule&&u||{"default":u}).TextEditor,R=(c=e("moment"),c&&c.__esModule&&c||{"default":c})["default"],_=(d=e("pikaday"),d&&d.__esModule&&d||{"default":d})["default"];Handsontable.editors=Handsontable.editors||{},Handsontable.editors.DateEditor=S;var S=function(e){this.$datePicker=null,this.datePicker=null,this.datePickerStyle=null,this.defaultDateFormat="DD/MM/YYYY",this.isCellEdited=!1,this.parentDestroyed=!1,$traceurRuntime.superConstructor(E).call(this,e)},E=S;$traceurRuntime.createClass(S,{init:function(){var e=this;if("function"!=typeof R)throw new Error("You need to include moment.js to your project.");if("function"!=typeof _)throw new Error("You need to include Pikaday to your project.");$traceurRuntime.superGet(this,E.prototype,"init").call(this),this.instance.addHook("afterDestroy",function(){e.parentDestroyed=!0,e.destroyElements()})},createElements:function(){$traceurRuntime.superGet(this,E.prototype,"createElements").call(this),this.datePicker=document.createElement("DIV"),this.datePickerStyle=this.datePicker.style,this.datePickerStyle.position="absolute",this.datePickerStyle.top=0,this.datePickerStyle.left=0,this.datePickerStyle.zIndex=9999,f(this.datePicker,"htDatepickerHolder"),document.body.appendChild(this.datePicker),this.$datePicker=new _(this.getDatePickerConfig());var e=new m(this);e.addEventListener(this.datePicker,"mousedown",function(e){return b(e)}),this.hideDatepicker()},destroyElements:function(){this.$datePicker.destroy()},prepare:function(e,t,n,o,r,i){this._opened=!1,$traceurRuntime.superGet(this,E.prototype,"prepare").call(this,e,t,n,o,r,i)},open:function(){var e=void 0!==arguments[0]?arguments[0]:null;$traceurRuntime.superGet(this,E.prototype,"open").call(this),this.showDatepicker(e)},close:function(){var e=this;this._opened=!1,this.instance._registerTimeout(setTimeout(function(){e.instance.selection.refreshBorders()},0)),$traceurRuntime.superGet(this,E.prototype,"close").call(this)},finishEditing:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=void 0!==arguments[1]?arguments[1]:!1;if(e){var n=this.originalValue;void 0!==n&&this.setValue(n)}this.hideDatepicker(),$traceurRuntime.superGet(this,E.prototype,"finishEditing").call(this,e,t)},showDatepicker:function(e){this.$datePicker.config(this.getDatePickerConfig());var t,n=this.TD.getBoundingClientRect(),o=this.cellProperties.dateFormat||this.defaultDateFormat,r=this.$datePicker.config(),i=this.instance.view.isMouseDown(),s=e?y(e.keyCode):!1;this.datePickerStyle.top=window.pageYOffset+n.top+p(this.TD)+"px",this.datePickerStyle.left=window.pageXOffset+n.left+"px",this.$datePicker._onInputFocus=function(){},r.format=o,this.originalValue?(t=this.originalValue,R(t,o,!0).isValid()&&this.$datePicker.setMoment(R(t,o),!0),s||i||this.setValue("")):this.cellProperties.defaultDate?(t=this.cellProperties.defaultDate,r.defaultDate=t,R(t,o,!0).isValid()&&this.$datePicker.setMoment(R(t,o),!0),s||i||this.setValue("")):this.$datePicker.gotoToday(),this.datePickerStyle.display="block",this.$datePicker.show()},hideDatepicker:function(){this.datePickerStyle.display="none",this.$datePicker.hide()},getDatePickerConfig:function(){var e=this,t=this.TEXTAREA,n={};this.cellProperties&&this.cellProperties.datePickerConfig&&g(n,this.cellProperties.datePickerConfig);var o=n.onSelect,r=n.onClose;return n.field=t,n.trigger=t,n.container=this.datePicker,n.bound=!1,n.format=n.format||this.defaultDateFormat,n.reposition=n.reposition||!1,n.onSelect=function(t){isNaN(t.getTime())||(t=R(t).format(e.cellProperties.dateFormat||e.defaultDateFormat)),e.setValue(t),e.hideDatepicker(),o&&o()},n.onClose=function(){e.parentDestroyed||e.finishEditing(!1),r&&r()},n}},{},C),w("date",S)},{editors:29,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,moment:"moment",pikaday:"pikaday",textEditor:40}],34:[function(e,t,n){"use strict";Object.defineProperties(n,{DropdownEditor:{get:function(){return l}},__esModule:{value:!0}});var o,r,i=(o=e("editors"),o&&o.__esModule&&o||{"default":o}),s=(i.getEditor,i.registerEditor),a=(r=e("autocompleteEditor"),r&&r.__esModule&&r||{"default":r}).AutocompleteEditor,l=function(){$traceurRuntime.superConstructor(u).apply(this,arguments)},u=l;$traceurRuntime.createClass(l,{prepare:function(e,t,n,o,r,i){$traceurRuntime.superGet(this,u.prototype,"prepare").call(this,e,t,n,o,r,i),this.cellProperties.filter=!1,this.cellProperties.strict=!0}},{},a),Handsontable.hooks.add("beforeValidate",function(e,t,n,o){var r=this.getCellMeta(t,n);r.editor===Handsontable.editors.DropdownEditor&&void 0===r.strict&&(r.filter=!1,r.strict=!0)}),s("dropdown",l)},{autocompleteEditor:31,editors:29}],35:[function(e,t,n){"use strict";Object.defineProperties(n,{HandsontableEditor:{get:function(){return w}},__esModule:{value:!0}});var o,r,i,s,a,l,u=(o=e("helpers/unicode"),o&&o.__esModule&&o||{"default":o}).KEY_CODES,c=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).extend,d=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).setCaretPosition,h=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),f=h.stopImmediatePropagation,p=h.isImmediatePropagationStopped,g=(a=e("editors"),a&&a.__esModule&&a||{"default":a}),m=(g.getEditor,g.registerEditor),v=(l=e("textEditor"),l&&l.__esModule&&l||{"default":l}).TextEditor,w=v.prototype.extend();w.prototype.createElements=function(){v.prototype.createElements.apply(this,arguments);var e=document.createElement("DIV");e.className="handsontableEditor",this.TEXTAREA_PARENT.appendChild(e),this.htContainer=e,this.assignHooks()},w.prototype.prepare=function(e,t,n,o,r,i){v.prototype.prepare.apply(this,arguments);var s=this,a={startRows:0,startCols:0,minRows:0,minCols:0,className:"listbox",copyPaste:!1,autoColumnSize:!1,autoRowSize:!1,readOnly:!0,fillHandle:!1,afterOnCellMouseDown:function(){var e=this.getValue();void 0!==e&&s.setValue(e),s.instance.destroyEditor()}};this.cellProperties.handsontable&&c(a,i.handsontable),this.htOptions=a};var y=function(e){if(!p(e)){var t,n=this.getActiveEditor(),o=n.htEditor.getInstance();if(e.keyCode==u.ARROW_DOWN)if(o.getSelected()){var r=o.getSelected()[0],i=o.countRows()-1;t=Math.min(i,r+1)}else t=0;else if(e.keyCode==u.ARROW_UP&&o.getSelected()){var r=o.getSelected()[0];t=r-1}void 0!==t&&(0>t?o.deselectCell():o.selectCell(t,0),o.getData().length&&(e.preventDefault(),f(e),n.instance.listen(),n.TEXTAREA.focus()))}};w.prototype.open=function(){this.instance.addHook("beforeKeyDown",y),v.prototype.open.apply(this,arguments),this.htEditor&&this.htEditor.destroy(),this.htEditor=new Handsontable(this.htContainer,this.htOptions),this.cellProperties.strict?(this.htEditor.selectCell(0,0),this.TEXTAREA.style.visibility="hidden"):(this.htEditor.deselectCell(),this.TEXTAREA.style.visibility="visible"),d(this.TEXTAREA,0,this.TEXTAREA.value.length)},w.prototype.close=function(){this.instance.removeHook("beforeKeyDown",y),this.instance.listen(),v.prototype.close.apply(this,arguments)},w.prototype.focus=function(){this.instance.listen(),v.prototype.focus.apply(this,arguments)},w.prototype.beginEditing=function(e){var t=this.instance.getSettings().onBeginEditing;t&&t()===!1||v.prototype.beginEditing.apply(this,arguments)},w.prototype.finishEditing=function(e,t){if(this.htEditor&&this.htEditor.isListening()&&this.instance.listen(),this.htEditor&&this.htEditor.getSelected()){var n=this.htEditor.getInstance().getValue();void 0!==n&&this.setValue(n)}return v.prototype.finishEditing.apply(this,arguments)},w.prototype.assignHooks=function(){var e=this;this.instance.addHook("afterDestroy",function(){e.htEditor&&e.htEditor.destroy()})},m("handsontable",w)},{editors:29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,textEditor:40}],36:[function(e,t,n){"use strict";Object.defineProperties(n,{MobileTextEditor:{get:function(){return M}},__esModule:{value:!0}});var o,r,i,s,a,l,u=(o=e("helpers/unicode"),o&&o.__esModule&&o||{"default":o}).KEY_CODES,c=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}),d=c.stopImmediatePropagation,h=c.isImmediatePropagationStopped,f=(i=e("helpers/dom/element"), -i&&i.__esModule&&i||{"default":i}),p=f.addClass,g=f.getScrollLeft,m=f.getScrollTop,v=f.hasClass,w=f.isChildOf,y=f.offset,b=f.outerHeight,C=f.outerWidth,R=f.removeClass,_=f.setCaretPosition,S=(s=e("editors"),s&&s.__esModule&&s||{"default":s}),E=(S.getEditor,S.registerEditor),T=(a=e("_baseEditor"),a&&a.__esModule&&a||{"default":a}).BaseEditor,O=(l=e("eventManager"),l&&l.__esModule&&l||{"default":l}).eventManager,M=T.prototype.extend(),k={},H=function(){this.controls={},this.controls.leftButton=document.createElement("DIV"),this.controls.leftButton.className="leftButton",this.controls.rightButton=document.createElement("DIV"),this.controls.rightButton.className="rightButton",this.controls.upButton=document.createElement("DIV"),this.controls.upButton.className="upButton",this.controls.downButton=document.createElement("DIV"),this.controls.downButton.className="downButton";for(var e in this.controls)this.controls.hasOwnProperty(e)&&this.positionControls.appendChild(this.controls[e])};M.prototype.valueChanged=function(){return this.initValue!=this.getValue()},M.prototype.init=function(){var e=this;this.eventManager=O(this.instance),this.createElements(),this.bindEvents(),this.instance.addHook("afterDestroy",function(){e.destroy()})},M.prototype.getValue=function(){return this.TEXTAREA.value},M.prototype.setValue=function(e){this.initValue=e,this.TEXTAREA.value=e},M.prototype.createElements=function(){this.editorContainer=document.createElement("DIV"),this.editorContainer.className="htMobileEditorContainer",this.cellPointer=document.createElement("DIV"),this.cellPointer.className="cellPointer",this.moveHandle=document.createElement("DIV"),this.moveHandle.className="moveHandle",this.inputPane=document.createElement("DIV"),this.inputPane.className="inputs",this.positionControls=document.createElement("DIV"),this.positionControls.className="positionControls",this.TEXTAREA=document.createElement("TEXTAREA"),p(this.TEXTAREA,"handsontableInput"),this.inputPane.appendChild(this.TEXTAREA),this.editorContainer.appendChild(this.cellPointer),this.editorContainer.appendChild(this.moveHandle),this.editorContainer.appendChild(this.inputPane),this.editorContainer.appendChild(this.positionControls),H.call(this),document.body.appendChild(this.editorContainer)},M.prototype.onBeforeKeyDown=function(e){var t=this,n=t.getActiveEditor();if(e.target===n.TEXTAREA&&!h(e))switch(e.keyCode){case u.ENTER:n.close(),e.preventDefault();break;case u.BACKSPACE:d(e)}},M.prototype.open=function(){this.instance.addHook("beforeKeyDown",this.onBeforeKeyDown),p(this.editorContainer,"active"),R(this.cellPointer,"hidden"),this.updateEditorPosition()},M.prototype.focus=function(){this.TEXTAREA.focus(),_(this.TEXTAREA,this.TEXTAREA.value.length)},M.prototype.close=function(){this.TEXTAREA.blur(),this.instance.removeHook("beforeKeyDown",this.onBeforeKeyDown),R(this.editorContainer,"active")},M.prototype.scrollToView=function(){var e=this.instance.getSelectedRange().highlight;this.instance.view.scrollViewport(e)},M.prototype.hideCellPointer=function(){v(this.cellPointer,"hidden")||p(this.cellPointer,"hidden")},M.prototype.updateEditorPosition=function(e,t){if(e&&t)e=parseInt(e,10),t=parseInt(t,10),this.editorContainer.style.top=t+"px",this.editorContainer.style.left=e+"px";else{var n=this.instance.getSelected(),o=this.instance.getCell(n[0],n[1]);if(k.cellPointer||(k.cellPointer={height:b(this.cellPointer),width:C(this.cellPointer)}),k.editorContainer||(k.editorContainer={width:C(this.editorContainer)}),void 0!==o){var r=this.instance.view.wt.wtOverlays.leftOverlay.trimmingContainer==window?0:g(this.instance.view.wt.wtOverlays.leftOverlay.holder),i=this.instance.view.wt.wtOverlays.topOverlay.trimmingContainer==window?0:m(this.instance.view.wt.wtOverlays.topOverlay.holder),s=y(o),a=C(o),l={x:r,y:i};this.editorContainer.style.top=parseInt(s.top+b(o)-l.y+k.cellPointer.height,10)+"px",this.editorContainer.style.left=parseInt(window.innerWidth/2-k.editorContainer.width/2,10)+"px",s.left+a/2>parseInt(this.editorContainer.style.left,10)+k.editorContainer.width?this.editorContainer.style.left=window.innerWidth-k.editorContainer.width+"px":s.left+a/2n;n++)t[e[n]]=e[n];else"object"==typeof e&&(t=e);return t},S.prototype.getValue=function(){return this.select.value},S.prototype.setValue=function(e){this.select.value=e};var E=function(e){var t=this,n=t.getActiveEditor();switch(e.keyCode){case b.ARROW_UP:var o=n.select.selectedIndex-1;o>=0&&(n.select[o].selected=!0),y(e),e.preventDefault();break;case b.ARROW_DOWN:var r=n.select.selectedIndex+1;r<=n.select.length-1&&(n.select[r].selected=!0),y(e),e.preventDefault()}};S.prototype.open=function(){this._opened=!0,this.refreshDimensions(),this.select.style.display="",this.instance.addHook("beforeKeyDown",E)},S.prototype.close=function(){this._opened=!1,this.select.style.display="none",this.instance.removeHook("beforeKeyDown",E)},S.prototype.focus=function(){this.select.focus()},S.prototype.refreshDimensions=function(){if(this.state===Handsontable.EditorState.EDITING){if(this.TD=this.getEditedCell(),!this.TD)return void this.close();var e,t=v(this.TD)+1,n=m(this.TD)+1,o=g(this.TD),r=g(this.instance.rootElement),i=p(this.TD),s=o.top-r.top-1-(i.scrollTop||0),a=o.left-r.left-1-(i.scrollLeft||0),l=this.checkEditorSection(),u=this.instance.getSettings();u.rowHeaders?1:0,u.colHeaders?1:0;switch(l){case"top":e=f(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":e=f(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":e=f(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":e=f(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":e=f(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}0===this.instance.getSelected()[0]&&(s+=1),0===this.instance.getSelected()[1]&&(a+=1);var c=this.select.style;e&&-1!=e?c[e[0]]=e[1]:w(this.select);var d=h(this.TD);parseInt(d.borderTopWidth,10)>0&&(n-=1),parseInt(d.borderLeftWidth,10)>0&&(t-=1),c.height=n+"px",c.minWidth=t+"px",c.top=s+"px",c.left=a+"px",c.margin="0px"}},S.prototype.getEditedCell=function(){var e,t=this.checkEditorSection();switch(t){case"top":e=this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=101;break;case"corner":e=this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=103;break;case"left":e=this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=102;break;default:e=this.instance.getCell(this.row,this.col),this.select.style.zIndex=""}return-1!=e&&-2!=e?e:void 0},R("select",S)},{_baseEditor:30,editors:29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],40:[function(e,t,n){"use strict";Object.defineProperties(n,{TextEditor:{get:function(){return H}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),d=c.addClass,h=c.getCaretPosition,f=c.getComputedStyle,p=c.getCssTransform,g=c.getScrollableElement,m=c.innerWidth,v=c.offset,w=c.resetCssTransform,y=c.setCaretPosition,b=(r=e("autoResize"),r&&r.__esModule&&r||{"default":r})["default"],C=(i=e("_baseEditor"),i&&i.__esModule&&i||{"default":i}).BaseEditor,R=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).eventManager,_=(a=e("editors"),a&&a.__esModule&&a||{"default":a}),S=(_.getEditor,_.registerEditor),E=(l=e("helpers/unicode"),l&&l.__esModule&&l||{"default":l}).KEY_CODES,T=(u=e("helpers/dom/event"),u&&u.__esModule&&u||{"default":u}),O=T.stopPropagation,M=T.stopImmediatePropagation,k=T.isImmediatePropagationStopped,H=C.prototype.extend();H.prototype.init=function(){var e=this;this.createElements(),this.eventManager=R(this),this.bindEvents(),this.autoResize=b(),this.instance.addHook("afterDestroy",function(){e.destroy()})},H.prototype.getValue=function(){return this.TEXTAREA.value},H.prototype.setValue=function(e){this.TEXTAREA.value=e};var D=function(e){var t,n=this,o=n.getActiveEditor();if(t=(e.ctrlKey||e.metaKey)&&!e.altKey,e.target===o.TEXTAREA&&!k(e)){if(17===e.keyCode||224===e.keyCode||91===e.keyCode||93===e.keyCode)return void M(e);switch(e.keyCode){case E.ARROW_RIGHT:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&M(e);break;case E.ARROW_LEFT:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&M(e);break;case E.ARROW_UP:case E.ARROW_DOWN:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&M(e);break;case E.ENTER:var r=o.instance.getSelected(),i=!(r[0]===r[2]&&r[1]===r[3]);if(t&&!i||e.altKey){if(o.isOpened()){var s=h(o.TEXTAREA),a=o.getValue(),l=a.slice(0,s)+"\n"+a.slice(s);o.setValue(l),y(o.TEXTAREA,s+1)}else o.beginEditing(o.originalValue+"\n");M(e)}e.preventDefault();break;case E.A:case E.X:case E.C:case E.V:t&&M(e);break;case E.BACKSPACE:case E.DELETE:case E.HOME:case E.END:M(e)}-1===[E.ARROW_UP,E.ARROW_RIGHT,E.ARROW_DOWN,E.ARROW_LEFT].indexOf(e.keyCode)&&o.autoResize.resize(String.fromCharCode(e.keyCode))}};H.prototype.open=function(){this.refreshDimensions(),this.instance.addHook("beforeKeyDown",D)},H.prototype.close=function(e){this.textareaParentStyle.display="none",this.autoResize.unObserve(),document.activeElement===this.TEXTAREA&&this.instance.listen(),this.instance.removeHook("beforeKeyDown",D)},H.prototype.focus=function(){this.TEXTAREA.focus(),y(this.TEXTAREA,this.TEXTAREA.value.length)},H.prototype.createElements=function(){this.TEXTAREA=document.createElement("TEXTAREA"),d(this.TEXTAREA,"handsontableInput"),this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,this.TEXTAREA_PARENT=document.createElement("DIV"),d(this.TEXTAREA_PARENT,"handsontableInputHolder"),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.textareaParentStyle.top=0,this.textareaParentStyle.left=0,this.textareaParentStyle.display="none",this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.instance.rootElement.appendChild(this.TEXTAREA_PARENT);var e=this;this.instance._registerTimeout(setTimeout(function(){e.refreshDimensions()},0))},H.prototype.getEditedCell=function(){var e,t=this.checkEditorSection();switch(t){case"top":e=this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=101;break;case"top-left-corner":e=this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=103;break;case"bottom-left-corner":e=this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=103;break;case"left":e=this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=102;break;case"bottom":e=this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=102;break;default:e=this.instance.getCell(this.row,this.col),this.textareaParentStyle.zIndex=""}return-1!=e&&-2!=e?e:void 0},H.prototype.refreshDimensions=function(){if(this.state===Handsontable.EditorState.EDITING){if(this.TD=this.getEditedCell(),!this.TD)return void this.close(!0);var e,t=v(this.TD),n=v(this.instance.rootElement),o=g(this.TD),r=this.instance.countRows(),i=t.top-n.top-1-(o.scrollTop||0),s=t.left-n.left-1-(o.scrollLeft||0),a=this.instance.getSettings(),l=(a.rowHeaders?1:0,a.colHeaders?1:0),u=this.checkEditorSection(),c=this.TD.style.backgroundColor;switch(u){case"top":e=p(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":e=p(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":e=p(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":e=p(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":e=p(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}(l&&0===this.instance.getSelected()[0]||a.fixedRowsBottom&&this.instance.getSelected()[0]===r-a.fixedRowsBottom)&&(i+=1),0===this.instance.getSelected()[1]&&(s+=1),e&&-1!=e?this.textareaParentStyle[e[0]]=e[1]:w(this.textareaParentStyle),this.textareaParentStyle.top=i+"px",this.textareaParentStyle.left=s+"px";var d=this.TD.offsetTop-this.instance.view.wt.wtOverlays.topOverlay.getScrollPosition(),h=this.TD.offsetLeft-this.instance.view.wt.wtOverlays.leftOverlay.getScrollPosition(),y=m(this.TD)-8,b=this.instance.view.maximumVisibleElementWidth(h)-9,C=this.TD.scrollHeight+1,R=Math.max(this.instance.view.maximumVisibleElementHeight(d)-2,23),_=f(this.TD);this.TEXTAREA.style.fontSize=_.fontSize,this.TEXTAREA.style.fontFamily=_.fontFamily,this.TEXTAREA.style.backgroundColor="",this.TEXTAREA.style.backgroundColor=c?c:f(this.TEXTAREA).backgroundColor,this.autoResize.init(this.TEXTAREA,{minHeight:Math.min(C,R),maxHeight:R,minWidth:Math.min(y,b),maxWidth:b},!0),this.textareaParentStyle.display="block"}},H.prototype.bindEvents=function(){var e=this;this.eventManager.addEventListener(this.TEXTAREA,"cut",function(e){O(e)}),this.eventManager.addEventListener(this.TEXTAREA,"paste",function(e){O(e)}),this.instance.addHook("afterScrollHorizontally",function(){e.refreshDimensions()}),this.instance.addHook("afterScrollVertically",function(){e.refreshDimensions()}),this.instance.addHook("afterColumnResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterRowResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterDestroy",function(){e.eventManager.destroy()})},H.prototype.destroy=function(){this.eventManager.destroy()},S("text",H)},{_baseEditor:30,autoResize:"autoResize",editors:29,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],41:[function(e,t,n){"use strict";function o(e,t){var n,o,r,i,s,a="HOT-TABLE";if(t.isTargetWebComponent=!1,t.realTarget=t.target,!Handsontable.eventManager.isHotTableEnv)return t;for(t=l(t),s=t.path?t.path.length:0;s--;){if(t.path[s].nodeName===a)n=!0;else if(n&&t.path[s].shadowRoot){i=t.path[s];break}0!==s||i||(i=t.path[s])}return i||(i=t.target),t.isTargetWebComponent=!0,c()?t.realTarget=t.srcElement||t.toElement:(e instanceof Handsontable.Core||e instanceof Walkontable)&&(e instanceof Handsontable.Core?o=e.view?e.view.wt.wtTable.TABLE:null:e instanceof Walkontable&&(o=e.wtTable.TABLE.parentNode.parentNode),r=u(t.target,[a],o),r?t.realTarget=o.querySelector(a)||t.target:t.realTarget=t.target),Object.defineProperty(t,"target",{get:function(){return l(i)},enumerable:!0,configurable:!0}),t}function r(e){return new d(e)}Object.defineProperties(n,{EventManager:{get:function(){return d}},eventManager:{get:function(){return r}},__esModule:{value:!0}});var i,s,a=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),l=a.polymerWrap,u=a.closest,c=(s=e("helpers/browser"),s&&s.__esModule&&s||{"default":s}).isWebComponentSupportedNatively,d=function(){var e=void 0!==arguments[0]?arguments[0]:null;this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])};$traceurRuntime.createClass(d,{addEventListener:function(e,t,n){function r(e){void 0==e.target&&void 0!=e.srcElement&&(e.definePoperty?e.definePoperty("target",{value:e.srcElement}):e.target=e.srcElement),void 0==e.preventDefault&&(e.definePoperty?e.definePoperty("preventDefault",{value:function(){this.returnValue=!1}}):e.preventDefault=function(){this.returnValue=!1}),e=o(s,e),n.call(this,e)}var i=this,s=this.context;return this.context.eventListeners.push({element:e,event:t,callback:n,callbackProxy:r}),window.addEventListener?e.addEventListener(t,r,!1):e.attachEvent("on"+t,r),Handsontable.countEventManagerListeners++,function(){i.removeEventListener(e,t,n)}},removeEventListener:function(e,t,n){for(var o,r=this.context.eventListeners.length;r--;)if(o=this.context.eventListeners[r],o.event==t&&o.element==e){if(n&&n!=o.callback)continue;this.context.eventListeners.splice(r,1),o.element.removeEventListener?o.element.removeEventListener(o.event,o.callbackProxy,!1):o.element.detachEvent("on"+o.event,o.callbackProxy),Handsontable.countEventManagerListeners--}},clearEvents:function(){if(this.context)for(var e=this.context.eventListeners.length;e--;){var t=this.context.eventListeners[e];t&&this.removeEventListener(t.element,t.event,t.callback)}},clear:function(){this.clearEvents()},destroy:function(){this.clearEvents(),this.context=null},fireEvent:function(e,t){var n,o={bubbles:!0,cancelable:"mousemove"!==t,view:window,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:void 0};document.createEvent?(n=document.createEvent("MouseEvents"),n.initMouseEvent(t,o.bubbles,o.cancelable,o.view,o.detail,o.screenX,o.screenY,o.clientX,o.clientY,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,o.button,o.relatedTarget||document.body.parentNode)):n=document.createEventObject(),e.dispatchEvent?e.dispatchEvent(n):e.fireEvent("on"+t,n)}},{}),window.Handsontable=window.Handsontable||{},Handsontable.countEventManagerListeners=0,Handsontable.eventManager=r},{"helpers/browser":43,"helpers/dom/element":45}],42:[function(e,t,n){"use strict";function o(e){for(var t=0,n=e.length;n>t;)e[t]=[e[t]],t++}function r(e,t){for(var n=0,o=t.length;o>n;)e.push(t[n]),n++}function i(e){var t=[];if(!e||0===e.length||!e[0]||0===e[0].length)return t;for(var n=e.length,o=e[0].length,r=0;n>r;r++)for(var i=0;o>i;i++)t[i]||(t[i]=[]),t[i][r]=e[r][i];return t}function s(e,t,n,o){var r=-1,i=e.length;for(o&&i&&(n=e[++r]);++rt?e:t},Array.isArray(e)?e[0]:void 0)}function h(e){return s(e,function(e,t){return t>e?e:t},Array.isArray(e)?e[0]:void 0)}function f(e){return e.length?c(e)/e.length:0}function p(e){return s(e,function(e,t){return e.concat(Array.isArray(t)?p(t):t)},[])}function g(e){var t=[];return u(e,function(e){-1===t.indexOf(e)&&t.push(e)}),t}Object.defineProperties(n,{to2dArray:{get:function(){return o}},extendArray:{get:function(){return r}},pivot:{get:function(){return i}},arrayReduce:{get:function(){return s}},arrayFilter:{get:function(){return a}},arrayMap:{get:function(){return l}},arrayEach:{get:function(){return u}},arraySum:{get:function(){return c}},arrayMax:{get:function(){return d}},arrayMin:{get:function(){return h}},arrayAvg:{get:function(){return f}},arrayFlatten:{get:function(){return p}},arrayUnique:{get:function(){return g}},__esModule:{value:!0}})},{}],43:[function(e,t,n){"use strict";function o(){return f}function r(){return p}function i(){return g}function s(){return m}function a(e){return e||(e=navigator.userAgent),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e)}function l(){return"ontouchstart"in window}function u(){var e=document.createElement("div");return e.createShadowRoot&&e.createShadowRoot.toString().match(/\[native code\]/)?!0:!1}function c(){var e=document.createElement("TABLE");e.style.borderSpacing=0,e.style.borderWidth=0,e.style.padding=0;var t=document.createElement("TBODY");e.appendChild(t),t.appendChild(document.createElement("TR")),t.firstChild.appendChild(document.createElement("TD")),t.firstChild.firstChild.innerHTML="t
t";var n=document.createElement("CAPTION");n.innerHTML="c
c
c
c",n.style.padding=0,n.style.margin=0,e.insertBefore(n,t),document.body.appendChild(e),h=e.offsetHeight<2*e.lastChild.offsetHeight,document.body.removeChild(e)}function d(){return void 0===h&&c(),h}Object.defineProperties(n,{isIE8:{get:function(){return o}},isIE9:{get:function(){return r}},isSafari:{get:function(){return i}},isChrome:{get:function(){return s}},isMobileBrowser:{get:function(){return a}},isTouchSupported:{get:function(){return l}},isWebComponentSupportedNatively:{get:function(){return u}},hasCaptionProblem:{get:function(){return d}},__esModule:{value:!0}});var h,f=!document.createTextNode("test").textContent,p=!!document.documentMode,g=/Safari/.test(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor),m=/Chrome/.test(navigator.userAgent)&&/Google/.test(navigator.vendor)},{}],44:[function(e,t,n){"use strict";function o(e){for(var t,n=e+1,o="";n>0;)t=(n-1)%26,o=String.fromCharCode(65+t)+o,n=parseInt((n-t)/26,10);return o}function r(e,t){e="number"==typeof e?e:100,t="number"==typeof t?t:4;var n,r,i=[];for(n=0;e>n;n++){var s=[];for(r=0;t>r;r++)s.push(o(r)+(n+1));i.push(s)}return i}function i(e,t){e="number"==typeof e?e:100,t="number"==typeof t?t:4;var n,r,i=[];for(n=0;e>n;n++){var s={};for(r=0;t>r;r++)s["prop"+r]=o(r)+(n+1);i.push(s)}return i}function s(e,t){for(var n,o=[],r=0;e>r;r++){n=[];for(var i=0;t>i;i++)n.push("");o.push(n)}return o}function a(e){var t,n,o,r,i=[],s=0;for(t=0,n=e.length;n>t;t++)for(o=0,r=e[t].length;r>o;o++)o==s&&(i.push([]),s++),i[o].push(e[t][o]);return i}function l(e,t){function n(e){var t=Handsontable.cellTypes[e];if("undefined"==typeof t)throw new Error('You declared cell type "'+e+'" as a string that is not mapped to a known object. Cell type must be an object or a string mapped to an object in Handsontable.cellTypes');return t}return t="undefined"==typeof t?!0:t,function(o,r){return function i(o){if(o){if(o.hasOwnProperty(e)&&void 0!==o[e])return o[e];if(o.hasOwnProperty("type")&&o.type){var r;if("string"!=typeof o.type)throw new Error("Cell type must be a string ");if(r=n(o.type),r.hasOwnProperty(e))return r[e];if(t)return}return i(c(o))}}("number"==typeof o?this.getCellMeta(o,r):o)}}Object.defineProperties(n,{spreadsheetColumnLabel:{get:function(){return o}},createSpreadsheetData:{get:function(){return r}},createSpreadsheetObjectData:{get:function(){return i}},createEmptySpreadsheetData:{get:function(){return s}},translateRowsToColumns:{get:function(){return a}},cellMethodLookupFactory:{get:function(){return l}},__esModule:{value:!0}});var u,c=(u=e("object"),u&&u.__esModule&&u||{"default":u}).getPrototypeOf},{object:50}],45:[function(e,t,n){"use strict";function o(e,t,n){for(;null!=e&&e!==n;){if(e.nodeType===Node.ELEMENT_NODE&&(t.indexOf(e.nodeName)>-1||t.indexOf(e)>-1))return e;e=e.host&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.host:e.parentNode}return null}function r(e,t){var n=e.parentNode,o=[];for("string"==typeof t?o=Array.prototype.slice.call(document.querySelectorAll(t),0):o.push(t);null!=n;){if(o.indexOf(n)>-1)return!0;n=n.parentNode}return!1}function i(e){function t(e){return e.nodeType===Node.ELEMENT_NODE&&e.nodeName===o.toUpperCase()}var n,o="hot-table",r=!1;for(n=s(e);null!=n;){if(t(n)){r=!0;break}if(n.host&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(r=t(n.host))break;n=n.host}n=n.parentNode}return r}function s(e){return"undefined"!=typeof Polymer&&"function"==typeof wrap?wrap(e):e}function a(e){return"undefined"!=typeof Polymer&&"function"==typeof unwrap?unwrap(e):e}function l(e){var t=0;if(e.previousSibling)for(;e=e.previousSibling;)++t;return t}function u(e,t){var n=document.querySelector(".ht_clone_"+e);return n?n.contains(t):null}function c(e){var t=0,n=[];if(!e||!e.length)return n;for(;e[t];)n.push(e[t]),t++;return n}function d(e,t){return K(e,t)}function h(e,t){return X(e,t)}function f(e,t){return q(e,t)}function p(e,t){if(3===e.nodeType)t.removeChild(e);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(e.nodeName)>-1)for(var n=e.childNodes,o=n.length-1;o>=0;o--)p(n[o],e)}function g(e){for(var t;t=e.lastChild;)e.removeChild(t)}function m(e,t){se.test(t)?e.innerHTML=t:v(e,t)}function v(e,t){var n=e.firstChild;n&&3===n.nodeType&&null===n.nextSibling?ae?n.textContent=t:n.data=t:(g(e),e.appendChild(document.createTextNode(t)))}function w(e){for(var t=e;a(t)!==document.documentElement;){if(null===t)return!1;if(t.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(t.host){if(t.host.impl)return w(t.host.impl);if(t.host)return w(t.host);throw new Error("Lost in Web Components world")}return!1}if("none"===t.style.display)return!1;t=t.parentNode}return!0}function y(e){var t,n,o,r,i;if(r=document.documentElement,te()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName)return i=e.getBoundingClientRect(),{top:i.top+(window.pageYOffset||r.scrollTop)-(r.clientTop||0),left:i.left+(window.pageXOffset||r.scrollLeft)-(r.clientLeft||0)};for(t=e.offsetLeft,n=e.offsetTop,o=e;(e=e.offsetParent)&&e!==document.body;)t+=e.offsetLeft,n+=e.offsetTop,o=e;return o&&"fixed"===o.style.position&&(t+=window.pageXOffset||r.scrollLeft,n+=window.pageYOffset||r.scrollTop),{left:t,top:n}}function b(){var e=window.scrollY;return void 0===e&&(e=document.documentElement.scrollTop),e}function C(){var e=window.scrollX;return void 0===e&&(e=document.documentElement.scrollLeft),e}function R(e){return e===window?b():e.scrollTop}function _(e){return e===window?C():e.scrollLeft}function S(e){for(var t,n,o,r=e.parentNode,i=["auto","scroll"],s="",a="",l="",u="";r&&r.style&&document.body!==r;){if(t=r.style.overflow,n=r.style.overflowX,o=r.style.overflowY,"scroll"==t||"scroll"==n||"scroll"==o)return r; -if(window.getComputedStyle&&(s=window.getComputedStyle(r),a=s.getPropertyValue("overflow"),l=s.getPropertyValue("overflow-y"),u=s.getPropertyValue("overflow-x"),"scroll"===a||"scroll"===u||"scroll"===l))return r;if(r.clientHeight<=r.scrollHeight&&(-1!==i.indexOf(o)||-1!==i.indexOf(t)||-1!==i.indexOf(a)||-1!==i.indexOf(l)))return r;if(r.clientWidth<=r.scrollWidth&&(-1!==i.indexOf(n)||-1!==i.indexOf(t)||-1!==i.indexOf(a)||-1!==i.indexOf(u)))return r;r=r.parentNode}return window}function E(e){for(var t=e.parentNode;t&&t.style&&document.body!==t;){if("visible"!==t.style.overflow&&""!==t.style.overflow)return t;if(window.getComputedStyle){var n=window.getComputedStyle(t);if("visible"!==n.getPropertyValue("overflow")&&""!==n.getPropertyValue("overflow"))return t}t=t.parentNode}return window}function T(e,t){if(e){if(e!==window){var n,o=e.style[t];return""!==o&&void 0!==o?o:(n=O(e),""!==n[t]&&void 0!==n[t]?n[t]:void 0)}if("width"===t)return window.innerWidth+"px";if("height"===t)return window.innerHeight+"px"}}function O(e){return e.currentStyle||document.defaultView.getComputedStyle(e)}function M(e){return e.offsetWidth}function k(e){return te()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName?e.offsetHeight+e.firstChild.offsetHeight:e.offsetHeight}function H(e){return e.clientHeight||e.innerHeight}function D(e){return e.clientWidth||e.innerWidth}function A(e,t,n){window.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function x(e,t,n){window.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)}function P(e){if(e.selectionStart)return e.selectionStart;if(document.selection){e.focus();var t=document.selection.createRange();if(null==t)return 0;var n=e.createTextRange(),o=n.duplicate();return n.moveToBookmark(t.getBookmark()),o.setEndPoint("EndToStart",n),o.text.length}return 0}function N(e){if(e.selectionEnd)return e.selectionEnd;if(document.selection){var t=document.selection.createRange();if(null==t)return 0;var n=e.createTextRange();return n.text.indexOf(t.text)+t.text.length}}function L(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e}function W(e,t,n){if(void 0===n&&(n=t),e.setSelectionRange){e.focus();try{e.setSelectionRange(t,n)}catch(o){var r=e.parentNode,i=r.style.display;r.style.display="block",e.setSelectionRange(t,n),r.style.display=i}}else if(e.createTextRange){var s=e.createTextRange();s.collapse(!0),s.moveEnd("character",n),s.moveStart("character",t),s.select()}}function I(){var e=document.createElement("p");e.style.width="100%",e.style.height="200px";var t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),(document.body||document.documentElement).appendChild(t);var n=e.offsetWidth;t.style.overflow="scroll";var o=e.offsetWidth;return n==o&&(o=t.clientWidth),(document.body||document.documentElement).removeChild(t),n-o}function j(){return void 0===ie&&(ie=I()),ie}function B(e,t,n){J()||Q()?(e.style.top=n,e.style.left=t):ee()?e.style["-webkit-transform"]="translate3d("+t+","+n+",0)":e.style.transform="translate3d("+t+","+n+",0)"}function F(e){var t;return e.style.transform&&""!==(t=e.style.transform)?["transform",t]:e.style["-webkit-transform"]&&""!==(t=e.style["-webkit-transform"])?["-webkit-transform",t]:-1}function V(e){e.transform&&""!==e.transform?e.transform="":e["-webkit-transform"]&&""!==e["-webkit-transform"]&&(e["-webkit-transform"]="")}function z(e){var t=["INPUT","SELECT","TEXTAREA"];return t.indexOf(e.nodeName)>-1||"true"===e.contentEditable}function Y(e){return z(e)&&-1==e.className.indexOf("handsontableInput")&&-1==e.className.indexOf("copyPaste")}function U(e){return ce.call(window,e)}function G(e){de.call(window,e)}Object.defineProperties(n,{closest:{get:function(){return o}},isChildOf:{get:function(){return r}},isChildOfWebComponentTable:{get:function(){return i}},polymerWrap:{get:function(){return s}},polymerUnwrap:{get:function(){return a}},index:{get:function(){return l}},overlayContainsElement:{get:function(){return u}},hasClass:{get:function(){return d}},addClass:{get:function(){return h}},removeClass:{get:function(){return f}},removeTextNodes:{get:function(){return p}},empty:{get:function(){return g}},HTML_CHARACTERS:{get:function(){return se}},fastInnerHTML:{get:function(){return m}},fastInnerText:{get:function(){return v}},isVisible:{get:function(){return w}},offset:{get:function(){return y}},getWindowScrollTop:{get:function(){return b}},getWindowScrollLeft:{get:function(){return C}},getScrollTop:{get:function(){return R}},getScrollLeft:{get:function(){return _}},getScrollableElement:{get:function(){return S}},getTrimmingContainer:{get:function(){return E}},getStyle:{get:function(){return T}},getComputedStyle:{get:function(){return O}},outerWidth:{get:function(){return M}},outerHeight:{get:function(){return k}},innerHeight:{get:function(){return H}},innerWidth:{get:function(){return D}},addEvent:{get:function(){return A}},removeEvent:{get:function(){return x}},getCaretPosition:{get:function(){return P}},getSelectionEndPosition:{get:function(){return N}},getSelectionText:{get:function(){return L}},setCaretPosition:{get:function(){return W}},getScrollbarWidth:{get:function(){return j}},setOverlayPosition:{get:function(){return B}},getCssTransform:{get:function(){return F}},resetCssTransform:{get:function(){return V}},isInput:{get:function(){return z}},isOutsideInput:{get:function(){return Y}},requestAnimationFrame:{get:function(){return U}},cancelAnimationFrame:{get:function(){return G}},__esModule:{value:!0}});var $,K,X,q,Z=($=e("../browser"),$&&$.__esModule&&$||{"default":$}),J=Z.isIE8,Q=Z.isIE9,ee=Z.isSafari,te=Z.hasCaptionProblem,ne=document.documentElement.classList?!0:!1;if(ne){var oe=function(){var e=document.createElement("div");return e.classList.add("test","test2"),e.classList.contains("test2")}();K=function(e,t){return""===t?!1:e.classList.contains(t)},X=function(e,t){var n=0;if("string"==typeof t&&(t=t.split(" ")),t=c(t),oe)e.classList.add.apply(e.classList,t);else for(;t&&t[n];)e.classList.add(t[n]),n++},q=function(e,t){var n=0;if("string"==typeof t&&(t=t.split(" ")),t=c(t),oe)e.classList.remove.apply(e.classList,t);else for(;t&&t[n];)e.classList.remove(t[n]),n++}}else{var re=function(e){return new RegExp("(\\s|^)"+e+"(\\s|$)")};K=function(e,t){return e.className.match(re(t))?!0:!1},X=function(e,t){var n=0,o=e.className;if("string"==typeof t&&(t=t.split(" ")),""===o)o=t.join(" ");else for(;t&&t[n];)re(t[n]).test(o)||(o+=" "+t[n]),n++;e.className=o},q=function(e,t){var n=0,o=e.className;for("string"==typeof t&&(t=t.split(" "));t&&t[n];)o=o.replace(re(t[n])," ").trim(),n++;e.className!==o&&(e.className=o)}}for(var ie,se=/(<(.*)>|&(.*);)/,ae=document.createTextNode("test").textContent?!0:!1,le=0,ue=["ms","moz","webkit","o"],ce=window.requestAnimationFrame,de=window.cancelAnimationFrame,he=0;he=t&&n(o)!==!1;);}function s(e,t){return t=parseInt(t.toString().replace("%",""),10),t=parseInt(e*t/100)}Object.defineProperties(n,{isNumeric:{get:function(){return o}},rangeEach:{get:function(){return r}},rangeEachReverse:{get:function(){return i}},valueAccordingPercent:{get:function(){return s}},__esModule:{value:!0}})},{}],50:[function(e,t,n){"use strict";function o(e){var t;return Array.isArray(e)?t=[]:(t={},p(e,function(e,n){e&&"object"==typeof e&&!Array.isArray(e)?t[n]=o(e):Array.isArray(e)?e.length&&"object"==typeof e[0]&&!Array.isArray(e[0])?t[n]=[o(e[0])]:t[n]=[]:t[n]=null})),t}function r(e,t){return t.prototype.constructor=t,e.prototype=new t,e.prototype.constructor=e,e}function i(e,t){return p(t,function(t,n){e[n]=t}),e}function s(e,t){p(t,function(n,o){t[o]&&"object"==typeof t[o]?(e[o]||(Array.isArray(t[o])?e[o]=[]:e[o]={}),s(e[o],t[o])):e[o]=t[o]})}function a(e){return"object"==typeof e?JSON.parse(JSON.stringify(e)):e}function l(e){var t={};return p(e,function(e,n){t[n]=e}),t}function u(e){for(var t=[],n=1;no;o++)n.prototype[t[o]]=void 0;return n}Object.defineProperties(n,{columnFactory:{get:function(){return o}},__esModule:{value:!0}});var r,i=(r=e("object"),r&&r.__esModule&&r||{"default":r}).inherit},{object:50}],52:[function(e,t,n){"use strict";function o(e){return e[0].toUpperCase()+e.substr(1)}function r(e,t){var n=!0;return p(t.length-1,function(o){return e.charAt(o)!==t.charAt(o)?(n=!1,!1):void 0}),n}function i(e,t){var n=!0,o=t.length-1,r=e.length-1;return p(o,function(i){var s=r-i,a=o-i;return e.charAt(s)!==t.charAt(a)?(n=!1,!1):void 0}),n}function s(){for(var e=[],t=0;t=t)return e;n=String(n);var o=n.length;o||(n=" ");var r=t-e.length,i=Math.ceil(r/n.length),s="";return p(i,function(e){s+=n}),s=s.slice(0,r),s+e}Object.defineProperties(n,{toUpperCaseFirst:{get:function(){return o}},startsWith:{get:function(){return r}},endsWith:{get:function(){return i}},equalsIgnoreCase:{get:function(){return s}},randomString:{get:function(){return a}},isPercentValue:{get:function(){return l}},substitute:{get:function(){return u}},padStart:{get:function(){return c}},__esModule:{value:!0}});var d,h,f=(d=e("mixed"),d&&d.__esModule&&d||{"default":d}).stringify,p=(h=e("number"),h&&h.__esModule&&h||{"default":h}).rangeEach},{mixed:48,number:49}],53:[function(e,t,n){"use strict";function o(e){return 32==e||e>=48&&57>=e||e>=96&&111>=e||e>=186&&192>=e||e>=219&&222>=e||e>=226||e>=65&&90>=e}function r(e){var t=[u.ARROW_DOWN,u.ARROW_UP,u.ARROW_LEFT,u.ARROW_RIGHT,u.HOME,u.END,u.DELETE,u.BACKSPACE,u.F1,u.F2,u.F3,u.F4,u.F5,u.F6,u.F7,u.F8,u.F9,u.F10,u.F11,u.F12,u.TAB,u.PAGE_DOWN,u.PAGE_UP,u.ENTER,u.ESCAPE,u.SHIFT,u.CAPS_LOCK,u.ALT];return-1!==t.indexOf(e)}function i(e){return-1!==[u.CONTROL_LEFT,224,u.COMMAND_LEFT,u.COMMAND_RIGHT].indexOf(e)}function s(e,t){var n=t.split("|"),o=!1;return l(n,function(t){return e===u[t]?(o=!0,!1):void 0}),o}Object.defineProperties(n,{KEY_CODES:{get:function(){return u}},isPrintableChar:{get:function(){return o}},isMetaKey:{get:function(){return r}},isCtrlKey:{get:function(){return i}},isKey:{get:function(){return s}},__esModule:{value:!0}});var a,l=(a=e("array"),a&&a.__esModule&&a||{"default":a}).arrayEach,u={MOUSE_LEFT:1,MOUSE_RIGHT:3,MOUSE_MIDDLE:2,BACKSPACE:8,COMMA:188,INSERT:45,DELETE:46,END:35,ENTER:13,ESCAPE:27,CONTROL_LEFT:91,COMMAND_LEFT:17,COMMAND_RIGHT:93,ALT:18,HOME:36,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,SPACE:32,SHIFT:16,CAPS_LOCK:20,TAB:9,ARROW_RIGHT:39,ARROW_LEFT:37,ARROW_UP:38,ARROW_DOWN:40,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,A:65,X:88,C:67,V:86}},{array:42}],54:[function(e,t,n){"use strict";Object.defineProperties(n,{localHooks:{get:function(){return l}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/array"),o&&o.__esModule&&o||{"default":o}).arrayEach,s=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).defineGetter,a="localHooks",l={_localHooks:Object.create(null),addLocalHook:function(e,t){this._localHooks[e]||(this._localHooks[e]=[]),this._localHooks[e].push(t)},runLocalHooks:function(e){for(var t=[],n=1;n=0?(t.skip=!0,!0):!1},has:function(e){var t=void 0!==arguments[1]?arguments[1]:null,n=this.getBucket(t);return void 0!==n[e]&&n[e].length?!0:!1},run:function(e,t,n,o,r,i,s,a){var l=this.globalBucket[t],u=-1,c=l?l.length:0;if(c)for(;++u=0},getRegistered:function(){return i}},{}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.Hooks=l},{"helpers/array":42,"helpers/object":50}],57:[function(e,t,n){"use strict";function o(e,t){e=c(e),Handsontable.plugins[e]=t,Handsontable.hooks.add("construct",function(){var n;d.has(this)||d.set(this,{}),n=d.get(this),n[e]||(n[e]=new t(this))}),Handsontable.hooks.add("afterDestroy",function(){if(d.has(this)){var e=d.get(this);u(e,function(e){return e.destroy()}),d["delete"](this)}})}function r(e,t){if("string"!=typeof t)throw Error('Only strings can be passed as "plugin" parameter');var n=c(t);if(d.has(e)&&d.get(e)[n])return d.get(e)[n]}function i(e){return d.has(e)?Object.keys(d.get(e)):[]}function s(e,t){var n=null;return d.has(e)&&u(d.get(e),function(e,o){e===t&&(n=o)}),n}Object.defineProperties(n,{registerPlugin:{get:function(){return o}},getPlugin:{get:function(){return r}},getRegistredPluginNames:{get:function(){return i}},getPluginName:{get:function(){return s}},__esModule:{value:!0}});var a,l,u=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}).objectEach,c=(l=e("helpers/string"),l&&l.__esModule&&l||{"default":l}).toUpperCaseFirst,d=new WeakMap;Handsontable.plugins=Handsontable.plugins||{},Handsontable.plugins.utils=Handsontable.plugins.utils||{},Handsontable.plugins.registerPlugin=o},{"helpers/object":50,"helpers/string":52}],58:[function(e,t,n){"use strict";Object.defineProperties(n,{"default":{get:function(){return m}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/object"),o&&o.__esModule&&o||{"default":o}),a=s.defineGetter,l=s.objectEach,u=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,c=(i=e("plugins"),i&&i.__esModule&&i||{"default":i}),d=c.getRegistredPluginNames,h=c.getPluginName,f=new WeakMap,p=null,g=function(e){var t=this;a(this,"hot",e,{writable:!1}),f.set(this,{hooks:{}}),p=null,this.pluginName=null,this.pluginsInitializedCallbacks=[],this.isPluginsReady=!1,this.enabled=!1,this.initialized=!1,this.hot.addHook("afterPluginsInitialized",function(){return t.onAfterPluginsInitialized()}),this.hot.addHook("afterUpdateSettings",function(){return t.onUpdateSettings()}),this.hot.addHook("beforeInit",function(){return t.init()})};$traceurRuntime.createClass(g,{init:function(){this.pluginName=h(this.hot,this),this.isEnabled&&this.isEnabled()&&this.enablePlugin(),p||(p=d(this.hot)),p.indexOf(this.pluginName)>=0&&p.splice(p.indexOf(this.pluginName),1),p.length||this.hot.runHooks("afterPluginsInitialized"),this.initialized=!0},enablePlugin:function(){this.enabled=!0},disablePlugin:function(){this.eventManager&&this.eventManager.clear(),this.clearHooks(),this.enabled=!1},addHook:function(e,t){var n=f.get(this).hooks[e]=f.get(this).hooks[e]||[];this.hot.addHook(e,t),n.push(t),f.get(this).hooks[e]=n},removeHooks:function(e){var t=this;u(f.get(this).hooks[e]||[],function(n){t.hot.removeHook(e,n)})},clearHooks:function(){var e=this,t=f.get(this).hooks;l(t,function(t,n){return e.removeHooks(n)}),t.length=0},callOnPluginsReady:function(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)},onAfterPluginsInitialized:function(){u(this.pluginsInitializedCallbacks,function(e){return e()}),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0},onUpdateSettings:function(){this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&this.updatePlugin())},updatePlugin:function(){},destroy:function(){var e=this;this.eventManager&&this.eventManager.destroy(),this.clearHooks(),l(this,function(t,n){"hot"!==n&&(e[n]=null)}),delete this.hot}},{});var m=g;Handsontable.plugins.BasePlugin=g},{"helpers/array":42,"helpers/object":50,plugins:57}],59:[function(e,t,n){"use strict";Object.defineProperties(n,{AutoColumnSize:{get:function(){return D}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c,d,h,f=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],p=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),g=p.arrayEach,m=p.arrayFilter,v=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),w=v.cancelAnimationFrame,y=v.requestAnimationFrame,b=v.isVisible,C=(s=e("utils/ghostTable"),s&&s.__esModule&&s||{"default":s}).GhostTable,R=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),_=R.isObject,S=(R.objectEach,l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}),E=S.valueAccordingPercent,T=S.rangeEach,O=(u=e("plugins"),u&&u.__esModule&&u||{"default":u}).registerPlugin,M=(c=e("utils/samplesGenerator"),c&&c.__esModule&&c||{"default":c}).SamplesGenerator,k=(d=e("helpers/string"),d&&d.__esModule&&d||{"default":d}).isPercentValue,H=(h=e("3rdparty/walkontable/src/calculator/viewportColumns"),h&&h.__esModule&&h||{"default":h}).WalkontableViewportColumnsCalculator,D=function(e){var t=this;$traceurRuntime.superConstructor(A).call(this,e),this.widths=[],this.ghostTable=new C(this.hot),this.samplesGenerator=new M(function(e,n){return t.hot.getDataAtCell(e,n)}),this.firstCalculation=!0,this.inProgress=!1,this.addHook("beforeColumnResize",function(e,n,o){return t.onBeforeColumnResize(e,n,o)})},A=D;$traceurRuntime.createClass(D,{isEnabled:function(){return this.hot.getSettings().autoColumnSize!==!1&&!this.hot.getSettings().colWidths},enablePlugin:function(){var e=this;this.enabled||(this.addHook("afterLoadData",function(){return e.onAfterLoadData()}),this.addHook("beforeChange",function(t){return e.onBeforeChange(t)}),this.addHook("beforeRender",function(t){return e.onBeforeRender(t)}),this.addHook("modifyColWidth",function(t,n){return e.getColumnWidth(n,t)}),$traceurRuntime.superGet(this,A.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,A.prototype,"disablePlugin").call(this)},calculateColumnsWidth:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countRows()-1},n=void 0!==arguments[2]?arguments[2]:!1,o=this;"number"==typeof e&&(e={from:e,to:e}),"number"==typeof t&&(t={from:t,to:t}),T(e.from,e.to,function(e){if(n||void 0===o.widths[e]&&!o.hot._getColWidthFromSettings(e)){var r=o.samplesGenerator.generateColumnSamples(e,t);r.forEach(function(e,t){return o.ghostTable.addColumn(t,e)})}}),this.ghostTable.columns.length&&(this.ghostTable.getWidths(function(e,t){return o.widths[e]=t}),this.ghostTable.clean())},calculateAllColumnsWidth:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=this,n=0,o=this.hot.countCols()-1,r=null;this.inProgress=!0;var i=function(){return t.hot?(t.calculateColumnsWidth({from:n,to:Math.min(n+A.CALCULATION_STEP,o)},e),n=n+A.CALCULATION_STEP+1,void(o>n?r=y(i):(w(r),t.inProgress=!1,t.hot.view.wt.wtOverlays.adjustElementsSize(!0),t.hot.view.wt.wtOverlays.leftOverlay.needFullRender&&t.hot.view.wt.wtOverlays.leftOverlay.clone.draw()))):(w(r),void(t.inProgress=!1))};this.firstCalculation&&this.getSyncCalculationLimit()&&(this.calculateColumnsWidth({from:0,to:this.getSyncCalculationLimit()},e),this.firstCalculation=!1,n=this.getSyncCalculationLimit()+1),o>n?i():this.inProgress=!1},recalculateAllColumnsWidth:function(){this.hot.view&&b(this.hot.view.wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllColumnsWidth())},getSyncCalculationLimit:function(){var e=A.SYNC_CALCULATION_LIMIT,t=this.hot.countCols()-1;return _(this.hot.getSettings().autoColumnSize)&&(e=this.hot.getSettings().autoColumnSize.syncLimit,k(e)?e=E(t,e):e>>=0),Math.min(e,t)},getColumnWidth:function(e){var t=arguments[1],n=void 0!==arguments[2]?arguments[2]:!0,o=t;return void 0===o&&(o=this.widths[e],n&&"number"==typeof o&&(o=Math.max(o,H.DEFAULT_WIDTH))),o},getFirstVisibleColumn:function(){var e=this.hot.view.wt;return e.wtViewport.columnsVisibleCalculator?e.wtTable.getFirstVisibleColumn():e.wtViewport.columnsRenderCalculator?e.wtTable.getFirstRenderedColumn():-1},getLastVisibleColumn:function(){var e=this.hot.view.wt;return e.wtViewport.columnsVisibleCalculator?e.wtTable.getLastVisibleColumn():e.wtViewport.columnsRenderCalculator?e.wtTable.getLastRenderedColumn():-1},clearCache:function(){this.widths.length=0},isNeedRecalculate:function(){return m(this.widths,function(e){return void 0===e}).length?!0:!1},onBeforeRender:function(){var e=this.hot.renderCall;this.calculateColumnsWidth({from:this.getFirstVisibleColumn(),to:this.getLastVisibleColumn()},void 0,e),this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllColumnsWidth()},onAfterLoadData:function(){var e=this;this.hot.view?this.recalculateAllColumnsWidth():setTimeout(function(){e.hot&&e.recalculateAllColumnsWidth()},0)},onBeforeChange:function(e){var t=this;g(e,function(e){return t.widths[e[1]]=void 0})},onBeforeColumnResize:function(e,t,n){return n&&(this.calculateColumnsWidth(e,void 0,!0),t=this.getColumnWidth(e,void 0,!1)),t},destroy:function(){this.ghostTable.clean(),$traceurRuntime.superGet(this,A.prototype,"destroy").call(this)}},{get CALCULATION_STEP(){return 50},get SYNC_CALCULATION_LIMIT(){return 50}},f),O("autoColumnSize",D)},{"3rdparty/walkontable/src/calculator/viewportColumns":3,_base:58,"helpers/array":42,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/string":52,plugins:57,"utils/ghostTable":98,"utils/samplesGenerator":99}],60:[function(e,t,n){"use strict";Object.defineProperties(n,{AutoRowSize:{get:function(){return M}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c,d,h=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],f=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),p=(f.arrayEach,f.arrayFilter),g=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),m=g.cancelAnimationFrame,v=g.requestAnimationFrame,w=g.isVisible,y=(s=e("utils/ghostTable"),s&&s.__esModule&&s||{"default":s}).GhostTable,b=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),C=b.isObject,R=(b.objectEach,l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}),_=R.valueAccordingPercent,S=R.rangeEach,E=(u=e("plugins"),u&&u.__esModule&&u||{"default":u}).registerPlugin,T=(c=e("utils/samplesGenerator"),c&&c.__esModule&&c||{"default":c}).SamplesGenerator,O=(d=e("helpers/string"),d&&d.__esModule&&d||{"default":d}).isPercentValue,M=function(e){var t=this;$traceurRuntime.superConstructor(k).call(this,e),this.heights=[],this.ghostTable=new y(this.hot),this.samplesGenerator=new T(function(e,n){return t.hot.getDataAtCell(e,n)}),this.firstCalculation=!0,this.inProgress=!1,this.addHook("beforeRowResize",function(e,n,o){return t.onBeforeRowResize(e,n,o)})},k=M;$traceurRuntime.createClass(M,{isEnabled:function(){return this.hot.getSettings().autoRowSize===!0||C(this.hot.getSettings().autoRowSize)},enablePlugin:function(){var e=this;this.enabled||(this.addHook("afterLoadData",function(){return e.onAfterLoadData()}),this.addHook("beforeChange",function(t){return e.onBeforeChange(t)}),this.addHook("beforeColumnMove",function(){return e.recalculateAllRowsHeight()}),this.addHook("beforeColumnResize",function(){return e.recalculateAllRowsHeight()}),this.addHook("beforeColumnSort",function(){return e.clearCache()}),this.addHook("beforeRender",function(t){ -return e.onBeforeRender(t)}),this.addHook("beforeRowMove",function(t,n){return e.onBeforeRowMove(t,n)}),this.addHook("modifyRowHeight",function(t,n){return e.getRowHeight(n,t)}),$traceurRuntime.superGet(this,k.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,k.prototype,"disablePlugin").call(this)},calculateRowsHeight:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countCols()-1},n=void 0!==arguments[2]?arguments[2]:!1,o=this;"number"==typeof e&&(e={from:e,to:e}),"number"==typeof t&&(t={from:t,to:t}),S(e.from,e.to,function(e){if(n||void 0===o.heights[e]){var r=o.samplesGenerator.generateRowSamples(e,t);r.forEach(function(e,t){return o.ghostTable.addRow(t,e)})}}),this.ghostTable.rows.length&&(this.ghostTable.getHeights(function(e,t){return o.heights[e]=t}),this.ghostTable.clean())},calculateAllRowsHeight:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=this,n=0,o=this.hot.countRows()-1,r=null;this.inProgress=!0;var i=function(){return t.hot?(t.calculateRowsHeight({from:n,to:Math.min(n+k.CALCULATION_STEP,o)},e),n=n+k.CALCULATION_STEP+1,void(o>n?r=v(i):(m(r),t.inProgress=!1,t.hot.view.wt.wtOverlays.adjustElementsSize(!0),t.hot.view.wt.wtOverlays.leftOverlay.needFullRender&&t.hot.view.wt.wtOverlays.leftOverlay.clone.draw()))):(m(r),void(t.inProgress=!1))};this.firstCalculation&&this.getSyncCalculationLimit()&&(this.calculateRowsHeight({from:0,to:this.getSyncCalculationLimit()},e),this.firstCalculation=!1,n=this.getSyncCalculationLimit()+1),o>n?i():this.inProgress=!1},recalculateAllRowsHeight:function(){w(this.hot.view.wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllRowsHeight())},getSyncCalculationLimit:function(){var e=k.SYNC_CALCULATION_LIMIT,t=this.hot.countRows()-1;return C(this.hot.getSettings().autoRowSize)&&(e=this.hot.getSettings().autoRowSize.syncLimit,O(e)?e=_(t,e):e>>=0),Math.min(e,t)},getRowHeight:function(e){var t=arguments[1],n=t;return void 0!==this.heights[e]&&this.heights[e]>(t||0)&&(n=this.heights[e]),n},getFirstVisibleRow:function(){var e=this.hot.view.wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getFirstVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getFirstRenderedRow():-1},getLastVisibleRow:function(){var e=this.hot.view.wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getLastVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getLastRenderedRow():-1},clearCache:function(){this.heights.length=0},clearCacheByRange:function(e){var t=this;"number"==typeof e&&(e={from:e,to:e}),S(Math.min(e.from,e.to),Math.max(e.from,e.to),function(e){return t.heights[e]=void 0})},isNeedRecalculate:function(){return p(this.heights,function(e){return void 0===e}).length?!0:!1},onBeforeRender:function(){var e=this.hot.renderCall;this.calculateRowsHeight({from:this.getFirstVisibleRow(),to:this.getLastVisibleRow()},void 0,e),this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllRowsHeight()},onBeforeRowMove:function(e,t){this.clearCacheByRange({from:e,to:t}),this.calculateAllRowsHeight()},onBeforeRowResize:function(e,t,n){return n&&(this.calculateRowsHeight(e,void 0,!0),t=this.getRowHeight(e)),t},onAfterLoadData:function(){var e=this;this.hot.view?this.recalculateAllRowsHeight():setTimeout(function(){e.hot&&e.recalculateAllRowsHeight()},0)},onBeforeChange:function(e){var t=null;1===e.length?t=e[0][0]:e.length>1&&(t={from:e[0][0],to:e[e.length-1][0]}),null!==t&&this.clearCacheByRange(t)},destroy:function(){this.ghostTable.clean(),$traceurRuntime.superGet(this,k.prototype,"destroy").call(this)}},{get CALCULATION_STEP(){return 50},get SYNC_CALCULATION_LIMIT(){return 500}},h),E("autoRowSize",M)},{_base:58,"helpers/array":42,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/string":52,plugins:57,"utils/ghostTable":98,"utils/samplesGenerator":99}],61:[function(e,t,n){"use strict";function o(e,t,n,o){var r,i,s,a,l,u=n.length,c=n?n[0].length:0,d=[],h=[];if(r=t.row-e.row,i=t.col-e.col,-1!==["down","up"].indexOf(o)){for(var f=0;i>=f;f++)s=parseInt(n[0][f],10),a=parseInt(n[u-1][f],10),l=("down"===o?a-s:s-a)/(u-1)||0,h.push(l);d.push(h)}if(-1!==["right","left"].indexOf(o))for(var p=0;r>=p;p++)s=parseInt(n[p][0],10),a=parseInt(n[p][c-1],10),l=("right"===o?a-s:s-a)/(c-1)||0,h=[],h.push(l),d.push(h);return d}function r(e){function t(t){return e.autofill?void(e.autofill.handle&&e.autofill.handle.isDragged&&(e.autofill.handle.isDragged>1&&e.autofill.apply(),e.autofill.handle.isDragged=0,a=!1)):!0}function n(e){var t,n;return s.instance.autofill?(t=c(s.instance.table).top-(window.pageYOffset||document.documentElement.scrollTop)+d(s.instance.table),n=c(s.instance.table).left-(window.pageXOffset||document.documentElement.scrollLeft)+h(s.instance.table),s.addingStarted===!1&&s.instance.autofill.handle.isDragged>0&&e.clientY>t&&e.clientX<=n?(s.instance.mouseDragOutside=!0,s.addingStarted=!0):s.instance.mouseDragOutside=!1,void(s.instance.mouseDragOutside&&setTimeout(function(){s.addingStarted=!1,s.instance.alter("insert_row")},200))):!1}var o,r,i,s=this,a=!1;this.instance=e,this.addingStarted=!1,i=f(e),i.addEventListener(document,"mouseup",t),i.addEventListener(document,"mousemove",n),o=this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown,this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown=function(t){e.autofill.handle.isDragged=1,a=!0,o(t)},r=this.instance.view.wt.wtSettings.settings.onCellMouseOver,this.instance.view.wt.wtSettings.settings.onCellMouseOver=function(t,n,o,i){e.autofill&&a&&!e.view.isMouseDown()&&e.autofill.handle&&e.autofill.handle.isDragged&&(e.autofill.handle.isDragged++,e.autofill.showBorder(n),e.autofill.checkIfNewRowNeeded()),r(t,n,o,i)},this.instance.view.wt.wtSettings.settings.onCellCornerDblClick=function(){e.autofill.selectAdjacent()}}Object.defineProperties(n,{Autofill:{get:function(){return r}},__esModule:{value:!0}});var i,s,a,l,u=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),c=u.offset,d=u.outerHeight,h=u.outerWidth,f=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).eventManager,p=((a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin,(l=e("3rdparty/walkontable/src/cell/coords"),l&&l.__esModule&&l||{"default":l}).WalkontableCellCoords);r.prototype.init=function(){this.handle={}},r.prototype.disable=function(){this.handle.disabled=!0},r.prototype.selectAdjacent=function(){var e,t,n,o,r;e=this.instance.selection.isMultiple()?this.instance.view.wt.selections.area.getCorners():this.instance.view.wt.selections.current.getCorners(),t=this.instance.getData();e:for(n=e[2]+1;nt[3]?(s="right",n=new p(e[0],t[3]+1),r=new p(e[2],e[3])):e[0]t[2]&&e[1]===t[1]&&(s="down",n=new p(t[2]+1,e[1]),r=new p(e[2],e[3])),n&&n.row>-1&&n.col>-1?(l={from:this.instance.getSelectedRange().from,to:this.instance.getSelectedRange().to},i=this.instance.getData(l.from.row,l.from.col,l.to.row,l.to.col),a=o(n,r,i,s),Handsontable.hooks.run(this.instance,"beforeAutofill",n,r,i),this.instance.populateFromArray(n.row,n.col,i,r.row,r.col,"autofill",null,s,a),this.instance.selection.setRangeStart(new p(e[0],e[1])),this.instance.selection.setRangeEnd(new p(e[2],e[3]))):this.instance.selection.refreshBorders())},r.prototype.showBorder=function(e){var t=this.instance.getSelectedRange().getTopLeftCorner(),n=this.instance.getSelectedRange().getBottomRightCorner();if("horizontal"!==this.instance.getSettings().fillHandle&&(n.rowe.row))e=new p(e.row,n.col);else{if("vertical"===this.instance.getSettings().fillHandle)return;e=new p(n.row,e.col)}this.instance.view.wt.selections.fill.clear(),this.instance.view.wt.selections.fill.add(this.instance.getSelectedRange().from),this.instance.view.wt.selections.fill.add(this.instance.getSelectedRange().to),this.instance.view.wt.selections.fill.add(e),this.instance.view.render()},r.prototype.checkIfNewRowNeeded=function(){var e,t,n=this.instance.countRows(),o=this;this.instance.view.wt.selections.fill.cellRange&&this.addingStarted===!1&&(t=this.instance.getSelected(),e=this.instance.view.wt.selections.fill.getCorners(),t[2]n[1]?e?1:-1:0}},dateSort:function(e){return function(t,n){if(t[1]===n[1])return 0;if(null===t[1]||""===t[1])return 1;if(null===n[1]||""===n[1])return-1;var o=new Date(t[1]),r=new Date(n[1]);return r>o?e?-1:1:o>r?e?1:-1:0}},sort:function(){if("undefined"==typeof this.hot.sortOrder)return void(this.hot.sortIndex.length=0);var e,t;this.hot.sortingEnabled=!1,this.hot.sortIndex.length=0;for(var n=this.hot.colOffset(),o=0,r=this.hot.countRows()-this.hot.getSettings().minSpareRows;r>o;o++)this.hot.sortIndex.push([o,this.hot.getDataAtCell(o,this.hot.sortColumn+n)]);switch(e=this.hot.getCellMeta(0,this.hot.sortColumn),this.sortIndicators[this.hot.sortColumn]=e.sortIndicator,e.type){case"date":t=this.dateSort;break;default:t=this.defaultSort}this.hot.sortIndex.sort(t(this.hot.sortOrder));for(var o=this.hot.sortIndex.length;o=0&&-1===r&&u(n,"columnSorting"),f(n,"descending"),f(n,"ascending"),this.sortIndicators[e]&&e===this.hot.sortColumn&&("ascending"===this.sortOrderClass?u(n,"ascending"):"descending"===this.sortOrderClass&&u(n,"descending")))},isSorted:function(){return"undefined"!=typeof this.hot.sortColumn},afterCreateRow:function(e,t){if(this.isSorted()){for(var n=0;n=e&&(this.hot.sortIndex[n][0]+=t);for(var n=0;t>n;n++)this.hot.sortIndex.splice(e+n,0,[e+n,this.hot.getSourceData()[e+n][this.hot.sortColumn+this.hot.colOffset()]]);this.saveSortingState()}},afterRemoveRow:function(e,t){function n(e){return m(o,function(t,n){return e>n&&t++,t},0)}if(this.isSorted()){var o=this.hot.sortIndex.splice(e,t);o=g(o,function(e){return e[0]}),this.hot.sortIndex=g(this.hot.sortIndex,function(e,t){var o=n(e[0]);return o&&(e[0]-=o),e}),this.saveSortingState()}}},{},w),y("columnSorting",b)},{_base:58,eventManager:41,"helpers/array":42,"helpers/dom/element":45,plugins:57}],63:[function(e,t,n){"use strict";Object.defineProperties(n,{CommentEditor:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).addClass,i=function(){this.editor=this.createEditor(),this.editorStyle=this.editor.style,this.editorStyle.position="absolute",this.editorStyle.zIndex=100,this.hide()},s=i;$traceurRuntime.createClass(i,{setPosition:function(e,t){this.editorStyle.left=e+"px",this.editorStyle.top=t+"px"},show:function(){this.editorStyle.display="block"},hide:function(){this.editorStyle.display="none"},isVisible:function(){return"block"===this.editorStyle.display},setValue:function(){var e=void 0!==arguments[0]?arguments[0]:"";e=e||"",this.getInputElement().value=e},getValue:function(){return this.getInputElement().value},isFocused:function(){return document.activeElement===this.getInputElement()},focus:function(){this.getInputElement().focus()},createEditor:function(){var e,t,n=document.querySelector("."+s.CLASS_EDITOR_CONTAINER);return n||(n=document.createElement("div"),r(n,s.CLASS_EDITOR_CONTAINER),document.body.appendChild(n)),e=document.createElement("div"),r(e,s.CLASS_EDITOR),t=document.createElement("textarea"),r(t,s.CLASS_INPUT),e.appendChild(t),n.appendChild(e),e},getInputElement:function(){return this.editor.querySelector("."+s.CLASS_INPUT)},destroy:function(){this.editor.parentNode.removeChild(this.editor),this.editor=null,this.editorStyle=null}},{get CLASS_EDITOR_CONTAINER(){return"htCommentsContainer"},get CLASS_EDITOR(){return"htComments"},get CLASS_INPUT(){return"htCommentTextArea"},get CLASS_CELL(){return"htCommentCell"}})},{"helpers/dom/element":45}],64:[function(e,t,n){"use strict";Object.defineProperties(n,{Comments:{get:function(){return R}},__esModule:{value:!0}});var o,r,i,s,a,l,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),c=u.addClass,d=u.closest,h=u.getWindowScrollLeft,f=u.getWindowScrollTop,p=u.hasClass,g=u.offset,m=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,v=(i=e("3rdparty/walkontable/src/cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords,w=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}),y=w.registerPlugin,b=(w.getPlugin,(a=e("_base"),a&&a.__esModule&&a||{"default":a})["default"]),C=(l=e("commentEditor"),l&&l.__esModule&&l||{"default":l}).CommentEditor,R=function(e){$traceurRuntime.superConstructor(_).call(this,e),this.editor=null,this.eventManager=null,this.range={},this.mouseDown=!1,this.contextMenuEvent=!1,this.timer=null},_=R;$traceurRuntime.createClass(R,{isEnabled:function(){return this.hot.getSettings().comments},enablePlugin:function(){var e=this;this.enabled||(this.editor||(this.editor=new C),this.eventManager||(this.eventManager=new m(this)),this.addHook("afterContextMenuDefaultOptions",function(t){return e.addToContextMenu(t)}),this.addHook("afterRenderer",function(t,n,o,r,i,s){return e.onAfterRenderer(t,s)}),this.addHook("afterScrollHorizontally",function(){return e.refreshEditorPosition()}),this.addHook("afterScrollVertically",function(){return e.refreshEditorPosition()}),this.addHook("afterColumnResize",function(){return e.refreshEditorPosition()}),this.addHook("afterRowResize",function(){return e.refreshEditorPosition()}),this.registerListeners(),$traceurRuntime.superGet(this,_.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,_.prototype,"disablePlugin").call(this)},registerListeners:function(){var e=this;this.eventManager.addEventListener(document,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(document,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(document,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(document,"mouseup",function(t){return e.onMouseUp(t)}),this.eventManager.addEventListener(this.editor.getInputElement(),"blur",function(t){return e.onEditorBlur(t)})},setRange:function(e){this.range=e},clearRange:function(){this.range={}},targetIsCellWithComment:function(e){return p(e.target,"htCommentCell")&&d(e.target,[this.hot.rootElement])?!0:!1},targetIsCommentTextArea:function(e){return this.editor.getInputElement()===e.target},saveComment:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');var e=this.editor.getValue(),t=this.range.from.row,n=this.range.from.col;this.hot.setCellMeta(t,n,"comment",e),this.hot.render()},saveCommentAtCell:function(e,t){this.setRange({from:new v(e,t)}),this.saveComment()},removeComment:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');this.hot.removeCellMeta(this.range.from.row,this.range.from.col,"comment"),this.hot.render(),this.hide()},removeCommentAtCell:function(e,t){this.setRange({from:new v(e,t)}),this.removeComment()},show:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');var e=this.hot.getCellMeta(this.range.from.row,this.range.from.col);return this.refreshEditorPosition(!0),this.editor.setValue(e.comment||""),this.editor.show(),!0},showAtCell:function(e,t){return this.setRange({from:new v(e,t)}),this.show()},hide:function(){this.editor.hide()},refreshEditorPosition:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(e||this.range.from&&this.editor.isVisible()){var t=this.hot.view.wt.wtTable.getCell(this.range.from),n=g(t),o=this.hot.getColWidth(this.range.from.col),r=n.top,i=n.left,s=0,a=0;this.hot.view.wt.wtViewport.hasVerticalScroll()&&(r-=this.hot.view.wt.wtOverlays.topOverlay.getScrollPosition(),s=20),this.hot.view.wt.wtViewport.hasHorizontalScroll()&&(i-=this.hot.view.wt.wtOverlays.leftOverlay.getScrollPosition(),a=20);var l=i+o,u=r,c=this.hot.view.wt.wtTable.holder.getBoundingClientRect(),d={left:c.left+h()+a,right:c.right+h()-15,top:c.top+f()+s,bottom:c.bottom+f()};l<=d.left||l>d.right||u<=d.top||u>d.bottom?this.hide():this.editor.setPosition(l,u)}},onMouseDown:function(e){this.mouseDown=!0,this.hot.view&&this.hot.view.wt&&(this.contextMenuEvent||this.targetIsCommentTextArea(e)||this.targetIsCellWithComment(e)||this.hide(),this.contextMenuEvent=!1)},onMouseOver:function(e){if(!this.mouseDown&&!this.editor.isFocused())if(this.targetIsCellWithComment(e)){var t=this.hot.view.wt.wtTable.getCoords(e.target),n={from:new v(t.row,t.col)};this.setRange(n),this.show()}else this.targetIsCommentTextArea(e)||this.editor.isFocused()||this.hide()},onMouseMove:function(e){var t=this;this.targetIsCommentTextArea(e)&&(this.mouseDown=!0,clearTimeout(this.timer),this.timer=setTimeout(function(){t.mouseDown=!1},200))},onMouseUp:function(e){this.mouseDown=!1},onAfterRenderer:function(e,t){t.comment&&c(e,t.commentedCellClassName)},onEditorBlur:function(e){this.saveComment()},checkSelectionCommentsConsistency:function(){var e=this.hot.getSelectedRange();if(!e)return!1;var t=!1,n=e.from;return this.hot.getCellMeta(n.row,n.col).comment&&(t=!0),t},onContextMenuAddComment:function(){var e=this,t=this.hot.getSelectedRange();this.contextMenuEvent=!0,this.setRange({from:t.from}),this.show(),setTimeout(function(){e.hot&&(e.hot.deselectCell(),e.editor.focus())},10)},onContextMenuRemoveComment:function(e,t){this.contextMenuEvent=!0,this.removeCommentAtCell(t.start.row,t.start.col)},addToContextMenu:function(e){var t=this;e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR,{key:"commentsAddEdit",name:function(){return t.checkSelectionCommentsConsistency()?"Edit Comment":"Add Comment"},callback:function(){return t.onContextMenuAddComment()},disabled:function(){return this.getSelected()?!1:!0}},{key:"commentsRemove",name:function(){return"Delete Comment"},callback:function(e,n){return t.onContextMenuRemoveComment(e,n)},disabled:function(){return!t.checkSelectionCommentsConsistency()}})},destroy:function(){this.editor&&this.editor.destroy(),$traceurRuntime.superGet(this,_.prototype,"destroy").call(this)}},{},b),y("comments",R)},{"3rdparty/walkontable/src/cell/coords":5,_base:58,commentEditor:63,eventManager:41,"helpers/dom/element":45,plugins:57}],65:[function(e,t,n){"use strict";function o(e,t){var n;return i(t,function(t){var o=t.key?t.key.split(":"):null;return Array.isArray(o)&&o[1]===e?(n=t,!1):void 0}),n}Object.defineProperties(n,{CommandExecutor:{get:function(){return s}},__esModule:{value:!0}});var r,i=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,s=function(e){this.hot=e,this.commands={},this.commonCallback=null};$traceurRuntime.createClass(s,{registerCommand:function(e,t){this.commands[e]=t},setCommonCallback:function(e){this.commonCallback=e},execute:function(e){for(var t=[],n=1;n0;if(s)return}}else if(!(t(i)||w(i,"current")&&w(i,"wtBorder")))return;this.open(e)},onMenuAfterOpen:function(){this.hot.runHooks("afterContextMenuShow",this)},onMenuAfterClose:function(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)},destroy:function(){this.close(),this.menu&&this.menu.destroy(),$traceurRuntime.superGet(this,W.prototype,"destroy").call(this)}},{get DEFAULT_ITEMS(){return[E,T,N,O,M,N,k,H,N,D,A,N,x,N,P]}},p),L.SEPARATOR={name:N},Handsontable.hooks.register("afterContextMenuDefaultOptions"),Handsontable.hooks.register("afterContextMenuShow"),Handsontable.hooks.register("afterContextMenuHide"),Handsontable.hooks.register("afterContextMenuExecute"),R("contextMenu",L)},{_base:58,commandExecutor:65,eventManager:41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,itemsFactory:68,menu:69,plugins:57,predefinedItems:70}],67:[function(e,t,n){"use strict";Object.defineProperties(n,{Cursor:{get:function(){return d}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.getWindowScrollLeft,a=i.getWindowScrollTop,l=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}),u=l.pageX,c=l.pageY,d=function(e){var t,n,o,r,i,l,d,h,f=a(),p=s();this.type=this.getSourceType(e),"literal"===this.type?(t=parseInt(e.top,10),o=parseInt(e.left,10),d=e.height,h=e.width):"event"===this.type&&(t=parseInt(c(e),10),o=parseInt(u(e),10),d=e.target.clientHeight,h=e.target.clientWidth),n=t-f,r=o-p,i=f,l=p,this.top=t,this.topRelative=n,this.left=o,this.leftRelative=r,this.scrollTop=i,this.scrollLeft=l,this.cellHeight=d,this.cellWidth=h};$traceurRuntime.createClass(d,{getSourceType:function(e){var t="literal";return e instanceof Event&&(t="event"),t},fitsAbove:function(e){return this.topRelative>=e.offsetHeight},fitsBelow:function(e){var t=void 0!==arguments[1]?arguments[1]:window.innerHeight;return this.topRelative+e.offsetHeight<=t},fitsOnRight:function(e){var t=void 0!==arguments[1]?arguments[1]:window.innerWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=t},fitsOnLeft:function(e){return this.leftRelative>=e.offsetWidth}},{}),Handsontable.plugins.utils=Handsontable.plugins.utils||{},Handsontable.plugins.utils.Cursor=d},{"helpers/dom/element":45,"helpers/dom/event":46}],68:[function(e,t,n){"use strict";function o(){var e=void 0!==arguments[0]?arguments[0]:null,t=void 0!==arguments[1]?arguments[1]:[],n=void 0!==arguments[2]?arguments[2]:{},o=[];return e&&e.items?e=e.items:Array.isArray(e)||(e=t),u(e)?l(e,function(e,t){var r=n["string"==typeof e?e:t];r||(r=e), -u(e)?c(r,e):"string"==typeof r&&(r={name:r}),void 0===r.key&&(r.key=t),o.push(r)}):d(e,function(e,t){var r=n[e];!r&&p.indexOf(e)>=0||(r||(r={name:e,key:t+""}),u(e)&&c(r,e),void 0===r.key&&(r.key=t),o.push(r))}),o[0].name===f&&o.shift(),o}Object.defineProperties(n,{ItemsFactory:{get:function(){return m}},__esModule:{value:!0}});var r,i,s,a=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}),l=a.objectEach,u=a.isObject,c=a.extend,d=(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,h=(s=e("predefinedItems"),s&&s.__esModule&&s||{"default":s}),f=h.SEPARATOR,p=h.ITEMS,g=h.predefinedItems,m=function(e){var t=void 0!==arguments[1]?arguments[1]:null;this.hot=e,this.predefinedItems=g(),this.defaultOrderPattern=t};$traceurRuntime.createClass(m,{setPredefinedItems:function(e){var t=this,n={};this.defaultOrderPattern.length=0,l(e,function(e,o){var r="";e.name===f?(n[f]=e,r=f):isNaN(parseInt(o,10))?(e.key=void 0===e.key?o:e.key,n[o]=e,r=e.key):(n[e.key]=e,r=e.key),t.defaultOrderPattern.push(r)}),this.predefinedItems=n},getVisibleItems:function(){var e=void 0!==arguments[0]?arguments[0]:null,t=this,n={};return l(this.predefinedItems,function(e,o){(!e.hidden||e.hidden&&!e.hidden.apply(t.hot))&&(n[o]=e)}),o(e,this.defaultOrderPattern,n)},getItems:function(){var e=void 0!==arguments[0]?arguments[0]:null;return o(e,this.defaultOrderPattern,this.predefinedItems)}},{})},{"helpers/array":42,"helpers/object":50,predefinedItems:70}],69:[function(e,t,n){"use strict";Object.defineProperties(n,{Menu:{get:function(){return W}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c,d,h,f=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),p=f.addClass,g=f.empty,m=f.fastInnerHTML,v=(f.getComputedStyle,f.getScrollbarWidth),w=(f.getWindowScrollLeft,f.getWindowScrollTop,f.hasClass,f.isChildOf),y=f.removeClass,b=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,C=(i=e("cursor"),i&&i.__esModule&&i||{"default":i}).Cursor,R=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).EventManager,_=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),S=(_.extend,_.isObject,_.objectEach,_.mixin),E=(l=e("utils"),l&&l.__esModule&&l||{"default":l}),T=E.isSeparator,O=E.isDisabled,M=E.isSelectionDisabled,k=E.hasSubMenu,H=E.normalizeSelection,D=(u=e("helpers/unicode"),u&&u.__esModule&&u||{"default":u}).KEY_CODES,A=(c=e("mixins/localHooks"),c&&c.__esModule&&c||{"default":c}).localHooks,x=(d=e("predefinedItems"),d&&d.__esModule&&d||{"default":d}),P=x.SEPARATOR,N=(x.predefinedItems,h=e("helpers/dom/event"),h&&h.__esModule&&h||{"default":h}),L=(N.stopPropagation,N.stopImmediatePropagation),W=(N.pageX,N.pageY,function(e){var t=void 0!==arguments[1]?arguments[1]:{parent:null,name:null,className:"",keepInViewport:!0};this.hot=e,this.options=t,this.eventManager=new R(this),this.container=this.createContainer(this.options.name),this.hotMenu=null,this.hotSubMenus={},this.parentMenu=this.options.parent||null,this.menuItems=null,this.origOutsideClickDeselects=null,this._afterScrollCallback=null,this.registerEvents()}),I=W;$traceurRuntime.createClass(W,{registerEvents:function(){var e=this;this.eventManager.addEventListener(document.documentElement,"mousedown",function(t){return e.onDocumentMouseDown(t)})},setMenuItems:function(e){this.menuItems=e},isSubMenu:function(){return null!==this.parentMenu},open:function(){var e=this;this.container.removeAttribute("style"),this.container.style.display="block";var t={data:this.menuItems,colHeaders:!1,colWidths:[200],autoRowSize:!1,readOnly:!0,copyPaste:!1,columns:[{data:"name",renderer:function(t,n,o,r,i,s){return e.menuItemRenderer(t,n,o,r,i,s)}}],renderAllRows:!0,fragmentSelection:"cell",beforeKeyDown:function(t){return e.onBeforeKeyDown(t)},afterOnCellMouseOver:function(t,n,o){return e.openSubMenu(n.row)}};this.origOutsideClickDeselects=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1,this.hotMenu=new Handsontable.Core(this.container,t),this.hotMenu.addHook("afterInit",function(){return e.onAfterInit()}),this.hotMenu.init(),this.hotMenu.listen(),this.blockMainTableCallbacks(),this.runLocalHooks("afterOpen")},close:function(){var e=void 0!==arguments[0]?arguments[0]:!1;this.isOpened()&&(e&&this.parentMenu?this.parentMenu.close():(this.closeAllSubMenus(),this.container.style.display="none",this.releaseMainTableCallbacks(),this.hotMenu.destroy(),this.hotMenu=null,this.hot.getSettings().outsideClickDeselects=this.origOutsideClickDeselects,this.runLocalHooks("afterClose")))},openSubMenu:function(e){var t=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!t||!k(t))return!1;var n=this.hotMenu.getSourceDataAtRow(e),o=new I(this.hot,{parent:this,name:n.name,className:this.options.className});return o.setMenuItems(n.submenu.items),o.open(),o.setPosition(t.getBoundingClientRect()),this.hotSubMenus[n.key]=o,o},closeSubMenu:function(e){var t=this.hotMenu.getSourceDataAtRow(e),n=this.hotSubMenus[t.key];n&&(n.destroy(),delete this.hotSubMenus[t.key])},closeAllSubMenus:function(){var e=this;b(this.hotMenu.getData(),function(t,n){return e.closeSubMenu(n)})},isAllSubMenusClosed:function(){return 0===Object.keys(this.hotSubMenus).length},destroy:function(){this.clearLocalHooks(),this.close(),this.parentMenu=null,this.eventManager.destroy()},isOpened:function(){return null!==this.hotMenu},executeCommand:function(e){if(this.isOpened()&&this.hotMenu.getSelected()){var t=this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelected()[0]);if(this.runLocalHooks("select",t,e),t.isCommand!==!1){var n=this.hot.getSelectedRange(),o=n?H(n):{};this.runLocalHooks("executeCommand",t.key,o,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",t.key,o,e),this.close(!0)}}},setPosition:function(e){var t=new C(e);this.options.keepInViewport?(t.fitsBelow(this.container)?this.setPositionBelowCursor(t):t.fitsAbove(this.container)?this.setPositionAboveCursor(t):this.setPositionBelowCursor(t),t.fitsOnRight(this.container)?this.setPositionOnRightOfCursor(t):this.setPositionOnLeftOfCursor(t)):(this.setPositionBelowCursor(t),this.setPositionOnRightOfCursor(t))},setPositionAboveCursor:function(e){var t=e.top-this.container.offsetHeight;this.isSubMenu()&&(t=window.scrollY+e.top+e.cellHeight-this.container.offsetHeight+3),this.container.style.top=t+"px"},setPositionBelowCursor:function(e){var t=e.top-1;this.isSubMenu()&&(t=e.top+window.scrollY-1),this.container.style.top=t+"px"},setPositionOnRightOfCursor:function(e){var t;t=this.isSubMenu()?window.scrollX+1+e.left+e.cellWidth:1+e.left,this.container.style.left=t+"px"},setPositionOnLeftOfCursor:function(e){this.container.style.left=e.left-this.container.offsetWidth+v()+4+"px"},selectFirstCell:function(){var e=this.hotMenu.getCell(0,0);T(e)||O(e)||M(e)?this.selectNextCell(0,0):this.hotMenu.selectCell(0,0)},selectLastCell:function(){var e=this.hotMenu.countRows()-1,t=this.hotMenu.getCell(e,0);T(t)||O(t)||M(t)?this.selectPrevCell(e,0):this.hotMenu.selectCell(e,0)},selectNextCell:function(e,t){var n=e+1,o=n=0?this.hotMenu.getCell(n,t):null;o&&(T(o)||O(o)||M(o)?this.selectPrevCell(n,t):this.hotMenu.selectCell(n,t))},menuItemRenderer:function(e,t,n,o,r,i){var s=this,a=e.getSourceDataAtRow(n),l=document.createElement("div"),u=function(e){return e.hasOwnProperty("submenu")},c=function(e){return new RegExp(P,"i").test(e.name)},d=function(e){return e.disabled===!0||"function"==typeof e.disabled&&e.disabled.call(s.hot)===!0},h=function(e){return"function"==typeof e.hidden&&e.hidden.call(s.hot)===!0},f=function(e){return e.disableSelection},v=h(a);"function"==typeof i&&(i=i.call(this.hot)),g(t),p(l,"htItemWrapper"),t.appendChild(l),c(a)?p(t,"htSeparator"):v||"function"!=typeof a.renderer?m(l,i):(p(t,"htCustomMenuRenderer"),t.appendChild(a.renderer(e,l,n,o,r,i))),v?t.parentNode&&p(t.parentNode,"htHidden"):d(a)?(p(t,"htDisabled"),this.eventManager.addEventListener(l,"mouseenter",function(){return e.deselectCell()})):f(a)?(p(t,"htSelectionDisabled"),this.eventManager.addEventListener(l,"mouseenter",function(){return e.deselectCell()})):u(a)?(p(t,"htSubmenu"),f(a)?this.eventManager.addEventListener(l,"mouseenter",function(){return e.deselectCell()}):this.eventManager.addEventListener(l,"mouseenter",function(){return e.selectCell(n,o,void 0,void 0,void 0,!1)})):(y(t,"htSubmenu"),y(t,"htDisabled"),f(a)?this.eventManager.addEventListener(l,"mouseenter",function(){return e.deselectCell()}):this.eventManager.addEventListener(l,"mouseenter",function(){return e.selectCell(n,o,void 0,void 0,void 0,!1)}))},createContainer:function(){var e=void 0!==arguments[0]?arguments[0]:null;e&&(e=e.replace(/ /g,"_"),e=this.options.className+"Sub_"+e);var t;return t=e?document.querySelector("."+this.options.className+"."+e):document.querySelector("."+this.options.className),t||(t=document.createElement("div"),p(t,"htMenu "+this.options.className),e&&p(t,e),document.getElementsByTagName("body")[0].appendChild(t)),t},blockMainTableCallbacks:function(){this._afterScrollCallback=function(){},this.hot.addHook("afterScrollVertically",this._afterScrollCallback),this.hot.addHook("afterScrollHorizontally",this._afterScrollCallback)},releaseMainTableCallbacks:function(){this._afterScrollCallback&&(this.hot.removeHook("afterScrollVertically",this._afterScrollCallback),this.hot.removeHook("afterScrollHorizontally",this._afterScrollCallback),this._afterScrollCallback=null)},onBeforeKeyDown:function(e){var t=this.hotMenu.getSelected(),n=!1;switch(e.keyCode){case D.ESCAPE:this.close(),n=!0;break;case D.ENTER:t&&(this.hotMenu.getSourceDataAtRow(t[0]).submenu?n=!0:(this.executeCommand(e),this.close(!0)));break;case D.ARROW_DOWN:t?this.selectNextCell(t[0],t[1]):this.selectFirstCell(),n=!0;break;case D.ARROW_UP:t?this.selectPrevCell(t[0],t[1]):this.selectLastCell(),n=!0;break;case D.ARROW_RIGHT:if(t){var o=this.openSubMenu(t[0]);o&&o.selectFirstCell()}n=!0;break;case D.ARROW_LEFT:t&&this.isSubMenu()&&(this.close(),this.parentMenu&&this.parentMenu.hotMenu.listen(),n=!0)}n&&(e.preventDefault(),L(e))},onAfterInit:function(){var e=this.hotMenu.getSettings().data,t=this.hotMenu.view.wt.wtTable.hider.style,n=this.hotMenu.view.wt.wtTable.holder.style,o=parseInt(t.width,10),r=0;b(e,function(e){return r+=e.name===P?1:26}),n.width=o+22+"px",n.height=r+4+"px"},onDocumentMouseDown:function(e){this.isOpened()&&(this.container&&w(e.target,this.container)&&this.executeCommand(e),(this.isAllSubMenusClosed()||this.isSubMenu())&&!w(e.target,".htMenu")&&w(e.target,document)&&this.close(!0))}},{}),S(W,A)},{cursor:67,eventManager:41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,"mixins/localHooks":54,predefinedItems:70,utils:71}],70:[function(e,t,n){"use strict";function o(){var e={};return c(D,function(t,n){return e[n]=d(t)}),e}function r(e,t){-1===H.indexOf(e)&&(D[e]=t)}var i;Object.defineProperties(n,{ROW_ABOVE:{get:function(){return w}},ROW_BELOW:{get:function(){return y}},COLUMN_LEFT:{get:function(){return b}},COLUMN_RIGHT:{get:function(){return C}},CLEAR_COLUMN:{get:function(){return R}},REMOVE_ROW:{get:function(){return _}},REMOVE_COLUMN:{get:function(){return S}},UNDO:{get:function(){return E}},REDO:{get:function(){return T}},READ_ONLY:{get:function(){return O}},ALIGNMENT:{get:function(){return M}},SEPARATOR:{get:function(){return k}},ITEMS:{get:function(){return H}},predefinedItems:{get:function(){return o}},addItem:{get:function(){return r}},__esModule:{value:!0}});var s,a,l,u=(s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}),c=u.objectEach,d=u.clone,h=((a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}).rangeEach,l=e("utils"),l&&l.__esModule&&l||{"default":l}),f=h.align,p=h.getAlignmentClasses,g=h.getValidSelection,m=h.checkSelectionConsistency,v=h.markLabelAsSelected,w="row_above",y="row_below",b="col_left",C="col_right",R="clear_column",_="remove_row",S="remove_col",E="undo",T="redo",O="make_read_only",M="alignment",k="---------",H=[w,y,b,C,R,_,S,E,T,O,M,k],D=(i={},Object.defineProperty(i,k,{value:{name:k},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,w,{value:{key:w,name:"Insert row above",callback:function(e,t){this.alter("insert_row",t.start.row)},disabled:function(){var e=g(this);if(!e)return!0;var t=this.countRows(),n=[0,e[1],t-1,e[1]];return n.join(",")===e.join(",")&&t>1},hidden:function(){return!this.getSettings().allowInsertRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,y,{value:{key:y,name:"Insert row below",callback:function(e,t){this.alter("insert_row",t.end.row+1)},disabled:function(){var e=g(this);if(!e)return!0;var t=this.countRows(),n=[0,e[1],t-1,e[1]];return n.join(",")===e.join(",")&&t>1},hidden:function(){return!this.getSettings().allowInsertRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,b,{value:{key:b,name:"Insert column on the left",callback:function(e,t){this.alter("insert_col",t.start.col)},disabled:function(){var e=g(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n},hidden:function(){return!this.getSettings().allowInsertColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,C,{value:{key:C,name:"Insert column on the right",callback:function(e,t){this.alter("insert_col",t.end.col+1)},disabled:function(){var e=g(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n},hidden:function(){return!this.getSettings().allowInsertColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,R,{value:{key:R,name:"Clear column",callback:function(e,t){var n=t.start.col;this.countRows()&&this.populateFromArray(0,n,[[null]],Math.max(t.start.row,t.end.row),n)},disabled:function(){var e=g(this);if(!e)return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,_,{value:{key:_,name:"Remove row",callback:function(e,t){var n=t.end.row-t.start.row+1;this.alter("remove_row",t.start.row,n)},disabled:function(){var e=g(this);if(!e)return!0;var t=[0,e[1],this.countRows()-1,e[1]];return t.join(",")===e.join(",")},hidden:function(){return!this.getSettings().allowRemoveRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,S,{value:{key:S,name:"Remove column",callback:function(e,t){var n=t.end.col-t.start.col+1;this.alter("remove_col",t.start.col,n)},disabled:function(){var e=g(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||n},hidden:function(){return!this.getSettings().allowRemoveColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,E,{value:{key:E,name:"Undo",callback:function(){this.undo()},disabled:function(){return this.undoRedo&&!this.undoRedo.isUndoAvailable()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,T,{value:{key:T,name:"Redo",callback:function(){this.redo()},disabled:function(){return this.undoRedo&&!this.undoRedo.isRedoAvailable()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,O,{value:{key:O,name:function(){var e=this,t="Read only",n=m(this.getSelectedRange(),function(t,n){return e.getCellMeta(t,n).readOnly});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=m(t,function(t,n){return e.getCellMeta(t,n).readOnly});t.forAll(function(t,o){e.getCellMeta(t,o).readOnly=n?!1:!0}),this.render()},disabled:function(){return this.getSelectedRange()?!1:!0}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,M,{value:{key:M,name:"Alignment",disabled:function(){return this.getSelectedRange()?!1:!0},submenu:{items:[{key:M+":left",name:function(){var e=this,t="Left",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htLeft")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htLeft";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":center",name:function(){var e=this,t="Center",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htCenter")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htCenter";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":right",name:function(){var e=this,t="Right",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htRight")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htRight";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":justify",name:function(){var e=this,t="Justify",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htJustify")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htJustify";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{name:k},{key:M+":top",name:function(){var e=this,t="Top",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htTop")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htTop";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":middle",name:function(){var e=this,t="Middle",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htMiddle")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htMiddle";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":bottom",name:function(){var e=this,t="Bottom",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htBottom")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htBottom";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1}]}},configurable:!0,enumerable:!0,writable:!0}),i)},{"helpers/number":49,"helpers/object":50,utils:71}],71:[function(e,t,n){"use strict";function o(e){return{start:e.getTopLeftCorner(),end:e.getBottomRightCorner()}}function r(e){return v(e,"htSeparator")}function i(e){return v(e,"htSubmenu")}function s(e){return v(e,"htDisabled")}function a(e){return v(e,"htSelectionDisabled")}function l(e){var t=e.getSelected();return t?t[0]<0?null:e.countRows()>=e.getSettings().maxRows?null:t:null}function u(e,t){return-1!=e.indexOf(t)?e:(e=e.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ",""),e+=" "+t)}function c(e,t){return-1!=e.indexOf(t)?e:(e=e.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ",""),e+=" "+t)}function d(e,t){for(var n={},o=e.from.row;o<=e.to.row;o++)for(var r=e.from.col;r<=e.to.col;r++)n[o]||(n[o]=[]),n[o][r]=t(o,r);return n}function h(e,t,n,o){if(e.from.row==e.to.row&&e.from.col==e.to.col)f(e.from.row,e.from.col,t,n,o);else for(var r=e.from.row;r<=e.to.row;r++)for(var i=e.from.col;i<=e.to.col;i++)f(r,i,t,n,o)}function f(e,t,n,o,r){var i=r(e,t),s=o;i.className&&(s="vertical"===n?u(i.className,o):c(i.className,o)),i.className=s}function p(e,t){var n=!1;return e&&e.forAll(function(e,o){return t(e,o)?(n=!0,!1):void 0}),n}function g(e){return''+String.fromCharCode(10003)+""+e}Object.defineProperties(n,{normalizeSelection:{get:function(){return o}},isSeparator:{get:function(){return r}},hasSubMenu:{get:function(){return i}},isDisabled:{get:function(){return s}},isSelectionDisabled:{get:function(){return a}},getValidSelection:{get:function(){return l}},prepareVerticalAlignClass:{get:function(){return u}},prepareHorizontalAlignClass:{get:function(){return c}},getAlignmentClasses:{get:function(){return d}},align:{get:function(){return h}},checkSelectionConsistency:{get:function(){return p}},markLabelAsSelected:{get:function(){return g}},__esModule:{value:!0}});var m,v=(m=e("helpers/dom/element"),m&&m.__esModule&&m||{"default":m}).hasClass},{"helpers/dom/element":45}],72:[function(e,t,n){"use strict";Object.defineProperties(n,{ContextMenuCopyPaste:{get:function(){return g}},__esModule:{value:!0}});var o,r,i,s,a,l,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).removeClass,c=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,d=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,h=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}).registerPlugin,f=(a=e("_base"),a&&a.__esModule&&a||{"default":a})["default"],p=(l=e("zeroclipboard"),l&&l.__esModule&&l||{"default":l})["default"],g=function(e){$traceurRuntime.superConstructor(m).call(this,e),this.eventManager=new d(this),this.swfPath=null,this.outsideClickDeselectsCache=null},m=g;$traceurRuntime.createClass(g,{isEnabled:function(){return this.hot.getSettings().contextMenuCopyPaste},enablePlugin:function(){var e=this;if(!this.enabled){"object"==typeof this.hot.getSettings().contextMenuCopyPaste&&(this.swfPath=this.hot.getSettings().contextMenuCopyPaste.swfPath),"undefined"==typeof p&&console.error("To be able to use the Copy/Paste feature from the context menu, you need to manually include ZeroClipboard.js file to your website.");try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(t){"undefined"==typeof navigator.mimeTypes["application/x-shockwave-flash"]&&console.error("To be able to use the Copy/Paste feature from the context menu, your browser needs to have Flash Plugin installed.")}this.swfPath&&p.config({swfPath:this.swfPath}),this.hot.addHook("afterContextMenuShow",function(){return e.onAfterContextMenuShow()}),this.hot.addHook("afterContextMenuDefaultOptions",function(t){return e.onAfterContextMenuDefaultOptions(t)}),this.registerEvents(),$traceurRuntime.superGet(this,m.prototype,"enablePlugin").call(this)}},disablePlugin:function(){$traceurRuntime.superGet(this,m.prototype,"disablePlugin").call(this)},registerEvents:function(){var e=this;this.eventManager.addEventListener(document,"mouseenter",function(){return e.removeCurrentClass()}),this.eventManager.addEventListener(document,"mouseleave",function(){return e.removeZeroClipboardClass()})},getCopyValue:function(){return this.hot.copyPaste.setCopyableText(),this.hot.copyPaste.copyPasteInstance.elTextarea.value},onAfterContextMenuDefaultOptions:function(e){e.items.unshift({key:"copy",name:"Copy"},{key:"paste",name:"Paste",callback:function(){this.copyPaste.triggerPaste()}},Handsontable.plugins.ContextMenu.SEPARATOR)},onAfterContextMenuShow:function(){var e=this,t=this.hot.getPlugin("contextMenu"),n=t.menu.hotMenu.getSourceData();c(n,function(n,o){if("copy"===n.key){var r=new p(t.menu.hotMenu.getCell(o,0));return r.off(),r.on("copy",function(t){var n=t.clipboardData;n.setData("text/plain",e.getCopyValue()),e.hot.getSettings().outsideClickDeselects=e.outsideClickDeselectsCache}),!1}})},removeCurrentClass:function(){var e=this.hot.getPlugin("contextMenu");if(e.menu.isOpened()){var t=e.menu.hotMenu.rootElement.querySelector("td.current");t&&u(t,"current")}this.outsideClickDeselectsCache=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1},removeZeroClipboardClass:function(){var e=this.hot.getPlugin("contextMenu");if(e.menu.isOpened()){var t=e.menu.hotMenu.rootElement.querySelector("td.zeroclipboard-is-hover");t&&u(t,"zeroclipboard-is-hover")}this.hot.getSettings().outsideClickDeselects=this.outsideClickDeselectsCache}},{},f),h("contextMenuCopyPaste",g)},{_base:58,eventManager:41,"helpers/array":42,"helpers/dom/element":45,plugins:57,zeroclipboard:"zeroclipboard"}],73:[function(e,t,n){"use strict";function o(e){function t(){e.isListening()&&e.selection.empty()}function n(t){var n,o,r,i,s,a,l,u,c,d;if(e.isListening()&&e.selection.isSelected()){n=t,o=v.parse(n),r=e.getSelected(),i=new M(r[0],r[1]),s=new M(r[2],r[3]),a=new k(i,i,s),l=a.getTopLeftCorner(),u=a.getBottomRightCorner(),c=l,d=new M(Math.max(u.row,o.length-1+l.row),Math.max(u.col,o[0].length-1+l.col));var h=s.row-i.row>=o.length-1,f=s.col-i.col>=o[0].length-1;e.addHookOnce("afterChange",function(t,n){var o=t?t.length:0;if(o){var r={row:0,col:0},i=-1;C(t,function(e,n){var s=o>n+1?t[n+1]:null;s&&(h||(r.row=r.row+Math.max(s[0]-e[0]-1,0)),!f&&e[1]>i&&(i=e[1],r.col=r.col+Math.max(s[1]-e[1]-1,0)))}),e.selectCell(c.row,c.col,d.row+r.row,d.col+r.col)}}),e.populateFromArray(c.row,c.col,o,d.row,d.col,"paste",e.getSettings().pasteMode)}}function o(t){if(e.getSelected()&&!(e.getActiveEditor()&&e.getActiveEditor().isOpened()||E(t))){if(b(t.keyCode)){if(e.getSettings().fragmentSelection&&T())return;return r.setCopyableText(),void S(t)}var n=(t.ctrlKey||t.metaKey)&&!t.altKey;t.keyCode==y.A&&n&&e._registerTimeout(setTimeout(O(r.setCopyableText,r),0))}}var r=this;this.copyPasteInstance=m(),this.copyPasteInstance.onCut(t),this.copyPasteInstance.onPaste(n),this.onPaste=n,e.addHook("beforeKeyDown",o),this.destroy=function(){this.copyPasteInstance&&(this.copyPasteInstance.removeCallback(t),this.copyPasteInstance.removeCallback(n),this.copyPasteInstance.destroy(),this.copyPasteInstance=null),e.removeHook("beforeKeyDown",o)},e.addHook("afterDestroy",O(this.destroy,this)),this.triggerPaste=O(this.copyPasteInstance.triggerPaste,this.copyPasteInstance),this.triggerCut=O(this.copyPasteInstance.triggerCut,this.copyPasteInstance),this.setCopyableText=function(){var t=e.getSettings(),n=t.copyRowsLimit,o=t.copyColsLimit,r=e.getSelectedRange(),i=r.getTopLeftCorner(),s=r.getBottomRightCorner(),a=i.row,l=i.col,u=s.row,c=s.col,d=Math.min(u,a+n-1),h=Math.min(c,l+o-1),f=[];f.push({startRow:a,startCol:l,endRow:d,endCol:h}),f=Handsontable.hooks.run(e,"modifyCopyableRange",f);var p=this.getRangedCopyableData(f);e.copyPaste.copyPasteInstance.copyable(p),(u!==d||c!==h)&&Handsontable.hooks.run(e,"afterCopyLimit",u-a+1,c-l+1,n,o)},this.getRangedCopyableData=function(t){var n=[],o=[],r=[];return C(t,function(e){R(e.startRow,e.endRow,function(e){-1===o.indexOf(e)&&o.push(e)}),R(e.startCol,e.endCol,function(e){-1===r.indexOf(e)&&r.push(e)})}),C(o,function(t){var o=[];C(r,function(n){o.push(e.getCopyableData(t,n))}),n.push(o)}),v.stringify(n)}}function r(){var e=this,t=e.getSettings().copyPaste!==!1;t&&!e.copyPaste?e.copyPaste=new o(e):!t&&e.copyPaste&&(e.copyPaste.destroy(),e.copyPaste=null)}Object.defineProperties(n,{CopyPastePlugin:{get:function(){return o}},__esModule:{value:!0}});var i,s,a,l,u,c,d,h,f,p,g,m=(i=e("copyPaste"),i&&i.__esModule&&i||{"default":i})["default"],v=(s=e("SheetClip"),s&&s.__esModule&&s||{"default":s})["default"],w=(a=e("helpers/unicode"),a&&a.__esModule&&a||{"default":a}),y=w.KEY_CODES,b=w.isCtrlKey,C=(l=e("helpers/array"),l&&l.__esModule&&l||{"default":l}).arrayEach,R=(u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}).rangeEach,_=(c=e("helpers/dom/event"),c&&c.__esModule&&c||{"default":c}),S=_.stopImmediatePropagation,E=_.isImmediatePropagationStopped,T=(d=e("helpers/dom/element"),d&&d.__esModule&&d||{"default":d}).getSelectionText,O=(h=e("helpers/function"),h&&h.__esModule&&h||{"default":h}).proxy,M=((f=e("plugins"),f&&f.__esModule&&f||{"default":f}).registerPlugin,(p=e("3rdparty/walkontable/src/cell/coords"),p&&p.__esModule&&p||{"default":p}).WalkontableCellCoords),k=(g=e("3rdparty/walkontable/src/cell/range"),g&&g.__esModule&&g||{"default":g}).WalkontableCellRange;Handsontable.hooks.add("afterInit",r),Handsontable.hooks.add("afterUpdateSettings",r),Handsontable.hooks.register("afterCopyLimit"),Handsontable.hooks.register("modifyCopyableRange")},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,SheetClip:"SheetClip",copyPaste:"copyPaste","helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/function":47,"helpers/number":49,"helpers/unicode":53,plugins:57}],74:[function(e,t,n){"use strict";function o(){}var r,i,s,a,l=((r=e("plugins"),r&&r.__esModule&&r||{"default":r}).registerPlugin,(i=e("3rdparty/walkontable/src/cell/range"),i&&i.__esModule&&i||{"default":i}).WalkontableCellRange),u=(s=e("3rdparty/walkontable/src/selection"),s&&s.__esModule&&s||{"default":s}).WalkontableSelection,c=function(e){return"boolean"==typeof e&&e===!0?!0:"object"==typeof e&&e.length>0?!0:!1},d=function(){c(this.getSettings().customBorders)&&(this.customBorders||(a=this,this.customBorders=new o))},h=function(e){for(var t=0;t=0?a.view.wt.selections[o]=n:a.view.wt.selections.push(n)},p=function(e,t,n){var o=b(e,t);o=C(o,n),this.setCellMeta(e,t,"borders",o),f(o)},g=function(e){for(var t=e.range,n=t.from.row;n<=t.to.row;n++)for(var o=t.from.col;o<=t.to.col;o++){var r=b(n,o),i=0;n==t.from.row&&(i++,e.hasOwnProperty("top")&&(r.top=e.top)),n==t.to.row&&(i++,e.hasOwnProperty("bottom")&&(r.bottom=e.bottom)),o==t.from.col&&(i++,e.hasOwnProperty("left")&&(r.left=e.left)),o==t.to.col&&(i++,e.hasOwnProperty("right")&&(r.right=e.right)),i>0&&(this.setCellMeta(n,o,"borders",r),f(r))}},m=function(e,t){return"border_row"+e+"col"+t},v=function(){return{width:1,color:"#000"}},w=function(){return{hide:!0}},y=function(){return{width:1,color:"#000",cornerVisible:!1}},b=function(e,t){return{className:m(e,t),border:y(),row:e,col:t,top:w(),right:w(),bottom:w(),left:w()}},C=function(e,t){return t.hasOwnProperty("border")&&(e.border=t.border),t.hasOwnProperty("top")&&(e.top=t.top),t.hasOwnProperty("right")&&(e.right=t.right),t.hasOwnProperty("bottom")&&(e.bottom=t.bottom),t.hasOwnProperty("left")&&(e.left=t.left),e},R=function(e){for(var t=document.querySelectorAll("."+e),n=0;n'+String.fromCharCode(10003)+""+e},M=function(e){this.getSettings().customBorders&&(e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR),e.items.push({key:"borders",name:"Borders",submenu:{items:[{key:"borders:top",name:function(){var e="Top",t=T(this,"top");return t&&(e=O(e)),e},callback:function(){var e=T(this,"top");E.call(this,this.getSelectedRange(),"top",e)},disabled:!1},{key:"borders:right",name:function(){var e="Right",t=T(this,"right");return t&&(e=O(e)),e},callback:function(){var e=T(this,"right");E.call(this,this.getSelectedRange(),"right",e)},disabled:!1},{key:"borders:bottom",name:function(){var e="Bottom",t=T(this,"bottom");return t&&(e=O(e)),e},callback:function(){var e=T(this,"bottom");E.call(this,this.getSelectedRange(),"bottom",e)},disabled:!1},{key:"borders:left",name:function(){var e="Left",t=T(this,"left");return t&&(e=O(e)),e},callback:function(){var e=T(this,"left");E.call(this,this.getSelectedRange(),"left",e)},disabled:!1},{key:"borders:no_borders",name:"Remove border(s)",callback:function(){E.call(this,this.getSelectedRange(),"noBorders")},disabled:function(){return!T(this)}}]}}))};Handsontable.hooks.add("beforeInit",d),Handsontable.hooks.add("afterContextMenuDefaultOptions",M),Handsontable.hooks.add("afterInit",function(){var e=this.getSettings().customBorders;if(e){for(var t=0;tthis.boundaries.bottom&&(o=t-this.boundaries.bottom),ethis.boundaries.right&&(n=e-this.boundaries.right),this.callback(n,o)};var a,l=function(e){e.dragToScrollListening=!1;var t=e.view.wt.wtTable.holder;a=new o,t!==window&&(a.setBoundaries(t.getBoundingClientRect()),a.setCallback(function(e,n){0>e?t.scrollLeft-=50:e>0&&(t.scrollLeft+=50),0>n?t.scrollTop-=20:n>0&&(t.scrollTop+=20)}),e.dragToScrollListening=!0)};Handsontable.hooks.add("afterInit",function(){var e=this,t=s(this);t.addEventListener(document,"mouseup",function(){e.dragToScrollListening=!1}),t.addEventListener(document,"mousemove",function(t){e.dragToScrollListening&&a.check(t.clientX,t.clientY)})}),Handsontable.hooks.add("afterDestroy",function(){s(this).clear()}),Handsontable.hooks.add("afterOnCellMouseDown",function(){l(this)}),Handsontable.hooks.add("afterOnCellCornerMouseDown",function(){l(this)}),Handsontable.plugins.DragToScroll=o},{eventManager:41,plugins:57}],76:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualColumnFreeze:{get:function(){return a}},__esModule:{value:!0}});var o,r,i=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],s=(r=e("plugins"),r&&r.__esModule&&r||{"default":r}).registerPlugin,a=function(e){$traceurRuntime.superConstructor(l).call(this,e)},l=a;$traceurRuntime.createClass(a,{isEnabled:function(){return!!this.hot.getSettings().manualColumnFreeze},enablePlugin:function(){var e=this;this.enabled||(this.addHook("modifyCol",function(t){return e.onModifyCol(t)}),this.addHook("afterContextMenuDefaultOptions",function(t){return e.addContextMenuEntry(t)}),$traceurRuntime.superGet(this,l.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,l.prototype,"disablePlugin").call(this)},init:function(){$traceurRuntime.superGet(this,l.prototype,"init").call(this),"undefined"==typeof this.hot.manualColumnPositionsPluginUsages?this.hot.manualColumnPositionsPluginUsages=["manualColumnFreeze"]:this.hot.manualColumnPositionsPluginUsages.push("manualColumnFreeze"),this.fixedColumnsCount=this.hot.getSettings().fixedColumnsLeft},onModifyCol:function(e){return this.hot.manualColumnPositionsPluginUsages.length>1?e:this.getModifiedColumnIndex(e)},getModifiedColumnIndex:function(e){return this.hot.manualColumnPositions[e]},addContextMenuEntry:function(e){var t=this;e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR,{key:"freeze_column",name:function(){var e=t.hot.getSelected()[1];return e>t.fixedColumnsCount-1?"Freeze this column":"Unfreeze this column"},disabled:function(){var e=t.hot.getSelected();return e[1]!==e[3]},callback:function(){var e=t.hot.getSelected()[1];e>t.fixedColumnsCount-1?t.freezeColumn(e):t.unfreezeColumn(e)}})},freezeColumn:function(e){if(!(e<=this.fixedColumnsCount-1)){var t=this.getModifiedColumnIndex(e)||e;this.checkPositionData(t),this.modifyColumnOrder(t,e,null,"freeze"),this.addFixedColumn(),this.hot.view.wt.wtOverlays.leftOverlay.refresh(),this.hot.view.wt.wtOverlays.adjustElementsSize()}},unfreezeColumn:function(e){if(!(e>this.fixedColumnsCount-1)){var t=this.getBestColumnReturnPosition(e),n=this.getModifiedColumnIndex(e)||e;this.checkPositionData(n),this.modifyColumnOrder(n,e,t,"unfreeze"),this.removeFixedColumn(),this.hot.view.wt.wtOverlays.leftOverlay.refresh(),this.hot.view.wt.wtOverlays.adjustElementsSize()}},addFixedColumn:function(){this.hot.updateSettings({fixedColumnsLeft:this.fixedColumnsCount+1}),this.fixedColumnsCount++},removeFixedColumn:function(){this.hot.updateSettings({fixedColumnsLeft:this.fixedColumnsCount-1}),this.fixedColumnsCount--},checkPositionData:function(e){this.hot.manualColumnPositions&&0!==this.hot.manualColumnPositions.length||this.hot.manualColumnPositions||(this.hot.manualColumnPositions=[]),e?this.hot.manualColumnPositions[e]||this.createPositionData(e+1):this.createPositionData(this.hot.countCols())},createPositionData:function(e){if(this.hot.manualColumnPositions.lengtht;t++)this.hot.manualColumnPositions[t]=t},modifyColumnOrder:function(e,t,n,o){null==n&&(n=e),"freeze"===o?this.hot.manualColumnPositions.splice(this.fixedColumnsCount,0,this.hot.manualColumnPositions.splice(t,1)[0]):"unfreeze"===o&&this.hot.manualColumnPositions.splice(n,0,this.hot.manualColumnPositions.splice(t,1)[0])},getBestColumnReturnPosition:function(e){for(var t=this.fixedColumnsCount,n=this.getModifiedColumnIndex(t),o=this.getModifiedColumnIndex(e);o>n;)t++,n=this.getModifiedColumnIndex(t);return t-1}},{},i),s("manualColumnFreeze",a)},{_base:58,plugins:57}],77:[function(e,t,n){"use strict";function o(){function e(e){g=this,m=e;var t=this.view.wt.wtTable.getCoords(e).col;if(t>=0){f=t;var n=m.getBoundingClientRect();l=n.left,v.style.top=n.top+"px",v.style.left=l+"px",g.rootElement.appendChild(v)}}function t(e,t){var n=e.getBoundingClientRect(),o=6;t>0?v.style.left=n.left+n.width-o+"px":v.style.left=n.left+"px"}function n(){var e=this;u(v,"active"),u(w,"active");var t=m.getBoundingClientRect();w.style.width=t.width+"px",w.style.height=e.view.maximumVisibleElementHeight(0)+"px",w.style.top=v.style.top,w.style.left=l+"px",e.rootElement.appendChild(w)}function o(e){w.style.left=l+e+"px"}function r(){d(v,"active"),d(w,"active")}var i,s,a,l,f,g,m,v=document.createElement("DIV"),w=document.createElement("DIV"),y=h(this);v.className="manualColumnMover",w.className="manualColumnMoverGuide";var b=function(){var e=this;Handsontable.hooks.run(e,"persistentStateSave","manualColumnPositions",e.manualColumnPositions)},C=function(){var e=this,t={};return Handsontable.hooks.run(e,"persistentStateLoad","manualColumnPositions",t),t.value},R=function(e){return"BODY"!=e.tagName?"THEAD"==e.parentNode.tagName?!0:(e=e.parentNode,R(e)):!1},_=function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:_(e.parentNode):null},S=function(){var l,u=this;y.addEventListener(u.rootElement,"mouseover",function(n){if(R(n.target)){var o=_(n.target);if(o)if(l){var r=u.view.wt.wtTable.getCoords(o).col;r>=0&&(s=r,t(n.target,s-i))}else e.call(u,o)}}),y.addEventListener(u.rootElement,"mousedown",function(e){c(e.target,"manualColumnMover")&&(a=p(e),n.call(u),l=u,i=f,s=f)}),y.addEventListener(window,"mousemove",function(e){l&&o(p(e)-a)}),y.addEventListener(window,"mouseup",function(t){l&&(r(),l=!1,T(u.manualColumnPositions,u.countCols()),u.manualColumnPositions.splice(s,0,u.manualColumnPositions.splice(i,1)[0]),Handsontable.hooks.run(u,"beforeColumnMove",i,s),u.forceFullRender=!0,u.view.render(),b.call(u),Handsontable.hooks.run(u,"afterColumnMove",i,s),e.call(u,m))}),u.addHook("afterDestroy",E)},E=function(){y.clear()},T=function(e,t){if(e.lengthn;n++)e[n]=n};this.beforeInit=function(){this.manualColumnPositions=[]},this.init=function(e){var t=this,n=!!this.getSettings().manualColumnMove;if(n){var o=this.getSettings().manualColumnMove,r=C.call(t);"undefined"!=typeof r?this.manualColumnPositions=r:Array.isArray(o)?this.manualColumnPositions=o:this.manualColumnPositions=[],("afterInit"===e||"afterUpdateSettings"===e&&0===y.context.eventListeners.length)&&("undefined"==typeof t.manualColumnPositionsPluginUsages?t.manualColumnPositionsPluginUsages=["manualColumnMove"]:t.manualColumnPositionsPluginUsages.push("manualColumnMove"),S.call(this),this.manualColumnPositions.length>0&&(this.forceFullRender=!0,this.render()))}else{var i=t.manualColumnPositionsPluginUsages?t.manualColumnPositionsPluginUsages.indexOf("manualColumnMove"):-1;i>-1&&(E.call(this),this.manualColumnPositions=[],t.manualColumnPositionsPluginUsages[i]=void 0)}},this.modifyCol=function(e){return this.getSettings().manualColumnMove?("undefined"==typeof this.manualColumnPositions[e]&&T(this.manualColumnPositions,e+1),this.manualColumnPositions[e]):e},this.afterRemoveCol=function(e,t){if(this.getSettings().manualColumnMove){var n,o=this.manualColumnPositions;n=o.splice(e,t),o=o.map(function(e){var t,o=e;for(t=0;tn[t]&&o--;return o}),this.manualColumnPositions=o}},this.afterCreateCol=function(e,t){if(this.getSettings().manualColumnMove){var n=this.manualColumnPositions;if(n.length){for(var o=[],r=0;t>r;r++)o.push(e+r);e>=n.length?n.concat(o):(n=n.map(function(n){return n>=e?n+t:n}),n.splice.apply(n,[e,0].concat(o))),this.manualColumnPositions=n}}}}Object.defineProperties(n,{ManualColumnMove:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=l.addClass,c=l.hasClass,d=l.removeClass,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,f=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=f.pageX,g=(f.pageY,(a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin,new o);Handsontable.hooks.add("beforeInit",g.beforeInit),Handsontable.hooks.add("afterInit",function(){g.init.call(this,"afterInit")}),Handsontable.hooks.add("afterUpdateSettings",function(){g.init.call(this,"afterUpdateSettings")}),Handsontable.hooks.add("modifyCol",g.modifyCol),Handsontable.hooks.add("afterRemoveCol",g.afterRemoveCol),Handsontable.hooks.add("afterCreateCol",g.afterCreateCol),Handsontable.hooks.register("beforeColumnMove"),Handsontable.hooks.register("afterColumnMove")},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],78:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualColumnResize:{get:function(){return v}},__esModule:{value:!0}});var o,r,i,s,a,l=(o=e("_base.js"),o&&o.__esModule&&o||{"default":o})["default"],u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=u.addClass,d=u.hasClass,h=u.removeClass,f=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,p=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=p.pageX,m=(p.pageY,(a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin),v=function(e){$traceurRuntime.superConstructor(w).call(this,e),this.currentTH=null,this.currentCol=null,this.currentWidth=null,this.newSize=null,this.startY=null,this.startWidth=null,this.startOffset=null,this.handle=document.createElement("DIV"),this.guide=document.createElement("DIV"),this.eventManager=f(this),this.pressed=null,this.dblclick=0,this.autoresizeTimeout=null,this.manualColumnWidths=[],c(this.handle,"manualColumnResizer"),c(this.guide,"manualColumnResizerGuide")},w=v;$traceurRuntime.createClass(v,{isEnabled:function(){return this.hot.getSettings().manualColumnResize},enablePlugin:function(){var e=this;if(!this.enabled){this.manualColumnWidths=[];var t=this.hot.getSettings().manualColumnResize,n=this.loadManualColumnWidths();this.addHook("modifyColWidth",function(t,n){return e.onModifyColWidth(t,n)}),"undefined"!=typeof n?this.manualColumnWidths=n:Array.isArray(t)?this.manualColumnWidths=t:this.manualColumnWidths=[],Handsontable.hooks.register("beforeColumnResize"),Handsontable.hooks.register("afterColumnResize"),this.bindEvents(),$traceurRuntime.superGet(this,w.prototype,"enablePlugin").call(this)}},updatePlugin:function(){var e=this.hot.getSettings().manualColumnResize;Array.isArray(e)?this.manualColumnWidths=e:this.manualColumnWidths=[]},disablePlugin:function(){$traceurRuntime.superGet(this,w.prototype,"disablePlugin").call(this)},saveManualColumnWidths:function(){this.hot.runHooks("persistentStateSave","manualColumnWidths",this.manualColumnWidths)},loadManualColumnWidths:function(){var e={};return this.hot.runHooks("persistentStateLoad","manualColumnWidths",e),e.value},setupHandlePosition:function(e){this.currentTH=e;var t=this.hot.view.wt.wtTable.getCoords(e).col;if(t>=0){var n=this.currentTH.getBoundingClientRect();this.currentCol=t,this.startOffset=n.left-6,this.startWidth=parseInt(n.width,10),this.handle.style.top=n.top+"px",this.handle.style.left=this.startOffset+this.startWidth+"px",this.hot.rootElement.appendChild(this.handle)}},refreshHandlePosition:function(){this.handle.style.left=this.startOffset+this.currentWidth+"px"},setupGuidePosition:function(){c(this.handle,"active"),c(this.guide,"active"),this.guide.style.top=this.handle.style.top,this.guide.style.left=this.handle.style.left,this.guide.style.height=this.hot.view.maximumVisibleElementHeight(0)+"px",this.hot.rootElement.appendChild(this.guide)},refreshGuidePosition:function(){this.guide.style.left=this.handle.style.left},hideHandleAndGuide:function(){h(this.handle,"active"),h(this.guide,"active")},checkIfColumnHeader:function(e){return"BODY"!=e.tagName?"THEAD"==e.parentNode.tagName?!0:(e=e.parentNode,this.checkIfColumnHeader(e)):!1},getTHFromTargetElement:function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:this.getTHFromTargetElement(e.parentNode):null},onMouseOver:function(e){if(this.checkIfColumnHeader(e.target)){var t=this.getTHFromTargetElement(e.target);if(!t)return;var n=t.getAttribute("colspan");!t||null!==n&&1!==n||this.pressed||this.setupHandlePosition(t)}},afterMouseDownTimeout:function(){if(this.dblclick>=2){var e=this.hot.runHooks("beforeColumnResize",this.currentCol,this.newSize,!0);void 0!==e&&(this.newSize=e),this.setManualSize(this.currentCol,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.hot.runHooks("afterColumnResize",this.currentCol,this.newSize,!0)}this.dblclick=0,this.autoresizeTimeout=null},onMouseDown:function(e){var t=this;d(e.target,"manualColumnResizer")&&(this.setupGuidePosition(),this.pressed=this.hot,null===this.autoresizeTimeout&&(this.autoresizeTimeout=setTimeout(function(){return t.afterMouseDownTimeout()},500),this.hot._registerTimeout(this.autoresizeTimeout)),this.dblclick++,this.startX=g(e),this.newSize=this.startWidth)},onMouseMove:function(e){this.pressed&&(this.currentWidth=this.startWidth+(g(e)-this.startX),this.newSize=this.setManualSize(this.currentCol,this.currentWidth),this.refreshHandlePosition(),this.refreshGuidePosition())},onMouseUp:function(e){this.pressed&&(this.hideHandleAndGuide(),this.pressed=!1,this.newSize!=this.startWidth&&(this.hot.runHooks("beforeColumnResize",this.currentCol,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",this.currentCol,this.newSize)),this.setupHandlePosition(this.currentTH))},bindEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},setManualSize:function(e,t){return t=Math.max(t,20),e=this.hot.runHooks("modifyCol",e),this.manualColumnWidths[e]=t,t},onModifyColWidth:function(e,t){return this.enabled&&(t=this.hot.runHooks("modifyCol",t),this.hot.getSettings().manualColumnResize&&this.manualColumnWidths[t])?this.manualColumnWidths[t]:e}},{},l),m("manualColumnResize",v)},{"_base.js":58,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],79:[function(e,t,n){"use strict";function o(){function e(e){var t=this;g=e;var n=this.view.wt.wtTable.getCoords(e).row;if(n>=0){f=n;var o=g.getBoundingClientRect();l=o.top,m.style.top=l+"px",m.style.left=o.left+"px",t.rootElement.appendChild(m)}}function t(e,t){var n=e.getBoundingClientRect(),o=6;t>0?m.style.top=n.top+n.height-o+"px":m.style.top=n.top+"px"}function n(){var e=this;u(m,"active"),u(v,"active");var t=g.getBoundingClientRect();v.style.width=e.view.maximumVisibleElementWidth(0)+"px",v.style.height=t.height+"px",v.style.top=l+"px",v.style.left=m.style.left,e.rootElement.appendChild(v)}function o(e){v.style.top=l+e+"px"}function r(){d(m,"active"),d(v,"active")}var i,s,a,l,f,g,m=document.createElement("DIV"),v=document.createElement("DIV"),w=h(this);m.className="manualRowMover",v.className="manualRowMoverGuide";var y=function(){var e=this;Handsontable.hooks.run(e,"persistentStateSave","manualRowPositions",e.manualRowPositions)},b=function(){var e=this,t={};return Handsontable.hooks.run(e,"persistentStateLoad","manualRowPositions",t),t.value},C=function(e){return"BODY"!=e.tagName?"TBODY"==e.parentNode.tagName?!0:(e=e.parentNode,C(e)):!1},R=function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:R(e.parentNode):null},_=function(){var l,u=this;w.addEventListener(u.rootElement,"mouseover",function(n){if(C(n.target)){var o=R(n.target);o&&(l?(s=u.view.wt.wtTable.getCoords(o).row,t(o,s-i)):e.call(u,o))}}),w.addEventListener(u.rootElement,"mousedown",function(e){c(e.target,"manualRowMover")&&(a=p(e),n.call(u),l=u,i=f,s=f)}),w.addEventListener(window,"mousemove",function(e){l&&o(p(e)-a)}),w.addEventListener(window,"mouseup",function(t){l&&(r(),l=!1,E(u.manualRowPositions,u.countRows()),u.manualRowPositions.splice(s,0,u.manualRowPositions.splice(i,1)[0]),Handsontable.hooks.run(u,"beforeRowMove",i,s),u.forceFullRender=!0,u.view.render(),y.call(u),Handsontable.hooks.run(u,"afterRowMove",i,s),e.call(u,g))}),u.addHook("afterDestroy",S)},S=function(){w.clear()},E=function(e,t){if(e.lengthn;n++)e[n]=n};this.beforeInit=function(){this.manualRowPositions=[]},this.init=function(e){var t=this,n=!!t.getSettings().manualRowMove;if(n){var o=t.getSettings().manualRowMove,r=b.call(t);"undefined"==typeof t.manualRowPositionsPluginUsages?t.manualRowPositionsPluginUsages=["manualColumnMove"]:t.manualRowPositionsPluginUsages.push("manualColumnMove"),"undefined"!=typeof r?this.manualRowPositions=r:Array.isArray(o)?this.manualRowPositions=o:this.manualRowPositions=[],("afterInit"===e||"afterUpdateSettings"===e&&0===w.context.eventListeners.length)&&(_.call(this),this.manualRowPositions.length>0&&(t.forceFullRender=!0,t.render()))}else{var i=t.manualRowPositionsPluginUsages?t.manualRowPositionsPluginUsages.indexOf("manualColumnMove"):-1;i>-1&&(S.call(this),t.manualRowPositions=[],t.manualRowPositionsPluginUsages[i]=void 0)}},this.modifyRow=function(e){var t=this;return t.getSettings().manualRowMove?("undefined"==typeof t.manualRowPositions[e]&&E(this.manualRowPositions,e+1),t.manualRowPositions[e]):e}}Object.defineProperties(n,{ManualRowMove:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=l.addClass,c=l.hasClass,d=l.removeClass,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,f=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=(f.pageX,f.pageY),g=((a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin,new o);Handsontable.hooks.add("beforeInit",g.beforeInit),Handsontable.hooks.add("afterInit",function(){g.init.call(this,"afterInit")}),Handsontable.hooks.add("afterUpdateSettings",function(){g.init.call(this,"afterUpdateSettings")}),Handsontable.hooks.add("modifyRow",g.modifyRow),Handsontable.hooks.register("beforeRowMove"),Handsontable.hooks.register("afterRowMove")},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],80:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualRowResize:{get:function(){return v}},__esModule:{value:!0}});var o,r,i,s,a,l=(o=e("_base.js"),o&&o.__esModule&&o||{"default":o})["default"],u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=u.addClass,d=u.hasClass,h=u.removeClass,f=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,p=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=(p.pageX,p.pageY),m=(a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin,v=function(e){$traceurRuntime.superConstructor(w).call(this,e),this.currentTH=null,this.currentRow=null,this.currentHeight=null,this.newSize=null,this.startY=null,this.startHeight=null,this.startOffset=null,this.handle=document.createElement("DIV"),this.guide=document.createElement("DIV"),this.eventManager=f(this),this.pressed=null,this.dblclick=0,this.autoresizeTimeout=null,this.manualRowHeights=[],c(this.handle,"manualRowResizer"),c(this.guide,"manualRowResizerGuide")},w=v;$traceurRuntime.createClass(v,{isEnabled:function(){return this.hot.getSettings().manualRowResize},enablePlugin:function(){var e=this;if(!this.enabled){this.manualRowHeights=[];var t=this.hot.getSettings().manualRowResize,n=this.loadManualRowHeights();"undefined"!=typeof n?this.manualRowHeights=n:Array.isArray(t)?this.manualRowHeights=t:this.manualRowHeights=[],this.addHook("modifyRowHeight",function(t,n){return e.onModifyRowHeight(t,n)}),Handsontable.hooks.register("beforeRowResize"),Handsontable.hooks.register("afterRowResize"),this.bindEvents(),$traceurRuntime.superGet(this,w.prototype,"enablePlugin").call(this)}},updatePlugin:function(){var e=this.hot.getSettings().manualRowResize;Array.isArray(e)?this.manualRowHeights=e:this.manualRowHeights=[]},disablePlugin:function(){$traceurRuntime.superGet(this,w.prototype,"disablePlugin").call(this)},saveManualRowHeights:function(){this.hot.runHooks("persistentStateSave","manualRowHeights",this.manualRowHeights)},loadManualRowHeights:function(){var e={};return this.hot.runHooks("persistentStateLoad","manualRowHeights",e),e.value},setupHandlePosition:function(e){this.currentTH=e;var t=this.hot.view.wt.wtTable.getCoords(e).row;if(t>=0){var n=this.currentTH.getBoundingClientRect();this.currentRow=t,this.startOffset=n.top-6,this.startHeight=parseInt(n.height,10),this.handle.style.left=n.left+"px",this.handle.style.top=this.startOffset+this.startHeight+"px",this.hot.rootElement.appendChild(this.handle)}},refreshHandlePosition:function(){this.handle.style.top=this.startOffset+this.currentHeight+"px"},setupGuidePosition:function(){c(this.handle,"active"),c(this.guide,"active"),this.guide.style.top=this.handle.style.top,this.guide.style.left=this.handle.style.left,this.guide.style.width=this.hot.view.maximumVisibleElementWidth(0)+"px",this.hot.rootElement.appendChild(this.guide)},refreshGuidePosition:function(){this.guide.style.top=this.handle.style.top},hideHandleAndGuide:function(){h(this.handle,"active"),h(this.guide,"active")},checkIfRowHeader:function(e){return"BODY"!=e.tagName?"TBODY"==e.parentNode.tagName?!0:(e=e.parentNode,this.checkIfRowHeader(e)):!1},getTHFromTargetElement:function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:this.getTHFromTargetElement(e.parentNode):null},onMouseOver:function(e){if(this.checkIfRowHeader(e.target)){var t=this.getTHFromTargetElement(e.target);t&&(this.pressed||this.setupHandlePosition(t))}},afterMouseDownTimeout:function(){if(this.dblclick>=2){var e=this.hot.runHooks("beforeRowResize",this.currentRow,this.newSize,!0);void 0!==e&&(this.newSize=e),this.setManualSize(this.currentRow,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.hot.runHooks("afterRowResize",this.currentRow,this.newSize,!0)}this.dblclick=0,this.autoresizeTimeout=null},onMouseDown:function(e){var t=this;d(e.target,"manualRowResizer")&&(this.setupGuidePosition(),this.pressed=this.hot,null==this.autoresizeTimeout&&(this.autoresizeTimeout=setTimeout(function(){return t.afterMouseDownTimeout()},500),this.hot._registerTimeout(this.autoresizeTimeout)),this.dblclick++,this.startY=g(e),this.newSize=this.startHeight)},onMouseMove:function(e){this.pressed&&(this.currentHeight=this.startHeight+(g(e)-this.startY),this.newSize=this.setManualSize(this.currentRow,this.currentHeight),this.refreshHandlePosition(),this.refreshGuidePosition())},onMouseUp:function(e){this.pressed&&(this.hideHandleAndGuide(),this.pressed=!1,this.newSize!=this.startHeight&&(this.hot.runHooks("beforeRowResize",this.currentRow,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.currentRow,this.newSize)),this.setupHandlePosition(this.currentTH))},bindEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},setManualSize:function(e,t){return e=this.hot.runHooks("modifyRow",e),this.manualRowHeights[e]=t,t},onModifyRowHeight:function(e,t){if(this.enabled){var n=this.hot.getPlugin("autoRowSize"),o=n?n.heights[t]:null;t=this.hot.runHooks("modifyRow",t);var r=this.manualRowHeights[t];if(void 0!==r&&(r===o||r>(e||0)))return r}return e}},{},l),m("manualRowResize",v)},{"_base.js":58,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],81:[function(e,t,n){"use strict";function o(){var e=[];return e.getInfo=function(e,t){for(var n=0,o=this.length;o>n;n++)if(this[n].row<=e&&this[n].row+this[n].rowspan-1>=e&&this[n].col<=t&&this[n].col+this[n].colspan-1>=t)return this[n]},e.setInfo=function(e){for(var t=0,n=this.length;n>t;t++)if(this[t].row===e.row&&this[t].col===e.col)return void(this[t]=e);this.push(e)},e.removeInfo=function(e,t){for(var n=0,o=this.length;o>n;n++)if(this[n].row===e&&this[n].col===t){this.splice(n,1);break}},e}function r(e){if(this.mergedCellInfoCollection=new o,Array.isArray(e))for(var t=0,n=e.length;n>t;t++)this.mergedCellInfoCollection.setInfo(e[t])}function i(e,t){var n=this.getSettings().mergeCells;if(n&&!this.selection.isMultiple()){var o=this.mergeCells.mergedCellInfoCollection.getInfo(e[0],e[1]);o&&(e[0]=o.row,e[1]=o.col,e[2]=o.row+o.rowspan-1,e[3]=o.col+o.colspan-1)}}function s(e,t){this.mergeCells&&this.mergeCells.shiftCollection("right",e,t)}function a(e,t){this.mergeCells&&this.mergeCells.shiftCollection("left",e,t)}function l(e,t){this.mergeCells&&this.mergeCells.shiftCollection("down",e,t)}function u(e,t){this.mergeCells&&this.mergeCells.shiftCollection("up",e,t)}Object.defineProperties(n,{MergeCells:{get:function(){return r}},__esModule:{value:!0}});var c,d,h,f,p,g=((c=e("plugins"),c&&c.__esModule&&c||{"default":c}).registerPlugin,(d=e("helpers/dom/event"),d&&d.__esModule&&d||{"default":d}).stopImmediatePropagation),m=(h=e("3rdparty/walkontable/src/cell/coords"),h&&h.__esModule&&h||{"default":h}).WalkontableCellCoords,v=(f=e("3rdparty/walkontable/src/cell/range"),f&&f.__esModule&&f||{"default":f}).WalkontableCellRange,w=(p=e("3rdparty/walkontable/src/table"),p&&p.__esModule&&p||{"default":p}).WalkontableTable;r.prototype.canMergeRange=function(e){return!e.isSingle()},r.prototype.mergeRange=function(e){if(this.canMergeRange(e)){var t=e.getTopLeftCorner(),n=e.getBottomRightCorner(),o={};o.row=t.row,o.col=t.col,o.rowspan=n.row-t.row+1,o.colspan=n.col-t.col+1,this.mergedCellInfoCollection.setInfo(o)}},r.prototype.mergeOrUnmergeSelection=function(e){var t=this.mergedCellInfoCollection.getInfo(e.from.row,e.from.col);t?this.unmergeSelection(e.from):this.mergeSelection(e)},r.prototype.mergeSelection=function(e){this.mergeRange(e)},r.prototype.unmergeSelection=function(e){var t=this.mergedCellInfoCollection.getInfo(e.row,e.col);this.mergedCellInfoCollection.removeInfo(t.row,t.col)},r.prototype.applySpanProperties=function(e,t,n){var o=this.mergedCellInfoCollection.getInfo(t,n);o?o.row===t&&o.col===n?(e.setAttribute("rowspan",o.rowspan),e.setAttribute("colspan",o.colspan)):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"),e.style.display="none"):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"))},r.prototype.modifyTransform=function(e,t,n){var o=function(e,t){return t.row>=e.row&&t.row<=e.row+e.rowspan-1?!0:!1},r=function(e,t){return t.col>=e.col&&t.col<=e.col+e.colspan-1?!0:!1},i=function(e){return new m(t.to.row+e.row,t.to.col+e.col)},s={row:n.row,col:n.col};if("modifyTransformStart"==e){this.lastDesiredCoords||(this.lastDesiredCoords=new m(null,null));for(var a,l=new m(t.highlight.row,t.highlight.col),u=this.mergedCellInfoCollection.getInfo(l.row,l.col),c=0,d=this.mergedCellInfoCollection.length;d>c;c++){var h=this.mergedCellInfoCollection[c];if(h=new m(h.row+h.rowspan-1,h.col+h.colspan-1),t.includes(h)){a=!0;break}}if(u){var f=new m(u.row,u.col),p=new m(u.row+u.rowspan-1,u.col+u.colspan-1),g=new v(f,f,p);g.includes(this.lastDesiredCoords)||(this.lastDesiredCoords=new m(null,null)),s.row=this.lastDesiredCoords.row?this.lastDesiredCoords.row-l.row:s.row,s.col=this.lastDesiredCoords.col?this.lastDesiredCoords.col-l.col:s.col,n.row>0?s.row=u.row+u.rowspan-1-l.row+n.row:n.row<0&&(s.row=l.row-u.row+n.row),n.col>0?s.col=u.col+u.colspan-1-l.col+n.col:n.col<0&&(s.col=l.col-u.col+n.col)}var w=new m(t.highlight.row+s.row,t.highlight.col+s.col),y=this.mergedCellInfoCollection.getInfo(w.row,w.col);y&&(this.lastDesiredCoords=w,s={row:y.row-l.row,col:y.col-l.col})}else if("modifyTransformEnd"==e)for(var c=0,d=this.mergedCellInfoCollection.length;d>c;c++){var b=this.mergedCellInfoCollection[c],f=new m(b.row,b.col),p=new m(b.row+b.rowspan-1,b.col+b.colspan-1),C=new v(f,f,p),R=t.getBordersSharedWith(C);if(C.isEqual(t))t.setDirection("NW-SE");else if(R.length>0){var _=t.highlight.isEqual(C.from);R.indexOf("top")>-1?t.to.isSouthEastOf(C.from)&&_?t.setDirection("NW-SE"):t.to.isSouthWestOf(C.from)&&_&&t.setDirection("NE-SW"):R.indexOf("bottom")>-1&&(t.to.isNorthEastOf(C.from)&&_?t.setDirection("SW-NE"):t.to.isNorthWestOf(C.from)&&_&&t.setDirection("SE-NW"))}var w=i(s),S=o(b,w),E=r(b,w);t.includesRange(C)&&(C.includes(w)||S||E)&&(S&&(s.row<0?s.row-=b.rowspan-1:s.row>0&&(s.row+=b.rowspan-1)), -E&&(s.col<0?s.col-=b.colspan-1:s.col>0&&(s.col+=b.colspan-1)))}0!==s.row&&(n.row=s.row),0!==s.col&&(n.col=s.col)},r.prototype.shiftCollection=function(e,t,n){var o=[0,0];switch(e){case"right":o[0]+=1;break;case"left":o[0]-=1;break;case"down":o[1]+=1;break;case"up":o[1]-=1}for(var r=0;rn;n++)e.mergeCells.mergedCellInfoCollection.setInfo(t[n])}else e.mergeCells=new r(t);else e.mergeCells&&(e.mergeCells.mergedCellInfoCollection=new o)},R=function(e){if(this.mergeCells){var t=(e.ctrlKey||e.metaKey)&&!e.altKey;t&&77===e.keyCode&&(this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()),this.render(),g(e))}},_=function(e){this.getSettings().mergeCells&&(e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR),e.items.push({key:"mergeCells",name:function(){var e=this.getSelected(),t=this.mergeCells.mergedCellInfoCollection.getInfo(e[0],e[1]);return t?"Unmerge cells":"Merge cells"},callback:function(){this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()),this.render()},disabled:function(){return!1}}))},S=function(e,t,n,o,r,i){this.mergeCells&&this.mergeCells.applySpanProperties(e,t,n)},E=function(e){return function(t){var n=this.getSettings().mergeCells;if(n){var o=this.getSelectedRange();if(this.mergeCells.modifyTransform(e,o,t),"modifyTransformEnd"===e){var r=this.countRows(),i=this.countCols();o.from.row<0?o.from.row=0:o.from.row>0&&o.from.row>=r&&(o.from.row=o.from-1),o.from.col<0?o.from.col=0:o.from.col>0&&o.from.col>=i&&(o.from.col=i-1)}}}},T=function(e){this.lastDesiredCoords=null;var t=this.getSettings().mergeCells;if(t){var n=this.getSelectedRange();n.highlight=new m(n.highlight.row,n.highlight.col),n.to=e;var o=!1;do{o=!1;for(var r=0,i=this.mergeCells.mergedCellInfoCollection.length;i>r;r++){var s=this.mergeCells.mergedCellInfoCollection[r],a=new m(s.row,s.col),l=new m(s.row+s.rowspan-1,s.col+s.colspan-1),u=new v(a,a,l);n.expandByRange(u)&&(e.row=n.to.row,e.col=n.to.col,o=!0)}}while(o)}},O=function(e,t){if(t&&"area"==t){var n=this.getSettings().mergeCells;if(n)for(var o=this.getSelectedRange(),r=new v(o.from,o.from,o.from),i=new v(o.to,o.to,o.to),s=0,a=this.mergeCells.mergedCellInfoCollection.length;a>s;s++){var l=this.mergeCells.mergedCellInfoCollection[s],u=new m(l.row,l.col),c=new m(l.row+l.rowspan-1,l.col+l.colspan-1),d=new v(u,u,c);r.expandByRange(d)&&(e[0]=r.from.row,e[1]=r.from.col),i.expandByRange(d)&&(e[2]=i.from.row,e[3]=i.from.col)}}},M=function(e,t,n){var o=this.getSettings().mergeCells;if(o){var r=this.mergeCells.mergedCellInfoCollection.getInfo(e,t);!r||r.row==e&&r.col==t||(n.copyable=!1)}},k=function(e){var t=this.getSettings().mergeCells;if(t)for(var n,o=this.countCols(),r=0;o>r;r++){if(n=this.mergeCells.mergedCellInfoCollection.getInfo(e.startRow,r),n&&n.rowe.endRow)return e.endRow=i,k.call(this,e)}}},H=function(e){var t=this.getSettings().mergeCells;if(t)for(var n,o=this.countRows(),r=0;o>r;r++){if(n=this.mergeCells.mergedCellInfoCollection.getInfo(r,e.startColumn),n&&n.cole.endColumn)return e.endColumn=i,H.call(this,e)}}},D=function(e){if(e&&this.mergeCells){var t=this.mergeCells.mergedCellInfoCollection,n=this.getSelectedRange();for(var o in t)if(n.highlight.row==t[o].row&&n.highlight.col==t[o].col&&n.to.row==t[o].row+t[o].rowspan-1&&n.to.col==t[o].col+t[o].colspan-1)return!1}return e};Handsontable.hooks.add("beforeInit",y),Handsontable.hooks.add("afterInit",b),Handsontable.hooks.add("afterUpdateSettings",C),Handsontable.hooks.add("beforeKeyDown",R),Handsontable.hooks.add("modifyTransformStart",E("modifyTransformStart")),Handsontable.hooks.add("modifyTransformEnd",E("modifyTransformEnd")),Handsontable.hooks.add("beforeSetRangeEnd",T),Handsontable.hooks.add("beforeDrawBorders",O),Handsontable.hooks.add("afterIsMultipleSelection",D),Handsontable.hooks.add("afterRenderer",S),Handsontable.hooks.add("afterContextMenuDefaultOptions",_),Handsontable.hooks.add("afterGetCellMeta",M),Handsontable.hooks.add("afterViewportRowCalculatorOverride",k),Handsontable.hooks.add("afterViewportColumnCalculatorOverride",H),Handsontable.hooks.add("afterAutofillApplyValues",i),Handsontable.hooks.add("afterCreateCol",s),Handsontable.hooks.add("afterRemoveCol",a),Handsontable.hooks.add("afterCreateRow",l),Handsontable.hooks.add("afterRemoveRow",u),Handsontable.MergeCells=r},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/table":20,"helpers/dom/event":46,plugins:57}],82:[function(e,t,n){"use strict";Object.defineProperties(n,{MultipleSelectionHandles:{get:function(){return p}},__esModule:{value:!0}});var o,r,i,s,a=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),l=a.getWindowScrollTop,u=a.hasClass,c=a.getWindowScrollLeft,d=(r=e("_base"),r&&r.__esModule&&r||{"default":r})["default"],h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,f=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}).registerPlugin,p=function(e){$traceurRuntime.superConstructor(g).call(this,e),this.dragged=[],this.eventManager=null,this.lastSetCell=null},g=p;$traceurRuntime.createClass(p,{isEnabled:function(){return Handsontable.mobileBrowser},enablePlugin:function(){this.enabled||(this.eventManager||(this.eventManager=new h(this)),this.registerListeners(),$traceurRuntime.superGet(this,g.prototype,"enablePlugin").call(this))},registerListeners:function(){function e(e){if(1===t.dragged.length)return t.dragged.splice(0,t.dragged.length),!0;var n=t.dragged.indexOf(e);return-1==n?!1:void(0===n?t.dragged=t.dragged.slice(0,1):1==n&&(t.dragged=t.dragged.slice(-1)))}var t=this;this.eventManager.addEventListener(this.hot.rootElement,"touchstart",function(e){var n;return u(e.target,"topLeftSelectionHandle-HitArea")?(n=t.hot.getSelectedRange(),t.dragged.push("topLeft"),t.touchStartRange={width:n.getWidth(),height:n.getHeight(),direction:n.getDirection()},e.preventDefault(),!1):u(e.target,"bottomRightSelectionHandle-HitArea")?(n=t.hot.getSelectedRange(),t.dragged.push("bottomRight"),t.touchStartRange={width:n.getWidth(),height:n.getHeight(),direction:n.getDirection()},e.preventDefault(),!1):void 0}),this.eventManager.addEventListener(this.hot.rootElement,"touchend",function(n){return u(n.target,"topLeftSelectionHandle-HitArea")?(e.call(t,"topLeft"),t.touchStartRange=void 0,n.preventDefault(),!1):u(n.target,"bottomRightSelectionHandle-HitArea")?(e.call(t,"bottomRight"),t.touchStartRange=void 0,n.preventDefault(),!1):void 0}),this.eventManager.addEventListener(this.hot.rootElement,"touchmove",function(e){var n,o,r,i,s,a,u,d=l(),h=c();0!==t.dragged.length&&(n=document.elementFromPoint(e.touches[0].screenX-h,e.touches[0].screenY-d),n&&n!==t.lastSetCell&&(("TD"==n.nodeName||"TH"==n.nodeName)&&(o=t.hot.getCoords(n),-1==o.col&&(o.col=0),r=t.hot.getSelectedRange(),i=r.getWidth(),s=r.getHeight(),a=r.getDirection(),1==i&&1==s&&t.hot.selection.setRangeEnd(o),u=t.getCurrentRangeCoords(r,o,t.touchStartRange.direction,a,t.dragged[0]),null!==u.start&&t.hot.selection.setRangeStart(u.start),t.hot.selection.setRangeEnd(u.end),t.lastSetCell=n),e.preventDefault()))})},getCurrentRangeCoords:function(e,t,n,o,r){var i=e.getTopLeftCorner(),s=e.getBottomRightCorner(),a=e.getBottomLeftCorner(),l=e.getTopRightCorner(),u={start:null,end:null};switch(n){case"NE-SW":switch(o){case"NE-SW":case"NW-SE":u="topLeft"==r?{start:new WalkontableCellCoords(t.row,e.highlight.col),end:new WalkontableCellCoords(a.row,t.col)}:{start:new WalkontableCellCoords(e.highlight.row,t.col),end:new WalkontableCellCoords(t.row,i.col)};break;case"SE-NW":"bottomRight"==r&&(u={start:new WalkontableCellCoords(s.row,t.col),end:new WalkontableCellCoords(t.row,i.col)})}break;case"NW-SE":switch(o){case"NE-SW":"topLeft"==r?u={start:t,end:a}:u.end=t;break;case"NW-SE":"topLeft"==r?u={start:t,end:s}:u.end=t;break;case"SE-NW":"topLeft"==r?u={start:t,end:i}:u.end=t;break;case"SW-NE":"topLeft"==r?u={start:t,end:l}:u.end=t}break;case"SW-NE":switch(o){case"NW-SE":u="bottomRight"==r?{start:new WalkontableCellCoords(t.row,i.col),end:new WalkontableCellCoords(a.row,t.col)}:{start:new WalkontableCellCoords(i.row,t.col),end:new WalkontableCellCoords(t.row,s.col)};break;case"SW-NE":u="topLeft"==r?{start:new WalkontableCellCoords(e.highlight.row,t.col),end:new WalkontableCellCoords(t.row,s.col)}:{start:new WalkontableCellCoords(t.row,i.col),end:new WalkontableCellCoords(i.row,t.col)};break;case"SE-NW":"bottomRight"==r?u={start:new WalkontableCellCoords(t.row,l.col),end:new WalkontableCellCoords(i.row,t.col)}:"topLeft"==r&&(u={start:a,end:t})}break;case"SE-NW":switch(o){case"NW-SE":case"NE-SW":case"SW-NE":"topLeft"==r&&(u.end=t);break;case"SE-NW":"topLeft"==r?u.end=t:u={start:t,end:i}}}return u},isDragged:function(){return this.dragged.length>0}},{},d),f("multipleSelectionHandles",p)},{_base:58,eventManager:41,"helpers/dom/element":45,plugins:57}],83:[function(e,t,n){"use strict";function o(){}function r(){var e=this,t=e.getSettings().observeChanges;t?(e.observer&&a.call(e),i.call(e),u.call(e)):t||a.call(e)}function i(){var e=this;e.observeChangesActive=!0,e.pauseObservingChanges=function(){e.observeChangesActive=!1},e.resumeObservingChanges=function(){e.observeChangesActive=!0},e.observedData=e.getSourceData(),e.observer=p.observe(e.observedData,function(t){e.observeChangesActive&&(s.call(e,t),e.render()),e.runHooks("afterChangesObserved")})}function s(e){function t(e){var t;return t=o(e),t=n(t)}function n(e){var t=[];return e.filter(function(e){var n=r(e.path);if(-1!=["add","remove"].indexOf(e.op)&&!isNaN(n.col)){if(-1!=t.indexOf(n.col))return!1;t.push(n.col)}return!0})}function o(e){return e.filter(function(e){return!/[\/]length/gi.test(e.path)})}function r(e){var t=e.match(/^\/(\d+)\/?(.*)?$/);return{row:parseInt(t[1],10),col:/^\d*$/.test(t[2])?parseInt(t[2],10):t[2]}}for(var i=this,s=t(e),a=0,l=s.length;l>a;a++){var u=s[a],c=r(u.path);switch(u.op){case"add":isNaN(c.col)?i.runHooks("afterCreateRow",c.row):i.runHooks("afterCreateCol",c.col);break;case"remove":isNaN(c.col)?i.runHooks("afterRemoveRow",c.row,1):i.runHooks("afterRemoveCol",c.col,1);break;case"replace":i.runHooks("afterChange",[c.row,c.col,null,u.value],"external")}}}function a(){var e=this;e.observer&&(l.call(e),c.call(e))}function l(){var e=this;p.unobserve(e.observedData,e.observer),delete e.observedData,delete e.observeChangesActive,delete e.pauseObservingChanges,delete e.resumeObservingChanges}function u(){var e=this;e.addHook("afterDestroy",a),e.addHook("afterCreateRow",d),e.addHook("afterRemoveRow",d),e.addHook("afterCreateCol",d),e.addHook("afterRemoveCol",d),e.addHook("afterChange",function(e,t){"loadData"!=t&&d.call(this)})}function c(){var e=this;e.removeHook("afterDestroy",a),e.removeHook("afterCreateRow",d),e.removeHook("afterRemoveRow",d),e.removeHook("afterCreateCol",d),e.removeHook("afterRemoveCol",d),e.removeHook("afterChange",d)}function d(){var e=this;e.pauseObservingChanges(),e.addHookOnce("afterChangesObserved",function(){e.resumeObservingChanges()})}Object.defineProperties(n,{ObserveChanges:{get:function(){return o}},__esModule:{value:!0}});var h,f,p=((h=e("plugins"),h&&h.__esModule&&h||{"default":h}).registerPlugin,(f=e("jsonpatch"),f&&f.__esModule&&f||{"default":f})["default"]);Handsontable.hooks.add("afterLoadData",r),Handsontable.hooks.add("afterUpdateSettings",r),Handsontable.hooks.register("afterChangesObserved")},{jsonpatch:"jsonpatch",plugins:57}],84:[function(e,t,n){"use strict";function o(e){var t,n=function(){window.localStorage[e+"__persistentStateKeys"]=JSON.stringify(t)},o=function(){var n=window.localStorage[e+"__persistentStateKeys"],o="string"==typeof n?JSON.parse(n):void 0;t=o?o:[]},r=function(){t=[],n()};o(),this.saveValue=function(o,r){window.localStorage[e+"_"+o]=JSON.stringify(r),-1==t.indexOf(o)&&(t.push(o),n())},this.loadValue=function(t,n){t="undefined"==typeof t?n:t;var o=window.localStorage[e+"_"+t];return"undefined"==typeof o?void 0:JSON.parse(o)},this.reset=function(t){window.localStorage.removeItem(e+"_"+t)},this.resetAll=function(){for(var n=0;na;a++)for(var l=0;i>l;l++){var u=e.getDataAtCell(a,l),c=e.getCellMeta(a,l),d=c.search.callback||n,h=c.search.queryMethod||o,f=h(t,u);if(f){var p={row:a,col:l,data:u};s.push(p)}d&&d(e,a,l,u,f)}return s}},Handsontable.Search.DEFAULT_CALLBACK=function(e,t,n,o,r){e.getCellMeta(t,n).isSearchResult=r},Handsontable.Search.DEFAULT_QUERY_METHOD=function(e,t){return"undefined"!=typeof e&&null!=e&&e.toLowerCase&&0!==e.length?"undefined"==typeof t||null==t?!1:-1!=t.toString().toLowerCase().indexOf(e.toLowerCase()):!1},Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS="htSearchResult",Handsontable.Search.global=function(){var e=Handsontable.Search.DEFAULT_CALLBACK,t=Handsontable.Search.DEFAULT_QUERY_METHOD,n=Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS;return{getDefaultCallback:function(){return e},setDefaultCallback:function(t){e=t},getDefaultQueryMethod:function(){return t},setDefaultQueryMethod:function(e){t=e},getDefaultSearchResultClass:function(){return n},setDefaultSearchResultClass:function(e){n=e}}}(),Handsontable.SearchCellDecorator=function(e,t,n,o,r,i,s){var u=null!==s.search&&"object"==typeof s.search&&s.search.searchResultClass||Handsontable.Search.global.getDefaultSearchResultClass();s.isSearchResult?a(t,u):l(t,u)};var h=d("base");c("base",function(e,t,n,o,r,i,s){h.apply(this,arguments),Handsontable.SearchCellDecorator.apply(this,arguments)}),Handsontable.hooks.add("afterInit",o),Handsontable.hooks.add("afterUpdateSettings",o)},{"helpers/dom/element":45,renderers:88}],86:[function(e,t,n){"use strict";Object.defineProperties(n,{TouchScroll:{get:function(){return d}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=s.addClass,l=s.removeClass,u=(r=e("_base"),r&&r.__esModule&&r||{"default":r})["default"],c=(i=e("plugins"),i&&i.__esModule&&i||{"default":i}).registerPlugin,d=function(e){var t=this;$traceurRuntime.superConstructor(h).call(this,e),this.hot.addHook("afterInit",function(){return t.afterInit()}),this.hot.addHook("afterUpdateSettings",function(){return t.onAfterUpdateSettings()}),this.scrollbars=[],this.clones=[]},h=d;$traceurRuntime.createClass(d,{afterInit:function(){this.registerEvents(),this.onAfterUpdateSettings()},onAfterUpdateSettings:function(){var e=this;this.hot.addHookOnce("afterRender",function(){var t=e.hot.view.wt.wtOverlays;e.scrollbars=[],e.scrollbars.push(t.topOverlay),t.bottomOverlay.clone&&e.scrollbars.push(t.bottomOverlay),e.scrollbars.push(t.leftOverlay),t.topLeftCornerOverlay&&e.scrollbars.push(t.topLeftCornerOverlay),t.bottomLeftCornerOverlay&&t.bottomLeftCornerOverlay.clone&&e.scrollbars.push(t.bottomLeftCornerOverlay),e.clones=[],t.topOverlay.needFullRender&&e.clones.push(t.topOverlay.clone.wtTable.holder.parentNode),t.bottomOverlay.needFullRender&&e.clones.push(t.bottomOverlay.clone.wtTable.holder.parentNode),t.leftOverlay.needFullRender&&e.clones.push(t.leftOverlay.clone.wtTable.holder.parentNode),t.topLeftCornerOverlay&&e.clones.push(t.topLeftCornerOverlay.clone.wtTable.holder.parentNode),t.bottomLeftCornerOverlay&&t.bottomLeftCornerOverlay.clone&&e.clones.push(t.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode)})},registerEvents:function(){var e=this;this.hot.addHook("beforeTouchScroll",function(){return e.onBeforeTouchScroll()}),this.hot.addHook("afterMomentumScroll",function(){return e.onAfterMomentumScroll()})},onBeforeTouchScroll:function(){Handsontable.freezeOverlays=!0;for(var e=0,t=this.clones.length;t>e;e++)a(this.clones[e],"hide-tween")},onAfterMomentumScroll:function(){Handsontable.freezeOverlays=!1;for(var e=this,t=0,n=this.clones.length;n>t;t++)l(this.clones[t],"hide-tween");for(var o=0,r=this.clones.length;r>o;o++)a(this.clones[o],"show-tween");setTimeout(function(){for(var t=0,n=e.clones.length;n>t;t++)l(e.clones[t],"show-tween")},400);for(var i=0,s=this.scrollbars.length;s>i;i++)this.scrollbars[i].refresh(),this.scrollbars[i].resetFixedPosition();this.hot.view.wt.wtOverlays.syncScrollWithMaster()}},{},u),c("touchScroll",d)},{_base:58,"helpers/dom/element":45,plugins:57}],87:[function(e,t,n){"use strict";function o(){var e=this,t="undefined"==typeof e.getSettings().undo||e.getSettings().undo;t?e.undoRedo||(e.undoRedo=new Handsontable.UndoRedo(e),s(e),e.addHook("beforeKeyDown",r),e.addHook("afterChange",i)):e.undoRedo&&(delete e.undoRedo,a(e),e.removeHook("beforeKeyDown",r),e.removeHook("afterChange",i))}function r(e){var t=this,n=(e.ctrlKey||e.metaKey)&&!e.altKey;n&&(89===e.keyCode||e.shiftKey&&90===e.keyCode?(t.undoRedo.redo(),f(e)):90===e.keyCode&&(t.undoRedo.undo(),f(e)))}function i(e,t){var n=this;return"loadData"==t?n.undoRedo.clear():void 0}function s(e){e.undo=function(){return e.undoRedo.undo()},e.redo=function(){return e.undoRedo.redo()},e.isUndoAvailable=function(){return e.undoRedo.isUndoAvailable()},e.isRedoAvailable=function(){return e.undoRedo.isRedoAvailable()},e.clearUndo=function(){return e.undoRedo.clear()}}function a(e){delete e.undo,delete e.redo,delete e.isUndoAvailable,delete e.isRedoAvailable,delete e.clearUndo}var l,u,c=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),d=c.inherit,h=c.deepClone,f=(u=e("helpers/dom/event"),u&&u.__esModule&&u||{"default":u}).stopImmediatePropagation;Handsontable.UndoRedo=function(e){var t=this;this.instance=e,this.doneActions=[],this.undoneActions=[],this.ignoreNewActions=!1,e.addHook("afterChange",function(e,n){if(e){var o=new Handsontable.UndoRedo.ChangeAction(e);t.done(o)}}),e.addHook("afterCreateRow",function(e,n,o){if(!o){var r=new Handsontable.UndoRedo.CreateRowAction(e,n);t.done(r)}}),e.addHook("beforeRemoveRow",function(e,n){var o=t.instance.getSourceData();e=(o.length+e)%o.length;var r=o.slice(e,e+n),i=new Handsontable.UndoRedo.RemoveRowAction(e,r);t.done(i)}),e.addHook("afterCreateCol",function(e,n,o){if(!o){var r=new Handsontable.UndoRedo.CreateColumnAction(e,n);t.done(r)}}),e.addHook("beforeRemoveCol",function(n,o){var r=t.instance.getSourceData();n=(t.instance.countCols()+n)%t.instance.countCols();for(var i=[],s=0,a=r.length;a>s;s++)i[s]=r[s].slice(n,n+o);var l;Array.isArray(e.getSettings().colHeaders)&&(l=e.getSettings().colHeaders.slice(n,n+i.length));var u=new Handsontable.UndoRedo.RemoveColumnAction(n,i,l);t.done(u)}),e.addHook("beforeCellAlignment",function(e,n,o,r){var i=new Handsontable.UndoRedo.CellAlignmentAction(e,n,o,r);t.done(i)})},Handsontable.UndoRedo.prototype.done=function(e){this.ignoreNewActions||(this.doneActions.push(e),this.undoneActions.length=0)},Handsontable.UndoRedo.prototype.undo=function(){if(this.isUndoAvailable()){var e=this.doneActions.pop();this.ignoreNewActions=!0;var t=this;e.undo(this.instance,function(){t.ignoreNewActions=!1,t.undoneActions.push(e)})}},Handsontable.UndoRedo.prototype.redo=function(){if(this.isRedoAvailable()){var e=this.undoneActions.pop();this.ignoreNewActions=!0;var t=this;e.redo(this.instance,function(){t.ignoreNewActions=!1,t.doneActions.push(e)})}},Handsontable.UndoRedo.prototype.isUndoAvailable=function(){return this.doneActions.length>0},Handsontable.UndoRedo.prototype.isRedoAvailable=function(){return this.undoneActions.length>0},Handsontable.UndoRedo.prototype.clear=function(){this.doneActions.length=0,this.undoneActions.length=0},Handsontable.UndoRedo.Action=function(){},Handsontable.UndoRedo.Action.prototype.undo=function(){},Handsontable.UndoRedo.Action.prototype.redo=function(){},Handsontable.UndoRedo.ChangeAction=function(e){this.changes=e},d(Handsontable.UndoRedo.ChangeAction,Handsontable.UndoRedo.Action),Handsontable.UndoRedo.ChangeAction.prototype.undo=function(e,t){for(var n=h(this.changes),o=e.countEmptyRows(!0),r=e.countEmptyCols(!0),i=0,s=n.length;s>i;i++)n[i].splice(3,1);e.addHookOnce("afterChange",t),e.setDataAtRowProp(n,null,null,"undo");for(var i=0,s=n.length;s>i;i++)e.getSettings().minSpareRows&&n[i][0]+1+e.getSettings().minSpareRows===e.countRows()&&o==e.getSettings().minSpareRows&&(e.alter("remove_row",parseInt(n[i][0]+1,10),e.getSettings().minSpareRows),e.undoRedo.doneActions.pop()),e.getSettings().minSpareCols&&n[i][1]+1+e.getSettings().minSpareCols===e.countCols()&&r==e.getSettings().minSpareCols&&(e.alter("remove_col",parseInt(n[i][1]+1,10),e.getSettings().minSpareCols),e.undoRedo.doneActions.pop())},Handsontable.UndoRedo.ChangeAction.prototype.redo=function(e,t){for(var n=h(this.changes),o=0,r=n.length;r>o;o++)n[o].splice(2,1);e.addHookOnce("afterChange",t),e.setDataAtRowProp(n,null,null,"redo")},Handsontable.UndoRedo.CreateRowAction=function(e,t){this.index=e,this.amount=t},d(Handsontable.UndoRedo.CreateRowAction,Handsontable.UndoRedo.Action),Handsontable.UndoRedo.CreateRowAction.prototype.undo=function(e,t){var n=e.countRows(),o=e.getSettings().minSpareRows;this.index>=n&&this.index-or;r++)n=e.getSourceDataAtRow(r),o=[this.index,0],Array.prototype.push.apply(o,this.data[r]),Array.prototype.splice.apply(n,o);"undefined"!=typeof this.headers&&(o=[this.index,0],Array.prototype.push.apply(o,this.headers),Array.prototype.splice.apply(e.getSettings().colHeaders,o)),e.addHookOnce("afterRender",t),e.render()},Handsontable.UndoRedo.RemoveColumnAction.prototype.redo=function(e,t){e.addHookOnce("afterRemoveCol",t),e.alter("remove_col",this.index,this.amount)},Handsontable.hooks.add("afterInit",o),Handsontable.hooks.add("afterUpdateSettings",o)},{"helpers/dom/event":46,"helpers/object":50}],88:[function(e,t,n){"use strict";function o(e,t){var n;l[e]=t,n=a(e)+"Renderer",Handsontable.renderers[n]=t,Handsontable[n]=t}function r(e){if("function"==typeof e)return e;if("string"!=typeof e)throw Error('Only strings and functions can be passed as "renderer" parameter');if(!(e in l))throw Error('No editor registered under name "'+e+'"');return l[e]}function i(e){return e in l}Object.defineProperties(n,{registerRenderer:{get:function(){return o}},getRenderer:{get:function(){return r}},hasRenderer:{get:function(){return i}},__esModule:{value:!0}});var s,a=(s=e("helpers/string"),s&&s.__esModule&&s||{"default":s}).toUpperCaseFirst,l={};Handsontable.renderers=Handsontable.renderers||{},Handsontable.renderers.registerRenderer=o,Handsontable.renderers.getRenderer=r},{"helpers/string":52}],89:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){s.className&&(t.className?t.className=t.className+" "+s.className:t.className=s.className),s.readOnly&&a(t,s.readOnlyCellClassName),s.valid===!1&&s.invalidCellClassName?a(t,s.invalidCellClassName):l(t,s.invalidCellClassName),s.wordWrap===!1&&s.noWordWrapClassName&&a(t,s.noWordWrapClassName),!i&&s.placeholder&&a(t,s.placeholderCellClassName)}Object.defineProperties(n,{cellDecorator:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),a=s.addClass,l=s.removeClass,u=(i=e("renderers"),i&&i.__esModule&&i||{"default":i}).registerRenderer;u("base",o),Handsontable.renderers.cellDecorator=o},{"helpers/dom/element":45,renderers:88}],90:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){var a=(m.cloneNode(!0),v.cloneNode(!0));if(f("text")(e,t,n,o,r,i,s),t.appendChild(a),u(t,"htAutocomplete"),t.firstChild||t.appendChild(document.createTextNode(String.fromCharCode(160))),!e.acArrowListener){var l=d(e);e.acArrowListener=function(r){c(r.target,"htAutocompleteArrow")&&e.view.wt.getSetting("onCellDblClick",null,new g(n,o),t)},l.addEventListener(e.rootElement,"mousedown",e.acArrowListener),e.addHookOnce("afterDestroy",function(){l.destroy()})}}Object.defineProperties(n,{autocompleteRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=l.addClass,c=l.hasClass,d=(l.empty,(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager),h=(s=e("renderers"),s&&s.__esModule&&s||{"default":s}),f=h.getRenderer,p=h.registerRenderer,g=(a=e("3rdparty/walkontable/src/cell/coords"),a&&a.__esModule&&a||{"default":a}).WalkontableCellCoords,m=document.createElement("DIV");m.className="htAutocompleteWrapper";var v=document.createElement("DIV");v.className="htAutocompleteArrow",v.appendChild(document.createTextNode(String.fromCharCode(9660)));p("autocomplete",o)},{"3rdparty/walkontable/src/cell/coords":5,eventManager:41,"helpers/dom/element":45,renderers:88}],91:[function(e,t,n){"use strict";function o(e,t,n,o,a,l,u){function c(e){var t=[C.SPACE,C.ENTER,C.DELETE,C.BACKSPACE];-1===t.indexOf(e.keyCode)||E(e)||f(function(){S(e),e.preventDefault()}),(e.keyCode==C.SPACE||e.keyCode==C.ENTER)&&d(),(e.keyCode==C.DELETE||e.keyCode==C.BACKSPACE)&&d(!1)}function d(){var e=void 0!==arguments[0]?arguments[0]:null;f(function(t){for(var n=0,o=t.length;o>n;n++){if(m(t[n],O)&&null===e)return;h(t[n],e)}})}function h(e){var t=void 0!==arguments[1]?arguments[1]:null;null===t?e.checked=!e.checked:e.checked=t,y.fireEvent(e,"change")}function f(t){for(var n=e.getSelectedRange(),o=n.getTopLeftCorner(),r=n.getBottomRightCorner(),i=o.row;i<=r.row;i++)for(var s=o.col;s<=r.col;s++){var a=e.getCell(i,s),l=e.getCellMeta(i,s),u=a.querySelectorAll("input[type=checkbox]");u.length>0&&!l.readOnly&&t(u)}}var y=new w(e),b=r(),R=u.label,M=!1;if("undefined"==typeof u.checkedTemplate&&(u.checkedTemplate=!0),"undefined"==typeof u.uncheckedTemplate&&(u.uncheckedTemplate=!1),p(t),l===u.checkedTemplate||v(l,u.checkedTemplate)?b.checked=!0:l===u.uncheckedTemplate||v(l,u.uncheckedTemplate)?b.checked=!1:null===l?g(b,"noValue"):(b.style.display="none",g(b,O),M=!0),!M&&R){var k="";R.value?k="function"==typeof R.value?R.value.call(this,n,o,a,l):R.value:R.property&&(k=e.getDataAtRowProp(n,R.property));var H=i(k);"before"===R.position?H.appendChild(b):H.insertBefore(b,H.firstChild),b=H}t.appendChild(b),M&&t.appendChild(document.createTextNode("#bad-value#")),u.readOnly?y.addEventListener(b,"click",s):(y.addEventListener(b,"mousedown",_),y.addEventListener(b,"mouseup",_),y.addEventListener(b,"change",function(t){e.setDataAtRowProp(n,a,t.target.checked?u.checkedTemplate:u.uncheckedTemplate)})),T.has(e)||(T.set(e,!0),e.addHook("beforeKeyDown",c))}function r(){var e=document.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("autocomplete","off"),e.cloneNode(!1)}function i(e){var t=document.createElement("label");return t.className="htCheckboxRendererLabel",t.appendChild(document.createTextNode(e)),t.cloneNode(!0)}function s(e){e.preventDefault()}Object.defineProperties(n,{checkboxRenderer:{get:function(){return o}},__esModule:{value:!0}});var a,l,u,c,d,h,f=(a=e("helpers/dom/element"),a&&a.__esModule&&a||{"default":a}),p=f.empty,g=f.addClass,m=f.hasClass,v=(l=e("helpers/string"),l&&l.__esModule&&l||{"default":l}).equalsIgnoreCase,w=(u=e("eventManager"),u&&u.__esModule&&u||{"default":u}).EventManager,y=(c=e("renderers"),c&&c.__esModule&&c||{"default":c}),b=(y.getRenderer,y.registerRenderer),C=(d=e("helpers/unicode"),d&&d.__esModule&&d||{"default":d}).KEY_CODES,R=(h=e("helpers/dom/event"),h&&h.__esModule&&h||{"default":h}),_=R.stopPropagation,S=R.stopImmediatePropagation,E=R.isImmediatePropagationStopped,T=new WeakMap,O="htBadValue"; -b("checkbox",o)},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/string":52,"helpers/unicode":53,renderers:88}],92:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,a){l("base").apply(this,arguments),s(t,i)}Object.defineProperties(n,{htmlRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}).fastInnerHTML,a=(i=e("renderers"),i&&i.__esModule&&i||{"default":i}),l=a.getRenderer,u=a.registerRenderer;u("html",o)},{"helpers/dom/element":45,renderers:88}],93:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){f(i)&&("undefined"!=typeof s.language&&l.language(s.language),i=l(i).format(s.format||"0"),u(t,"htNumeric")),d("text")(e,t,n,o,r,i,s)}Object.defineProperties(n,{numericRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l=(r=e("numeral"),r&&r.__esModule&&r||{"default":r})["default"],u=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).addClass,c=(s=e("renderers"),s&&s.__esModule&&s||{"default":s}),d=c.getRenderer,h=c.registerRenderer,f=(a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}).isNumeric;h("numeric",o)},{"helpers/dom/element":45,"helpers/number":49,numeral:"numeral",renderers:88}],94:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,a){l("text").apply(this,arguments),i=t.innerHTML;var u,c=a.hashLength||i.length,d=a.hashSymbol||"*";for(u="";u.split(d).length-13?("function"==typeof o&&(e.__proto__=o),e.prototype=d(a(o),i(t))):e.prototype=t,f(e,"prototype",{configurable:!1,writable:!1}),h(e,i(n))}function a(e){if("function"==typeof e){var t=e.prototype;if(u(t)===t||null===t)return e.prototype;throw new c("super prototype must be an Object or null")}if(null===e)return null;throw new c("Super expression must either be null or a function, not "+typeof e+".")}function l(e,t,o){null!==g(t)&&n(e,t,"constructor",o)}var u=Object,c=TypeError,d=u.create,h=$traceurRuntime.defineProperties,f=$traceurRuntime.defineProperty,p=$traceurRuntime.getOwnPropertyDescriptor,g=Object.getPrototypeOf,m=$traceurRuntime.toProperty,v=Object,w=v.getOwnPropertyNames,y=v.getOwnPropertySymbols;$traceurRuntime.createClass=s,$traceurRuntime.defaultSuperCall=l,$traceurRuntime.superCall=n,$traceurRuntime.superConstructor=t,$traceurRuntime.superGet=o,$traceurRuntime.superSet=r}()},{}],97:[function(e,t,n){"use strict";function o(e){var t=this;this.eventManager=b(e),this.instance=e,this.settings=e.getSettings(),this.selectionMouseDown=!1;var n=e.rootElement.getAttribute("style");n&&e.rootElement.setAttribute("data-originalstyle",n),d(e.rootElement,"handsontable");var o=document.createElement("TABLE");d(o,"htCore"),e.getSettings().tableClassName&&d(o,e.getSettings().tableClassName),this.THEAD=document.createElement("THEAD"),o.appendChild(this.THEAD),this.TBODY=document.createElement("TBODY"),o.appendChild(this.TBODY),e.table=o,e.container.insertBefore(o,e.container.firstChild),this.eventManager.addEventListener(e.rootElement,"mousedown",function(e){this.selectionMouseDown=!0,t.isTextSelectionAllowed(e.target)||(i(),e.preventDefault(),window.focus())}),this.eventManager.addEventListener(e.rootElement,"mouseup",function(e){this.selectionMouseDown=!1}),this.eventManager.addEventListener(e.rootElement,"mousemove",function(e){this.selectionMouseDown&&!t.isTextSelectionAllowed(e.target)&&(i(),e.preventDefault())}),this.eventManager.addEventListener(document.documentElement,"keyup",function(t){e.selection.isInProgress()&&!t.shiftKey&&e.selection.finish()});var r;this.isMouseDown=function(){return r},this.eventManager.addEventListener(document.documentElement,"mouseup",function(t){e.selection.isInProgress()&&1===t.which&&e.selection.finish(),r=!1,y(document.activeElement)&&e.unlisten()}),this.eventManager.addEventListener(document.documentElement,"mousedown",function(n){var o=n.target,i=n.x||n.clientX,s=n.y||n.clientY;if(!r&&e.rootElement){if(o===e.view.wt.wtTable.holder){var a=g();if(document.elementFromPoint(i+a,s)!==e.view.wt.wtTable.holder||document.elementFromPoint(i,s+a)!==e.view.wt.wtTable.holder)return}else for(;o!==document.documentElement;){if(null===o){if(n.isTargetWebComponent)break;return}if(o===e.rootElement)return;o=o.parentNode}t.settings.outsideClickDeselects?e.deselectCell():e.destroyEditor()}}),this.eventManager.addEventListener(o,"selectstart",function(e){t.settings.fragmentSelection||w(e.target)||e.preventDefault()});var i=function(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty()},s=[new E({className:"current",border:{width:2,color:"#5292F7",cornerVisible:function(){return t.settings.fillHandle&&!t.isCellEdited()&&!e.selection.isMultiple()},multipleSelectionHandlesVisible:function(){return!t.isCellEdited()&&!e.selection.isMultiple()}}}),new E({className:"area",border:{width:1,color:"#89AFF9",cornerVisible:function(){return t.settings.fillHandle&&!t.isCellEdited()&&e.selection.isMultiple()},multipleSelectionHandlesVisible:function(){return!t.isCellEdited()&&e.selection.isMultiple()}}}),new E({className:"highlight",highlightRowClassName:t.settings.currentRowClassName,highlightColumnClassName:t.settings.currentColClassName}),new E({className:"fill",border:{width:1,color:"red"}})];s.current=s[0],s.area=s[1],s.highlight=s[2],s.fill=s[3];var a={debug:function(){return t.settings.debug},externalRowCalculator:this.instance.getPlugin("autoRowSize")&&this.instance.getPlugin("autoRowSize").isEnabled(),table:o,stretchH:this.settings.stretchH,data:e.getDataAtCell,totalRows:function(){return e.countRows()},totalColumns:function(){return e.countCols()},fixedColumnsLeft:function(){return t.settings.fixedColumnsLeft},fixedRowsTop:function(){return t.settings.fixedRowsTop},fixedRowsBottom:function(){return t.settings.fixedRowsBottom},minSpareRows:function(){return t.settings.minSpareRows},renderAllRows:t.settings.renderAllRows,rowHeaders:function(){var n=[];return e.hasRowHeaders()&&n.push(function(e,n){t.appendRowHeader(e,n)}),Handsontable.hooks.run(e,"afterGetRowHeaderRenderers",n),n},columnHeaders:function(){var n=[];return e.hasColHeaders()&&n.push(function(e,n){t.appendColHeader(e,n)}),Handsontable.hooks.run(e,"afterGetColumnHeaderRenderers",n),n},columnWidth:e.getColWidth,rowHeight:e.getRowHeight,cellRenderer:function(e,n,o){var r=t.instance.colToProp(n),i=t.instance.getCellMeta(e,n),s=t.instance.getCellRenderer(i),a=t.instance.getDataAtRowProp(e,r);s(t.instance,o,e,n,r,a,i),Handsontable.hooks.run(t.instance,"afterRenderer",o,e,n,r,a,i)},selections:s,hideBorderOnMouseDownOver:function(){return t.settings.fragmentSelection},onCellMouseDown:function(n,o,i,s){var a,l,u=i.parentNode,c=u.parentNode;if(e.listen(),t.activeWt=s,r=!0,Handsontable.hooks.run(e,"beforeOnCellMouseDown",n,o,i),e.selection.setSelectedHeaders(!1,!1),!_(n)){if(2===n.button&&e.selection.inInSelection(o));else n.shiftKey?o.row>=0&&o.col>=0&&e.selection.setRangeEnd(o):(o.row<0||o.col<0)&&(o.row>=0||o.col>=0)?(o.row<0&&(a=c.childNodes.length-Array.prototype.indexOf.call(c.childNodes,u)-1,l=e.getHeaderColspan(o.col,a),e.selection.setSelectedHeaders(!1,!0),e.selectCell(0,o.col,e.countRows()-1,o.col+Math.max(0,l-1))),o.col<0&&(e.selection.setSelectedHeaders(!0,!1),e.selectCell(o.row,0,o.row,e.countCols()-1))):(o.row=o.row<0?0:o.row,o.col=o.col<0?0:o.col,e.selection.setRangeStart(o));Handsontable.hooks.run(e,"afterOnCellMouseDown",n,o,i),t.activeWt=t.wt}},onCellMouseOver:function(n,o,i,s){t.activeWt=s,o.row>=0&&o.col>=0?r&&e.selection.setRangeEnd(o):r&&(o.row<0&&(e.selection.selectedHeader.cols?(e.selection.setRangeEnd(new S(e.countRows()-1,o.col)),e.selection.setSelectedHeaders(!1,!0)):e.selection.setRangeEnd(new S(o.row,o.col))),o.col<0&&(e.selection.selectedHeader.rows?(e.selection.setRangeEnd(new S(o.row,e.countCols()-1)),e.selection.setSelectedHeaders(!0,!1)):e.selection.setRangeEnd(new S(o.row,o.col)))),Handsontable.hooks.run(e,"afterOnCellMouseOver",n,o,i),t.activeWt=t.wt},onCellCornerMouseDown:function(t){t.preventDefault(),Handsontable.hooks.run(e,"afterOnCellCornerMouseDown",t)},beforeDraw:function(e){t.beforeRender(e)},onDraw:function(e){t.onDraw(e)},onScrollVertically:function(){e.runHooks("afterScrollVertically")},onScrollHorizontally:function(){e.runHooks("afterScrollHorizontally")},onBeforeDrawBorders:function(t,n){e.runHooks("beforeDrawBorders",t,n)},onBeforeTouchScroll:function(){e.runHooks("beforeTouchScroll")},onAfterMomentumScroll:function(){e.runHooks("afterMomentumScroll")},viewportRowCalculatorOverride:function(n){var o=e.countRows(),r=t.settings.viewportRowRenderingOffset;if("auto"===r&&t.settings.fixedRowsTop&&(r=10),"number"==typeof r&&(n.startRow=Math.max(n.startRow-r,0),n.endRow=Math.min(n.endRow+r,o-1)),"auto"===r){var i=n.startRow+n.endRow-n.startRow,s=Math.ceil(i/o*12);n.startRow=Math.max(n.startRow-s,0),n.endRow=Math.min(n.endRow+s,o-1)}e.runHooks("afterViewportRowCalculatorOverride",n)},viewportColumnCalculatorOverride:function(n){var o=e.countCols(),r=t.settings.viewportColumnRenderingOffset;if("auto"===r&&t.settings.fixedColumnsLeft&&(r=10),"number"==typeof r&&(n.startColumn=Math.max(n.startColumn-r,0),n.endColumn=Math.min(n.endColumn+r,o-1)),"auto"===r){var i=n.startColumn+n.endColumn-n.startColumn,s=Math.ceil(i/o*12);n.startRow=Math.max(n.startColumn-s,0),n.endColumn=Math.min(n.endColumn+s,o-1)}e.runHooks("afterViewportColumnCalculatorOverride",n)}};Handsontable.hooks.run(e,"beforeInitWalkontable",a),this.wt=new T(a),this.activeWt=this.wt,this.eventManager.addEventListener(t.wt.wtTable.spreader,"mousedown",function(e){e.target===t.wt.wtTable.spreader&&3===e.which&&R(e)}),this.eventManager.addEventListener(t.wt.wtTable.spreader,"contextmenu",function(e){e.target===t.wt.wtTable.spreader&&3===e.which&&R(e)}),this.eventManager.addEventListener(document.documentElement,"click",function(){t.settings.observeDOMVisibility&&t.wt.drawInterrupted&&(t.instance.forceFullRender=!0,t.render())})}Object.defineProperties(n,{TableView:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l,u,c=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),d=c.addClass,h=c.empty,f=c.fastInnerHTML,p=c.fastInnerText,g=c.getScrollbarWidth,m=c.hasClass,v=c.isChildOf,w=c.isInput,y=c.isOutsideInput,b=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,C=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),R=C.stopPropagation,_=C.isImmediatePropagationStopped,S=(a=e("3rdparty/walkontable/src/cell/coords"),a&&a.__esModule&&a||{"default":a}).WalkontableCellCoords,E=(l=e("3rdparty/walkontable/src/selection"),l&&l.__esModule&&l||{"default":l}).WalkontableSelection,T=(u=e("3rdparty/walkontable/src/core"),u&&u.__esModule&&u||{"default":u}).Walkontable;Handsontable.TableView=o,o.prototype.isTextSelectionAllowed=function(e){if(w(e))return!0;var t=v(e,this.instance.view.wt.wtTable.spreader);return this.settings.fragmentSelection===!0&&t?!0:"cell"===this.settings.fragmentSelection&&this.isSelectedOnlyCell()&&t?!0:!1},o.prototype.isSelectedOnlyCell=function(){var e=this.instance.getSelected()||[],t=e[0],n=e[1],o=e[2],r=e[3];return void 0!==t&&t===o&&n===r},o.prototype.isCellEdited=function(){var e=this.instance.getActiveEditor();return e&&e.isOpened()},o.prototype.beforeRender=function(e){e&&Handsontable.hooks.run(this.instance,"beforeRender",this.instance.forceFullRender)},o.prototype.onDraw=function(e){e&&Handsontable.hooks.run(this.instance,"afterRender",this.instance.forceFullRender)},o.prototype.render=function(){this.wt.draw(!this.instance.forceFullRender),this.instance.forceFullRender=!1,this.instance.renderCall=!1},o.prototype.getCellAtCoords=function(e,t){var n=this.wt.getCell(e,t);return 0>n?null:n},o.prototype.scrollViewport=function(e){this.wt.scrollViewport(e)},o.prototype.appendRowHeader=function(e,t){if(t.firstChild){var n=t.firstChild;if(!m(n,"relative"))return h(t),void this.appendRowHeader(e,t);this.updateCellHeader(n.querySelector(".rowHeader"),e,this.instance.getRowHeader)}else{var o=document.createElement("div"),r=document.createElement("span");o.className="relative",r.className="rowHeader",this.updateCellHeader(r,e,this.instance.getRowHeader),o.appendChild(r),t.appendChild(o)}Handsontable.hooks.run(this.instance,"afterGetRowHeader",e,t)},o.prototype.appendColHeader=function(e,t){if(t.firstChild){var n=t.firstChild;m(n,"relative")?this.updateCellHeader(n.querySelector(".colHeader"),e,this.instance.getColHeader):(h(t),this.appendColHeader(e,t))}else{var o=document.createElement("div"),r=document.createElement("span");o.className="relative",r.className="colHeader",this.updateCellHeader(r,e,this.instance.getColHeader),o.appendChild(r),t.appendChild(o)}Handsontable.hooks.run(this.instance,"afterGetColHeader",e,t)},o.prototype.updateCellHeader=function(e,t,n){t>-1?f(e,n(t)):(p(e,String.fromCharCode(160)),d(e,"cornerHeader"))},o.prototype.maximumVisibleElementWidth=function(e){var t=this.wt.wtViewport.getWorkspaceWidth(),n=t-e;return n>0?n:0},o.prototype.maximumVisibleElementHeight=function(e){var t=this.wt.wtViewport.getWorkspaceHeight(),n=t-e;return n>0?n:0},o.prototype.mainViewIsActive=function(){return this.wt===this.activeWt},o.prototype.destroy=function(){this.wt.destroy(),this.eventManager.destroy()}},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/core":7,"3rdparty/walkontable/src/selection":18,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46}],98:[function(e,t,n){"use strict";Object.defineProperties(n,{GhostTable:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s,a,l=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),u=l.addClass,c=l.outerHeight,d=l.outerWidth,h=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,f=((i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}).objectEach,(s=e("helpers/number"),s&&s.__esModule&&s||{"default":s}).rangeEach,(a=e("helpers/mixed"),a&&a.__esModule&&a||{"default":a}).stringify,function(e){this.hot=e,this.container=null,this.injected=!1,this.rows=[],this.columns=[],this.samples=null});$traceurRuntime.createClass(f,{addRow:function(e,t){if(this.columns.length)throw new Error("Doesn't support multi-dimensional table");this.rows.length||(this.container=this.createContainer(this.hot.rootElement.className));var n={row:e};this.rows.push(n),this.samples=t,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol()),this.table.tr.appendChild(this.createRow(e)),this.container.container.appendChild(this.table.fragment),n.table=this.table.table},addColumn:function(e,t){if(this.rows.length)throw new Error("Doesn't support multi-dimensional table");this.columns.length||(this.container=this.createContainer(this.hot.rootElement.className));var n={col:e};this.columns.push(n),this.samples=t,this.table=this.createTable(this.hot.table.className),null!==this.hot.getColHeader(e)&&this.hot.view.appendColHeader(e,this.table.th),this.table.tBody.appendChild(this.createCol(e)),this.container.container.appendChild(this.table.fragment),n.table=this.table.table},getHeights:function(e){this.injected||this.injectTable(),h(this.rows,function(t){e(t.row,c(t.table)-1)})},getWidths:function(e){this.injected||this.injectTable(),h(this.columns,function(t){e(t.col,d(t.table))})},createColGroupsCol:function(){var e=this,t=document,n=t.createDocumentFragment();return n.appendChild(this.createColElement(-1)),this.samples.forEach(function(t){h(t.strings,function(t){n.appendChild(e.createColElement(t.col))})}),n},createRow:function(e){var t=this,n=document,o=n.createDocumentFragment(),r=n.createElement("th");return null!==this.hot.getRowHeader(e)&&this.hot.view.appendRowHeader(e,r),o.appendChild(r),this.samples.forEach(function(r){h(r.strings,function(r){var i=r.col,s=t.hot.getCellMeta(e,i);s.col=i,s.row=e;var a=t.hot.getCellRenderer(s),l=n.createElement("td");a(t.hot,l,e,i,t.hot.colToProp(i),r.value,s),o.appendChild(l)})}),o},createCol:function(e){var t=this,n=document,o=n.createDocumentFragment();return this.samples.forEach(function(r){h(r.strings,function(r){var i=r.row,s=t.hot.getCellMeta(i,e);s.col=e,s.row=i;var a=t.hot.getCellRenderer(s),l=n.createElement("td"),u=n.createElement("tr");a(t.hot,l,i,e,t.hot.colToProp(i),r.value,s),u.appendChild(l),o.appendChild(u)})}),o},clean:function(){this.rows.length=0,this.columns.length=0,this.samples&&this.samples.clear(),this.samples=null,this.removeTable()},injectTable:function(){var e=void 0!==arguments[0]?arguments[0]:null;this.injected||((e||this.hot.rootElement).appendChild(this.container.fragment),this.injected=!0)},removeTable:function(){this.injected&&this.container.container.parentNode&&(this.container.container.parentNode.removeChild(this.container.container),this.container=null,this.injected=!1)},createColElement:function(e){var t=document,n=t.createElement("col");return n.style.width=this.hot.view.wt.wtTable.getStretchedColumnWidth(e)+"px",n},createTable:function(){var e=void 0!==arguments[0]?arguments[0]:"",t=document,n=t.createDocumentFragment(),o=t.createElement("table"),r=t.createElement("thead"),i=t.createElement("tbody"),s=t.createElement("colgroup"),a=t.createElement("tr"),l=t.createElement("th");return this.isVertical()&&o.appendChild(s),this.isHorizontal()&&(a.appendChild(l),r.appendChild(a),o.style.tableLayout="auto",o.style.width="auto"),o.appendChild(r),this.isVertical()&&i.appendChild(a),o.appendChild(i),u(o,e),n.appendChild(o),{fragment:n,table:o,tHead:r,tBody:i,colGroup:s,tr:a,th:l}},createContainer:function(){var e=void 0!==arguments[0]?arguments[0]:"",t=document,n=t.createDocumentFragment(),o=t.createElement("div");return e="htGhostTable htAutoSize "+e.trim(),u(o,e),n.appendChild(o),{fragment:n,container:o}},isVertical:function(){return this.rows.length&&!this.columns.length?!0:!1},isHorizontal:function(){return this.columns.length&&!this.rows.length?!0:!1}},{}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.GhostTable=f},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],99:[function(e,t,n){"use strict";var o;Object.defineProperties(n,{SamplesGenerator:{get:function(){return h}},__esModule:{value:!0}});var r,i,s,a,l,u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=(u.addClass,u.outerHeight,u.outerWidth,(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,(s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}).objectEach,(a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}).rangeEach),d=(l=e("helpers/mixed"),l&&l.__esModule&&l||{"default":l}).stringify,h=function(e){this.samples=null,this.dataFactory=e},f=h;$traceurRuntime.createClass(h,(o={},Object.defineProperty(o,"generateRowSamples",{value:function(e,t){return this.generateSamples("row",t,e)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateColumnSamples",{value:function(e,t){return this.generateSamples("col",t,e)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateSamples",{value:function(e,t,n){var o=this,r=new Map;return"number"==typeof n&&(n={from:n,to:n}),c(n.from,n.to,function(n){var i=o.generateSample(e,t,n);r.set(n,i)}),r},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateSample",{value:function(e,t,n){var o=this,r=new Map;return c(t.from,t.to,function(t){var i,s;if("row"===e)s=o.dataFactory(n,t);else{if("col"!==e)throw new Error("Unsupported sample type");s=o.dataFactory(t,n)}Array.isArray(s)||(s=d(s));var a=s.length;r.has(a)||r.set(a,{needed:f.SAMPLE_COUNT,strings:[]});var l=r.get(a);if(l.needed){var u="row"===e?"col":"row";l.strings.push((i={},Object.defineProperty(i,"value",{value:s,configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,u,{value:t,configurable:!0,enumerable:!0,writable:!0}),i)),l.needed--}}),r},configurable:!0,enumerable:!0,writable:!0}),o),{get SAMPLE_COUNT(){return 3}}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.SamplesGenerator=h},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],100:[function(e,t,n){"use strict";function o(e,t){var n=e,o="string"==typeof n?n.toLowerCase():null;return function(e){for(var r=!1,s=0,a=e.length;a>s;s++){if(n===e[s]){r=!0;break}if(o===i(e[s]).toLowerCase()){r=!0;break}}t(r)}}var r,i=(r=e("helpers/mixed"),r&&r.__esModule&&r||{"default":r}).stringify;Handsontable.AutocompleteValidator=function(e,t){this.strict&&this.source?"function"==typeof this.source?this.source(e,o(e,t)):o(e,t)(this.source):t(!0)}},{"helpers/mixed":48}],101:[function(e,t,n){"use strict";var o,r,i=(o=e("moment"),o&&o.__esModule&&o||{"default":o})["default"],s=(r=e("editors"),r&&r.__esModule&&r||{"default":r}).getEditor;Handsontable.DateValidator=function(e,t){var n=!0,o=s("date",this.instance);null===e&&(e="");var r=i(new Date(e)).isValid(),l=i(e,this.dateFormat||o.defaultDateFormat,!0).isValid();if(r||(n=!1),!r&&l&&(n=!0),r&&!l)if(this.correctFormat===!0){var u=a(e,this.dateFormat);this.instance.setDataAtCell(this.row,this.col,u,"dateValidator"),n=!0}else n=!1;t(n)};var a=function(e,t){var n=i(new Date(e)),o=n.format("YYYY"),r=i().format("YYYY");return o.substr(0,2)!==r.substr(0,2)?e.match(new RegExp(o))||n.year(o.replace(o.substr(0,2),r.substr(0,2))):o.length>4&&n.year((n.year()+"").substr(0,4)),n.format(t)}},{editors:29,moment:"moment"}],102:[function(e,t,n){"use strict";Handsontable.NumericValidator=function(e,t){null===e&&(e=""),t(/^-?\d*(\.|\,)?\d*$/.test(e))}},{}],SheetClip:[function(e,t,n){"use strict";!function(e){function t(e){return e.split('"').length-1}var o={parse:function(e){var n,o,r,i,s,a,l,u=[],c=0;for(r=e.split("\n"),r.length>1&&""===r[r.length-1]&&r.pop(),n=0,o=r.length;o>n;n+=1){for(r[n]=r[n].split(" "),i=0,s=r[n].length;s>i;i+=1)u[c]||(u[c]=[]),a&&0===i?(l=u[c].length-1,u[c][l]=u[c][l]+"\n"+r[n][0],a&&1&t(r[n][0])&&(a=!1,u[c][l]=u[c][l].substring(0,u[c][l].length-1).replace(/""/g,'"'))):i===s-1&&0===r[n][i].indexOf('"')&&1&t(r[n][i])?(u[c].push(r[n][i].substring(1).replace(/""/g,'"')),a=!0):(u[c].push(r[n][i].replace(/""/g,'"')),a=!1);a||(c+=1)}return u},stringify:function(e){var t,n,o,r,i,s="";for(t=0,n=e.length;n>t;t+=1){for(r=e[t].length,o=0;r>o;o+=1)o>0&&(s+=" "),i=e[t][o],s+="string"==typeof i?i.indexOf("\n")>-1?'"'+i.replace(/"/g,'""')+'"':i:null===i||void 0===i?"":i;s+="\n"}return s}};"undefined"!=typeof n?(n.parse=o.parse,n.stringify=o.stringify):e.SheetClip=o}(window)},{}],autoResize:[function(e,t,n){"use strict";function o(){var e,t={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300},n=document.body,o=document.createTextNode(""),r=document.createElement("SPAN"),i=function(e,t,n){window.attachEvent?e.attachEvent("on"+t,n):e.addEventListener(t,n,!1)},s=function(e,t,n){window.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)},a=function(i){var s,a;i?/^[a-zA-Z \.,\\\/\|0-9]$/.test(i)||(i="."):i="",void 0!==o.textContent?o.textContent=e.value+i:o.data=e.value+i,r.style.fontSize=Handsontable.Dom.getComputedStyle(e).fontSize,r.style.fontFamily=Handsontable.Dom.getComputedStyle(e).fontFamily,r.style.whiteSpace="pre",n.appendChild(r),s=r.clientWidth+2,n.removeChild(r),e.style.height=t.minHeight+"px",t.minWidth>s?e.style.width=t.minWidth+"px":s>t.maxWidth?e.style.width=t.maxWidth+"px":e.style.width=s+"px",a=e.scrollHeight?e.scrollHeight-1:0,t.minHeight>a?e.style.height=t.minHeight+"px":t.maxHeight-1||"true"===e.contentEditable}var n=this,o=!1;if(e.metaKey?o=!0:e.ctrlKey&&-1===navigator.userAgent.indexOf("Mac")&&(o=!0), -o){if(document.activeElement!==this.elTextarea&&(""!==this.getSelectionText()||t()))return;this.selectNodeText(this.elTextarea),setTimeout(function(){document.activeElement!==n.elTextarea&&n.selectNodeText(n.elTextarea)},0)}!o||67!==e.keyCode&&86!==e.keyCode&&88!==e.keyCode||(88===e.keyCode?setTimeout(function(){n.triggerCut(e)},0):86===e.keyCode&&setTimeout(function(){n.triggerPaste(e)},0))},r.prototype.selectNodeText=function(e){e&&e.select()},r.prototype.getSelectionText=function(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e},r.prototype.copyable=function(e){if("string"!=typeof e&&void 0===e.toString)throw new Error("copyable requires string parameter");this.elTextarea.value=e,this.selectNodeText(this.elTextarea)},r.prototype.onCut=function(e){this.cutCallbacks.push(e)},r.prototype.onPaste=function(e){this.pasteCallbacks.push(e)},r.prototype.removeCallback=function(e){var t,n;for(t=0,n=this.copyCallbacks.length;n>t;t++)if(this.copyCallbacks[t]===e)return this.copyCallbacks.splice(t,1),!0;for(t=0,n=this.cutCallbacks.length;n>t;t++)if(this.cutCallbacks[t]===e)return this.cutCallbacks.splice(t,1),!0;for(t=0,n=this.pasteCallbacks.length;n>t;t++)if(this.pasteCallbacks[t]===e)return this.pasteCallbacks.splice(t,1),!0;return!1},r.prototype.triggerCut=function(e){var t=this;t.cutCallbacks&&setTimeout(function(){for(var n=0,o=t.cutCallbacks.length;o>n;n++)t.cutCallbacks[n](e)},50)},r.prototype.triggerPaste=function(e,t){var n=this;n.pasteCallbacks&&setTimeout(function(){for(var o=t||n.elTextarea.value,r=0,i=n.pasteCallbacks.length;i>r;r++)n.pasteCallbacks[r](o,e)},50)},r.prototype.destroy=function(){this.hasBeenDestroyed()||0!==--this.refCounter||(this.elDiv&&this.elDiv.parentNode&&(this.elDiv.parentNode.removeChild(this.elDiv),this.elDiv=null,this.elTextarea=null),document.documentElement.removeEventListener("keydown",this.onKeyDownRef),this.onKeyDownRef=null)},r.prototype.hasBeenDestroyed=function(){return!this.refCounter}},{}],es6collections:[function(e,t,n){"use strict";!function(e){function t(e,t){function o(e){return this&&this.constructor===o?(this._keys=[],this._values=[],this._itp=[],this.objectOnly=t,void(e&&n.call(this,e))):new o(e)}return t||y(e,"size",{get:m}),e.constructor=o,o.prototype=e,o}function n(e){this.add?e.forEach(this.add,this):e.forEach(function(e){this.set(e[0],e[1])},this)}function o(e){return this.has(e)&&(this._keys.splice(w,1),this._values.splice(w,1),this._itp.forEach(function(e){w-1}function r(e){return this.has(e)?this._values[w]:void 0}function i(e,t){if(this.objectOnly&&t!==Object(t))throw new TypeError("Invalid value used as weak collection key");if(t!=t||0===t)for(w=e.length;w--&&!b(e[w],t););else w=e.indexOf(t);return w>-1}function s(e){return i.call(this,this._values,e)}function a(e){return i.call(this,this._keys,e)}function l(e,t){return this.has(e)?this._values[w]=t:this._values[this._keys.push(e)-1]=t,this}function u(e){return this.has(e)||this._values.push(e),this}function c(){this._values.length=0}function d(){return g(this._itp,this._keys)}function h(){return g(this._itp,this._values)}function f(){return g(this._itp,this._keys,this._values)}function p(){return g(this._itp,this._values,this._values)}function g(e,t,n){var o=[0],r=!1;return e.push(o),{next:function(){var i,s=o[0];return!r&&st;t++)if(w[t].obj===e)return w[t]}function i(e){for(var t=0,n=w.length;n>t;t++)w[t]===e&&w.splice(t,1)}function s(e,t){for(var n=0,o=e.observers.length;o>n;n++)if(e.observers[n].callback===t)return e.observers[n].observer}function a(e,t){for(var n=0,o=e.observers.length;o>n;n++)if(e.observers[n].observer===t)return e.observers.splice(n,1),void(e.observers.length||i(e))}function l(e,t){h(t),Object.observe?d(t,e):clearTimeout(t.next);var n=r(e);a(n,t)}function u(e,t){var n,i=[],a=e,l=r(e);if(l?n=s(l,t):(l=new y(e),w.push(l)),n)return n;if(Object.observe)n=function(r){d(n,e),c(n,e);for(var s=0,l=r.length;l>s;){if(("length"!==r[s].name||!R(r[s].object))&&"__Jasmine_been_here_before__"!==r[s].name){var u=r[s].type;switch(u){case"new":u="add";break;case"deleted":u="delete";break;case"updated":u="update"}v[u].call(r[s],i,o(a,r[s].object))}s++}i&&t&&t(i),n.patches=i,i=[]};else if(n={},l.value=JSON.parse(JSON.stringify(e)),t){n.callback=t,n.next=null;var u=this.intervals||[100,1e3,1e4,6e4],f=0,p=function(){h(n)},g=function(){clearTimeout(n.next),n.next=setTimeout(function(){p(),f=0,n.next=setTimeout(m,u[f++])},0)},m=function(){p(),f==u.length&&(f=u.length-1),n.next=setTimeout(m,u[f++])};"undefined"!=typeof window&&(window.addEventListener?(window.addEventListener("mousedown",g),window.addEventListener("mouseup",g),window.addEventListener("keydown",g)):(window.attachEvent("onmousedown",g),window.attachEvent("onmouseup",g),window.attachEvent("onkeydown",g))),n.next=setTimeout(m,u[f++])}return n.patches=i,n.object=e,l.observers.push(new b(t,n)),c(n,e)}function c(e,t){if(Object.observe){Object.observe(t,e);for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];o&&"object"==typeof o&&c(e,o)}}return e}function d(e,t){if(Object.observe){Object.unobserve(t,e);for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];o&&"object"==typeof o&&d(e,o)}}return e}function h(e){if(Object.observe)Object.deliverChangeRecords(e);else{for(var t,n=0,o=w.length;o>n;n++)if(w[n].obj===e.object){t=w[n];break}t&&f(t.value,e.object,e.patches,"")}var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function f(e,n,o,r){for(var i=C(n),s=C(e),a=!1,l=!1,u=s.length-1;u>=0;u--){var c=s[u],d=e[c];if(n.hasOwnProperty(c)){var h=n[c];d instanceof Object?f(d,h,o,r+"/"+t(c)):d!=h&&(a=!0,o.push({op:"replace",path:r+"/"+t(c),value:h}),e[c]=h)}else o.push({op:"remove",path:r+"/"+t(c)}),delete e[c],l=!0}if(l||i.length!=s.length)for(var u=0;ur;){n=t[r];for(var s=n.path.split("/"),a=e,l=1,u=s.length;;)if(R(a)){var c=parseInt(s[l],10);if(l++,l>=u){o=m[n.op].call(n,a,c,e);break}a=a[c]}else{var d=s[l];if(-1!=d.indexOf("~")&&(d=d.replace(/~1/g,"/").replace(/~0/g,"~")),l++,l>=u){o=g[n.op].call(n,a,d,e);break}a=a[d]}r++}return o}var g={add:function(e,t){return e[t]=this.value,!0},remove:function(e,t){return delete e[t],!0},replace:function(e,t){return e[t]=this.value,!0},move:function(e,t,n){var o={op:"_get",path:this.from};return p(n,[o]),p(n,[{op:"remove",path:this.from}]),p(n,[{op:"add",path:this.path,value:o.value}]),!0},copy:function(e,t,n){var o={op:"_get",path:this.from};return p(n,[o]),p(n,[{op:"add",path:this.path,value:o.value}]),!0},test:function(e,t){return JSON.stringify(e[t])===JSON.stringify(this.value)},_get:function(e,t){this.value=e[t]}},m={add:function(e,t){return e.splice(t,0,this.value),!0},remove:function(e,t){return e.splice(t,1),!0},replace:function(e,t){return e[t]=this.value,!0},move:g.move,copy:g.copy,test:g.test,_get:g._get},v={add:function(e,n){var o={op:"add",path:n+t(this.name),value:this.object[this.name]};e.push(o)},"delete":function(e,n){var o={op:"remove",path:n+t(this.name)};e.push(o)},update:function(e,n){var o={op:"replace",path:n+t(this.name),value:this.object[this.name]};e.push(o)}},w=[];e.intervals;var y=function(){function e(e){this.observers=[],this.obj=e}return e}(),b=function(){function e(e,t){this.callback=e,this.observer=t}return e}();e.unobserve=l,e.observe=u,e.generate=h;var C;C=Object.keys?Object.keys:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t};var R;R=Array.isArray?Array.isArray:function(e){return e.push&&"number"==typeof e.length},e.apply=p}(o||(o={})),"undefined"!=typeof n&&(n.apply=o.apply,n.observe=o.observe,n.unobserve=o.unobserve,n.generate=o.generate)},{}],moment:[function(t,n,o){ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Handsontable=e()}}(function(){var e;return function(e,t,n){return function o(e,t,n){function r(a,l){if(!t[a]){if(!e[a]){var u="function"==typeof require&&require;if(!l&&u)return u(a,!0);if(i)return i(a,!0);if(s[a]&&"undefined"!=typeof window[s[a]])return window[s[a]];var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var d=t[a]={exports:{}};e[a][0].call(d.exports,function(t){var n=e[a][1][t];return r(n?n:t)},d,d.exports,o,e,t,n)}return t[a].exports}for(var i="function"==typeof require&&require,s=JSON.parse('{"zeroclipboard":"ZeroClipboard","moment":"moment","pikaday":"Pikaday"}')||{},a=0;a1)for(t=1,o=arguments.length;o>t;t++)r.push(arguments[t]);if(l){if("undefined"==typeof l[e])throw new Error("Handsontable do not provide action: "+e);i=l[e].apply(l,r),"destroy"===e&&a.removeData()}return i}}(window,jQuery,Handsontable)},{}],2:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableBorder:{get:function(){return b}},__esModule:{value:!0}});var o,r,i,s,a,l=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),u=l.getComputedStyle,c=l.getTrimmingContainer,d=l.innerWidth,h=l.innerHeight,f=l.offset,p=l.outerHeight,g=l.outerWidth,m=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}).stopImmediatePropagation,w=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,v=(s=e("cell/coords"),s&&s.__esModule&&s||{"default":s}).WalkontableCellCoords,y=(a=e("overlay/_base.js"),a&&a.__esModule&&a||{"default":a}).WalkontableOverlay,b=function(e,t){t&&(this.eventManager=new w(e),this.instance=e,this.wot=e,this.settings=t,this.mouseDown=!1,this.main=null,this.top=null,this.left=null,this.bottom=null,this.right=null,this.topStyle=null,this.leftStyle=null,this.bottomStyle=null,this.rightStyle=null,this.cornerDefaultStyle={width:"5px",height:"5px",borderWidth:"2px",borderStyle:"solid",borderColor:"#FFF"},this.corner=null,this.cornerStyle=null,this.createBorders(t),this.registerListeners())};$traceurRuntime.createClass(b,{registerListeners:function(){var e=this;this.eventManager.addEventListener(document.body,"mousedown",function(){return e.onMouseDown()}),this.eventManager.addEventListener(document.body,"mouseup",function(){return e.onMouseUp()});for(var t=this,n=function(n,o){t.eventManager.addEventListener(t.main.childNodes[n],"mouseenter",function(t){return e.onMouseEnter(t,e.main.childNodes[n])})},o=0,r=this.main.childNodes.length;r>o;o++)n(o,r)},onMouseDown:function(){this.mouseDown=!0},onMouseUp:function(){this.mouseDown=!1},onMouseEnter:function(e,t){function n(e){return e.clientYMath.ceil(i.top+i.height)?!0:e.clientXMath.ceil(i.left+i.width)?!0:void 0}function o(e){n(e)&&(r.eventManager.removeEventListener(document.body,"mousemove",o),t.style.display="block")}if(this.mouseDown&&this.wot.getSetting("hideBorderOnMouseDownOver")){e.preventDefault(),m(e);var r=this,i=t.getBoundingClientRect();t.style.display="none",this.eventManager.addEventListener(document.body,"mousemove",o)}},createBorders:function(e){this.main=document.createElement("div");var t=["top","left","bottom","right","corner"],n=this.main.style;n.position="absolute",n.top=0,n.left=0;for(var o=0;5>o;o++){var r=t[o],i=document.createElement("div");i.className="wtBorder "+(this.settings.className||""),this.settings[r]&&this.settings[r].hide&&(i.className+=" hidden"),n=i.style,n.backgroundColor=this.settings[r]&&this.settings[r].color?this.settings[r].color:e.border.color,n.height=this.settings[r]&&this.settings[r].width?this.settings[r].width+"px":e.border.width+"px",n.width=this.settings[r]&&this.settings[r].width?this.settings[r].width+"px":e.border.width+"px",this.main.appendChild(i)}this.top=this.main.childNodes[0],this.left=this.main.childNodes[1],this.bottom=this.main.childNodes[2],this.right=this.main.childNodes[3],this.topStyle=this.top.style,this.leftStyle=this.left.style,this.bottomStyle=this.bottom.style,this.rightStyle=this.right.style,this.corner=this.main.childNodes[4],this.corner.className+=" corner",this.cornerStyle=this.corner.style,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.height=this.cornerDefaultStyle.height,this.cornerStyle.border=[this.cornerDefaultStyle.borderWidth,this.cornerDefaultStyle.borderStyle,this.cornerDefaultStyle.borderColor].join(" "),Handsontable.mobileBrowser&&this.createMultipleSelectorHandles(),this.disappear(),this.wot.wtTable.bordersHolder||(this.wot.wtTable.bordersHolder=document.createElement("div"),this.wot.wtTable.bordersHolder.className="htBorders",this.wot.wtTable.spreader.appendChild(this.wot.wtTable.bordersHolder)),this.wot.wtTable.bordersHolder.insertBefore(this.main,this.wot.wtTable.bordersHolder.firstChild)},createMultipleSelectorHandles:function(){this.selectionHandles={topLeft:document.createElement("DIV"),topLeftHitArea:document.createElement("DIV"),bottomRight:document.createElement("DIV"),bottomRightHitArea:document.createElement("DIV")};var e=10,t=40;this.selectionHandles.topLeft.className="topLeftSelectionHandle",this.selectionHandles.topLeftHitArea.className="topLeftSelectionHandle-HitArea",this.selectionHandles.bottomRight.className="bottomRightSelectionHandle",this.selectionHandles.bottomRightHitArea.className="bottomRightSelectionHandle-HitArea",this.selectionHandles.styles={topLeft:this.selectionHandles.topLeft.style,topLeftHitArea:this.selectionHandles.topLeftHitArea.style,bottomRight:this.selectionHandles.bottomRight.style,bottomRightHitArea:this.selectionHandles.bottomRightHitArea.style};var n={position:"absolute",height:t+"px",width:t+"px","border-radius":parseInt(t/1.5,10)+"px"};for(var o in n)n.hasOwnProperty(o)&&(this.selectionHandles.styles.bottomRightHitArea[o]=n[o],this.selectionHandles.styles.topLeftHitArea[o]=n[o]);var r={position:"absolute",height:e+"px",width:e+"px","border-radius":parseInt(e/1.5,10)+"px",background:"#F5F5FF",border:"1px solid #4285c8"};for(var i in r)r.hasOwnProperty(i)&&(this.selectionHandles.styles.bottomRight[i]=r[i],this.selectionHandles.styles.topLeft[i]=r[i]);this.main.appendChild(this.selectionHandles.topLeft),this.main.appendChild(this.selectionHandles.bottomRight),this.main.appendChild(this.selectionHandles.topLeftHitArea),this.main.appendChild(this.selectionHandles.bottomRightHitArea)},isPartRange:function(e,t){return!this.wot.selections.area.cellRange||e==this.wot.selections.area.cellRange.to.row&&t==this.wot.selections.area.cellRange.to.col?!1:!0},updateMultipleSelectionHandlesPosition:function(e,t,n,o,r,i){var s=parseInt(this.selectionHandles.styles.topLeft.width,10),a=parseInt(this.selectionHandles.styles.topLeftHitArea.width,10);this.selectionHandles.styles.topLeft.top=parseInt(n-s,10)+"px",this.selectionHandles.styles.topLeft.left=parseInt(o-s,10)+"px",this.selectionHandles.styles.topLeftHitArea.top=parseInt(n-a/4*3,10)+"px",this.selectionHandles.styles.topLeftHitArea.left=parseInt(o-a/4*3,10)+"px",this.selectionHandles.styles.bottomRight.top=parseInt(n+i,10)+"px",this.selectionHandles.styles.bottomRight.left=parseInt(o+r,10)+"px",this.selectionHandles.styles.bottomRightHitArea.top=parseInt(n+i-a/4,10)+"px",this.selectionHandles.styles.bottomRightHitArea.left=parseInt(o+r-a/4,10)+"px",this.settings.border.multipleSelectionHandlesVisible&&this.settings.border.multipleSelectionHandlesVisible()?(this.selectionHandles.styles.topLeft.display="block",this.selectionHandles.styles.topLeftHitArea.display="block",this.isPartRange(e,t)?(this.selectionHandles.styles.bottomRight.display="none",this.selectionHandles.styles.bottomRightHitArea.display="none"):(this.selectionHandles.styles.bottomRight.display="block",this.selectionHandles.styles.bottomRightHitArea.display="block")):(this.selectionHandles.styles.topLeft.display="none",this.selectionHandles.styles.bottomRight.display="none",this.selectionHandles.styles.topLeftHitArea.display="none",this.selectionHandles.styles.bottomRightHitArea.display="none"),e==this.wot.wtSettings.getSetting("fixedRowsTop")||t==this.wot.wtSettings.getSetting("fixedColumnsLeft")?(this.selectionHandles.styles.topLeft.zIndex="9999",this.selectionHandles.styles.topLeftHitArea.zIndex="9999"):(this.selectionHandles.styles.topLeft.zIndex="",this.selectionHandles.styles.topLeftHitArea.zIndex="")},appear:function(e){if(!this.disabled){var t,n,o,r,i,s,a,l,m,w,b,C,R,_,S,E,T,O,M;M=y.isOverlayTypeOf(this.wot.cloneOverlay,y.CLONE_TOP)||y.isOverlayTypeOf(this.wot.cloneOverlay,y.CLONE_TOP_LEFT_CORNER)?this.wot.getSetting("fixedRowsTop"):y.isOverlayTypeOf(this.wot.cloneOverlay,y.CLONE_BOTTOM)||y.isOverlayTypeOf(this.wot.cloneOverlay,y.CLONE_BOTTOM_LEFT_CORNER)?this.wot.getSetting("fixedRowsBottom"):this.wot.wtTable.getRenderedRowsCount();for(var k=0;M>k;k++){var H=this.wot.wtTable.rowFilter.renderedToSource(k);if(H>=e[0]&&H<=e[2]){R=H;break}}for(var D=M-1;D>=0;D--){var x=this.wot.wtTable.rowFilter.renderedToSource(D);if(x>=e[0]&&x<=e[2]){S=x;break}}M=this.wot.wtTable.getRenderedColumnsCount();for(var A=0;M>A;A++){var P=this.wot.wtTable.columnFilter.renderedToSource(A);if(P>=e[1]&&P<=e[3]){_=P;break}}for(var N=M-1;N>=0;N--){var L=this.wot.wtTable.columnFilter.renderedToSource(N);if(L>=e[1]&&L<=e[3]){E=L;break}}if(void 0===R||void 0===_)return void this.disappear();t=R!==S||_!==E,n=this.wot.wtTable.getCell(new v(R,_)),o=t?this.wot.wtTable.getCell(new v(S,E)):n,r=f(n),i=t?f(o):r,s=f(this.wot.wtTable.TABLE),l=r.top,b=i.top+p(o)-l,w=r.left,C=i.left+g(o)-w,a=l-s.top-1,m=w-s.left-1;var W=u(n);parseInt(W.borderTopWidth,10)>0&&(a+=1,b=b>0?b-1:0),parseInt(W.borderLeftWidth,10)>0&&(m+=1,C=C>0?C-1:0),this.topStyle.top=a+"px",this.topStyle.left=m+"px",this.topStyle.width=C+"px",this.topStyle.display="block",this.leftStyle.top=a+"px",this.leftStyle.left=m+"px",this.leftStyle.height=b+"px",this.leftStyle.display="block";var I=Math.floor(this.settings.border.width/2);this.bottomStyle.top=a+b-I+"px",this.bottomStyle.left=m+"px",this.bottomStyle.width=C+"px",this.bottomStyle.display="block",this.rightStyle.top=a+"px",this.rightStyle.left=m+C-I+"px",this.rightStyle.height=b+1+"px",this.rightStyle.display="block",Handsontable.mobileBrowser||!this.hasSetting(this.settings.border.cornerVisible)||this.isPartRange(S,E)?this.cornerStyle.display="none":(this.cornerStyle.top=a+b-4+"px",this.cornerStyle.left=m+C-4+"px",this.cornerStyle.borderRightWidth=this.cornerDefaultStyle.borderWidth,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.display="block",T=c(this.wot.wtTable.TABLE),E===this.wot.getSetting("totalColumns")-1&&(O=o.offsetLeft+g(o)>=d(T),O&&(this.cornerStyle.left=Math.floor(m+C-3-parseInt(this.cornerDefaultStyle.width)/2)+"px",this.cornerStyle.borderRightWidth=0)),S===this.wot.getSetting("totalRows")-1&&(O=o.offsetTop+p(o)>=h(T),O&&(this.cornerStyle.top=Math.floor(a+b-3-parseInt(this.cornerDefaultStyle.height)/2)+"px",this.cornerStyle.borderBottomWidth=0))),Handsontable.mobileBrowser&&this.updateMultipleSelectionHandlesPosition(R,_,a,m,C,b)}},disappear:function(){this.topStyle.display="none",this.leftStyle.display="none",this.bottomStyle.display="none",this.rightStyle.display="none",this.cornerStyle.display="none",Handsontable.mobileBrowser&&(this.selectionHandles.styles.topLeft.display="none",this.selectionHandles.styles.bottomRight.display="none")},hasSetting:function(e){return"function"==typeof e?e():!!e}},{}),window.WalkontableBorder=b},{"cell/coords":5,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"overlay/_base.js":11}],3:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableViewportColumnsCalculator:{get:function(){return r}},__esModule:{value:!0}});var o=new WeakMap,r=function(e,t,n,r,i,s,a){o.set(this,{viewportWidth:e,scrollOffset:t,totalColumns:n,columnWidthFn:r,overrideFn:i,onlyFullyVisible:s}),this.count=0,this.startColumn=null,this.endColumn=null,this.startPosition=null,this.stretchAllRatio=0,this.stretchLastWidth=0,this.stretch=a,this.totalTargetWidth=0,this.needVerifyLastColumnWidth=!0,this.stretchAllColumnsWidth=[],this.calculate()},i=r;$traceurRuntime.createClass(r,{calculate:function(){for(var e,t=0,n=!0,r=[],i=o.get(this),s=i.onlyFullyVisible,a=i.overrideFn,l=i.scrollOffset,u=i.totalColumns,c=i.viewportWidth,d=0;u>d;d++)if(e=this._getColumnWidth(d),l>=t&&!s&&(this.startColumn=d),t>=l&&l+c>=t+e&&(null==this.startColumn&&(this.startColumn=d),this.endColumn=d),r.push(t),t+=e,s||(this.endColumn=d),t>=l+c){n=!1;break}if(this.endColumn===u-1&&n)for(this.startColumn=this.endColumn;this.startColumn>0;){var h=r[this.endColumn]+e-r[this.startColumn-1];if((c>=h||!s)&&this.startColumn--,h>c)break}null!==this.startColumn&&a&&a(this),this.startPosition=r[this.startColumn],void 0==this.startPosition&&(this.startPosition=null),null!==this.startColumn&&(this.count=this.endColumn-this.startColumn+1)},refreshStretching:function(e){if("none"!==this.stretch){for(var t,n,r=0,i=o.get(this),s=i.totalColumns,a=0;s>a;a++)t=this._getColumnWidth(a),r+=t;if(this.totalTargetWidth=e,n=r-e,"all"===this.stretch&&0>n)this.stretchAllRatio=e/r,this.stretchAllColumnsWidth=[],this.needVerifyLastColumnWidth=!0;else if("last"===this.stretch&&e!==1/0){var l=this._getColumnWidth(s-1),u=-n+l;this.stretchLastWidth=u>=0?u:l}}},getStretchedColumnWidth:function(e,t){var n=null;return"all"===this.stretch&&0!==this.stretchAllRatio?n=this._getStretchedAllColumnWidth(e,t):"last"===this.stretch&&0!==this.stretchLastWidth&&(n=this._getStretchedLastColumnWidth(e)),n},_getStretchedAllColumnWidth:function(e,t){var n=0,r=o.get(this),i=r.totalColumns;if(this.stretchAllColumnsWidth[e]||(this.stretchAllColumnsWidth[e]=Math.round(t*this.stretchAllRatio)),this.stretchAllColumnsWidth.length===i&&this.needVerifyLastColumnWidth){this.needVerifyLastColumnWidth=!1;for(var s=0;sf;f++){var p=l(f);if(void 0===p&&(p=i.DEFAULT_HEIGHT),u>=e&&!s&&(this.startRow=f),e>=u&&u+d-h>=e+p&&(null===this.startRow&&(this.startRow=f),this.endRow=f),n.push(e),e+=p,s||(this.endRow=f),e>=u+d-h){t=!1;break}}if(this.endRow===c-1&&t)for(this.startRow=this.endRow;this.startRow>0;){var g=n[this.endRow]+p-n[this.startRow-1];if((d-h>=g||!s)&&this.startRow--,g>=d-h)break}null!==this.startRow&&a&&a(this),this.startPosition=n[this.startRow],void 0==this.startPosition&&(this.startPosition=null),null!==this.startRow&&(this.count=this.endRow-this.startRow+1)}},{get DEFAULT_HEIGHT(){return 23}}),window.WalkontableViewportRowsCalculator=r},{}],5:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableCellCoords:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t){"undefined"!=typeof e&&"undefined"!=typeof t?(this.row=e,this.col=t):(this.row=null,this.col=null)};$traceurRuntime.createClass(o,{isValid:function(e){return this.row<0||this.col<0?!1:this.row>=e.getSetting("totalRows")||this.col>=e.getSetting("totalColumns")?!1:!0},isEqual:function(e){return e===this?!0:this.row===e.row&&this.col===e.col},isSouthEastOf:function(e){return this.row>=e.row&&this.col>=e.col},isNorthWestOf:function(e){return this.row<=e.row&&this.col<=e.col},isSouthWestOf:function(e){return this.row>=e.row&&this.col<=e.col},isNorthEastOf:function(e){return this.row<=e.row&&this.col>=e.col}},{}),window.WalkontableCellCoords=o},{}],6:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableCellRange:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("cell/coords"),o&&o.__esModule&&o||{"default":o}).WalkontableCellCoords,i=function(e,t,n){this.highlight=e,this.from=t,this.to=n},s=i;$traceurRuntime.createClass(i,{isValid:function(e){return this.from.isValid(e)&&this.to.isValid(e)},isSingle:function(){return this.from.row===this.to.row&&this.from.col===this.to.col},getHeight:function(){return Math.max(this.from.row,this.to.row)-Math.min(this.from.row,this.to.row)+1},getWidth:function(){return Math.max(this.from.col,this.to.col)-Math.min(this.from.col,this.to.col)+1},includes:function(e){var t=this.getTopLeftCorner(),n=this.getBottomRightCorner();return e.row<0&&(e.row=0),e.col<0&&(e.col=0),t.row<=e.row&&n.row>=e.row&&t.col<=e.col&&n.col>=e.col},includesRange:function(e){return this.includes(e.getTopLeftCorner())&&this.includes(e.getBottomRightCorner())},isEqual:function(e){return Math.min(this.from.row,this.to.row)==Math.min(e.from.row,e.to.row)&&Math.max(this.from.row,this.to.row)==Math.max(e.from.row,e.to.row)&&Math.min(this.from.col,this.to.col)==Math.min(e.from.col,e.to.col)&&Math.max(this.from.col,this.to.col)==Math.max(e.from.col,e.to.col)},overlaps:function(e){return e.isSouthEastOf(this.getTopLeftCorner())&&e.isNorthWestOf(this.getBottomRightCorner())},isSouthEastOf:function(e){return this.getTopLeftCorner().isSouthEastOf(e)||this.getBottomRightCorner().isSouthEastOf(e)},isNorthWestOf:function(e){return this.getTopLeftCorner().isNorthWestOf(e)||this.getBottomRightCorner().isNorthWestOf(e)},expand:function(e){var t=this.getTopLeftCorner(),n=this.getBottomRightCorner();return e.rown.row||e.col>n.col?(this.from=new r(Math.min(t.row,e.row),Math.min(t.col,e.col)),this.to=new r(Math.max(n.row,e.row),Math.max(n.col,e.col)),!0):!1},expandByRange:function(e){if(this.includesRange(e)||!this.overlaps(e))return!1;var t=this.getTopLeftCorner(),n=this.getBottomRightCorner(),o=(this.getTopRightCorner(),this.getBottomLeftCorner(),e.getTopLeftCorner()),i=e.getBottomRightCorner(),a=Math.min(t.row,o.row),l=Math.min(t.col,o.col),u=Math.max(n.row,i.row),c=Math.max(n.col,i.col),d=new r(a,l),h=new r(u,c),f=new s(d,d,h).isCorner(this.from,e),p=e.isEqual(new s(d,d,h));return f&&!p&&(this.from.col>d.col&&(d.col=c,h.col=l),this.from.row>d.row&&(d.row=u,h.row=a)),this.from=d,this.to=h,!0},getDirection:function(){return this.from.isNorthWestOf(this.to)?"NW-SE":this.from.isNorthEastOf(this.to)?"NE-SW":this.from.isSouthEastOf(this.to)?"SE-NW":this.from.isSouthWestOf(this.to)?"SW-NE":void 0},setDirection:function(e){switch(e){case"NW-SE":this.from=this.getTopLeftCorner(),this.to=this.getBottomRightCorner();break;case"NE-SW":this.from=this.getTopRightCorner(),this.to=this.getBottomLeftCorner();break;case"SE-NW":this.from=this.getBottomRightCorner(),this.to=this.getTopLeftCorner();break;case"SW-NE":this.from=this.getBottomLeftCorner(),this.to=this.getTopRightCorner()}},getTopLeftCorner:function(){return new r(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))},getBottomRightCorner:function(){return new r(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))},getTopRightCorner:function(){return new r(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))},getBottomLeftCorner:function(){return new r(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))},isCorner:function(e,t){return t&&t.includes(e)&&(this.getTopLeftCorner().isEqual(new r(t.from.row,t.from.col))||this.getTopRightCorner().isEqual(new r(t.from.row,t.to.col))||this.getBottomLeftCorner().isEqual(new r(t.to.row,t.from.col))||this.getBottomRightCorner().isEqual(new r(t.to.row,t.to.col)))?!0:e.isEqual(this.getTopLeftCorner())||e.isEqual(this.getTopRightCorner())||e.isEqual(this.getBottomLeftCorner())||e.isEqual(this.getBottomRightCorner())},getOppositeCorner:function(e,t){if(!(e instanceof r))return!1;if(t&&t.includes(e)){if(this.getTopLeftCorner().isEqual(new r(t.from.row,t.from.col)))return this.getBottomRightCorner();if(this.getTopRightCorner().isEqual(new r(t.from.row,t.to.col)))return this.getBottomLeftCorner();if(this.getBottomLeftCorner().isEqual(new r(t.to.row,t.from.col)))return this.getTopRightCorner();if(this.getBottomRightCorner().isEqual(new r(t.to.row,t.to.col)))return this.getTopLeftCorner()}return e.isEqual(this.getBottomRightCorner())?this.getTopLeftCorner():e.isEqual(this.getTopLeftCorner())?this.getBottomRightCorner():e.isEqual(this.getTopRightCorner())?this.getBottomLeftCorner():e.isEqual(this.getBottomLeftCorner())?this.getTopRightCorner():void 0},getBordersSharedWith:function(e){if(!this.includesRange(e))return[];var t={top:Math.min(this.from.row,this.to.row),bottom:Math.max(this.from.row,this.to.row),left:Math.min(this.from.col,this.to.col),right:Math.max(this.from.col,this.to.col)},n={top:Math.min(e.from.row,e.to.row),bottom:Math.max(e.from.row,e.to.row),left:Math.min(e.from.col,e.to.col),right:Math.max(e.from.col,e.to.col)},o=[];return t.top==n.top&&o.push("top"),t.right==n.right&&o.push("right"),t.bottom==n.bottom&&o.push("bottom"),t.left==n.left&&o.push("left"),o},getInner:function(){for(var e=this.getTopLeftCorner(),t=this.getBottomRightCorner(),n=[],o=e.row;o<=t.row;o++)for(var i=e.col;i<=t.col;i++)this.from.row===o&&this.from.col===i||this.to.row===o&&this.to.col===i||n.push(new r(o,i));return n},getAll:function(){for(var e=this.getTopLeftCorner(),t=this.getBottomRightCorner(),n=[],o=e.row;o<=t.row;o++)for(var i=e.col;i<=t.col;i++)e.row===o&&e.col===i?n.push(e):t.row===o&&t.col===i?n.push(t):n.push(new r(o,i));return n},forAll:function(e){for(var t=this.getTopLeftCorner(),n=this.getBottomRightCorner(),o=t.row;o<=n.row;o++)for(var r=t.col;r<=n.col;r++){var i=e(o,r);if(i===!1)return}}},{}),window.WalkontableCellRange=i},{"cell/coords":5}],7:[function(e,t,n){"use strict";Object.defineProperties(n,{Walkontable:{get:function(){return x}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c,d,h,f,p,g,m,w=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),v=w.addClass,y=w.fastInnerText,b=w.isVisible,C=w.removeClass,R=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).objectEach,_=(i=e("helpers/string"),i&&i.__esModule&&i||{"default":i}),S=_.toUpperCaseFirst,E=_.randomString,T=(s=e("event"),s&&s.__esModule&&s||{"default":s}).WalkontableEvent,O=(a=e("overlays"),a&&a.__esModule&&a||{"default":a}).WalkontableOverlays,M=(l=e("scroll"),l&&l.__esModule&&l||{"default":l}).WalkontableScroll,k=(u=e("settings"),u&&u.__esModule&&u||{"default":u}).WalkontableSettings,H=(c=e("table"),c&&c.__esModule&&c||{"default":c}).WalkontableTable,D=(d=e("viewport"),d&&d.__esModule&&d||{"default":d}).WalkontableViewport,x=((h=e("overlay/_base.js"),h&&h.__esModule&&h||{"default":h}).WalkontableOverlay,(f=e("overlay/top.js"),f&&f.__esModule&&f||{"default":f}).WalkontableTopOverlay,(p=e("overlay/left.js"),p&&p.__esModule&&p||{"default":p}).WalkontableLeftOverlay,(g=e("overlay/debug.js"),g&&g.__esModule&&g||{"default":g}).WalkontableDebugOverlay,(m=e("overlay/topLeftCorner.js"),m&&m.__esModule&&m||{"default":m}).WalkontableTopLeftCornerOverlay,function(e){var t=[];if(this.guid="wt_"+E(),e.cloneSource?(this.cloneSource=e.cloneSource,this.cloneOverlay=e.cloneOverlay,this.wtSettings=e.cloneSource.wtSettings,this.wtTable=new H(this,e.table,e.wtRootElement),this.wtScroll=new M(this),this.wtViewport=e.cloneSource.wtViewport,this.wtEvent=new T(this),this.selections=this.cloneSource.selections):(this.wtSettings=new k(this,e),this.wtTable=new H(this,e.table),this.wtScroll=new M(this),this.wtViewport=new D(this),this.wtEvent=new T(this),this.selections=this.getSetting("selections"),this.wtOverlays=new O(this),this.exportSettingsAsClassNames()),this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(var n=0,o=this.wtTable.THEAD.childNodes[0].childNodes.length;o>n;n++)t.push(this.wtTable.THEAD.childNodes[0].childNodes[n].innerHTML);this.getSetting("columnHeaders").length||this.update("columnHeaders",[function(e,n){y(n,t[e])}])}this.drawn=!1,this.drawInterrupted=!1});$traceurRuntime.createClass(x,{draw:function(){var e=void 0!==arguments[0]?arguments[0]:!1;return this.drawInterrupted=!1,e||b(this.wtTable.TABLE)?this.wtTable.draw(e):this.drawInterrupted=!0,this},getCell:function(e){var t=void 0!==arguments[1]?arguments[1]:!1;if(!t)return this.wtTable.getCell(e);var n=this.wtSettings.getSetting("totalRows"),o=this.wtSettings.getSetting("fixedRowsTop"),r=this.wtSettings.getSetting("fixedRowsBottom"),i=this.wtSettings.getSetting("fixedColumnsLeft");if(e.row=n-r){if(this.wtOverlays.bottomLeftCornerOverlay.clone)return this.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell(e)}else{if(e.coln-r&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)},update:function(e,t){return this.wtSettings.update(e,t)},scrollVertical:function(e){return this.wtOverlays.topOverlay.scrollTo(e),this.getSetting("onScrollVertically"),this},scrollHorizontal:function(e){return this.wtOverlays.leftOverlay.scrollTo(e),this.getSetting("onScrollHorizontally"),this},scrollViewport:function(e){return this.wtScroll.scrollViewport(e),this},getViewport:function(){return[this.wtTable.getFirstVisibleRow(),this.wtTable.getFirstVisibleColumn(),this.wtTable.getLastVisibleRow(),this.wtTable.getLastVisibleColumn()]},getOverlayName:function(){return this.cloneOverlay?this.cloneOverlay.type:"master"},exportSettingsAsClassNames:function(){var e=this,t={rowHeaders:["array"],columnHeaders:["array"]},n=[],o=[];R(t,function(t,r){t.indexOf("array")>-1&&e.getSetting(r).length&&o.push("ht"+S(r)),n.push("ht"+S(r))}),C(this.wtTable.wtRootElement.parentNode,n),v(this.wtTable.wtRootElement.parentNode,o)},getSetting:function(e,t,n,o,r){return this.wtSettings.getSetting(e,t,n,o,r)},hasSetting:function(e){return this.wtSettings.has(e)},destroy:function(){this.wtOverlays.destroy(),this.wtEvent.destroy()}},{}),window.Walkontable=x},{event:8,"helpers/dom/element":45,"helpers/object":50,"helpers/string":52,"overlay/_base.js":11,"overlay/debug.js":12,"overlay/left.js":13,"overlay/top.js":14,"overlay/topLeftCorner.js":15,overlays:16,scroll:17,settings:19,table:20,viewport:22}],8:[function(e,t,n){"use strict";function o(e){var t=this,n=c(e);this.instance=e;var o=[null,null];this.dblClickTimeout=[null,null];var r,i=function(e){var n=t.parentCell(e.realTarget);l(e.realTarget,"corner")?t.instance.getSetting("onCellCornerMouseDown",e,e.realTarget):n.TD&&t.instance.hasSetting("onCellMouseDown")&&t.instance.getSetting("onCellMouseDown",e,n.coords,n.TD,t.instance),2!==e.button&&n.TD&&(o[0]=n.TD,clearTimeout(t.dblClickTimeout[0]),t.dblClickTimeout[0]=setTimeout(function(){o[0]=null},1e3))},s=function(e){t.instance.touchMoving=!0},d=function(e){n.addEventListener(this,"touchmove",s),t.checkIfTouchMove=setTimeout(function(){return t.instance.touchMoving===!0?(t.instance.touchMoving=void 0,void n.removeEventListener("touchmove",s,!1)):void i(e)},30)},h=function(e){var n,o,r;t.instance.hasSetting("onCellMouseOver")&&(n=t.instance.wtTable.TABLE,o=a(e.realTarget,["TD","TH"],n),r=t.instance.cloneSource||t.instance,o&&o!==r.lastMouseOver&&u(o,n)&&(r.lastMouseOver=o,t.instance.getSetting("onCellMouseOver",e,t.instance.wtTable.getCoords(o),o,t.instance)))},f=function(e){if(2!==e.button){var n=t.parentCell(e.realTarget);n.TD===o[0]&&n.TD===o[1]?(l(e.realTarget,"corner")?t.instance.getSetting("onCellCornerDblClick",e,n.coords,n.TD,t.instance):t.instance.getSetting("onCellDblClick",e,n.coords,n.TD,t.instance),o[0]=null,o[1]=null):n.TD===o[0]&&(o[1]=n.TD,clearTimeout(t.dblClickTimeout[1]),t.dblClickTimeout[1]=setTimeout(function(){o[1]=null},500))}},p=function(e){clearTimeout(r),e.preventDefault(),f(e)};if(n.addEventListener(this.instance.wtTable.holder,"mousedown",i),n.addEventListener(this.instance.wtTable.TABLE,"mouseover",h),n.addEventListener(this.instance.wtTable.holder,"mouseup",f),this.instance.wtTable.holder.parentNode.parentNode&&Handsontable.mobileBrowser&&!t.instance.wtTable.isWorkingOnClone()){var g="."+this.instance.wtTable.holder.parentNode.className.split(" ").join(".");n.addEventListener(this.instance.wtTable.holder,"touchstart",function(e){t.instance.touchApplied=!0,u(e.target,g)&&d.call(e.target,e)}),n.addEventListener(this.instance.wtTable.holder,"touchend",function(e){t.instance.touchApplied=!1,u(e.target,g)&&p.call(e.target,e)}),t.instance.momentumScrolling||(t.instance.momentumScrolling={}),n.addEventListener(this.instance.wtTable.holder,"scroll",function(e){clearTimeout(t.instance.momentumScrolling._timeout),t.instance.momentumScrolling.ongoing||t.instance.getSetting("onBeforeTouchScroll"),t.instance.momentumScrolling.ongoing=!0,t.instance.momentumScrolling._timeout=setTimeout(function(){t.instance.touchApplied||(t.instance.momentumScrolling.ongoing=!1,t.instance.getSetting("onAfterMomentumScroll"))},200)})}n.addEventListener(window,"resize",function(){"none"!==t.instance.getSetting("stretchH")&&t.instance.draw()}),this.destroy=function(){clearTimeout(this.dblClickTimeout[0]),clearTimeout(this.dblClickTimeout[1]),n.destroy()}}Object.defineProperties(n,{WalkontableEvent:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),a=s.closest,l=s.hasClass,u=s.isChildOf,c=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager;o.prototype.parentCell=function(e){var t={},n=this.instance.wtTable.TABLE,o=a(e,["TD","TH"],n);return o&&u(o,n)?(t.coords=this.instance.wtTable.getCoords(o),t.TD=o):l(e,"wtBorder")&&l(e,"current")?(t.coords=this.instance.selections.current.cellRange.highlight,t.TD=this.instance.wtTable.getCell(t.coords)):l(e,"wtBorder")&&l(e,"area")&&this.instance.selections.area.cellRange&&(t.coords=this.instance.selections.area.cellRange.to,t.TD=this.instance.wtTable.getCell(t.coords)),t},window.WalkontableEvent=o},{eventManager:41,"helpers/dom/element":45}],9:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableColumnFilter:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t,n){this.offset=e,this.total=t,this.countTH=n};$traceurRuntime.createClass(o,{offsetted:function(e){return e+this.offset},unOffsetted:function(e){return e-this.offset},renderedToSource:function(e){return this.offsetted(e)},sourceToRendered:function(e){return this.unOffsetted(e)},offsettedTH:function(e){return e-this.countTH},unOffsettedTH:function(e){return e+this.countTH},visibleRowHeadedColumnToSourceColumn:function(e){return this.renderedToSource(this.offsettedTH(e))},sourceColumnToVisibleRowHeadedColumn:function(e){ +return this.unOffsettedTH(this.sourceToRendered(e))}},{}),window.WalkontableColumnFilter=o},{}],10:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableRowFilter:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t,n){this.offset=e,this.total=t,this.countTH=n};$traceurRuntime.createClass(o,{offsetted:function(e){return e+this.offset},unOffsetted:function(e){return e-this.offset},renderedToSource:function(e){return this.offsetted(e)},sourceToRendered:function(e){return this.unOffsetted(e)},offsettedTH:function(e){return e-this.countTH},unOffsettedTH:function(e){return e+this.countTH},visibleColHeadedRowToSourceRow:function(e){return this.renderedToSource(this.offsettedTH(e))},sourceRowToVisibleColHeadedRow:function(e){return this.unOffsettedTH(this.sourceToRendered(e))}},{}),window.WalkontableRowFilter=o},{}],11:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableOverlay:{get:function(){return h}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=s.getScrollableElement,l=s.getTrimmingContainer,u=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).defineGetter,c=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,d={},h=function(e){u(this,"wot",e,{writable:!1}),this.instance=this.wot,this.type="",this.mainTableScrollableElement=null,this.TABLE=this.wot.wtTable.TABLE,this.hider=this.wot.wtTable.hider,this.spreader=this.wot.wtTable.spreader,this.holder=this.wot.wtTable.holder,this.wtRootElement=this.wot.wtTable.wtRootElement,this.trimmingContainer=l(this.hider.parentNode.parentNode),this.needFullRender=this.shouldBeRendered(),this.areElementSizesAdjusted=!1},f=h;$traceurRuntime.createClass(h,{shouldBeRendered:function(){return!0},makeClone:function(e){if(-1===f.CLONE_TYPES.indexOf(e))throw new Error('Clone type "'+e+'" is not supported.');var t=document.createElement("DIV"),n=document.createElement("TABLE");t.className="ht_clone_"+e+" handsontable",t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.overflow="hidden",n.className=this.wot.wtTable.TABLE.className,t.appendChild(n),this.type=e,this.wot.wtTable.wtRootElement.parentNode.appendChild(t);var o=this.wot.getSetting("preventOverflow");return o===!0||"horizontal"===o&&this.type===f.CLONE_TOP||"vertical"===o&&this.type===f.CLONE_LEFT?this.mainTableScrollableElement=window:this.mainTableScrollableElement=a(this.wot.wtTable.TABLE),new Walkontable({cloneSource:this.wot,cloneOverlay:this,table:n})},refresh:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=this.shouldBeRendered();this.clone&&(this.needFullRender||t)&&this.clone.draw(e),this.needFullRender=t},destroy:function(){c(this.clone).destroy()}},{get CLONE_TOP(){return"top"},get CLONE_BOTTOM(){return"bottom"},get CLONE_LEFT(){return"left"},get CLONE_TOP_LEFT_CORNER(){return"top_left_corner"},get CLONE_BOTTOM_LEFT_CORNER(){return"bottom_left_corner"},get CLONE_DEBUG(){return"debug"},get CLONE_TYPES(){return[f.CLONE_TOP,f.CLONE_BOTTOM,f.CLONE_LEFT,f.CLONE_TOP_LEFT_CORNER,f.CLONE_BOTTOM_LEFT_CORNER,f.CLONE_DEBUG]},registerOverlay:function(e,t){if(-1===f.CLONE_TYPES.indexOf(e))throw new Error("Unsupported overlay ("+e+").");d[e]=t},createOverlay:function(e,t){return new d[e](t)},isOverlayTypeOf:function(e,t){return e&&d[t]?e instanceof d[t]:!1}}),window.WalkontableOverlay=h},{eventManager:41,"helpers/dom/element":45,"helpers/object":50}],12:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableDebugOverlay:{get:function(){return a}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).addClass,s=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,a=function(e){$traceurRuntime.superConstructor(l).call(this,e),this.clone=this.makeClone(s.CLONE_DEBUG),this.clone.wtTable.holder.style.opacity=.4,this.clone.wtTable.holder.style.textShadow="0 0 2px #ff0000",i(this.clone.wtTable.holder.parentNode,"wtDebugVisible")},l=a;$traceurRuntime.createClass(a,{},{},s),window.WalkontableDebugOverlay=a,s.registerOverlay(s.CLONE_DEBUG,a)},{_base:11,"helpers/dom/element":45}],13:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableLeftOverlay:{get:function(){return m}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.addClass,a=i.getScrollbarWidth,l=i.getScrollLeft,u=i.getWindowScrollTop,c=i.hasClass,d=i.outerWidth,h=i.innerHeight,f=i.removeClass,p=i.setOverlayPosition,g=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,m=function(e){$traceurRuntime.superConstructor(w).call(this,e),this.clone=this.makeClone(g.CLONE_LEFT)},w=m;$traceurRuntime.createClass(m,{shouldBeRendered:function(){return this.wot.getSetting("fixedColumnsLeft")||this.wot.getSetting("rowHeaders").length?!0:!1},resetFixedPosition:function(){if(this.needFullRender&&this.wot.wtTable.holder.parentNode){var e=this.clone.wtTable.holder.parentNode,t=0,n=this.wot.getSetting("preventOverflow");if(this.trimmingContainer!==window||n&&"horizontal"===n)t=this.getScrollPosition();else{var o,r,i=this.wot.wtTable.hider.getBoundingClientRect(),s=Math.ceil(i.left),a=Math.ceil(i.right);r=this.wot.wtTable.hider.style.top,r=""===r?0:r,o=0>s&&a-e.offsetWidth>0?-s:0,t=o,o+="px",p(e,o,r)}this.adjustHeaderBordersPosition(t),this.adjustElementsSize()}},setScrollPosition:function(e){this.mainTableScrollableElement===window?window.scrollTo(e,u()):this.mainTableScrollableElement.scrollLeft=e},onScroll:function(){this.wot.getSetting("onScrollVertically")},sumCellSizes:function(e,t){for(var n=0,o=this.wot.wtSettings.defaultColumnWidth;t>e;)n+=this.wot.wtTable.getStretchedColumnWidth(e)||o,e++;return n},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1;(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize(),e||(this.areElementSizesAdjusted=!0))},adjustRootElementSize:function(){var e,t=this.wot.wtTable.holder,n=t.clientHeight===t.offsetHeight?0:a(),o=this.clone.wtTable.holder.parentNode,r=o.style,i=this.wot.getSetting("preventOverflow");if(this.trimmingContainer!==window||"vertical"===i){var s=this.wot.wtViewport.getWorkspaceHeight()-n;s=Math.min(s,h(this.wot.wtTable.wtRootElement)),r.height=s+"px"}this.clone.wtTable.holder.style.height=r.height,e=d(this.clone.wtTable.TABLE),r.width=(0===e?e:e+4)+"px"},adjustRootChildrenSize:function(){var e=a();this.clone.wtTable.hider.style.height=this.hider.style.height,this.clone.wtTable.holder.style.height=this.clone.wtTable.holder.parentNode.style.height,0===e&&(e=30),this.clone.wtTable.holder.style.width=parseInt(this.clone.wtTable.holder.parentNode.style.width,10)+e+"px"},applyToDOM:function(){var e=this.wot.getSetting("totalColumns");if(this.areElementSizesAdjusted||this.adjustElementsSize(),"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition)this.spreader.style.left=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the columnsRenderCalculator");this.spreader.style.left="0"}this.spreader.style.right="",this.needFullRender&&this.syncOverlayOffset()},syncOverlayOffset:function(){"number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px":this.clone.wtTable.spreader.style.top=""},scrollTo:function(e,t){var n=this.getTableParentOffset(),o=this.wot.cloneSource?this.wot.cloneSource:this.wot,r=o.wtTable.holder,i=0;t&&r.offsetWidth!==r.clientWidth&&(i=a()),t?(n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportWidth()):n+=this.sumCellSizes(this.wot.getSetting("fixedColumnsLeft"),e),n+=i,this.setScrollPosition(n)},getTableParentOffset:function(){var e=this.wot.getSetting("preventOverflow"),t=0;return e||this.trimmingContainer!==window||(t=this.wot.wtTable.holderOffset.left),t},getScrollPosition:function(){return l(this.mainTableScrollableElement)},adjustHeaderBordersPosition:function(e){var t=this.wot.wtTable.holder.parentNode,n=this.wot.getSetting("rowHeaders"),o=this.wot.getSetting("fixedColumnsLeft");if(o&&!n.length)s(t,"innerBorderLeft");else if(!o&&n.length){var r=c(t,"innerBorderLeft");e?s(t,"innerBorderLeft"):f(t,"innerBorderLeft"),(!r&&e||r&&!e)&&this.wot.wtOverlays.adjustElementsSize()}}},{},g),window.WalkontableLeftOverlay=m,g.registerOverlay(g.CLONE_LEFT,m)},{_base:11,"helpers/dom/element":45}],14:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableTopOverlay:{get:function(){return m}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.addClass,a=i.getScrollbarWidth,l=i.getScrollTop,u=i.getWindowScrollLeft,c=i.hasClass,d=i.outerHeight,h=i.innerWidth,f=i.removeClass,p=i.setOverlayPosition,g=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,m=function(e){$traceurRuntime.superConstructor(w).call(this,e),this.clone=this.makeClone(g.CLONE_TOP)},w=m;$traceurRuntime.createClass(m,{shouldBeRendered:function(){return this.wot.getSetting("fixedRowsTop")||this.wot.getSetting("columnHeaders").length?!0:!1},resetFixedPosition:function(){if(this.needFullRender&&this.wot.wtTable.holder.parentNode){var e=this.clone.wtTable.holder.parentNode,t=0,n=this.wot.getSetting("preventOverflow");if(this.trimmingContainer!==window||n&&"vertical"===n)t=this.getScrollPosition();else{var o,r,i=this.wot.wtTable.hider.getBoundingClientRect(),s=Math.ceil(i.top),a=Math.ceil(i.bottom);o=this.wot.wtTable.hider.style.left,o=""===o?0:o,r=0>s&&a-e.offsetHeight>0?-s:0,t=r,r+="px",p(e,o,r)}this.adjustHeaderBordersPosition(t),this.adjustElementsSize()}},setScrollPosition:function(e){this.mainTableScrollableElement===window?window.scrollTo(u(),e):this.mainTableScrollableElement.scrollTop=e},onScroll:function(){this.wot.getSetting("onScrollHorizontally")},sumCellSizes:function(e,t){for(var n=0,o=this.wot.wtSettings.settings.defaultRowHeight;t>e;){var r=this.wot.wtTable.getRowHeight(e);n+=void 0===r?o:r,e++}return n},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1;(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize(),e||(this.areElementSizesAdjusted=!0))},adjustRootElementSize:function(){var e,t=this.wot.wtTable.holder,n=t.clientWidth===t.offsetWidth?0:a(),o=this.clone.wtTable.holder.parentNode,r=o.style,i=this.wot.getSetting("preventOverflow");if(this.trimmingContainer!==window||"horizontal"===i){var s=this.wot.wtViewport.getWorkspaceWidth()-n;s=Math.min(s,h(this.wot.wtTable.wtRootElement)),r.width=s+"px"}this.clone.wtTable.holder.style.width=r.width,e=d(this.clone.wtTable.TABLE),r.height=(0===e?e:e+4)+"px"},adjustRootChildrenSize:function(){var e=a();this.clone.wtTable.hider.style.width=this.hider.style.width,this.clone.wtTable.holder.style.width=this.clone.wtTable.holder.parentNode.style.width,0===e&&(e=30),this.clone.wtTable.holder.style.height=parseInt(this.clone.wtTable.holder.parentNode.style.height,10)+e+"px"},applyToDOM:function(){var e=this.wot.getSetting("totalRows");if(this.areElementSizesAdjusted||this.adjustElementsSize(),"number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition)this.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.top="0"}this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()},syncOverlayOffset:function(){"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.left=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px":this.clone.wtTable.spreader.style.left=""},scrollTo:function(e,t){var n=this.getTableParentOffset(),o=this.wot.cloneSource?this.wot.cloneSource:this.wot,r=o.wtTable.holder,i=0;if(t&&r.offsetHeight!==r.clientHeight&&(i=a()),t){var s=this.wot.getSetting("fixedRowsBottom"),l=(this.wot.getSetting("fixedRowsTop"),this.wot.getSetting("totalRows"));n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportHeight()-this.sumCellSizes(l-s,l),n+=1}else n+=this.sumCellSizes(this.wot.getSetting("fixedRowsTop"),e);n+=i,this.setScrollPosition(n)},getTableParentOffset:function(){return this.mainTableScrollableElement===window?this.wot.wtTable.holderOffset.top:0},getScrollPosition:function(){return l(this.mainTableScrollableElement)},adjustHeaderBordersPosition:function(e){if(0===this.wot.getSetting("fixedRowsTop")&&this.wot.getSetting("columnHeaders").length>0){var t=this.wot.wtTable.holder.parentNode,n=c(t,"innerBorderTop");e||0===this.wot.getSetting("totalRows")?s(t,"innerBorderTop"):f(t,"innerBorderTop"),(!n&&e||n&&!e)&&this.wot.wtOverlays.adjustElementsSize()}if(0===this.wot.getSetting("rowHeaders").length){var o=this.clone.wtTable.THEAD.querySelectorAll("th:nth-of-type(2)");if(o)for(var r=0;ru&&d-e.offsetWidth>0&&(h=-u+"px"),o&&"horizontal"!==o||0>i&&c-e.offsetHeight>0&&(f=-i+"px"),l(e,h,f)}e.style.height=(0===t?t:t+4)+"px",e.style.width=(0===n?n:n+4)+"px"}}},{},u),window.WalkontableTopLeftCornerOverlay=c,u.registerOverlay(u.CLONE_TOP_LEFT_CORNER,c)},{_base:11,"helpers/dom/element":45}],16:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableOverlays:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=s.getScrollableElement,l=s.getScrollbarWidth,u=s.getScrollLeft,c=s.getScrollTop,d=(r=e("helpers/unicode"),r&&r.__esModule&&r||{"default":r}).isKey,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,f=function(e){this.wot=e,this.instance=this.wot,this.eventManager=new h(this.wot),this.wot.update("scrollbarWidth",l()),this.wot.update("scrollbarHeight",l()),this.scrollableElement=a(this.wot.wtTable.TABLE),this.topOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP,this.wot),"undefined"==typeof WalkontableBottomOverlay?this.bottomOverlay={needFullRender:!1}:this.bottomOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM,this.wot),this.leftOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_LEFT,this.wot),this.topOverlay.needFullRender&&this.leftOverlay.needFullRender&&(this.topLeftCornerOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP_LEFT_CORNER,this.wot)),this.bottomOverlay.needFullRender&&this.leftOverlay.needFullRender&&"undefined"!=typeof WalkontableBottomLeftCornerOverlay?this.bottomLeftCornerOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER,this.wot):this.bottomLeftCornerOverlay={needFullRender:!1},this.wot.getSetting("debug")&&(this.debug=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_DEBUG,this.wot)),this.destroyed=!1,this.keyPressed=!1,this.spreaderLastSize={width:null,height:null},this.overlayScrollPositions={master:{top:0,left:0},top:{top:null,left:0},bottom:{top:null,left:0},left:{top:0,left:null}},this.verticalScrolling=!1,this.horizontalScrolling=!1,this.delegatedScrollCallback=!1,this.registerListeners()};$traceurRuntime.createClass(f,{refreshAll:function(){if(this.wot.drawn){if(!this.wot.wtTable.holder.parentNode)return void this.destroy();this.wot.draw(!0),this.verticalScrolling&&this.leftOverlay.onScroll(),this.horizontalScrolling&&this.topOverlay.onScroll(),this.verticalScrolling=!1,this.horizontalScrolling=!1}},registerListeners:function(){var e=this;this.eventManager.addEventListener(document.documentElement,"keydown",function(t){return e.onKeyDown(t)}),this.eventManager.addEventListener(document.documentElement,"keyup",function(){return e.onKeyUp()}),this.eventManager.addEventListener(document,"visibilitychange",function(){return e.onKeyUp()});var t=this.topOverlay.mainTableScrollableElement,n=this.leftOverlay.mainTableScrollableElement;this.eventManager.addEventListener(t,"scroll",function(t){return e.onTableScroll(t)}),t!==n&&this.eventManager.addEventListener(n,"scroll",function(t){return e.onTableScroll(t)}),this.topOverlay.needFullRender&&(this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.bottomOverlay.needFullRender&&(this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.leftOverlay.needFullRender&&(this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.topOverlay.trimmingContainer!==window&&this.leftOverlay.trimmingContainer!==window&&this.eventManager.addEventListener(window,"wheel",function(t){var n,o=t.wheelDeltaY||t.deltaY,r=t.wheelDeltaX||t.deltaX;e.topOverlay.clone.wtTable.holder.contains(t.realTarget)?n="top":e.bottomOverlay.clone&&e.bottomOverlay.clone.wtTable.holder.contains(t.realTarget)?n="bottom":e.leftOverlay.clone.wtTable.holder.contains(t.realTarget)&&(n="left"),"top"==n&&0!==o?t.preventDefault():"left"==n&&0!==r?t.preventDefault():"bottom"==n&&0!==o&&t.preventDefault()})},onTableScroll:function(e){if(!Handsontable.mobileBrowser){var t=this.leftOverlay.mainTableScrollableElement,n=this.topOverlay.mainTableScrollableElement,o=e.target;this.keyPressed&&(n!==window&&o!==window&&!e.target.contains(n)||t!==window&&o!==window&&!e.target.contains(t))||("scroll"===e.type?this.syncScrollPositions(e):this.translateMouseWheelToScroll(e))}},onKeyDown:function(e){this.keyPressed=d(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")},onKeyUp:function(){this.keyPressed=!1},translateMouseWheelToScroll:function(e){for(var t,n=this.topOverlay.clone.wtTable.holder,o=this.bottomOverlay.clone?this.bottomOverlay.clone.wtTable.holder:null,r=this.leftOverlay.clone.wtTable.holder,i={type:"wheel"},s=e.target,a=e.wheelDeltaY||-1*e.deltaY,l=e.wheelDeltaX||-1*e.deltaX;s!=document&&null!=s;){if(s.className.indexOf("wtHolder")>-1){t=s;break}s=s.parentNode}return i.target=t,t==n?this.syncScrollPositions(i,-.2*a):t==o?this.syncScrollPositions(i,-.2*a):t==r&&this.syncScrollPositions(i,-.2*l),!1},syncScrollPositions:function(e){var t=void 0!==arguments[1]?arguments[1]:null;if(!this.destroyed){if(0===arguments.length)return void this.syncScrollWithMaster();var n,o,r,i=this.leftOverlay.mainTableScrollableElement,s=this.topOverlay.mainTableScrollableElement,a=e.target,l=0,d=!1,h=!1,f=this.wot.getSetting("preventOverflow");this.topOverlay.needFullRender&&(n=this.topOverlay.clone.wtTable.holder),this.bottomOverlay.needFullRender&&(r=this.bottomOverlay.clone.wtTable.holder),this.leftOverlay.needFullRender&&(o=this.leftOverlay.clone.wtTable.holder),a===document&&(a=window),a===i||a===s?(l=u(f?this.scrollableElement:a),this.overlayScrollPositions.master.left!==l&&(this.horizontalScrolling=!0,this.overlayScrollPositions.master.left=l,d=!0,n&&(n.scrollLeft=l,h=i!==window),r&&(r.scrollLeft=l,h=i!==window)),l=c(a),this.overlayScrollPositions.master.top!==l&&(this.verticalScrolling=!0,this.overlayScrollPositions.master.top=l,d=!0,o&&(o.scrollTop=l,h=s!==window))):a===r?(l=u(a),this.overlayScrollPositions.bottom.left!==l&&(this.horizontalScrolling=!0,this.overlayScrollPositions.bottom.left=l,d=!0,i.scrollLeft=l),null!==t&&(d=!0,s.scrollTop+=t)):a===n?(l=u(a),this.overlayScrollPositions.top.left!==l&&(this.horizontalScrolling=!0,this.overlayScrollPositions.top.left=l,d=!0,i.scrollLeft=l),null!==t&&(d=!0,s.scrollTop+=t)):a===o&&(l=c(a),this.overlayScrollPositions.left.top!==l&&(this.verticalScrolling=!0,this.overlayScrollPositions.left.top=l,d=!0,s.scrollTop=l),null!==t&&(d=!0,s.scrollLeft+=t)),!this.keyPressed&&d&&"scroll"===e.type&&(this.delegatedScrollCallback?this.delegatedScrollCallback=!1:this.refreshAll(),h&&(this.delegatedScrollCallback=!0))}},syncScrollWithMaster:function(){var e=this.topOverlay.mainTableScrollableElement;this.topOverlay.needFullRender&&(this.topOverlay.clone.wtTable.holder.scrollLeft=e.scrollLeft),this.leftOverlay.needFullRender&&(this.leftOverlay.clone.wtTable.holder.scrollTop=e.scrollTop)},destroy:function(){this.eventManager.destroy(),this.topOverlay.destroy(),this.bottomOverlay.clone&&this.bottomOverlay.destroy(),this.leftOverlay.destroy(),this.topLeftCornerOverlay&&this.topLeftCornerOverlay.destroy(),this.bottomLeftCornerOverlay&&this.bottomLeftCornerOverlay.clone&&this.bottomLeftCornerOverlay.destroy(),this.debug&&this.debug.destroy(),this.destroyed=!0},refresh:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(this.topOverlay.areElementSizesAdjusted&&this.leftOverlay.areElementSizesAdjusted){var t=this.wot.wtTable.wtRootElement.parentNode||this.wot.wtTable.wtRootElement,n=t.clientWidth,o=t.clientHeight;(n!==this.spreaderLastSize.width||o!==this.spreaderLastSize.height)&&(this.spreaderLastSize.width=n,this.spreaderLastSize.height=o,this.adjustElementsSize())}this.bottomOverlay.clone&&this.bottomOverlay.refresh(e),this.leftOverlay.refresh(e),this.topOverlay.refresh(e),this.topLeftCornerOverlay&&this.topLeftCornerOverlay.refresh(e),this.bottomLeftCornerOverlay&&this.bottomLeftCornerOverlay.clone&&this.bottomLeftCornerOverlay.refresh(e),this.debug&&this.debug.refresh(e)},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=this.wot.getSetting("totalColumns"),n=this.wot.getSetting("totalRows"),o=this.wot.wtViewport.getRowHeaderWidth(),r=this.wot.wtViewport.getColumnHeaderHeight(),i=this.wot.wtTable.hider.style;i.width=o+this.leftOverlay.sumCellSizes(0,t)+"px",i.height=r+this.topOverlay.sumCellSizes(0,n)+1+"px",this.topOverlay.adjustElementsSize(e),this.leftOverlay.adjustElementsSize(e),this.bottomOverlay.clone&&this.bottomOverlay.adjustElementsSize(e)},applyToDOM:function(){this.topOverlay.areElementSizesAdjusted&&this.leftOverlay.areElementSizesAdjusted||this.adjustElementsSize(),this.topOverlay.applyToDOM(),this.bottomOverlay.clone&&this.bottomOverlay.applyToDOM(),this.leftOverlay.applyToDOM()}},{}),window.WalkontableOverlays=f},{eventManager:41,"helpers/dom/element":45,"helpers/unicode":53}],17:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableScroll:{get:function(){return p}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.innerHeight,a=i.innerWidth,l=i.getScrollLeft,u=i.getScrollTop,c=i.offset,d=(r=e("helpers/number"),r&&r.__esModule&&r||{"default":r}),h=d.rangeEach,f=d.rangeEachReverse,p=function(e){this.wot=e,this.instance=e};$traceurRuntime.createClass(p,{scrollViewport:function(e){if(this.wot.drawn){var t=this._getVariables(),n=t.topOverlay,o=t.leftOverlay,r=t.totalRows,i=t.totalColumns,s=t.fixedRowsTop,a=t.fixedRowsBottom,l=t.fixedColumnsLeft;if(e.row<0||e.row>r-1)throw new Error("row "+e.row+" does not exist");if(e.col<0||e.col>i-1)throw new Error("column "+e.col+" does not exist");e.row>=s&&e.rowthis.getLastVisibleRow()&&e.row=l&&e.colthis.getLastVisibleColumn()&&o.scrollTo(e.col,!0)}},getFirstVisibleRow:function(){var e=this._getVariables(),t=e.topOverlay,n=e.wtTable,o=e.wtViewport,r=e.totalRows,i=e.fixedRowsTop,a=n.getFirstVisibleRow();if(t.mainTableScrollableElement===window){var l=c(n.wtRootElement),d=s(n.hider),h=s(window),p=u(window);if(l.top+d-h<=p){var g=o.getColumnHeaderHeight();g+=t.sumCellSizes(0,i),f(r,1,function(e){return g+=t.sumCellSizes(e-1,e),l.top+d-g<=p?(a=e,!1):void 0})}}return a},getLastVisibleRow:function(){var e=this._getVariables(),t=e.topOverlay,n=e.wtTable,o=e.wtViewport,r=e.totalRows,i=n.getLastVisibleRow();if(t.mainTableScrollableElement===window){var a=c(n.wtRootElement),l=s(window),d=u(window);if(a.top>d){var f=o.getColumnHeaderHeight();h(1,r,function(e){return f+=t.sumCellSizes(e-1,e),a.top+f-d>=l?(i=e-2,!1):void 0})}}return i},getFirstVisibleColumn:function(){var e=this._getVariables(),t=e.leftOverlay,n=e.wtTable,o=e.wtViewport,r=e.totalColumns,i=(e.fixedColumnsLeft,n.getFirstVisibleColumn());if(t.mainTableScrollableElement===window){var s=c(n.wtRootElement),u=a(n.hider),d=a(window),h=l(window);if(s.left+u-d<=h){var p=o.getRowHeaderWidth();f(r,1,function(e){return p+=t.sumCellSizes(e-1,e),s.left+u-p<=h?(i=e,!1):void 0})}}return i},getLastVisibleColumn:function(){var e=this._getVariables(),t=e.leftOverlay,n=e.wtTable,o=e.wtViewport,r=e.totalColumns,i=n.getLastVisibleColumn();if(t.mainTableScrollableElement===window){var s=c(n.wtRootElement),u=a(window),d=l(window);if(s.left>d){var f=o.getRowHeaderWidth();h(1,r,function(e){return f+=t.sumCellSizes(e-1,e),s.left+f-d>=u?(i=e-2,!1):void 0})}}return i},_getVariables:function(){var e=this.wot,t=e.wtOverlays.topOverlay,n=e.wtOverlays.leftOverlay,o=e.wtTable,r=e.wtViewport,i=e.getSetting("totalRows"),s=e.getSetting("totalColumns"),a=e.getSetting("fixedRowsTop"),l=e.getSetting("fixedRowsBottom"),u=e.getSetting("fixedColumnsLeft");return{topOverlay:t,leftOverlay:n,wtTable:o,wtViewport:r,totalRows:i,totalColumns:s,fixedRowsTop:a,fixedRowsBottom:l,fixedColumnsLeft:u}}},{}),window.WalkontableScroll=p},{"helpers/dom/element":45,"helpers/number":49}],18:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableSelection:{get:function(){return d}},__esModule:{value:!0}});var o,r,i,s,a=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).addClass,l=(r=e("border"),r&&r.__esModule&&r||{"default":r}).WalkontableBorder,u=(i=e("cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords,c=(s=e("cell/range"),s&&s.__esModule&&s||{"default":s}).WalkontableCellRange,d=function(e,t){this.settings=e,this.cellRange=t||null,this.instanceBorders={}};$traceurRuntime.createClass(d,{getBorder:function(e){return this.instanceBorders[e.guid]?this.instanceBorders[e.guid]:void(this.instanceBorders[e.guid]=new l(e,this.settings))},isEmpty:function(){return null===this.cellRange},add:function(e){this.isEmpty()?this.cellRange=new c(e,e,e):this.cellRange.expand(e)},replace:function(e,t){if(!this.isEmpty()){if(this.cellRange.from.isEqual(e))return this.cellRange.from=t,!0;if(this.cellRange.to.isEqual(e))return this.cellRange.to=t,!0}return!1},clear:function(){this.cellRange=null},getCorners:function(){var e=this.cellRange.getTopLeftCorner(),t=this.cellRange.getBottomRightCorner();return[e.row,e.col,t.row,t.col]},addClassAtCoords:function(e,t,n,o){var r=e.wtTable.getCell(new u(t,n));"object"==typeof r&&a(r,o)},draw:function(e){if(this.isEmpty()){if(this.settings.border){var t=this.getBorder(e);t&&t.disappear()}}else{for(var n,o,r,i=e.wtTable.getRenderedRowsCount(),s=e.wtTable.getRenderedColumnsCount(),l=this.getCorners(),u=0;s>u;u++)o=e.wtTable.columnFilter.renderedToSource(u),o>=l[1]&&o<=l[3]&&(r=e.wtTable.getColumnHeader(o),r&&this.settings.highlightColumnClassName&&a(r,this.settings.highlightColumnClassName));for(var c=0;i>c;c++){n=e.wtTable.rowFilter.renderedToSource(c),n>=l[0]&&n<=l[2]&&(r=e.wtTable.getRowHeader(n),r&&this.settings.highlightRowClassName&&a(r,this.settings.highlightRowClassName));for(var d=0;s>d;d++)o=e.wtTable.columnFilter.renderedToSource(d),n>=l[0]&&n<=l[2]&&o>=l[1]&&o<=l[3]?this.settings.className&&this.addClassAtCoords(e,n,o,this.settings.className):n>=l[0]&&n<=l[2]?this.settings.highlightRowClassName&&this.addClassAtCoords(e,n,o,this.settings.highlightRowClassName):o>=l[1]&&o<=l[3]&&this.settings.highlightColumnClassName&&this.addClassAtCoords(e,n,o,this.settings.highlightColumnClassName)}if(e.getSetting("onBeforeDrawBorders",l,this.settings.className),this.settings.border){var h=this.getBorder(e);h&&h.appear(l)}}}},{}),window.WalkontableSelection=d},{border:2,"cell/coords":5,"cell/range":6,"helpers/dom/element":45}],19:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableSettings:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).fastInnerText,i=function(e,t){var n=this;this.wot=e,this.instance=e,this.defaults={table:void 0,debug:!1,externalRowCalculator:!1,stretchH:"none",currentRowClassName:null,currentColumnClassName:null,preventOverflow:function(){return!1},data:void 0,fixedColumnsLeft:0,fixedRowsTop:0,fixedRowsBottom:0,minSpareRows:0,rowHeaders:function(){return[]},columnHeaders:function(){return[]},totalRows:void 0,totalColumns:void 0,cellRenderer:function(e,t,o){var i=n.getSetting("data",e,t);r(o,void 0===i||null===i?"":i)},columnWidth:function(e){},rowHeight:function(e){},defaultRowHeight:23,defaultColumnWidth:50,selections:null,hideBorderOnMouseDownOver:!1,viewportRowCalculatorOverride:null,viewportColumnCalculatorOverride:null,onCellMouseDown:null,onCellMouseOver:null,onCellDblClick:null,onCellCornerMouseDown:null,onCellCornerDblClick:null,beforeDraw:null,onDraw:null,onBeforeDrawBorders:null,onScrollVertically:null,onScrollHorizontally:null,onBeforeTouchScroll:null,onAfterMomentumScroll:null,scrollbarWidth:10,scrollbarHeight:10,renderAllRows:!1,groups:!1},this.settings={};for(var o in this.defaults)if(this.defaults.hasOwnProperty(o))if(void 0!==t[o])this.settings[o]=t[o];else{if(void 0===this.defaults[o])throw new Error('A required setting "'+o+'" was not provided');this.settings[o]=this.defaults[o]}};$traceurRuntime.createClass(i,{update:function(e,t){if(void 0===t)for(var n in e)e.hasOwnProperty(n)&&(this.settings[n]=e[n]);else this.settings[e]=t;return this.wot},getSetting:function(e,t,n,o,r){return"function"==typeof this.settings[e]?this.settings[e](t,n,o,r):void 0!==t&&Array.isArray(this.settings[e])?this.settings[e][t]:this.settings[e]},has:function(e){return!!this.settings[e]}},{}),window.WalkontableSettings=i},{"helpers/dom/element":45}],20:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableTable:{get:function(){return C}},__esModule:{value:!0}});var o,r,i,s,a,l,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),c=u.getStyle,d=u.getTrimmingContainer,h=u.hasClass,f=u.index,p=u.offset,g=u.removeClass,m=u.removeTextNodes,w=(u.overlayContainsElement,(r=e("cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords),v=((i=e("cell/range"),i&&i.__esModule&&i||{"default":i}).WalkontableCellRange,(s=e("filter/column"),s&&s.__esModule&&s||{"default":s}).WalkontableColumnFilter),y=(a=e("filter/row"),a&&a.__esModule&&a||{"default":a}).WalkontableRowFilter,b=(l=e("tableRenderer"),l&&l.__esModule&&l||{"default":l}).WalkontableTableRenderer,C=function(e,t){this.wot=e,this.instance=this.wot, +this.TABLE=t,this.TBODY=null,this.THEAD=null,this.COLGROUP=null,this.tableOffset=0,this.holderOffset=0,m(this.TABLE),this.spreader=this.createSpreader(this.TABLE),this.hider=this.createHider(this.spreader),this.holder=this.createHolder(this.hider),this.wtRootElement=this.holder.parentNode,this.alignOverlaysWithTrimmingContainer(),this.fixTableDomTree(),this.colgroupChildrenLength=this.COLGROUP.childNodes.length,this.theadChildrenLength=this.THEAD.firstChild?this.THEAD.firstChild.childNodes.length:0,this.tbodyChildrenLength=this.TBODY.childNodes.length,this.rowFilter=null,this.columnFilter=null};$traceurRuntime.createClass(C,{fixTableDomTree:function(){this.TBODY=this.TABLE.querySelector("tbody"),this.TBODY||(this.TBODY=document.createElement("tbody"),this.TABLE.appendChild(this.TBODY)),this.THEAD=this.TABLE.querySelector("thead"),this.THEAD||(this.THEAD=document.createElement("thead"),this.TABLE.insertBefore(this.THEAD,this.TBODY)),this.COLGROUP=this.TABLE.querySelector("colgroup"),this.COLGROUP||(this.COLGROUP=document.createElement("colgroup"),this.TABLE.insertBefore(this.COLGROUP,this.THEAD)),this.wot.getSetting("columnHeaders").length&&!this.THEAD.childNodes.length&&this.THEAD.appendChild(document.createElement("TR"))},createSpreader:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.className="wtSpreader",n&&n.insertBefore(t,e),t.appendChild(e)),t.style.position="relative",t},createHider:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.className="wtHider",n&&n.insertBefore(t,e),t.appendChild(e)),t},createHolder:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.style.position="relative",t.className="wtHolder",n&&n.insertBefore(t,e),this.isWorkingOnClone()||(t.parentNode.className+="ht_master handsontable"),t.appendChild(e)),t},alignOverlaysWithTrimmingContainer:function(){var e=d(this.wtRootElement);if(!this.isWorkingOnClone())if(this.holder.parentNode.style.position="relative",e===window){var t=this.wot.getSetting("preventOverflow");t||(this.holder.style.overflow="visible",this.wtRootElement.style.overflow="visible")}else this.holder.style.width=c(e,"width"),this.holder.style.height=c(e,"height"),this.holder.style.overflow=""},isWorkingOnClone:function(){return!!this.wot.cloneSource},draw:function(e){var t=this.instance.getSetting("totalRows");if(this.isWorkingOnClone()||(this.holderOffset=p(this.holder),e=this.wot.wtViewport.createRenderCalculators(e)),e)this.isWorkingOnClone()||this.wot.wtViewport.createVisibleCalculators(),this.wot.wtOverlays&&this.wot.wtOverlays.refresh(!0);else{this.isWorkingOnClone()?this.tableOffset=this.wot.cloneSource.wtTable.tableOffset:this.tableOffset=p(this.TABLE);var n;n=WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)?0:WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?t-this.wot.getSetting("fixedRowsBottom"):this.wot.wtViewport.rowsRenderCalculator.startRow;var o;o=WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_LEFT)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?0:this.wot.wtViewport.columnsRenderCalculator.startColumn,this.rowFilter=new y(n,t,this.wot.getSetting("columnHeaders").length),this.columnFilter=new v(o,this.wot.getSetting("totalColumns"),this.wot.getSetting("rowHeaders").length),this._doDraw(),this.alignOverlaysWithTrimmingContainer()}return this.refreshSelections(e),this.isWorkingOnClone()||(this.wot.wtOverlays.topOverlay.resetFixedPosition(),this.wot.wtOverlays.bottomOverlay.clone&&this.wot.wtOverlays.bottomOverlay.resetFixedPosition(),this.wot.wtOverlays.leftOverlay.resetFixedPosition(),this.wot.wtOverlays.topLeftCornerOverlay&&this.wot.wtOverlays.topLeftCornerOverlay.resetFixedPosition(),this.instance.wtOverlays.bottomLeftCornerOverlay&&this.instance.wtOverlays.bottomLeftCornerOverlay.clone&&this.wot.wtOverlays.bottomLeftCornerOverlay.resetFixedPosition()),this.wot.drawn=!0,this},_doDraw:function(){var e=new b(this);e.render()},removeClassFromCells:function(e){for(var t=this.TABLE.querySelectorAll("."+e),n=0,o=t.length;o>n;n++)g(t[n],e)},refreshSelections:function(e){if(this.wot.selections){var t=this.wot.selections.length;if(e)for(var n=0;t>n;n++)this.wot.selections[n].settings.className&&this.removeClassFromCells(this.wot.selections[n].settings.className),this.wot.selections[n].settings.highlightRowClassName&&this.removeClassFromCells(this.wot.selections[n].settings.highlightRowClassName),this.wot.selections[n].settings.highlightColumnClassName&&this.removeClassFromCells(this.wot.selections[n].settings.highlightColumnClassName);for(var o=0;t>o;o++)this.wot.selections[o].draw(this.wot,e)}},getCell:function(e){if(this.isRowBeforeRenderedRows(e.row))return-1;if(this.isRowAfterRenderedRows(e.row))return-2;var t=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e.row)];return t?t.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e.col)]:void 0},getColumnHeader:function(e){var t=void 0!==arguments[1]?arguments[1]:0,n=this.THEAD.childNodes[t];return n?n.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]:void 0},getRowHeader:function(e){if(0===this.columnFilter.sourceColumnToVisibleRowHeadedColumn(0))return null;var t=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)];return t?t.childNodes[0]:void 0},getCoords:function(e){var t=e.parentNode,n=f(t);n=t.parentNode===this.THEAD?this.rowFilter.visibleColHeadedRowToSourceRow(n):this.rowFilter.renderedToSource(n);var o=this.columnFilter.visibleRowHeadedColumnToSourceColumn(e.cellIndex);return new w(n,o)},getTrForRow:function(e){return this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)]},getFirstRenderedRow:function(){return this.wot.wtViewport.rowsRenderCalculator.startRow},getFirstVisibleRow:function(){return this.wot.wtViewport.rowsVisibleCalculator.startRow},getFirstRenderedColumn:function(){return this.wot.wtViewport.columnsRenderCalculator.startColumn},getFirstVisibleColumn:function(){return this.wot.wtViewport.columnsVisibleCalculator.startColumn},getLastRenderedRow:function(){return this.wot.wtViewport.rowsRenderCalculator.endRow},getLastVisibleRow:function(){return this.wot.wtViewport.rowsVisibleCalculator.endRow},getLastRenderedColumn:function(){return this.wot.wtViewport.columnsRenderCalculator.endColumn},getLastVisibleColumn:function(){return this.wot.wtViewport.columnsVisibleCalculator.endColumn},isRowBeforeRenderedRows:function(e){return this.rowFilter.sourceToRendered(e)<0&&e>=0},isRowAfterViewport:function(e){return this.rowFilter.sourceToRendered(e)>this.getLastVisibleRow()},isRowAfterRenderedRows:function(e){return this.rowFilter.sourceToRendered(e)>this.getLastRenderedRow()},isColumnBeforeViewport:function(e){return this.columnFilter.sourceToRendered(e)<0&&e>=0},isColumnAfterViewport:function(e){return this.columnFilter.sourceToRendered(e)>this.getLastVisibleColumn()},isLastRowFullyVisible:function(){return this.getLastVisibleRow()===this.getLastRenderedRow()},isLastColumnFullyVisible:function(){return this.getLastVisibleColumn()===this.getLastRenderedColumn()},getRenderedColumnsCount:function(){return WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)?this.wot.getSetting("totalColumns"):WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_LEFT)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?this.wot.getSetting("fixedColumnsLeft"):this.wot.wtViewport.columnsRenderCalculator.count},getRenderedRowsCount:function(){return WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)?this.wot.getSetting("totalRows"):WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)?this.wot.getSetting("fixedRowsTop"):WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?this.instance.getSetting("fixedRowsBottom"):this.wot.wtViewport.rowsRenderCalculator.count},getVisibleRowsCount:function(){return this.wot.wtViewport.rowsVisibleCalculator.count},allRowsInViewport:function(){return this.wot.getSetting("totalRows")==this.getVisibleRowsCount()},getRowHeight:function(e){var t=this.wot.wtSettings.settings.rowHeight(e),n=this.wot.wtViewport.oversizedRows[e];return void 0!==n&&(t=void 0===t?n:Math.max(t,n)),t},getColumnHeaderHeight:function(e){var t=this.wot.wtSettings.settings.defaultRowHeight,n=this.wot.wtViewport.oversizedColumnHeaders[e];return void 0!==n&&(t=t?Math.max(t,n):n),t},getVisibleColumnsCount:function(){return this.wot.wtViewport.columnsVisibleCalculator.count},allColumnsInViewport:function(){return this.wot.getSetting("totalColumns")==this.getVisibleColumnsCount()},getColumnWidth:function(e){var t=this.wot.wtSettings.settings.columnWidth;return"function"==typeof t?t=t(e):"object"==typeof t&&(t=t[e]),t||this.wot.wtSettings.settings.defaultColumnWidth},getStretchedColumnWidth:function(e){var t=this.getColumnWidth(e),n=-1===[void 0,null].indexOf(t)?t:this.instance.wtSettings.settings.defaultColumnWidth,o=this.wot.wtViewport.columnsRenderCalculator;if(o){var r=o.getStretchedColumnWidth(e,n);r&&(n=r)}return n}},{}),window.WalkontableTable=C},{"cell/coords":5,"cell/range":6,"filter/column":9,"filter/row":10,"helpers/dom/element":45,tableRenderer:21}],21:[function(e,t,n){"use strict";function o(e,t){var n=document.createElement("TH");return t.insertBefore(n,e),t.removeChild(e),n}function r(e,t){var n=document.createElement("TD");return t.insertBefore(n,e),t.removeChild(e),n}Object.defineProperties(n,{WalkontableTableRenderer:{get:function(){return f}},__esModule:{value:!0}});var i,s=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),a=s.addClass,l=s.empty,u=s.getScrollbarWidth,c=s.hasClass,d=s.innerHeight,h=s.outerWidth,f=function(e){this.wtTable=e,this.wot=e.instance,this.instance=e.instance,this.rowFilter=e.rowFilter,this.columnFilter=e.columnFilter,this.TABLE=e.TABLE,this.THEAD=e.THEAD,this.TBODY=e.TBODY,this.COLGROUP=e.COLGROUP,this.rowHeaders=[],this.rowHeaderCount=0,this.columnHeaders=[],this.columnHeaderCount=0,this.fixedRowsTop=0,this.fixedRowsBottom=0};$traceurRuntime.createClass(f,{render:function(){this.wtTable.isWorkingOnClone()||this.wot.getSetting("beforeDraw",!0),this.rowHeaders=this.wot.getSetting("rowHeaders"),this.rowHeaderCount=this.rowHeaders.length,this.fixedRowsTop=this.wot.getSetting("fixedRowsTop"),this.fixedRowsBottom=this.wot.getSetting("fixedRowsBottom"),this.columnHeaders=this.wot.getSetting("columnHeaders"),this.columnHeaderCount=this.columnHeaders.length;var e,t=this.wtTable.getRenderedColumnsCount(),n=this.wtTable.getRenderedRowsCount(),o=this.wot.getSetting("totalColumns"),r=this.wot.getSetting("totalRows"),i=!1;if((WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER))&&(this.columnHeaders=[],this.columnHeaderCount=0),o>0&&(this.adjustAvailableNodes(),i=!0,this.renderColumnHeaders(),this.renderRows(r,n,t),this.wtTable.isWorkingOnClone()||(e=this.wot.wtViewport.getWorkspaceWidth(),this.wot.wtViewport.containerWidth=null),this.adjustColumnHeaderHeights(),this.adjustColumnWidths(t),this.markOversizedColumns()),i||this.adjustAvailableNodes(),this.removeRedundantRows(n),this.wtTable.isWorkingOnClone()){if(WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)){var s=this.wot.cloneOverlay.instance;this.wot.cloneOverlay.markOversizedFixedBottomRows(),s.wtOverlays.adjustElementsSize()}}else{this.markOversizedRows(),this.wot.wtViewport.createVisibleCalculators(),this.wot.wtOverlays.refresh(!1);var a=h(this.wtTable.hider),l=h(this.wtTable.TABLE);if(0!==a&&l!==a&&this.adjustColumnWidths(t),this.wot.wtOverlays.applyToDOM(),e!==this.wot.wtViewport.getWorkspaceWidth()){this.wot.wtViewport.containerWidth=null;for(var u=this.wtTable.getFirstRenderedColumn(),c=this.wtTable.getLastRenderedColumn(),d=u;c>d;d++){var f=this.wtTable.getStretchedColumnWidth(d),p=this.columnFilter.sourceToRendered(d);this.COLGROUP.childNodes[p+this.rowHeaderCount].style.width=f+"px"}}this.wot.getSetting("onDraw",!0)}},removeRedundantRows:function(e){for(;this.wtTable.tbodyChildrenLength>e;)this.TBODY.removeChild(this.TBODY.lastChild),this.wtTable.tbodyChildrenLength--},renderRows:function(e,t,n){for(var o,r,i=0,s=this.rowFilter.renderedToSource(i),a=this.wtTable.isWorkingOnClone();e>s&&s>=0&&(i>1e3&&console.error("Security brake: Too much TRs. Please define height for your table, which will enforce scrollbars."),void 0===t||i!==t);){if(r=this.getOrCreateTrForRow(i,r),this.renderRowHeaders(s,r),this.adjustColumns(r,n+this.rowHeaderCount),o=this.renderCells(s,r,n),(!a||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM))&&this.resetOversizedRow(s),r.firstChild){var l=this.wot.wtTable.getRowHeight(s);l?(l--,r.firstChild.style.height=l+"px"):r.firstChild.style.height=""}i++,s=this.rowFilter.renderedToSource(i)}},resetOversizedRow:function(e){this.wot.getSetting("externalRowCalculator")||this.wot.wtViewport.oversizedRows&&this.wot.wtViewport.oversizedRows[e]&&(this.wot.wtViewport.oversizedRows[e]=void 0)},markOversizedRows:function(){if(!this.wot.getSetting("externalRowCalculator")){var e,t,n,o,r,i=this.instance.wtTable.TBODY.childNodes.length,s=i*this.instance.wtSettings.settings.defaultRowHeight,a=d(this.instance.wtTable.TBODY)-1;this.instance.getSetting("totalRows");if(s!==a||this.instance.getSetting("fixedRowsBottom"))for(;i;)i--,n=this.instance.wtTable.rowFilter.renderedToSource(i),e=this.instance.wtTable.getRowHeight(n),o=this.instance.wtTable.getTrForRow(n),r=o.querySelector("th"),t=r?d(r):d(o)-1,(!e&&this.instance.wtSettings.settings.defaultRowHeighte)&&(this.instance.wtViewport.oversizedRows[n]=++t)}},markOversizedColumns:function(){var e=this.wot.getOverlayName();if(this.columnHeaderCount&&!this.wot.wtViewport.isMarkedOversizedColumn[e]&&!this.wtTable.isWorkingOnClone()){for(var t=this.wtTable.getRenderedColumnsCount(),n=0;no;o++)this.markIfOversizedColumnHeader(o);this.wot.wtViewport.isMarkedOversizedColumn[e]=!0}},adjustColumnHeaderHeights:function(){for(var e=this.wot.getSetting("columnHeaders"),t=this.wot.wtTable.THEAD.childNodes,n=this.wot.wtViewport.oversizedColumnHeaders,o=0,r=e.length;r>o;o++)if(n[o]){if(0===t[o].childNodes.length)return;t[o].childNodes[0].style.height=n[o]+"px"}},markIfOversizedColumnHeader:function(e){for(var t,n,o,r=this.wot.wtTable.columnFilter.renderedToSource(e),i=this.columnHeaderCount,s=this.wot.wtSettings.settings.defaultRowHeight;i;)i--,t=this.wot.wtTable.getColumnHeaderHeight(i),n=this.wot.wtTable.getColumnHeader(r,i),n&&(o=d(n),(!t&&o>s||o>t)&&(this.wot.wtViewport.oversizedColumnHeaders[i]=o))},renderCells:function(e,t,n){for(var o,i,s=0;n>s;s++)i=this.columnFilter.renderedToSource(s),o=0===s?t.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(i)]:o.nextSibling,"TH"==o.nodeName&&(o=r(o,t)),c(o,"hide")||(o.className=""),o.removeAttribute("style"),this.wot.wtSettings.settings.cellRenderer(e,i,o);return o},adjustColumnWidths:function(e){var t=0,n=this.wot.cloneSource?this.wot.cloneSource:this.wot,o=n.wtTable.holder;o.offsetHeightr;r++){var i=this.wtTable.getStretchedColumnWidth(this.columnFilter.renderedToSource(r));this.COLGROUP.childNodes[r+this.rowHeaderCount].style.width=i+"px"}},appendToTbody:function(e){this.TBODY.appendChild(e),this.wtTable.tbodyChildrenLength++},getOrCreateTrForRow:function(e,t){var n;return e>=this.wtTable.tbodyChildrenLength?(n=this.createRow(),this.appendToTbody(n)):n=0===e?this.TBODY.firstChild:t.nextSibling,n.className&&n.removeAttribute("class"),n},createRow:function(){for(var e=document.createElement("TR"),t=0;to;o++){var r=this.columnFilter.renderedToSource(o);this.renderColumnHeader(t,r,n.childNodes[o+this.rowHeaderCount])}},adjustColGroups:function(){for(var e=this.wtTable.getRenderedColumnsCount();this.wtTable.colgroupChildrenLengthe+this.rowHeaderCount;)this.COLGROUP.removeChild(this.COLGROUP.lastChild),this.wtTable.colgroupChildrenLength--;this.rowHeaderCount&&a(this.COLGROUP.childNodes[0],"rowHeader")},adjustThead:function(){var e=this.wtTable.getRenderedColumnsCount(),t=this.THEAD.firstChild;if(this.columnHeaders.length){for(var n=0,o=this.columnHeaders.length;o>n;n++){for(t=this.THEAD.childNodes[n],t||(t=document.createElement("TR"),this.THEAD.appendChild(t)),this.theadChildrenLength=t.childNodes.length;this.theadChildrenLengthe+this.rowHeaderCount;)t.removeChild(t.lastChild),this.theadChildrenLength--}var r=this.THEAD.childNodes.length;if(r>this.columnHeaders.length)for(var i=this.columnHeaders.length;r>i;i++)this.THEAD.removeChild(this.THEAD.lastChild)}else t&&l(t)},getTrForColumnHeaders:function(e){return this.THEAD.childNodes[e]},renderColumnHeader:function(e,t,n){return n.className="",n.removeAttribute("style"),this.columnHeaders[e](t,n,e)},adjustColumns:function(e,t){for(var n=e.childNodes.length;t>n;){var o=document.createElement("TD");e.appendChild(o),n++}for(;n>t;)e.removeChild(e.lastChild),n--},removeRedundantColumns:function(e){for(;this.wtTable.tbodyChildrenLength>e;)this.TBODY.removeChild(this.TBODY.lastChild),this.wtTable.tbodyChildrenLength--}},{}),window.WalkontableTableRenderer=f},{"helpers/dom/element":45}],22:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableViewport:{get:function(){return m}},__esModule:{value:!0}});var o,r,i,s,a=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),l=a.getScrollbarWidth,u=(a.getScrollTop,a.getStyle),c=a.offset,d=a.outerHeight,h=a.outerWidth,f=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,p=(i=e("calculator/viewportColumns"),i&&i.__esModule&&i||{"default":i}).WalkontableViewportColumnsCalculator,g=(s=e("calculator/viewportRows"),s&&s.__esModule&&s||{"default":s}).WalkontableViewportRowsCalculator,m=function(e){var t=this;this.wot=e,this.instance=this.wot,this.oversizedRows=[],this.oversizedColumnHeaders=[],this.isMarkedOversizedColumn={},this.clientHeight=0,this.containerWidth=NaN,this.rowHeaderWidth=NaN,this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,this.eventManager=new f(this.wot),this.eventManager.addEventListener(window,"resize",function(){t.clientHeight=t.getWorkspaceHeight()})};$traceurRuntime.createClass(m,{getWorkspaceHeight:function(){var e,t=this.instance.wtOverlays.topOverlay.trimmingContainer,n=0;return t===window?n=document.documentElement.clientHeight:(e=d(t),n=e>0&&t.clientHeight>0?t.clientHeight:1/0),n},getWorkspaceWidth:function(){var e,t,n=this.wot.getSetting("totalColumns"),o=this.instance.wtOverlays.leftOverlay.trimmingContainer,r=this.wot.getSetting("stretchH"),i=document.documentElement.offsetWidth,s=this.wot.getSetting("preventOverflow");return s?h(this.instance.wtTable.wtRootElement):(e=Handsontable.freezeOverlays?Math.min(i-this.getWorkspaceOffset().left,i):Math.min(this.getContainerFillWidth(),i-this.getWorkspaceOffset().left,i),o===window&&n>0&&this.sumColumnWidths(0,n-1)>e?document.documentElement.clientWidth:o!==window&&(t=u(this.instance.wtOverlays.leftOverlay.trimmingContainer,"overflow"),"scroll"==t||"hidden"==t||"auto"==t)?Math.max(e,o.clientWidth):"none"!==r&&r?e:Math.max(e,h(this.instance.wtTable.TABLE)))},hasVerticalScroll:function(){return this.getWorkspaceActualHeight()>this.getWorkspaceHeight()},hasHorizontalScroll:function(){return this.getWorkspaceActualWidth()>this.getWorkspaceWidth()},sumColumnWidths:function(e,t){for(var n=0;t>e;)n+=this.wot.wtTable.getColumnWidth(e),e++;return n},getContainerFillWidth:function(){if(this.containerWidth)return this.containerWidth;var e,t,n=this.instance.wtTable.holder;return t=document.createElement("div"),t.style.width="100%",t.style.height="1px",n.appendChild(t),e=t.offsetWidth,this.containerWidth=e,n.removeChild(t),e},getWorkspaceOffset:function(){return c(this.wot.wtTable.TABLE)},getWorkspaceActualHeight:function(){return d(this.wot.wtTable.TABLE)},getWorkspaceActualWidth:function(){return h(this.wot.wtTable.TABLE)||h(this.wot.wtTable.TBODY)||h(this.wot.wtTable.THEAD)},getColumnHeaderHeight:function(){return isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=d(this.wot.wtTable.THEAD)),this.columnHeaderHeight},getViewportHeight:function(){var e,t=this.getWorkspaceHeight();return t===1/0?t:(e=this.getColumnHeaderHeight(),e>0&&(t-=e),t)},getRowHeaderWidth:function(){if(this.wot.cloneSource)return this.wot.cloneSource.wtViewport.getRowHeaderWidth();if(isNaN(this.rowHeaderWidth)){var e=this.instance.getSetting("rowHeaders");if(e.length){var t=this.instance.wtTable.TABLE.querySelector("TH");this.rowHeaderWidth=0;for(var n=0,o=e.length;o>n;n++)t?(this.rowHeaderWidth+=h(t),t=t.nextSibling):this.rowHeaderWidth+=50}else this.rowHeaderWidth=0}return this.rowHeaderWidth},getViewportWidth:function(){var e,t=this.getWorkspaceWidth();return t===1/0?t:(e=this.getRowHeaderWidth(),e>0?t-e:t)},createRowsCalculator:function(){var e,t,n,o,r,i,s,a=void 0!==arguments[0]?arguments[0]:!1,u=this;return this.rowHeaderWidth=NaN,e=this.wot.wtSettings.settings.renderAllRows?1/0:this.getViewportHeight(),t=this.wot.wtOverlays.topOverlay.getScrollPosition()-this.wot.wtOverlays.topOverlay.getTableParentOffset(),0>t&&(t=0),n=this.wot.getSetting("fixedRowsTop"),r=this.wot.getSetting("fixedRowsBottom"),s=this.wot.getSetting("totalRows"),n&&(i=this.wot.wtOverlays.topOverlay.sumCellSizes(0,n),t+=i,e-=i),r&&this.wot.wtOverlays.bottomOverlay.clone&&(i=this.wot.wtOverlays.bottomOverlay.sumCellSizes(s-r,s),e-=i),o=this.wot.wtTable.holder.clientHeight===this.wot.wtTable.holder.offsetHeight?0:l(),new g(e,t,this.wot.getSetting("totalRows"),function(e){return u.wot.wtTable.getRowHeight(e)},a?null:this.wot.wtSettings.settings.viewportRowCalculatorOverride,a,o)},createColumnsCalculator:function(){var e,t,n=void 0!==arguments[0]?arguments[0]:!1,o=this,r=this.getViewportWidth();if(this.columnHeaderHeight=NaN,e=this.wot.wtOverlays.leftOverlay.getScrollPosition()-this.wot.wtOverlays.leftOverlay.getTableParentOffset(),0>e&&(e=0),t=this.wot.getSetting("fixedColumnsLeft")){var i=this.wot.wtOverlays.leftOverlay.sumCellSizes(0,t);e+=i,r-=i}return this.wot.wtTable.holder.clientWidth!==this.wot.wtTable.holder.offsetWidth&&(r-=l()),new p(r,e,this.wot.getSetting("totalColumns"),function(e){return o.wot.wtTable.getColumnWidth(e)},n?null:this.wot.wtSettings.settings.viewportColumnCalculatorOverride,n,this.wot.getSetting("stretchH"))},createRenderCalculators:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(e){var t=this.createRowsCalculator(!0),n=this.createColumnsCalculator(!0);this.areAllProposedVisibleRowsAlreadyRendered(t)&&this.areAllProposedVisibleColumnsAlreadyRendered(n)||(e=!1)}return e||(this.rowsRenderCalculator=this.createRowsCalculator(),this.columnsRenderCalculator=this.createColumnsCalculator()),this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,e},createVisibleCalculators:function(){this.rowsVisibleCalculator=this.createRowsCalculator(!0),this.columnsVisibleCalculator=this.createColumnsCalculator(!0)},areAllProposedVisibleRowsAlreadyRendered:function(e){return this.rowsVisibleCalculator?e.startRow0?!1:e.endRow>this.rowsRenderCalculator.endRow||e.endRow===this.rowsRenderCalculator.endRow&&e.endRow0?!1:e.endColumn>this.columnsRenderCalculator.endColumn||e.endColumn===this.columnsRenderCalculator.endColumn&&e.endColumn=0;s--)if(null===e[s])e.splice(s,1);else{var a=e[s][0],l=d.propToCol(e[s][1]),u=m.runHooks("modifyCol",l),c=m.getCellMeta(a,u);if("numeric"===c.type&&"string"==typeof e[s][3]&&e[s][3].length>0&&(/^-?[\d\s]*(\.|\,)?\d*$/.test(e[s][3])||c.format)){var h=e[s][3].length;"undefined"==typeof c.language?R.language("en"):e[s][3].indexOf(".")===h-3&&-1===e[s][3].indexOf(",")?R.language("en"):R.language(c.language),R.validate(e[s][3])&&(e[s][3]=R().unformat(e[s][3]))}m.getCellValidator(c)&&(i.addValidatorToQueue(),m.validateCell(e[s][3],c,function(t,n){return function(o){if("boolean"!=typeof o)throw new Error("Validation error: result is not boolean");o===!1&&n.allowInvalid===!1&&(e.splice(t,1),n.valid=!0,--t),i.removeValidatorFormQueue()}}(s,c),t))}i.checkIfQueueIsEmpty()}function r(e,t){var n=e.length-1;if(!(0>n)){for(;n>=0;n--)if(null!==e[n]){if(null!=e[n][2]||null!=e[n][3]){if(c.settings.allowInsertRow)for(;e[n][0]>m.countRows()-1;)d.createRow();if("array"===m.dataType&&c.settings.allowInsertColumn)for(;d.propToCol(e[n][1])>m.countCols()-1;)d.createCol();d.set(e[n][0],e[n][1],e[n][3])}}else e.splice(n,1);m.forceFullRender=!0,f.adjustRowsAndCols(),Handsontable.hooks.run(m,"beforeChangeRender",e,t),p.refreshBorders(null,!0),m.view.wt.wtOverlays.adjustElementsSize(),Handsontable.hooks.run(m,"afterChange",e,t||"edit")}}function i(e,t,n){return"object"==typeof e?e:[[e,t,n]]}function s(e){if(e.hasOwnProperty("type")){var t,n={};if("object"==typeof e.type)t=e.type;else if("string"==typeof e.type&&(t=Handsontable.cellTypes[e.type],void 0===t))throw new Error('You declared cell type "'+e.type+'" as a string that is not mapped to a known object. Cell type must be an object or a string mapped to an object in Handsontable.cellTypes');for(var o in t)t.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&(n[o]=t[o]);return n}}function a(e){return Handsontable.hooks.run(m,"modifyRow",e)}function l(e){return Handsontable.hooks.run(m,"modifyCol",e)}function u(){throw new Error("This method cannot be called because this Handsontable instance has been destroyed")}var c,d,h,f,p,g,m=this,w=function(){},v=D(m);A(w.prototype,Z.prototype),A(w.prototype,t),A(w.prototype,s(t)),this.rootElement=e,this.isHotTableEnv=T(this.rootElement),Handsontable.eventManager.isHotTableEnv=this.isHotTableEnv,this.container=document.createElement("DIV"),this.renderCall=!1,e.insertBefore(this.container,e.firstChild),this.guid="ht_"+B(),this.rootElement.id&&"ht_"!==this.rootElement.id.substring(0,3)||(this.rootElement.id=this.guid),c={cellSettings:[],columnSettings:[],columnsSettingConflicts:["data","width"],settings:new w,selRange:null,isPopulated:null,scrollable:null,firstRun:!0},f={alter:function(e,t,n,o,r){var i;switch(n=n||1,e){case"insert_row":if(m.getSettings().maxRows===m.countSourceRows())return;i=d.createRow(t,n),i&&(p.isSelected()&&c.selRange.from.row>=t?(c.selRange.from.row=c.selRange.from.row+i,p.transformEnd(i,0)):p.refreshBorders());break;case"insert_col":if(i=d.createCol(t,n)){if(Array.isArray(m.getSettings().colHeaders)){var s=[t,0];s.length+=i,Array.prototype.splice.apply(m.getSettings().colHeaders,s)}p.isSelected()&&c.selRange.from.col>=t?(c.selRange.from.col=c.selRange.from.col+i,p.transformEnd(0,i)):p.refreshBorders()}break;case"remove_row":d.removeRow(t,n),c.cellSettings.splice(t,n);var a=m.countRows(),l=m.getSettings().fixedRowsTop;l>=t+1&&(m.getSettings().fixedRowsTop-=Math.min(n,l-t));var u=m.getSettings().fixedRowsBottom;u&&t>=a-u&&(m.getSettings().fixedRowsBottom-=Math.min(n,u)),f.adjustRowsAndCols(),p.refreshBorders();break;case"remove_col":d.removeCol(t,n);for(var h=0,g=d.getAll().length;g>h;h++)h in c.cellSettings&&c.cellSettings[h].splice(t,n);var w=m.getSettings().fixedColumnsLeft;w>=t+1&&(m.getSettings().fixedColumnsLeft-=Math.min(n,w-t)),Array.isArray(m.getSettings().colHeaders)&&("undefined"==typeof t&&(t=-1),m.getSettings().colHeaders.splice(t,n)),f.adjustRowsAndCols(),p.refreshBorders();break;default:throw new Error('There is no such action "'+e+'"')}r||f.adjustRowsAndCols()},adjustRowsAndCols:function(){if(c.settings.minRows){var e=m.countRows();if(et;t++)d.createRow(m.countRows(),1,!0)}if(c.settings.minSpareRows){var o=m.countEmptyRows(!0);if(oi-1?(l=i-1,a=!0,h>l&&(h=l)):h>i-1&&(h=i-1,a=!0,l>h&&(l=h)),u>s-1?(u=s-1,a=!0,f>u&&(f=u)):f>s-1&&(f=s-1,a=!0,u>f&&(u=f)),a&&m.selectCell(l,u,h,f)}m.view&&m.view.wt.wtOverlays.adjustElementsSize()},populateFromArray:function(e,t,n,o,r,i,s){var a,l,u,d,h=[],f={};if(l=t.length,0===l)return!1;var p,g,w,v;({row:null===n?null:n.row,col:null===n?null:n.col});switch(r){case"shift_down":for(p=n?n.col-e.col+1:0,g=n?n.row-e.row+1:0,t=U(t),u=0,d=t.length,w=Math.max(d,p);w>u;u++)if(d>u){for(a=0,l=t[u].length;g-l>a;a++)t[u].push(t[u][a%l]);t[u].unshift(e.col+u,e.row,0),m.spliceCol.apply(m,t[u])}else t[u%d][0]=e.col+u,m.spliceCol.apply(m,t[u%d]);break;case"shift_right":for(p=n?n.col-e.col+1:0,g=n?n.row-e.row+1:0,a=0,l=t.length,v=Math.max(l,g);v>a;a++)if(l>a){for(u=0,d=t[a].length;p-d>u;u++)t[a].push(t[a][u%d]);t[a].unshift(e.row+a,e.col,0),m.spliceRow.apply(m,t[a])}else t[a%l][0]=e.row+a,m.spliceRow.apply(m,t[a%l]);break;case"overwrite":default:f.row=e.row,f.col=e.col;var y,b={row:n&&e?n.row-e.row+1:1,col:n&&e?n.col-e.col+1:1},C=0,R=0,_=!0,S=function(e){var n=void 0!==arguments[1]?arguments[1]:null,o=t[e%t.length];return null!==n?o[n%o.length]:o},E=t.length,T=n?n.row-e.row+1:0;for(l=n?T:Math.max(E,T),a=0;l>a&&!(n&&f.row>n.row&&T>E||!c.settings.allowInsertRow&&f.row>m.countRows()-1||f.row>=c.settings.maxRows);a++){var O=a-C,M=S(O).length,k=n?n.col-e.col+1:0;if(d=n?k:Math.max(M,k),f.col=e.col,y=m.getCellMeta(f.row,f.col),"paste"!==o&&"autofill"!==o||!y.skipRowOnPaste){for(R=0,u=0;d>u&&!(n&&f.col>n.col&&k>M||!c.settings.allowInsertColumn&&f.col>m.countCols()-1||f.col>=c.settings.maxCols);u++)if(y=m.getCellMeta(f.row,f.col),"paste"!==o&&"autofill"!==o||!y.skipColumnOnPaste)if(y.readOnly)f.col++;else{var H=u-R,D=S(O,H),x=m.getDataAtCell(f.row,f.col),A={row:O,col:H};if("autofill"===o){var W=m.runHooks("beforeAutofillInsidePopulate",A,i,t,s,{},b);W&&(D="undefined"==typeof W.value?D:W.value)}if(null!==D&&"object"==typeof D)if(null===x||"object"!=typeof x)_=!1;else{var I=P(x[0]||x),j=P(D[0]||D);N(I,j)?D=L(D):_=!1}else null!==x&&"object"==typeof x&&(_=!1);_&&h.push([f.row,f.col,D]),_=!0,f.col++}else R++,f.col++,d++;f.row++}else C++,f.row++,l++}m.setDataAtCell(h,null,null,o||"populateFromArray")}}},this.selection=p={inProgress:!1,selectedHeader:{cols:!1,rows:!1},setSelectedHeaders:function(e,t){m.selection.selectedHeader.rows=e,m.selection.selectedHeader.cols=t},begin:function(){m.selection.inProgress=!0},finish:function(){var e=m.getSelected();Handsontable.hooks.run(m,"afterSelectionEnd",e[0],e[1],e[2],e[3]),Handsontable.hooks.run(m,"afterSelectionEndByProp",e[0],m.colToProp(e[1]),e[2],m.colToProp(e[3])),m.selection.inProgress=!1},isInProgress:function(){return m.selection.inProgress},setRangeStart:function(e,t){Handsontable.hooks.run(m,"beforeSetRangeStart",e),c.selRange=new X(e,e,e),p.setRangeEnd(e,null,t)},setRangeEnd:function(e,t,n){if(null!==c.selRange){var o,r=!1,i=!0,s=m.view.wt.wtTable.getFirstVisibleRow(),a=m.view.wt.wtTable.getFirstVisibleColumn(),l={row:null,col:null};Handsontable.hooks.run(m,"beforeSetRangeEnd",e),m.selection.begin(),l.row=e.row<0?s:e.row,l.col=e.col<0?a:e.col,c.selRange.to=new K(l.row,l.col),c.settings.multiSelect||(c.selRange.from=e),m.view.wt.selections.current.clear(),o=m.getCellMeta(c.selRange.highlight.row,c.selRange.highlight.col).disableVisualSelection,"string"==typeof o&&(o=[o]),(o===!1||Array.isArray(o)&&-1===o.indexOf("current"))&&m.view.wt.selections.current.add(c.selRange.highlight),m.view.wt.selections.area.clear(),(o===!1||Array.isArray(o)&&-1===o.indexOf("area"))&&p.isMultiple()&&(m.view.wt.selections.area.add(c.selRange.from),m.view.wt.selections.area.add(c.selRange.to)),(c.settings.currentRowClassName||c.settings.currentColClassName)&&(m.view.wt.selections.highlight.clear(),m.view.wt.selections.highlight.add(c.selRange.from),m.view.wt.selections.highlight.add(c.selRange.to)),Handsontable.hooks.run(m,"afterSelection",c.selRange.from.row,c.selRange.from.col,c.selRange.to.row,c.selRange.to.col),Handsontable.hooks.run(m,"afterSelectionByProp",c.selRange.from.row,d.colToProp(c.selRange.from.col),c.selRange.to.row,d.colToProp(c.selRange.to.col)),(0===c.selRange.from.row&&c.selRange.to.row===m.countRows()-1&&m.countRows()>1||0===c.selRange.from.col&&c.selRange.to.col===m.countCols()-1&&m.countCols()>1)&&(r=!0),(e.row<0||e.col<0)&&(i=!1),t!==!1&&!r&&i&&(c.selRange.from&&!p.isMultiple()?m.view.scrollViewport(c.selRange.from):m.view.scrollViewport(e)),p.refreshBorders(null,n)}},refreshBorders:function(e,t){t||g.destroyEditor(e),m.view.render(),p.isSelected()&&!t&&g.prepareEditor()},isMultiple:function(){var e=!(c.selRange.to.col===c.selRange.from.col&&c.selRange.to.row===c.selRange.from.row),t=Handsontable.hooks.run(m,"afterIsMultipleSelection",e);return e?t:void 0},transformStart:function(e,t,n,o){var r,i,s,a,l=new K(e,t),u=0,d=0;m.runHooks("modifyTransformStart",l),r=m.countRows(),i=m.countCols(),a=m.getSettings().fixedRowsBottom,c.selRange.highlight.row+e>r-1?n&&c.settings.minSpareRows>0&&!(a&&c.selRange.highlight.row>=r-a-1)?(m.alter("insert_row",r),r=m.countRows()):c.settings.autoWrapCol&&(l.row=1-r,l.col=c.selRange.highlight.col+l.col==i-1?1-i:1):c.settings.autoWrapCol&&c.selRange.highlight.row+l.row<0&&c.selRange.highlight.col+l.col>=0&&(l.row=r-1,l.col=c.selRange.highlight.col+l.col==0?i-1:-1),c.selRange.highlight.col+l.col>i-1?n&&c.settings.minSpareCols>0?(m.alter("insert_col",i),i=m.countCols()):c.settings.autoWrapRow&&(l.row=c.selRange.highlight.row+l.row==r-1?1-r:1,l.col=1-i):c.settings.autoWrapRow&&c.selRange.highlight.col+l.col<0&&c.selRange.highlight.row+l.row>=0&&(l.row=c.selRange.highlight.row+l.row==0?r-1:-1,l.col=i-1),s=new K(c.selRange.highlight.row+l.row,c.selRange.highlight.col+l.col),s.row<0?(u=-1,s.row=0):s.row>0&&s.row>=r&&(u=1,s.row=r-1),s.col<0?(d=-1,s.col=0):s.col>0&&s.col>=i&&(d=1,s.col=i-1),m.runHooks("afterModifyTransformStart",s,u,d),p.setRangeStart(s,o)},transformEnd:function(e,t){var n,o,r,i=new K(e,t),s=0,a=0;m.runHooks("modifyTransformEnd",i),n=m.countRows(),o=m.countCols(),r=new K(c.selRange.to.row+i.row,c.selRange.to.col+i.col),r.row<0?(s=-1,r.row=0):r.row>0&&r.row>=n&&(s=1,r.row=n-1),r.col<0?(a=-1,r.col=0):r.col>0&&r.col>=o&&(a=1,r.col=o-1),m.runHooks("afterModifyTransformEnd",r,s,a),p.setRangeEnd(r,!0)},isSelected:function(){return null!==c.selRange},inInSelection:function(e){return p.isSelected()?c.selRange.includes(e):!1},deselect:function(){p.isSelected()&&(m.selection.inProgress=!1,c.selRange=null,m.view.wt.selections.current.clear(),m.view.wt.selections.area.clear(),(c.settings.currentRowClassName||c.settings.currentColClassName)&&m.view.wt.selections.highlight.clear(),g.destroyEditor(),p.refreshBorders(),Handsontable.hooks.run(m,"afterDeselect"))},selectAll:function(){c.settings.multiSelect&&(p.setRangeStart(new K(0,0)),p.setRangeEnd(new K(m.countRows()-1,m.countCols()-1),!1))},empty:function(){if(p.isSelected()){var e,t,n=c.selRange.getTopLeftCorner(),o=c.selRange.getBottomRightCorner(),r=[];for(e=n.row;e<=o.row;e++)for(t=n.col;t<=o.col;t++)m.getCellMeta(e,t).readOnly||r.push([e,t,""]);m.setDataAtCell(r)}}},this.init=function(){h=new z(m,c.settings.data),Handsontable.hooks.run(m,"beforeInit"),Handsontable.mobileBrowser&&S(m.rootElement,"mobile"),this.updateSettings(c.settings,!0),this.view=new F(this),g=new H(m,c,p,d),this.forceFullRender=!0,Handsontable.hooks.run(m,"init"),this.view.render(),"object"==typeof c.firstRun&&(Handsontable.hooks.run(m,"afterChange",c.firstRun[0],c.firstRun[1]),c.firstRun=!1),Handsontable.hooks.run(m,"afterInit")},this.validateCell=function(e,t,n,o){function r(e){var o=t.physicalCol,r=t.physicalRow,i=m.getCell(r,o,!0);i&&m.view.wt.wtSettings.settings.cellRenderer(r,o,i),n(e)}var i=m.getCellValidator(t);"[object RegExp]"===Object.prototype.toString.call(i)&&(i=function(e){return function(t,n){n(e.test(t))}}(i)),"function"==typeof i?(e=Handsontable.hooks.run(m,"beforeValidate",e,t.row,t.prop,o),m._registerTimeout(setTimeout(function(){i.call(t,e,function(n){n=Handsontable.hooks.run(m,"afterValidate",n,e,t.row,t.prop,o),t.valid=n,r(n),Handsontable.hooks.run(m,"postAfterValidate",n,e,t.row,t.prop,o)})},0))):(t.valid=!0,r(t.valid))},this.setDataAtCell=function(e,t,n,s){var a,l,u,c=i(e,t,n),h=[];for(a=0,l=c.length;l>a;a++){if("object"!=typeof c[a])throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if("number"!=typeof c[a][1])throw new Error("Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`");u=d.colToProp(c[a][1]),h.push([c[a][0],u,d.get(c[a][0],u),c[a][2]])}s||"object"!=typeof e||(s=t),o(h,s,function(){r(h,s)})},this.setDataAtRowProp=function(e,t,n,s){var a,l,u=i(e,t,n),c=[];for(a=0,l=u.length;l>a;a++)c.push([u[a][0],u[a][1],d.get(u[a][0],u[a][1]),u[a][2]]);s||"object"!=typeof e||(s=t),o(c,s,function(){r(c,s)})},this.listen=function(){Handsontable.activeGuid=m.guid},this.unlisten=function(){Handsontable.activeGuid=null},this.isListening=function(){return Handsontable.activeGuid===m.guid},this.destroyEditor=function(e){p.refreshBorders(e)},this.populateFromArray=function(e,t,n,o,r,i,s,a,l){var u;if("object"!=typeof n||"object"!=typeof n[0])throw new Error("populateFromArray parameter `input` must be an array of arrays");return u="number"==typeof o?new K(o,r):null,f.populateFromArray(new K(e,t),n,u,i,s,a,l)},this.spliceCol=function(e,t,n){return d.spliceCol.apply(d,arguments)},this.spliceRow=function(e,t,n){return d.spliceRow.apply(d,arguments)},this.getSelected=function(){return p.isSelected()?[c.selRange.from.row,c.selRange.from.col,c.selRange.to.row,c.selRange.to.col]:void 0},this.getSelectedRange=function(){return p.isSelected()?c.selRange:void 0},this.render=function(){m.view&&(m.renderCall=!0,m.forceFullRender=!0,p.refreshBorders(null,!0))},this.loadData=function(e){function t(){c.cellSettings.length=0}if("object"==typeof e&&null!==e)e.push&&e.splice||(e=[e]);else{if(null!==e)throw new Error("loadData only accepts array of objects or array of arrays ("+typeof e+" given)");e=[];for(var n,o=0,r=c.settings.startRows;r>o;o++){n=[];for(var i=0,s=c.settings.startCols;s>i;i++)n.push(null);e.push(n)}}c.isPopulated=!1,w.prototype.data=e,Array.isArray(c.settings.dataSchema)||Array.isArray(e[0])?m.dataType="array":"function"==typeof c.settings.dataSchema?m.dataType="function":m.dataType="object",d=new k(m,c,w),h.data=e,h.dataType=m.dataType,h.colToProp=d.colToProp.bind(d),h.propToCol=d.propToCol.bind(d),t(),f.adjustRowsAndCols(),Handsontable.hooks.run(m,"afterLoadData",c.firstRun),c.firstRun?c.firstRun=[null,"loadData"]:(Handsontable.hooks.run(m,"afterChange",null,"loadData"),m.render()),c.isPopulated=!0},this.getData=function(e,t,n,o){return"undefined"==typeof e?d.getAll():d.getRange(new K(e,t),new K(n,o),d.DESTINATION_RENDERER)},this.getCopyableText=function(e,t,n,o){return d.getCopyableText(new K(e,t),new K(n,o))},this.getCopyableData=function(e,t){return d.getCopyable(e,d.colToProp(t))},this.getSchema=function(){return d.getSchema()},this.updateSettings=function(e,t){var n,o;if("undefined"!=typeof e.rows)throw new Error('"rows" setting is no longer supported. do you mean startRows, minRows or maxRows?');if("undefined"!=typeof e.cols)throw new Error('"cols" setting is no longer supported. do you mean startCols, minCols or maxCols?');for(n in e)"data"!==n&&(Handsontable.hooks.getRegistered().indexOf(n)>-1?("function"==typeof e[n]||Array.isArray(e[n]))&&m.addHook(n,e[n]):!t&&e.hasOwnProperty(n)&&(w.prototype[n]=e[n]));if(void 0===e.data&&void 0===c.settings.data?m.loadData(null):void 0!==e.data?m.loadData(e.data):void 0!==e.columns&&d.createMap(),o=m.countCols(),c.cellSettings.length=0,o>0){var r,i;for(n=0;o>n;n++)c.columnSettings[n]=M(w,c.columnsSettingConflicts),r=c.columnSettings[n].prototype,w.prototype.columns&&(i=w.prototype.columns[n],A(r,i),A(r,s(i)))}if("undefined"!=typeof e.cell)for(n in e.cell)if(e.cell.hasOwnProperty(n)){var a=e.cell[n];m.setCellMetaObject(a.row,a.col,a)}if(Handsontable.hooks.run(m,"afterCellMetaReset"),"undefined"!=typeof e.className&&(w.prototype.className&&O(m.rootElement,w.prototype.className),e.className&&S(m.rootElement,e.className)),"undefined"!=typeof e.height){var l=e.height;"function"==typeof l&&(l=l()),m.rootElement.style.height=l+"px"}if("undefined"!=typeof e.width){var u=e.width;"function"==typeof u&&(u=u()),m.rootElement.style.width=u+"px"}l&&(m.rootElement.style.overflow="hidden"),t||Handsontable.hooks.run(m,"afterUpdateSettings"),f.adjustRowsAndCols(),m.view&&!c.firstRun&&(m.forceFullRender=!0,p.refreshBorders(null,!0))},this.getValue=function(){var e=m.getSelected();if(w.prototype.getValue){if("function"==typeof w.prototype.getValue)return w.prototype.getValue.call(m);if(e)return m.getData()[e[0]][w.prototype.getValue]}else if(e)return m.getDataAtCell(e[0],e[1])},this.getSettings=function(){return c.settings},this.clear=function(){p.selectAll(),p.empty()},this.alter=function(e,t,n,o,r){f.alter(e,t,n,o,r)},this.getCell=function(e,t,n){return m.view.getCellAtCoords(new K(e,t),n)},this.getCoords=function(e){return this.view.wt.wtTable.getCoords.call(this.view.wt.wtTable,e)},this.colToProp=function(e){return d.colToProp(e)},this.propToCol=function(e){return d.propToCol(e)},this.getDataAtCell=function(e,t){return d.get(e,d.colToProp(t))},this.getDataAtRowProp=function(e,t){return d.get(e,t)},this.getDataAtCol=function(e){var t=[];return t.concat.apply(t,d.getRange(new K(0,e),new K(c.settings.data.length-1,e),d.DESTINATION_RENDERER))},this.getDataAtProp=function(e){var t,n=[];return t=d.getRange(new K(0,d.propToCol(e)),new K(c.settings.data.length-1,d.propToCol(e)),d.DESTINATION_RENDERER),n.concat.apply(n,t)},this.getSourceData=function(e,t,n,o){var r;return r=void 0===e?h.getData():h.getByRange(new K(e,t),new K(n,o))},this.getSourceDataAtCol=function(e){return h.getAtColumn(e)},this.getSourceDataAtRow=function(e){return h.getAtRow(e)},this.getSourceDataAtCell=function(e,t){return h.getAtCell(e,t)},this.getDataAtRow=function(e){var t=d.getRange(new K(e,0),new K(e,this.countCols()-1),d.DESTINATION_RENDERER);return t[0]},this.getDataType=function(e,t,n,o){var r=this,i=null,s=null;void 0===e&&(e=0,n=this.countRows(),t=0,o=this.countCols()),void 0===n&&(n=e),void 0===o&&(o=t);var a="mixed";return V(Math.min(e,n),Math.max(e,n),function(e){var n=!0;return V(Math.min(t,o),Math.max(t,o),function(t){var o=r.getCellMeta(e,t);return s=o.type,i?n=i===s:i=s,n}),a=n?s:"mixed",n}),a},this.removeCellMeta=function(e,t,n){var o=m.getCellMeta(e,t);void 0!=o[n]&&delete c.cellSettings[e][t][n]},this.setCellMetaObject=function(e,t,n){if("object"==typeof n)for(var o in n)if(n.hasOwnProperty(o)){var r=n[o];this.setCellMeta(e,t,o,r)}},this.setCellMeta=function(e,t,n,o){c.cellSettings[e]||(c.cellSettings[e]=[]),c.cellSettings[e][t]||(c.cellSettings[e][t]=new c.columnSettings[t]),c.cellSettings[e][t][n]=o,Handsontable.hooks.run(m,"afterSetCellMeta",e,t,n,o)},this.getCellsMeta=function(){return W(c.cellSettings)},this.getCellMeta=function(e,t){var n,o=d.colToProp(t),r=e,i=t;if(e=a(e),t=l(t),c.columnSettings[t]||(c.columnSettings[t]=M(w,c.columnsSettingConflicts)),c.cellSettings[e]||(c.cellSettings[e]=[]),c.cellSettings[e][t]||(c.cellSettings[e][t]=new c.columnSettings[t]),n=c.cellSettings[e][t],n.row=e,n.col=t,n.physicalRow=r,n.physicalCol=i,n.prop=o,n.instance=m,Handsontable.hooks.run(m,"beforeGetCellMeta",e,t,n),A(n,s(n)),n.cells){var u=n.cells.call(n,e,t,o);u&&(A(n,u),A(n,s(u)))}return Handsontable.hooks.run(m,"afterGetCellMeta",e,t,n),n},this.isColumnModificationAllowed=function(){return!("object"===m.dataType||m.getSettings().columns)};var y=G("renderer");this.getCellRenderer=function(e,t){var n=y.call(this,e,t);return j(n)},this.getCellEditor=G("editor"),this.getCellValidator=G("validator"),this.validateCells=function(e){var t=new n;t.onQueueEmpty=e;for(var o=m.countRows()-1;o>=0;){for(var r=m.countCols()-1;r>=0;)t.addValidatorToQueue(),m.validateCell(m.getDataAtCell(o,r),m.getCellMeta(o,r),function(e){if("boolean"!=typeof e)throw new Error("Validation error: result is not boolean");e===!1&&(t.valid=!1),t.removeValidatorFormQueue()},"validateCells"),r--;o--}t.checkIfQueueIsEmpty()},this.getRowHeader=function(e){var t=c.settings.rowHeaders;return void 0!==e&&(e=Handsontable.hooks.run(m,"modifyRowHeader",e)),void 0===e?(t=[],V(m.countRows()-1,function(e){t.push(m.getRowHeader(e))})):Array.isArray(t)&&void 0!==t[e]?t=t[e]:"function"==typeof t?t=t(e):t&&"string"!=typeof t&&"number"!=typeof t&&(t=e+1),t},this.hasRowHeaders=function(){return!!c.settings.rowHeaders},this.hasColHeaders=function(){if(void 0!==c.settings.colHeaders&&null!==c.settings.colHeaders)return!!c.settings.colHeaders;for(var e=0,t=m.countCols();t>e;e++)if(m.getColHeader(e))return!0;return!1},this.getColHeader=function(e){if(e=Handsontable.hooks.run(m,"modifyColHeader",e),void 0===e){for(var t=[],n=0,o=m.countCols();o>n;n++)t.push(m.getColHeader(n));return t}var r=e;return e=Handsontable.hooks.run(m,"modifyCol",e),c.settings.columns&&c.settings.columns[e]&&c.settings.columns[e].title?c.settings.columns[e].title:Array.isArray(c.settings.colHeaders)&&void 0!==c.settings.colHeaders[e]?c.settings.colHeaders[e]:"function"==typeof c.settings.colHeaders?c.settings.colHeaders(e):c.settings.colHeaders&&"string"!=typeof c.settings.colHeaders&&"number"!=typeof c.settings.colHeaders?$(r):c.settings.colHeaders},this._getColWidthFromSettings=function(e){var t=m.getCellMeta(0,e),n=t.width;if((void 0===n||n===c.settings.width)&&(n=t.colWidths),void 0!==n&&null!==n){switch(typeof n){case"object":n=n[e];break;case"function":n=n(e)}"string"==typeof n&&(n=parseInt(n,10))}return n},this.getColWidth=function(e){var t=m._getColWidthFromSettings(e);return t=Handsontable.hooks.run(m,"modifyColWidth",t,e),void 0===t&&(t=q.DEFAULT_WIDTH),t},this._getRowHeightFromSettings=function(e){var t=c.settings.rowHeights;if(void 0!==t&&null!==t){switch(typeof t){case"object":t=t[e];break;case"function":t=t(e)}"string"==typeof t&&(t=parseInt(t,10))}return t},this.getRowHeight=function(e){var t=m._getRowHeightFromSettings(e);return t=Handsontable.hooks.run(m,"modifyRowHeight",t,e)},this.countSourceRows=function(){return m.getSourceData()?m.getSourceData().length:0},this.countRows=function(){return d.getLength()},this.countCols=function(){return"object"===m.dataType||"function"===m.dataType?c.settings.columns&&c.settings.columns.length?c.settings.columns.length:d.colToPropCache.length:"array"===m.dataType?c.settings.columns&&c.settings.columns.length?c.settings.columns.length:c.settings.data&&c.settings.data[0]&&c.settings.data[0].length?c.settings.data[0].length:0:void 0},this.getColspanOffset=function(e,t){var n=0;if(m.colspanArray){for(var o=0;e>o;o++)n+=m.colspanArray[t][o]-1||0;return n}for(var n=0,r=m.view.wt.wtTable.THEAD.childNodes.length-t-1,i=m.view.wt.wtTable.THEAD.querySelector("tr:nth-child("+parseInt(r+1,10)+")"),s=m.view.wt.wtSettings.settings.rowHeaders().length,o=s;s+e>o;o++)i.childNodes[o].hasAttribute("colspan")&&(n+=parseInt(i.childNodes[o].getAttribute("colspan"),10)-1);return n},this.getHeaderColspan=function(e,t){var n=m.view.wt.wtTable.THEAD.childNodes.length-t-1,o=m.view.wt.wtSettings.settings.rowHeaders().length,r=m.view.wt.wtTable.THEAD.querySelector("tr:nth-child("+parseInt(n+1,10)+")"),i=o+e-m.view.wt.wtViewport.columnsRenderCalculator.startColumn;return r.childNodes[i].hasAttribute("colspan")?parseInt(r.childNodes[i].getAttribute("colspan"),10):0},this.rowOffset=function(){return m.view.wt.wtTable.getFirstRenderedRow()},this.colOffset=function(){return m.view.wt.wtTable.getFirstRenderedColumn()},this.countRenderedRows=function(){return m.view.wt.drawn?m.view.wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return m.view.wt.drawn?m.view.wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return m.view.wt.drawn?m.view.wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return m.view.wt.drawn?m.view.wt.wtTable.getVisibleColumnsCount():-1},this.countEmptyRows=function(e){for(var t,n=m.countRows()-1,o=0;n>=0;){if(t=Handsontable.hooks.run(this,"modifyRow",n),m.isEmptyRow(t))o++;else if(e)break;n--}return o},this.countEmptyCols=function(e){if(m.countRows()<1)return 0;for(var t=m.countCols()-1,n=0;t>=0;){if(m.isEmptyCol(t))n++;else if(e)break;t--}return n},this.isEmptyRow=function(e){return c.settings.isEmptyRow.call(m,e)},this.isEmptyCol=function(e){return c.settings.isEmptyCol.call(m,e)},this.selectCell=function(e,t,n,o,r,i){var s;if(i="undefined"==typeof i||i===!0,"number"!=typeof e||0>e||e>=m.countRows())return!1;if("number"!=typeof t||0>t||t>=m.countCols())return!1;if("undefined"!=typeof n){if("number"!=typeof n||0>n||n>=m.countRows())return!1;if("number"!=typeof o||0>o||o>=m.countCols())return!1}return s=new K(e,t),c.selRange=new X(s,s,s),i&&m.listen(),"undefined"==typeof n?p.setRangeEnd(c.selRange.from,r):p.setRangeEnd(new K(n,o),r),m.selection.finish(),!0},this.selectCellByProp=function(e,t,n,o,r){return arguments[1]=d.propToCol(arguments[1]),"undefined"!=typeof arguments[3]&&(arguments[3]=d.propToCol(arguments[3])),m.selectCell.apply(m,arguments)},this.deselectCell=function(){p.deselect()},this.destroy=function(){m._clearTimeouts(),m.view&&m.view.destroy(),h&&h.destroy(),h=null,E(m.rootElement),v.destroy(),Handsontable.hooks.run(m,"afterDestroy"),Handsontable.hooks.destroy(m);for(var e in m)m.hasOwnProperty(e)&&("function"==typeof m[e]?m[e]=u:"guid"!==e&&(m[e]=null));c=null,d=null,f=null,p=null,g=null,m=null,w=null},this.getActiveEditor=function(){return g.getActiveEditor()},this.getPlugin=function(e){return I(this,e)},this.getInstance=function(){return m},this.addHook=function(e,t){Handsontable.hooks.add(e,t,m)},this.hasHook=function(e){return Handsontable.hooks.has(e,m)},this.addHookOnce=function(e,t){Handsontable.hooks.once(e,t,m)},this.removeHook=function(e,t){Handsontable.hooks.remove(e,t,m)},this.runHooks=function(e,t,n,o,r,i,s){return Handsontable.hooks.run(m,e,t,n,o,r,i,s)},this.timeouts=[],this._registerTimeout=function(e){this.timeouts.push(e)},this._clearTimeouts=function(){for(var e=0,t=this.timeouts.length;t>e;e++)clearTimeout(this.timeouts[e])},this.version=Handsontable.version,Handsontable.hooks.run(m,"construct")};var Z=function(){};Z.prototype={data:void 0,dataSchema:void 0,width:void 0,height:void 0,startRows:5,startCols:5,rowHeaders:null,colHeaders:null,colWidths:void 0,rowHeights:void 0,columns:void 0,cells:void 0,cell:[],comments:!1,customBorders:!1,minRows:0,minCols:0,maxRows:1/0,maxCols:1/0,minSpareRows:0,minSpareCols:0,allowInsertRow:!0,allowInsertColumn:!0,allowRemoveRow:!0,allowRemoveColumn:!0,multiSelect:!0,fillHandle:!0,fixedRowsTop:0,fixedRowsBottom:0,fixedColumnsLeft:0,outsideClickDeselects:!0,enterBeginsEditing:!0,enterMoves:{row:1,col:0},tabMoves:{row:0,col:1},autoWrapRow:!1,autoWrapCol:!1,copyRowsLimit:1e3,copyColsLimit:1e3,pasteMode:"overwrite",persistentState:!1,currentRowClassName:void 0,currentColClassName:void 0,className:void 0,tableClassName:void 0,stretchH:"none",isEmptyRow:function(e){var t,n,o,r;for(t=0,n=this.countCols();n>t;t++)if(o=this.getDataAtCell(e,t),""!==o&&null!==o&&"undefined"!=typeof o)return"object"==typeof o?(r=this.getCellMeta(e,t),N(this.getSchema()[r.prop],o)):!1;return!0},isEmptyCol:function(e){var t,n,o;for(t=0,n=this.countRows();n>t;t++)if(o=this.getDataAtCell(t,e),""!==o&&null!==o&&"undefined"!=typeof o)return!1;return!0},observeDOMVisibility:!0,allowInvalid:!0,invalidCellClassName:"htInvalid",placeholder:!1,placeholderCellClassName:"htPlaceholder",readOnlyCellClassName:"htDimmed",renderer:void 0,commentedCellClassName:"htCommentCell",fragmentSelection:!1,readOnly:!1,skipColumnOnPaste:!1,search:!1,type:"text",copyable:!0,editor:void 0,autoComplete:void 0,visibleRows:10,trimDropdown:!0,debug:!1,wordWrap:!0,noWordWrapClassName:"htNoWrap",contextMenu:void 0,contextMenuCopyPaste:void 0,copyPaste:void 0,undo:void 0,columnSorting:void 0,manualColumnMove:void 0,manualColumnResize:void 0,manualRowMove:void 0,manualRowResize:void 0,mergeCells:!1,viewportRowRenderingOffset:"auto", +viewportColumnRenderingOffset:"auto",validator:void 0,disableVisualSelection:!1,sortIndicator:!1,manualColumnFreeze:void 0,trimWhitespace:!0,settings:void 0,source:void 0,title:void 0,checkedTemplate:void 0,uncheckedTemplate:void 0,label:void 0,format:void 0,language:void 0,selectOptions:void 0,autoColumnSize:void 0,autoRowSize:void 0,dateFormat:void 0,correctFormat:!1,defaultDate:void 0,strict:void 0,renderAllRows:void 0,preventOverflow:!1},Handsontable.DefaultSettings=Z},{"3rdparty/walkontable/src/calculator/viewportColumns":3,"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/selection":18,dataMap:26,dataSource:27,editorManager:28,eventManager:41,"helpers/array":42,"helpers/data":44,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/setting":51,"helpers/string":52,numeral:"numeral",plugins:57,renderers:88,tableView:97}],26:[function(e,t,n){"use strict";function o(e,t,n){this.instance=e,this.priv=t,this.GridSettings=n,this.dataSource=this.instance.getSettings().data,this.dataSource[0]?this.duckSchema=this.recursiveDuckSchema(this.dataSource[0]):this.duckSchema={},this.createMap()}Object.defineProperties(n,{DataMap:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l,u,c,d=(r=e("SheetClip"),r&&r.__esModule&&r||{"default":r})["default"],h=(i=e("helpers/data"),i&&i.__esModule&&i||{"default":i}).cellMethodLookupFactory,f=(s=e("helpers/setting"),s&&s.__esModule&&s||{"default":s}).columnFactory,p=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),g=p.duckSchema,m=p.deepExtend,w=(l=e("helpers/array"),l&&l.__esModule&&l||{"default":l}),v=w.extendArray,y=w.to2dArray,b=(u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}).rangeEach,C=(c=e("multiMap"),c&&c.__esModule&&c||{"default":c}).MultiMap;o.prototype.DESTINATION_RENDERER=1,o.prototype.DESTINATION_CLIPBOARD_GENERATOR=2,o.prototype.recursiveDuckSchema=function(e){return g(e)},o.prototype.recursiveDuckColumns=function(e,t,n){var o,r;if("undefined"==typeof t&&(t=0,n=""),"object"==typeof e&&!Array.isArray(e))for(r in e)e.hasOwnProperty(r)&&(null===e[r]?(o=n+r,this.colToPropCache.push(o),this.propToColCache.set(o,t),t++):t=this.recursiveDuckColumns(e[r],t,r+"."));return t},o.prototype.createMap=function(){var e,t,n=this.getSchema();if("undefined"==typeof n)throw new Error("trying to create `columns` definition but you didnt' provide `schema` nor `data`");this.colToPropCache=[],this.propToColCache=new C;var o=this.instance.getSettings().columns;if(o)for(e=0,t=o.length;t>e;e++)"undefined"!=typeof o[e].data&&(this.colToPropCache[e]=o[e].data,this.propToColCache.set(o[e].data,e));else this.recursiveDuckColumns(n)},o.prototype.colToProp=function(e){return e=Handsontable.hooks.run(this.instance,"modifyCol",e),this.colToPropCache&&"undefined"!=typeof this.colToPropCache[e]?this.colToPropCache[e]:e},o.prototype.propToCol=function(e){var t;return t="undefined"==typeof this.propToColCache.get(e)?e:this.propToColCache.get(e),t=Handsontable.hooks.run(this.instance,"modifyCol",t)},o.prototype.getSchema=function(){var e=this.instance.getSettings().dataSchema;return e?"function"==typeof e?e():e:this.duckSchema},o.prototype.createRow=function(e,t,n){var o,r,i=this.instance.countCols(),s=0;t||(t=1),("number"!=typeof e||e>=this.instance.countSourceRows())&&(e=this.instance.countSourceRows()),r=e;for(var a=this.instance.getSettings().maxRows;t>s&&this.instance.countSourceRows()l;l++)o.push(null)}else"function"===this.instance.dataType?o=this.instance.getSettings().dataSchema(e):(o={},m(o,this.getSchema()));e===this.instance.countSourceRows()?this.dataSource.push(o):this.dataSource.splice(e,0,o),s++,r++}return Handsontable.hooks.run(this.instance,"afterCreateRow",e,s,n),this.instance.forceFullRender=!0,s},o.prototype.createCol=function(e,t,n){if(!this.instance.isColumnModificationAllowed())throw new Error("Cannot create new column. When data source in an object, you can only have as much columns as defined in first data row, data schema or in the 'columns' setting.If you want to be able to add new columns, you have to use array datasource.");var o,r,i=this.instance.countSourceRows(),s=this.dataSource,a=0;t||(t=1),r=e;for(var l=this.instance.getSettings().maxCols;t>a&&this.instance.countCols()=this.instance.countCols()){for(var u=0;i>u;u++)"undefined"==typeof s[u]&&(s[u]=[]),s[u].push(null);this.priv.columnSettings.push(o)}else{for(var u=0;i>u;u++)s[u].splice(r,0,null);this.priv.columnSettings.splice(r,0,o)}a++,r++}return Handsontable.hooks.run(this.instance,"afterCreateCol",e,a,n),this.instance.forceFullRender=!0,a},o.prototype.removeRow=function(e,t){t||(t=1),"number"!=typeof e&&(e=-t),e=(this.instance.countSourceRows()+e)%this.instance.countSourceRows();var n=this.physicalRowsToLogical(e,t),o=Handsontable.hooks.run(this.instance,"beforeRemoveRow",e,t,n);if(o!==!1){var r=this.dataSource,i=r.filter(function(e,t){return-1==n.indexOf(t)});r.length=0,Array.prototype.push.apply(r,i),Handsontable.hooks.run(this.instance,"afterRemoveRow",e,t,n),this.instance.forceFullRender=!0}},o.prototype.removeCol=function(e,t){if("object"===this.instance.dataType||this.instance.getSettings().columns)throw new Error("cannot remove column with object data source or columns option specified");t||(t=1),"number"!=typeof e&&(e=-t),e=(this.instance.countCols()+e)%this.instance.countCols();var n=Handsontable.hooks.run(this.instance,"beforeRemoveCol",e,t);if(n!==!1){for(var o=this.dataSource,r=0,i=this.instance.countSourceRows();i>r;r++)o[r].splice(e,t);this.priv.columnSettings.splice(e,t),Handsontable.hooks.run(this.instance,"afterRemoveCol",e,t),this.instance.forceFullRender=!0}},o.prototype.spliceCol=function(e,t,n){var o=4<=arguments.length?[].slice.call(arguments,3):[],r=this.instance.getDataAtCol(e),i=r.slice(t,t+n),s=r.slice(t+n);v(o,s);for(var a=0;n>a;)o.push(null),a++;return y(o),this.instance.populateFromArray(t,e,o,null,null,"spliceCol"),i},o.prototype.spliceRow=function(e,t,n){var o=4<=arguments.length?[].slice.call(arguments,3):[],r=this.instance.getSourceDataAtRow(e),i=r.slice(t,t+n),s=r.slice(t+n);v(o,s);for(var a=0;n>a;)o.push(null),a++;return this.instance.populateFromArray(e,t,[o],null,null,"spliceRow"),i},o.prototype.get=function(e,t){if(e=Handsontable.hooks.run(this.instance,"modifyRow",e),"string"==typeof t&&t.indexOf(".")>-1){var n=t.split("."),o=this.dataSource[e];if(!o)return null;for(var r=0,i=n.length;i>r;r++)if(o=o[n[r]],"undefined"==typeof o)return null;return o}return"function"==typeof t?t(this.dataSource.slice(e,e+1)[0]):this.dataSource[e]&&this.dataSource[e].hasOwnProperty&&this.dataSource[e].hasOwnProperty(t)?this.dataSource[e][t]:null};var R=h("copyable",!1);o.prototype.getCopyable=function(e,t){return R.call(this.instance,e,this.propToCol(t))?this.get(e,t):""},o.prototype.set=function(e,t,n,o){if(e=Handsontable.hooks.run(this.instance,"modifyRow",e,o||"datamapGet"),"string"==typeof t&&t.indexOf(".")>-1){for(var r=t.split("."),i=this.dataSource[e],s=0,a=r.length-1;a>s;s++)"undefined"==typeof i[r[s]]&&(i[r[s]]={}),i=i[r[s]];i[r[s]]=n}else"function"==typeof t?t(this.dataSource.slice(e,e+1)[0],n):this.dataSource[e][t]=n},o.prototype.physicalRowsToLogical=function(e,t){for(var n,o=this.instance.countSourceRows(),r=(o+e)%o,i=[],s=t;o>r&&s;)n=Handsontable.hooks.run(this.instance,"modifyRow",r),i.push(n),s--,r++;return i},o.prototype.clear=function(){for(var e=0;e=o;o++){a=[];var c=Handsontable.hooks.run(this.instance,"modifyRow",o);for(i=Math.min(e.col,t.col);s>=i;i++){if(null===c)break;a.push(u.call(this,o,this.colToProp(i)))}null!==c&&l.push(a)}return l},o.prototype.getText=function(e,t){return d.stringify(this.getRange(e,t,this.DESTINATION_RENDERER))},o.prototype.getCopyableText=function(e,t){return d.stringify(this.getRange(e,t,this.DESTINATION_CLIPBOARD_GENERATOR))},Handsontable.DataMap=o},{SheetClip:"SheetClip","helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51,multiMap:55}],27:[function(e,t,n){"use strict";Object.defineProperties(n,{DataSource:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s,a,l=((o=e("helpers/data"),o&&o.__esModule&&o||{"default":o}).cellMethodLookupFactory,(r=e("helpers/setting"),r&&r.__esModule&&r||{"default":r}).columnFactory,i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}),u=(l.duckSchema,l.deepExtend,l.getProperty),c=(s=e("helpers/array"),s&&s.__esModule&&s||{"default":s}),d=(c.extendArray,c.arrayEach),h=(a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}).rangeEach,f=function(e,t){this.hot=e,this.data=t,this.dataType="array",this.colToProp=function(){},this.propToCol=function(){}};$traceurRuntime.createClass(f,{getData:function(){return this.data},getAtColumn:function(e){var t=this,n=[];return d(this.data,function(o){var r=t.colToProp(e);o="string"==typeof r?u(o,r):o[r],n.push(o)}),n},getAtRow:function(e){return this.data[e]},getAtCell:function(e,t){return this.data[e][this.colToProp(t)]},getByRange:function(e,t){var n=this,o=Math.min(e.row,t.row),r=Math.min(e.col,t.col),i=Math.max(e.row,t.row),s=Math.max(e.col,t.col),a=[];return h(o,i,function(e){var t,o=n.getAtRow(e);"array"===n.dataType?t=o.slice(r,s):"object"===n.dataType&&(t={},h(r,s,function(e){var r=n.colToProp(e);t[r]=o[r]})),a.push(t)}),a},destroy:function(){this.data=null,this.hot=null}},{})},{"helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51}],28:[function(e,t,n){"use strict";function o(e,t,n){function o(e){var o="function"==typeof t.settings.enterMoves?t.settings.enterMoves(event):t.settings.enterMoves;e?n.transformStart(-o.row,-o.col):n.transformStart(o.row,o.col,!0)}function r(e){e?n.transformEnd(-1,0):n.transformStart(-1,0)}function i(e){e?n.transformEnd(1,0):n.transformStart(1,0)}function s(e){e?n.transformEnd(0,1):n.transformStart(0,1)}function a(e){e?n.transformEnd(0,-1):n.transformStart(0,-1)}function l(l){var c,p;if(e.isListening()&&(Handsontable.hooks.run(e,"beforeKeyDown",l),!C&&!w(l)&&(t.lastKeyCode=l.keyCode,n.isSelected()))){if(c=(l.ctrlKey||l.metaKey)&&!l.altKey,y&&!y.isWaiting()&&!(h(l.keyCode)||f(l.keyCode)||c||b.isEditorOpened()))return void b.openEditor("",l);switch(p=l.shiftKey?n.setRangeEnd:n.setRangeStart,l.keyCode){case d.A:!b.isEditorOpened()&&c&&(n.selectAll(),l.preventDefault(),g(l));break;case d.ARROW_UP:b.isEditorOpened()&&!y.isWaiting()&&b.closeEditorAndSaveChanges(c),r(l.shiftKey),l.preventDefault(),g(l);break;case d.ARROW_DOWN:b.isEditorOpened()&&!y.isWaiting()&&b.closeEditorAndSaveChanges(c),i(l.shiftKey),l.preventDefault(),g(l);break;case d.ARROW_RIGHT:b.isEditorOpened()&&!y.isWaiting()&&b.closeEditorAndSaveChanges(c),s(l.shiftKey),l.preventDefault(),g(l);break;case d.ARROW_LEFT:b.isEditorOpened()&&!y.isWaiting()&&b.closeEditorAndSaveChanges(c),a(l.shiftKey),l.preventDefault(),g(l);break;case d.TAB:var v="function"==typeof t.settings.tabMoves?t.settings.tabMoves(l):t.settings.tabMoves;l.shiftKey?n.transformStart(-v.row,-v.col):n.transformStart(v.row,v.col,!0),l.preventDefault(),g(l);break;case d.BACKSPACE:case d.DELETE:n.empty(l),b.prepareEditor(),l.preventDefault();break;case d.F2:b.openEditor(null,l),y&&y.enableFullEditMode(),l.preventDefault();break;case d.ENTER:b.isEditorOpened()?(y&&y.state!==Handsontable.EditorState.WAITING&&b.closeEditorAndSaveChanges(c),o(l.shiftKey)):e.getSettings().enterBeginsEditing?(b.openEditor(null,l),y&&y.enableFullEditMode()):o(l.shiftKey),l.preventDefault(),m(l);break;case d.ESCAPE:b.isEditorOpened()&&b.closeEditorAndRestoreOriginalValue(c),l.preventDefault();break;case d.HOME:p(l.ctrlKey||l.metaKey?new u(0,t.selRange.from.col):new u(t.selRange.from.row,0)),l.preventDefault(),g(l);break;case d.END:p(l.ctrlKey||l.metaKey?new u(e.countRows()-1,t.selRange.from.col):new u(t.selRange.from.row,e.countCols()-1)),l.preventDefault(),g(l);break;case d.PAGE_UP:n.transformStart(-e.countVisibleRows(),0),l.preventDefault(),g(l);break;case d.PAGE_DOWN:n.transformStart(e.countVisibleRows(),0),l.preventDefault(),g(l)}}}function c(){function t(e,t,n){"TD"==n.nodeName&&(b.openEditor(),y&&y.enableFullEditMode())}e.addHook("afterDocumentKeyDown",l),p.addEventListener(document.documentElement,"keydown",function(t){e.runHooks("afterDocumentKeyDown",t)}),e.view.wt.update("onCellDblClick",t),e.addHook("afterDestroy",function(){C=!0})}var p,y,b=this,C=!1;p=v(e),this.destroyEditor=function(e){this.closeEditor(e)},this.getActiveEditor=function(){return y},this.prepareEditor=function(){var n,o,r,i,s,a,l;return y&&y.isWaiting()?void this.closeEditor(!1,!1,function(e){e&&b.prepareEditor()}):(n=t.selRange.highlight.row,o=t.selRange.highlight.col,r=e.colToProp(o),i=e.getCell(n,o),s=e.getDataAtCell(n,o),a=e.getCellMeta(n,o),l=e.getCellEditor(a),void(l?(y=Handsontable.editors.getEditor(l,e),y.prepare(n,o,r,i,s,a)):y=void 0))},this.isEditorOpened=function(){return y&&y.isOpened()},this.openEditor=function(e,t){y&&!y.cellProperties.readOnly?y.beginEditing(e,t):y&&y.cellProperties.readOnly&&t&&t.keyCode===d.ENTER&&o()},this.closeEditor=function(e,t,n){y?y.finishEditing(e,t,n):n&&n(!1)},this.closeEditorAndSaveChanges=function(e){return this.closeEditor(!1,e)},this.closeEditorAndRestoreOriginalValue=function(e){return this.closeEditor(!0,e)},c()}Object.defineProperties(n,{EditorManager:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l,u=(r=e("3rdparty/walkontable/src/cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords,c=(i=e("helpers/unicode"),i&&i.__esModule&&i||{"default":i}),d=c.KEY_CODES,h=c.isMetaKey,f=c.isCtrlKey,p=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=p.stopPropagation,m=p.stopImmediatePropagation,w=p.isImmediatePropagationStopped,v=((a=e("editors"),a&&a.__esModule&&a||{"default":a}).getEditor,(l=e("eventManager"),l&&l.__esModule&&l||{"default":l}).eventManager);Handsontable.EditorManager=o},{"3rdparty/walkontable/src/cell/coords":5,editors:29,eventManager:41,"helpers/dom/event":46,"helpers/unicode":53}],29:[function(e,t,n){"use strict";function o(e){var t,n;n={},t=e,this.getConstructor=function(){return e},this.getInstance=function(e){return e.guid in n||(n[e.guid]=new t(e)),n[e.guid]}}function r(e,t){var n=new o(t);"string"==typeof e&&(c[e]=n,Handsontable.editors[u(e)+"Editor"]=t),d.set(t,n)}function i(e,t){var n;if("function"==typeof e)d.get(e)||r(null,e),n=d.get(e);else{if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter ');n=c[e]}if(!n)throw Error('No editor registered under name "'+e+'"');return n.getInstance(t)}function s(e){var t;if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter ');if(t=c[e],!t)throw Error('No editor registered under name "'+e+'"');return t.getConstructor()}function a(e){return c[e]?!0:!1}Object.defineProperties(n,{registerEditor:{get:function(){return r}},getEditor:{get:function(){return i}},hasEditor:{get:function(){return a}},getEditorConstructor:{get:function(){return s}},__esModule:{value:!0}});var l,u=(l=e("helpers/string"),l&&l.__esModule&&l||{"default":l}).toUpperCaseFirst,c={},d=new WeakMap;Handsontable.editors=Handsontable.editors||{},Handsontable.editors.registerEditor=r,Handsontable.editors.getEditor=i},{"helpers/string":52}],30:[function(e,t,n){"use strict";function o(e){this.instance=e,this.state=Handsontable.EditorState.VIRGIN,this._opened=!1,this._fullEditMode=!1,this._closeCallback=null,this.init()}Object.defineProperties(n,{BaseEditor:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/mixed"),r&&r.__esModule&&r||{"default":r}).stringify,a=(i=e("3rdparty/walkontable/src/cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords;Handsontable.editors=Handsontable.editors||{},Handsontable.editors.BaseEditor=o,Handsontable.EditorState={VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"},o.prototype._fireCallbacks=function(e){this._closeCallback&&(this._closeCallback(e),this._closeCallback=null)},o.prototype.init=function(){},o.prototype.getValue=function(){throw Error("Editor getValue() method unimplemented")},o.prototype.setValue=function(e){throw Error("Editor setValue() method unimplemented")},o.prototype.open=function(){throw Error("Editor open() method unimplemented")},o.prototype.close=function(){throw Error("Editor close() method unimplemented")},o.prototype.prepare=function(e,t,n,o,r,i){this.TD=o,this.row=e,this.col=t,this.prop=n,this.originalValue=r,this.cellProperties=i,this.instance.view.isMouseDown()&&document.activeElement&&document.activeElement!==document.body?document.activeElement.blur():document.activeElement||document.body.focus(),this.state=Handsontable.EditorState.VIRGIN},o.prototype.extend=function(){function e(){n.apply(this,arguments)}function t(e,t){function n(){}return n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e}var n=this.constructor;return t(e,n)},o.prototype.saveValue=function(e,t){var n,o;t?(n=this.instance.getSelected(),n[0]>n[2]&&(o=n[0],n[0]=n[2],n[2]=o),n[1]>n[3]&&(o=n[1],n[1]=n[3],n[3]=o),this.instance.populateFromArray(n[0],n[1],e,n[2],n[3],"edit")):this.instance.populateFromArray(this.row,this.col,e,null,null,"edit")},o.prototype.beginEditing=function(e,t){this.state==Handsontable.EditorState.VIRGIN&&(this.instance.view.scrollViewport(new a(this.row,this.col)),this.instance.view.render(),this.state=Handsontable.EditorState.EDITING,e="string"==typeof e?e:this.originalValue,this.setValue(s(e)),this.open(t),this._opened=!0,this.focus(),this.instance.view.render())},o.prototype.finishEditing=function(e,t,n){var o,r=this;if(n){var i=this._closeCallback;this._closeCallback=function(e){i&&i(e),n(e)}}if(!this.isWaiting()){if(this.state==Handsontable.EditorState.VIRGIN)return void this.instance._registerTimeout(setTimeout(function(){r._fireCallbacks(!0)},0));if(this.state==Handsontable.EditorState.EDITING){if(e)return this.cancelChanges(),void this.instance.view.render();o=this.instance.getSettings().trimWhitespace?[["string"==typeof this.getValue()?String.prototype.trim.call(this.getValue()||""):this.getValue()]]:[[this.getValue()]],this.state=Handsontable.EditorState.WAITING,this.saveValue(o,t),this.instance.getCellValidator(this.cellProperties)?this.instance.addHookOnce("postAfterValidate",function(e){r.state=Handsontable.EditorState.FINISHED,r.discardEditor(e)}):(this.state=Handsontable.EditorState.FINISHED,this.discardEditor(!0))}}},o.prototype.cancelChanges=function(){this.state=Handsontable.EditorState.FINISHED,this.discardEditor()},o.prototype.discardEditor=function(e){this.state===Handsontable.EditorState.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.instance.selectCell(this.row,this.col),this.focus(),this.state=Handsontable.EditorState.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=Handsontable.EditorState.VIRGIN,this._fireCallbacks(!0)))},o.prototype.enableFullEditMode=function(){this._fullEditMode=!0},o.prototype.isInFullEditMode=function(){return this._fullEditMode},o.prototype.isOpened=function(){return this._opened},o.prototype.isWaiting=function(){return this.state===Handsontable.EditorState.WAITING},o.prototype.checkEditorSection=function(){var e=this.instance.countRows(),t="";return this.row=e-this.instance.getSettings().fixedRowsBottom?t=this.col"+a+"")))},autoColumnSize:!0,modifyColWidth:function(e,t){var o=this.getPlugin("autoColumnSize").widths;return o[t]&&(e=o[t]),n?e:e+15}}),this.htEditor.view.wt.wtTable.holder.parentNode.style["padding-right"]=v()+2+"px",T&&(T=!1),t.instance._registerTimeout(setTimeout(function(){t.queryChoices(t.TEXTAREA.value)},0))},E.prototype.close=function(){S.prototype.close.apply(this,arguments)},E.prototype.queryChoices=function(e){if(this.query=e,"function"==typeof this.cellProperties.source){var t=this;this.cellProperties.source(e,function(e){t.updateChoicesList(e)})}else if(Array.isArray(this.cellProperties.source)){var n;if(e&&this.cellProperties.filter!==!1){var o=this.cellProperties.filteringCaseSensitive===!0,r=e.toLowerCase();n=this.cellProperties.source.filter(function(t){return o?-1!=t.indexOf(e):-1!=t.toLowerCase().indexOf(r)})}else n=this.cellProperties.source;this.updateChoicesList(n)}else this.updateChoicesList([])},E.prototype.updateChoicesList=function(e){var t,n=w(this.TEXTAREA),o=y(this.TEXTAREA),r=E.sortByRelevance(this.getValue(),e,this.cellProperties.filteringCaseSensitive);if(0==this.cellProperties.filter)t=r[0];else{for(var i=[],s=0,a=r.length;a>s;s++)i.push(e[r[s]]);t=0,e=i}this.choices=e,this.htEditor.loadData(p([e])),this.updateDropdownHeight(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(t),this.instance.listen(),this.TEXTAREA.focus(),C(this.TEXTAREA,n,n==o?void 0:o)},E.prototype.updateDropdownHeight=function(){var e=this.htEditor.getColWidth(0)+v()+2,t=void 0===this.cellProperties.trimDropdown?!0:this.cellProperties.trimDropdown;this.htEditor.updateSettings({height:this.getDropdownHeight(),width:t?void 0:e}),this.htEditor.view.wt.wtTable.alignOverlaysWithTrimmingContainer()},E.prototype.finishEditing=function(e){e||this.instance.removeHook("beforeKeyDown",o),S.prototype.finishEditing.apply(this,arguments)},E.prototype.highlightBestMatchingChoice=function(e){"number"==typeof e?this.htEditor.selectCell(e,0):this.htEditor.deselectCell()},E.sortByRelevance=function(e,t,n){var o,r,i,s,a,l=[],u=e.length,c=[];if(0===u){for(s=0,a=t.length;a>s;s++)c.push(s);return c}for(s=0,a=t.length;a>s;s++)o=f(t[s]),r=n?o.indexOf(e):o.toLowerCase().indexOf(e.toLowerCase()),-1!=r&&(i=o.length-r-u,l.push({baseIndex:s,index:r,charsLeft:i,value:o}));for(l.sort(function(e,t){return-1===t.index?-1:-1===e.index?1:e.indext.charsLeft?1:0:void 0}),s=0,a=l.length;a>s;s++)c.push(l[s].baseIndex);return c},E.prototype.getDropdownHeight=function(){var e=this.htEditor.getInstance().getRowHeight(0)||23,t=this.cellProperties.visibleRows;return this.choices.length>=t?t*e:this.choices.length*e+8},E.prototype.allowKeyEventPropagation=function(e){var t={row:this.htEditor.getSelectedRange()?this.htEditor.getSelectedRange().from.row:-1},n=!1;return e===d.ARROW_DOWN&&t.row-1&&(n=!0),n},_("autocomplete",E)},{editors:29,handsontableEditor:35,"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/unicode":53}],32:[function(e,t,n){"use strict";Object.defineProperties(n,{CheckboxEditor:{get:function(){return u}},__esModule:{value:!0}});var o,r,i,s=(o=e("editors"),o&&o.__esModule&&o||{"default":o}).registerEditor,a=(r=e("_baseEditor"),r&&r.__esModule&&r||{"default":r}).BaseEditor,l=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).hasClass,u=function(){$traceurRuntime.superConstructor(c).apply(this,arguments)},c=u;$traceurRuntime.createClass(u,{beginEditing:function(){var e=this.TD.querySelector('input[type="checkbox"]');l(e,"htBadValue")||e.click()},finishEditing:function(){},init:function(){},open:function(){},close:function(){},getValue:function(){},setValue:function(){},focus:function(){}},{},a),s("checkbox",u)},{_baseEditor:30,editors:29,"helpers/dom/element":45}],33:[function(e,t,n){"use strict";Object.defineProperties(n,{DateEditor:{get:function(){return S}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c,d,h=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),f=h.addClass,p=h.outerHeight,g=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).deepExtend,m=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,w=(s=e("editors"),s&&s.__esModule&&s||{"default":s}),v=(w.getEditor,w.registerEditor),y=(a=e("helpers/unicode"),a&&a.__esModule&&a||{"default":a}).isMetaKey,b=(l=e("helpers/dom/event"),l&&l.__esModule&&l||{"default":l}).stopPropagation,C=(u=e("textEditor"),u&&u.__esModule&&u||{"default":u}).TextEditor,R=(c=e("moment"),c&&c.__esModule&&c||{"default":c})["default"],_=(d=e("pikaday"),d&&d.__esModule&&d||{"default":d})["default"];Handsontable.editors=Handsontable.editors||{},Handsontable.editors.DateEditor=S;var S=function(e){this.$datePicker=null,this.datePicker=null,this.datePickerStyle=null,this.defaultDateFormat="DD/MM/YYYY",this.isCellEdited=!1,this.parentDestroyed=!1,$traceurRuntime.superConstructor(E).call(this,e)},E=S;$traceurRuntime.createClass(S,{init:function(){var e=this;if("function"!=typeof R)throw new Error("You need to include moment.js to your project.");if("function"!=typeof _)throw new Error("You need to include Pikaday to your project.");$traceurRuntime.superGet(this,E.prototype,"init").call(this),this.instance.addHook("afterDestroy",function(){e.parentDestroyed=!0,e.destroyElements()})},createElements:function(){$traceurRuntime.superGet(this,E.prototype,"createElements").call(this),this.datePicker=document.createElement("DIV"),this.datePickerStyle=this.datePicker.style,this.datePickerStyle.position="absolute",this.datePickerStyle.top=0,this.datePickerStyle.left=0,this.datePickerStyle.zIndex=9999,f(this.datePicker,"htDatepickerHolder"),document.body.appendChild(this.datePicker),this.$datePicker=new _(this.getDatePickerConfig());var e=new m(this);e.addEventListener(this.datePicker,"mousedown",function(e){return b(e)}),this.hideDatepicker()},destroyElements:function(){this.$datePicker.destroy()},prepare:function(e,t,n,o,r,i){this._opened=!1,$traceurRuntime.superGet(this,E.prototype,"prepare").call(this,e,t,n,o,r,i)},open:function(){var e=void 0!==arguments[0]?arguments[0]:null;$traceurRuntime.superGet(this,E.prototype,"open").call(this),this.showDatepicker(e)},close:function(){var e=this;this._opened=!1,this.instance._registerTimeout(setTimeout(function(){e.instance.selection.refreshBorders()},0)),$traceurRuntime.superGet(this,E.prototype,"close").call(this)},finishEditing:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=void 0!==arguments[1]?arguments[1]:!1;if(e){var n=this.originalValue;void 0!==n&&this.setValue(n)}this.hideDatepicker(),$traceurRuntime.superGet(this,E.prototype,"finishEditing").call(this,e,t)},showDatepicker:function(e){this.$datePicker.config(this.getDatePickerConfig());var t,n=this.TD.getBoundingClientRect(),o=this.cellProperties.dateFormat||this.defaultDateFormat,r=this.$datePicker.config(),i=this.instance.view.isMouseDown(),s=e?y(e.keyCode):!1;this.datePickerStyle.top=window.pageYOffset+n.top+p(this.TD)+"px",this.datePickerStyle.left=window.pageXOffset+n.left+"px",this.$datePicker._onInputFocus=function(){},r.format=o,this.originalValue?(t=this.originalValue,R(t,o,!0).isValid()&&this.$datePicker.setMoment(R(t,o),!0),s||i||this.setValue("")):this.cellProperties.defaultDate?(t=this.cellProperties.defaultDate,r.defaultDate=t,R(t,o,!0).isValid()&&this.$datePicker.setMoment(R(t,o),!0),s||i||this.setValue("")):this.$datePicker.gotoToday(),this.datePickerStyle.display="block",this.$datePicker.show()},hideDatepicker:function(){this.datePickerStyle.display="none",this.$datePicker.hide()},getDatePickerConfig:function(){var e=this,t=this.TEXTAREA,n={};this.cellProperties&&this.cellProperties.datePickerConfig&&g(n,this.cellProperties.datePickerConfig);var o=n.onSelect,r=n.onClose;return n.field=t,n.trigger=t,n.container=this.datePicker,n.bound=!1,n.format=n.format||this.defaultDateFormat,n.reposition=n.reposition||!1,n.onSelect=function(t){isNaN(t.getTime())||(t=R(t).format(e.cellProperties.dateFormat||e.defaultDateFormat)),e.setValue(t),e.hideDatepicker(),o&&o()},n.onClose=function(){e.parentDestroyed||e.finishEditing(!1),r&&r()},n}},{},C),v("date",S)},{editors:29,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,moment:"moment",pikaday:"pikaday",textEditor:40}],34:[function(e,t,n){"use strict";Object.defineProperties(n,{DropdownEditor:{get:function(){return l}},__esModule:{value:!0}});var o,r,i=(o=e("editors"),o&&o.__esModule&&o||{"default":o}),s=(i.getEditor,i.registerEditor),a=(r=e("autocompleteEditor"),r&&r.__esModule&&r||{"default":r}).AutocompleteEditor,l=function(){$traceurRuntime.superConstructor(u).apply(this,arguments)},u=l;$traceurRuntime.createClass(l,{prepare:function(e,t,n,o,r,i){$traceurRuntime.superGet(this,u.prototype,"prepare").call(this,e,t,n,o,r,i),this.cellProperties.filter=!1,this.cellProperties.strict=!0}},{},a),Handsontable.hooks.add("beforeValidate",function(e,t,n,o){var r=this.getCellMeta(t,n); +r.editor===Handsontable.editors.DropdownEditor&&void 0===r.strict&&(r.filter=!1,r.strict=!0)}),s("dropdown",l)},{autocompleteEditor:31,editors:29}],35:[function(e,t,n){"use strict";Object.defineProperties(n,{HandsontableEditor:{get:function(){return v}},__esModule:{value:!0}});var o,r,i,s,a,l,u=(o=e("helpers/unicode"),o&&o.__esModule&&o||{"default":o}).KEY_CODES,c=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).extend,d=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).setCaretPosition,h=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),f=h.stopImmediatePropagation,p=h.isImmediatePropagationStopped,g=(a=e("editors"),a&&a.__esModule&&a||{"default":a}),m=(g.getEditor,g.registerEditor),w=(l=e("textEditor"),l&&l.__esModule&&l||{"default":l}).TextEditor,v=w.prototype.extend();v.prototype.createElements=function(){w.prototype.createElements.apply(this,arguments);var e=document.createElement("DIV");e.className="handsontableEditor",this.TEXTAREA_PARENT.appendChild(e),this.htContainer=e,this.assignHooks()},v.prototype.prepare=function(e,t,n,o,r,i){w.prototype.prepare.apply(this,arguments);var s=this,a={startRows:0,startCols:0,minRows:0,minCols:0,className:"listbox",copyPaste:!1,autoColumnSize:!1,autoRowSize:!1,readOnly:!0,fillHandle:!1,afterOnCellMouseDown:function(){var e=this.getValue();void 0!==e&&s.setValue(e),s.instance.destroyEditor()}};this.cellProperties.handsontable&&c(a,i.handsontable),this.htOptions=a};var y=function(e){if(!p(e)){var t,n=this.getActiveEditor(),o=n.htEditor.getInstance();if(e.keyCode==u.ARROW_DOWN)if(o.getSelected()){var r=o.getSelected()[0],i=o.countRows()-1;t=Math.min(i,r+1)}else t=0;else if(e.keyCode==u.ARROW_UP&&o.getSelected()){var r=o.getSelected()[0];t=r-1}void 0!==t&&(0>t?o.deselectCell():o.selectCell(t,0),o.getData().length&&(e.preventDefault(),f(e),n.instance.listen(),n.TEXTAREA.focus()))}};v.prototype.open=function(){this.instance.addHook("beforeKeyDown",y),w.prototype.open.apply(this,arguments),this.htEditor&&this.htEditor.destroy(),this.htEditor=new Handsontable(this.htContainer,this.htOptions),this.cellProperties.strict?(this.htEditor.selectCell(0,0),this.TEXTAREA.style.visibility="hidden"):(this.htEditor.deselectCell(),this.TEXTAREA.style.visibility="visible"),d(this.TEXTAREA,0,this.TEXTAREA.value.length)},v.prototype.close=function(){this.instance.removeHook("beforeKeyDown",y),this.instance.listen(),w.prototype.close.apply(this,arguments)},v.prototype.focus=function(){this.instance.listen(),w.prototype.focus.apply(this,arguments)},v.prototype.beginEditing=function(e){var t=this.instance.getSettings().onBeginEditing;t&&t()===!1||w.prototype.beginEditing.apply(this,arguments)},v.prototype.finishEditing=function(e,t){if(this.htEditor&&this.htEditor.isListening()&&this.instance.listen(),this.htEditor&&this.htEditor.getSelected()){var n=this.htEditor.getInstance().getValue();void 0!==n&&this.setValue(n)}return w.prototype.finishEditing.apply(this,arguments)},v.prototype.assignHooks=function(){var e=this;this.instance.addHook("afterDestroy",function(){e.htEditor&&e.htEditor.destroy()})},m("handsontable",v)},{editors:29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,textEditor:40}],36:[function(e,t,n){"use strict";Object.defineProperties(n,{MobileTextEditor:{get:function(){return M}},__esModule:{value:!0}});var o,r,i,s,a,l,u=(o=e("helpers/unicode"),o&&o.__esModule&&o||{"default":o}).KEY_CODES,c=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}),d=c.stopImmediatePropagation,h=c.isImmediatePropagationStopped,f=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),p=f.addClass,g=f.getScrollLeft,m=f.getScrollTop,w=f.hasClass,v=f.isChildOf,y=f.offset,b=f.outerHeight,C=f.outerWidth,R=f.removeClass,_=f.setCaretPosition,S=(s=e("editors"),s&&s.__esModule&&s||{"default":s}),E=(S.getEditor,S.registerEditor),T=(a=e("_baseEditor"),a&&a.__esModule&&a||{"default":a}).BaseEditor,O=(l=e("eventManager"),l&&l.__esModule&&l||{"default":l}).eventManager,M=T.prototype.extend(),k={},H=function(){this.controls={},this.controls.leftButton=document.createElement("DIV"),this.controls.leftButton.className="leftButton",this.controls.rightButton=document.createElement("DIV"),this.controls.rightButton.className="rightButton",this.controls.upButton=document.createElement("DIV"),this.controls.upButton.className="upButton",this.controls.downButton=document.createElement("DIV"),this.controls.downButton.className="downButton";for(var e in this.controls)this.controls.hasOwnProperty(e)&&this.positionControls.appendChild(this.controls[e])};M.prototype.valueChanged=function(){return this.initValue!=this.getValue()},M.prototype.init=function(){var e=this;this.eventManager=O(this.instance),this.createElements(),this.bindEvents(),this.instance.addHook("afterDestroy",function(){e.destroy()})},M.prototype.getValue=function(){return this.TEXTAREA.value},M.prototype.setValue=function(e){this.initValue=e,this.TEXTAREA.value=e},M.prototype.createElements=function(){this.editorContainer=document.createElement("DIV"),this.editorContainer.className="htMobileEditorContainer",this.cellPointer=document.createElement("DIV"),this.cellPointer.className="cellPointer",this.moveHandle=document.createElement("DIV"),this.moveHandle.className="moveHandle",this.inputPane=document.createElement("DIV"),this.inputPane.className="inputs",this.positionControls=document.createElement("DIV"),this.positionControls.className="positionControls",this.TEXTAREA=document.createElement("TEXTAREA"),p(this.TEXTAREA,"handsontableInput"),this.inputPane.appendChild(this.TEXTAREA),this.editorContainer.appendChild(this.cellPointer),this.editorContainer.appendChild(this.moveHandle),this.editorContainer.appendChild(this.inputPane),this.editorContainer.appendChild(this.positionControls),H.call(this),document.body.appendChild(this.editorContainer)},M.prototype.onBeforeKeyDown=function(e){var t=this,n=t.getActiveEditor();if(e.target===n.TEXTAREA&&!h(e))switch(e.keyCode){case u.ENTER:n.close(),e.preventDefault();break;case u.BACKSPACE:d(e)}},M.prototype.open=function(){this.instance.addHook("beforeKeyDown",this.onBeforeKeyDown),p(this.editorContainer,"active"),R(this.cellPointer,"hidden"),this.updateEditorPosition()},M.prototype.focus=function(){this.TEXTAREA.focus(),_(this.TEXTAREA,this.TEXTAREA.value.length)},M.prototype.close=function(){this.TEXTAREA.blur(),this.instance.removeHook("beforeKeyDown",this.onBeforeKeyDown),R(this.editorContainer,"active")},M.prototype.scrollToView=function(){var e=this.instance.getSelectedRange().highlight;this.instance.view.scrollViewport(e)},M.prototype.hideCellPointer=function(){w(this.cellPointer,"hidden")||p(this.cellPointer,"hidden")},M.prototype.updateEditorPosition=function(e,t){if(e&&t)e=parseInt(e,10),t=parseInt(t,10),this.editorContainer.style.top=t+"px",this.editorContainer.style.left=e+"px";else{var n=this.instance.getSelected(),o=this.instance.getCell(n[0],n[1]);if(k.cellPointer||(k.cellPointer={height:b(this.cellPointer),width:C(this.cellPointer)}),k.editorContainer||(k.editorContainer={width:C(this.editorContainer)}),void 0!==o){var r=this.instance.view.wt.wtOverlays.leftOverlay.trimmingContainer==window?0:g(this.instance.view.wt.wtOverlays.leftOverlay.holder),i=this.instance.view.wt.wtOverlays.topOverlay.trimmingContainer==window?0:m(this.instance.view.wt.wtOverlays.topOverlay.holder),s=y(o),a=C(o),l={x:r,y:i};this.editorContainer.style.top=parseInt(s.top+b(o)-l.y+k.cellPointer.height,10)+"px",this.editorContainer.style.left=parseInt(window.innerWidth/2-k.editorContainer.width/2,10)+"px",s.left+a/2>parseInt(this.editorContainer.style.left,10)+k.editorContainer.width?this.editorContainer.style.left=window.innerWidth-k.editorContainer.width+"px":s.left+a/2n;n++)t[e[n]]=e[n];else"object"==typeof e&&(t=e);return t},S.prototype.getValue=function(){return this.select.value},S.prototype.setValue=function(e){this.select.value=e};var E=function(e){var t=this,n=t.getActiveEditor();switch(e.keyCode){case b.ARROW_UP:var o=n.select.selectedIndex-1;o>=0&&(n.select[o].selected=!0),y(e),e.preventDefault();break;case b.ARROW_DOWN:var r=n.select.selectedIndex+1;r<=n.select.length-1&&(n.select[r].selected=!0),y(e),e.preventDefault()}};S.prototype.open=function(){this._opened=!0,this.refreshDimensions(),this.select.style.display="",this.instance.addHook("beforeKeyDown",E)},S.prototype.close=function(){this._opened=!1,this.select.style.display="none",this.instance.removeHook("beforeKeyDown",E)},S.prototype.focus=function(){this.select.focus()},S.prototype.refreshDimensions=function(){if(this.state===Handsontable.EditorState.EDITING){if(this.TD=this.getEditedCell(),!this.TD)return void this.close();var e,t=w(this.TD)+1,n=m(this.TD)+1,o=g(this.TD),r=g(this.instance.rootElement),i=p(this.TD),s=o.top-r.top-1-(i.scrollTop||0),a=o.left-r.left-1-(i.scrollLeft||0),l=this.checkEditorSection(),u=this.instance.getSettings();u.rowHeaders?1:0,u.colHeaders?1:0;switch(l){case"top":e=f(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":e=f(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":e=f(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":e=f(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":e=f(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}0===this.instance.getSelected()[0]&&(s+=1),0===this.instance.getSelected()[1]&&(a+=1);var c=this.select.style;e&&-1!=e?c[e[0]]=e[1]:v(this.select);var d=h(this.TD);parseInt(d.borderTopWidth,10)>0&&(n-=1),parseInt(d.borderLeftWidth,10)>0&&(t-=1),c.height=n+"px",c.minWidth=t+"px",c.top=s+"px",c.left=a+"px",c.margin="0px"}},S.prototype.getEditedCell=function(){var e,t=this.checkEditorSection();switch(t){case"top":e=this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=101;break;case"corner":e=this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=103;break;case"left":e=this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=102;break;default:e=this.instance.getCell(this.row,this.col),this.select.style.zIndex=""}return-1!=e&&-2!=e?e:void 0},R("select",S)},{_baseEditor:30,editors:29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],40:[function(e,t,n){"use strict";Object.defineProperties(n,{TextEditor:{get:function(){return H}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),d=c.addClass,h=c.getCaretPosition,f=c.getComputedStyle,p=c.getCssTransform,g=c.getScrollableElement,m=c.innerWidth,w=c.offset,v=c.resetCssTransform,y=c.setCaretPosition,b=(r=e("autoResize"),r&&r.__esModule&&r||{"default":r})["default"],C=(i=e("_baseEditor"),i&&i.__esModule&&i||{"default":i}).BaseEditor,R=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).eventManager,_=(a=e("editors"),a&&a.__esModule&&a||{"default":a}),S=(_.getEditor,_.registerEditor),E=(l=e("helpers/unicode"),l&&l.__esModule&&l||{"default":l}).KEY_CODES,T=(u=e("helpers/dom/event"),u&&u.__esModule&&u||{"default":u}),O=T.stopPropagation,M=T.stopImmediatePropagation,k=T.isImmediatePropagationStopped,H=C.prototype.extend();H.prototype.init=function(){var e=this;this.createElements(),this.eventManager=R(this),this.bindEvents(),this.autoResize=b(),this.instance.addHook("afterDestroy",function(){e.destroy()})},H.prototype.getValue=function(){return this.TEXTAREA.value},H.prototype.setValue=function(e){this.TEXTAREA.value=e};var D=function(e){var t,n=this,o=n.getActiveEditor();if(t=(e.ctrlKey||e.metaKey)&&!e.altKey,e.target===o.TEXTAREA&&!k(e)){if(17===e.keyCode||224===e.keyCode||91===e.keyCode||93===e.keyCode)return void M(e);switch(e.keyCode){case E.ARROW_RIGHT:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&M(e);break;case E.ARROW_LEFT:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&M(e);break;case E.ARROW_UP:case E.ARROW_DOWN:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&M(e);break;case E.ENTER:var r=o.instance.getSelected(),i=!(r[0]===r[2]&&r[1]===r[3]);if(t&&!i||e.altKey){if(o.isOpened()){var s=h(o.TEXTAREA),a=o.getValue(),l=a.slice(0,s)+"\n"+a.slice(s);o.setValue(l),y(o.TEXTAREA,s+1)}else o.beginEditing(o.originalValue+"\n");M(e)}e.preventDefault();break;case E.A:case E.X:case E.C:case E.V:t&&M(e);break;case E.BACKSPACE:case E.DELETE:case E.HOME:case E.END:M(e)}-1===[E.ARROW_UP,E.ARROW_RIGHT,E.ARROW_DOWN,E.ARROW_LEFT].indexOf(e.keyCode)&&o.autoResize.resize(String.fromCharCode(e.keyCode))}};H.prototype.open=function(){this.refreshDimensions(),this.instance.addHook("beforeKeyDown",D)},H.prototype.close=function(e){this.textareaParentStyle.display="none",this.autoResize.unObserve(),document.activeElement===this.TEXTAREA&&this.instance.listen(),this.instance.removeHook("beforeKeyDown",D)},H.prototype.focus=function(){this.TEXTAREA.focus(),y(this.TEXTAREA,this.TEXTAREA.value.length)},H.prototype.createElements=function(){this.TEXTAREA=document.createElement("TEXTAREA"),d(this.TEXTAREA,"handsontableInput"),this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,this.TEXTAREA_PARENT=document.createElement("DIV"),d(this.TEXTAREA_PARENT,"handsontableInputHolder"),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.textareaParentStyle.top=0,this.textareaParentStyle.left=0,this.textareaParentStyle.display="none",this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.instance.rootElement.appendChild(this.TEXTAREA_PARENT);var e=this;this.instance._registerTimeout(setTimeout(function(){e.refreshDimensions()},0))},H.prototype.getEditedCell=function(){var e,t=this.checkEditorSection();switch(t){case"top":e=this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=101;break;case"top-left-corner":e=this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=103;break;case"bottom-left-corner":e=this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=103;break;case"left":e=this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=102;break;case"bottom":e=this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=102;break;default:e=this.instance.getCell(this.row,this.col),this.textareaParentStyle.zIndex=""}return-1!=e&&-2!=e?e:void 0},H.prototype.refreshDimensions=function(){if(this.state===Handsontable.EditorState.EDITING){if(this.TD=this.getEditedCell(),!this.TD)return void this.close(!0);var e,t=w(this.TD),n=w(this.instance.rootElement),o=g(this.TD),r=this.instance.countRows(),i=t.top-n.top-1-(o.scrollTop||0),s=t.left-n.left-1-(o.scrollLeft||0),a=this.instance.getSettings(),l=(a.rowHeaders?1:0,a.colHeaders?1:0),u=this.checkEditorSection(),c=this.TD.style.backgroundColor;switch(u){case"top":e=p(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":e=p(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":e=p(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":e=p(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":e=p(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}(l&&0===this.instance.getSelected()[0]||a.fixedRowsBottom&&this.instance.getSelected()[0]===r-a.fixedRowsBottom)&&(i+=1),0===this.instance.getSelected()[1]&&(s+=1),e&&-1!=e?this.textareaParentStyle[e[0]]=e[1]:v(this.textareaParentStyle),this.textareaParentStyle.top=i+"px",this.textareaParentStyle.left=s+"px";var d=this.TD.offsetTop-this.instance.view.wt.wtOverlays.topOverlay.getScrollPosition(),h=this.TD.offsetLeft-this.instance.view.wt.wtOverlays.leftOverlay.getScrollPosition(),y=m(this.TD)-8,b=this.instance.view.maximumVisibleElementWidth(h)-9,C=this.TD.scrollHeight+1,R=Math.max(this.instance.view.maximumVisibleElementHeight(d)-2,23),_=f(this.TD);this.TEXTAREA.style.fontSize=_.fontSize,this.TEXTAREA.style.fontFamily=_.fontFamily,this.TEXTAREA.style.backgroundColor="",this.TEXTAREA.style.backgroundColor=c?c:f(this.TEXTAREA).backgroundColor,this.autoResize.init(this.TEXTAREA,{minHeight:Math.min(C,R),maxHeight:R,minWidth:Math.min(y,b),maxWidth:b},!0),this.textareaParentStyle.display="block"}},H.prototype.bindEvents=function(){var e=this;this.eventManager.addEventListener(this.TEXTAREA,"cut",function(e){O(e)}),this.eventManager.addEventListener(this.TEXTAREA,"paste",function(e){O(e)}),this.instance.addHook("afterScrollHorizontally",function(){e.refreshDimensions()}),this.instance.addHook("afterScrollVertically",function(){e.refreshDimensions()}),this.instance.addHook("afterColumnResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterRowResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterDestroy",function(){e.eventManager.destroy()})},H.prototype.destroy=function(){this.eventManager.destroy()},S("text",H)},{_baseEditor:30,autoResize:"autoResize",editors:29,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],41:[function(e,t,n){"use strict";function o(e,t){var n,o,r,i,s,a="HOT-TABLE";if(t.isTargetWebComponent=!1,t.realTarget=t.target,!Handsontable.eventManager.isHotTableEnv)return t;for(t=l(t),s=t.path?t.path.length:0;s--;){if(t.path[s].nodeName===a)n=!0;else if(n&&t.path[s].shadowRoot){i=t.path[s];break}0!==s||i||(i=t.path[s])}return i||(i=t.target),t.isTargetWebComponent=!0,c()?t.realTarget=t.srcElement||t.toElement:(e instanceof Handsontable.Core||e instanceof Walkontable)&&(e instanceof Handsontable.Core?o=e.view?e.view.wt.wtTable.TABLE:null:e instanceof Walkontable&&(o=e.wtTable.TABLE.parentNode.parentNode),r=u(t.target,[a],o),r?t.realTarget=o.querySelector(a)||t.target:t.realTarget=t.target),Object.defineProperty(t,"target",{get:function(){return l(i)},enumerable:!0,configurable:!0}),t}function r(e){return new d(e)}Object.defineProperties(n,{EventManager:{get:function(){return d}},eventManager:{get:function(){return r}},__esModule:{value:!0}});var i,s,a=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),l=a.polymerWrap,u=a.closest,c=(s=e("helpers/browser"),s&&s.__esModule&&s||{"default":s}).isWebComponentSupportedNatively,d=function(){var e=void 0!==arguments[0]?arguments[0]:null;this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])};$traceurRuntime.createClass(d,{addEventListener:function(e,t,n){function r(e){void 0==e.target&&void 0!=e.srcElement&&(e.definePoperty?e.definePoperty("target",{value:e.srcElement}):e.target=e.srcElement),void 0==e.preventDefault&&(e.definePoperty?e.definePoperty("preventDefault",{value:function(){this.returnValue=!1}}):e.preventDefault=function(){this.returnValue=!1}),e=o(s,e),n.call(this,e)}var i=this,s=this.context;return this.context.eventListeners.push({element:e,event:t,callback:n,callbackProxy:r}),window.addEventListener?e.addEventListener(t,r,!1):e.attachEvent("on"+t,r),Handsontable.countEventManagerListeners++,function(){i.removeEventListener(e,t,n)}},removeEventListener:function(e,t,n){for(var o,r=this.context.eventListeners.length;r--;)if(o=this.context.eventListeners[r],o.event==t&&o.element==e){if(n&&n!=o.callback)continue;this.context.eventListeners.splice(r,1),o.element.removeEventListener?o.element.removeEventListener(o.event,o.callbackProxy,!1):o.element.detachEvent("on"+o.event,o.callbackProxy),Handsontable.countEventManagerListeners--}},clearEvents:function(){if(this.context)for(var e=this.context.eventListeners.length;e--;){var t=this.context.eventListeners[e];t&&this.removeEventListener(t.element,t.event,t.callback)}},clear:function(){this.clearEvents()},destroy:function(){this.clearEvents(),this.context=null},fireEvent:function(e,t){var n,o={bubbles:!0,cancelable:"mousemove"!==t,view:window,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:void 0};document.createEvent?(n=document.createEvent("MouseEvents"),n.initMouseEvent(t,o.bubbles,o.cancelable,o.view,o.detail,o.screenX,o.screenY,o.clientX,o.clientY,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,o.button,o.relatedTarget||document.body.parentNode)):n=document.createEventObject(),e.dispatchEvent?e.dispatchEvent(n):e.fireEvent("on"+t,n)}},{}),window.Handsontable=window.Handsontable||{},Handsontable.countEventManagerListeners=0,Handsontable.eventManager=r},{"helpers/browser":43,"helpers/dom/element":45}],42:[function(e,t,n){"use strict";function o(e){for(var t=0,n=e.length;n>t;)e[t]=[e[t]],t++}function r(e,t){for(var n=0,o=t.length;o>n;)e.push(t[n]),n++}function i(e){var t=[];if(!e||0===e.length||!e[0]||0===e[0].length)return t;for(var n=e.length,o=e[0].length,r=0;n>r;r++)for(var i=0;o>i;i++)t[i]||(t[i]=[]),t[i][r]=e[r][i];return t}function s(e,t,n,o){var r=-1,i=e.length;for(o&&i&&(n=e[++r]);++rt?e:t},Array.isArray(e)?e[0]:void 0)}function h(e){return s(e,function(e,t){return t>e?e:t},Array.isArray(e)?e[0]:void 0)}function f(e){return e.length?c(e)/e.length:0}function p(e){return s(e,function(e,t){return e.concat(Array.isArray(t)?p(t):t)},[])}function g(e){var t=[];return u(e,function(e){-1===t.indexOf(e)&&t.push(e)}),t}Object.defineProperties(n,{to2dArray:{get:function(){return o}},extendArray:{get:function(){return r}},pivot:{get:function(){return i}},arrayReduce:{get:function(){return s}},arrayFilter:{get:function(){return a}},arrayMap:{get:function(){return l}},arrayEach:{get:function(){return u}},arraySum:{get:function(){return c}},arrayMax:{get:function(){return d}},arrayMin:{get:function(){return h}},arrayAvg:{get:function(){return f}},arrayFlatten:{get:function(){return p}},arrayUnique:{get:function(){return g}},__esModule:{value:!0}})},{}],43:[function(e,t,n){"use strict";function o(){return f}function r(){return p}function i(){return g}function s(){return m}function a(e){return e||(e=navigator.userAgent),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e)}function l(){return"ontouchstart"in window}function u(){var e=document.createElement("div");return e.createShadowRoot&&e.createShadowRoot.toString().match(/\[native code\]/)?!0:!1}function c(){var e=document.createElement("TABLE");e.style.borderSpacing=0,e.style.borderWidth=0,e.style.padding=0;var t=document.createElement("TBODY");e.appendChild(t),t.appendChild(document.createElement("TR")),t.firstChild.appendChild(document.createElement("TD")),t.firstChild.firstChild.innerHTML="t
t";var n=document.createElement("CAPTION");n.innerHTML="c
c
c
c",n.style.padding=0,n.style.margin=0,e.insertBefore(n,t),document.body.appendChild(e),h=e.offsetHeight<2*e.lastChild.offsetHeight,document.body.removeChild(e)}function d(){return void 0===h&&c(),h}Object.defineProperties(n,{isIE8:{get:function(){return o}},isIE9:{get:function(){return r}},isSafari:{get:function(){return i}},isChrome:{get:function(){return s}},isMobileBrowser:{get:function(){return a}},isTouchSupported:{get:function(){return l}},isWebComponentSupportedNatively:{get:function(){return u}},hasCaptionProblem:{get:function(){return d}},__esModule:{value:!0}});var h,f=!document.createTextNode("test").textContent,p=!!document.documentMode,g=/Safari/.test(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor),m=/Chrome/.test(navigator.userAgent)&&/Google/.test(navigator.vendor)},{}],44:[function(e,t,n){"use strict";function o(e){for(var t,n=e+1,o="";n>0;)t=(n-1)%26,o=String.fromCharCode(65+t)+o,n=parseInt((n-t)/26,10);return o}function r(e,t){e="number"==typeof e?e:100,t="number"==typeof t?t:4;var n,r,i=[];for(n=0;e>n;n++){var s=[];for(r=0;t>r;r++)s.push(o(r)+(n+1));i.push(s)}return i}function i(e,t){e="number"==typeof e?e:100,t="number"==typeof t?t:4;var n,r,i=[];for(n=0;e>n;n++){var s={};for(r=0;t>r;r++)s["prop"+r]=o(r)+(n+1);i.push(s)}return i}function s(e,t){for(var n,o=[],r=0;e>r;r++){n=[];for(var i=0;t>i;i++)n.push("");o.push(n)}return o}function a(e){var t,n,o,r,i=[],s=0;for(t=0,n=e.length;n>t;t++)for(o=0,r=e[t].length;r>o;o++)o==s&&(i.push([]),s++),i[o].push(e[t][o]);return i}function l(e,t){function n(e){var t=Handsontable.cellTypes[e];if("undefined"==typeof t)throw new Error('You declared cell type "'+e+'" as a string that is not mapped to a known object. Cell type must be an object or a string mapped to an object in Handsontable.cellTypes');return t}return t="undefined"==typeof t?!0:t,function(o,r){return function i(o){if(o){if(o.hasOwnProperty(e)&&void 0!==o[e])return o[e];if(o.hasOwnProperty("type")&&o.type){var r;if("string"!=typeof o.type)throw new Error("Cell type must be a string "); +if(r=n(o.type),r.hasOwnProperty(e))return r[e];if(t)return}return i(c(o))}}("number"==typeof o?this.getCellMeta(o,r):o)}}Object.defineProperties(n,{spreadsheetColumnLabel:{get:function(){return o}},createSpreadsheetData:{get:function(){return r}},createSpreadsheetObjectData:{get:function(){return i}},createEmptySpreadsheetData:{get:function(){return s}},translateRowsToColumns:{get:function(){return a}},cellMethodLookupFactory:{get:function(){return l}},__esModule:{value:!0}});var u,c=(u=e("object"),u&&u.__esModule&&u||{"default":u}).getPrototypeOf},{object:50}],45:[function(e,t,n){"use strict";function o(e,t,n){for(;null!=e&&e!==n;){if(e.nodeType===Node.ELEMENT_NODE&&(t.indexOf(e.nodeName)>-1||t.indexOf(e)>-1))return e;e=e.host&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.host:e.parentNode}return null}function r(e,t){var n=e.parentNode,o=[];for("string"==typeof t?o=Array.prototype.slice.call(document.querySelectorAll(t),0):o.push(t);null!=n;){if(o.indexOf(n)>-1)return!0;n=n.parentNode}return!1}function i(e){function t(e){return e.nodeType===Node.ELEMENT_NODE&&e.nodeName===o.toUpperCase()}var n,o="hot-table",r=!1;for(n=s(e);null!=n;){if(t(n)){r=!0;break}if(n.host&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(r=t(n.host))break;n=n.host}n=n.parentNode}return r}function s(e){return"undefined"!=typeof Polymer&&"function"==typeof wrap?wrap(e):e}function a(e){return"undefined"!=typeof Polymer&&"function"==typeof unwrap?unwrap(e):e}function l(e){var t=0;if(e.previousSibling)for(;e=e.previousSibling;)++t;return t}function u(e,t){var n=document.querySelector(".ht_clone_"+e);return n?n.contains(t):null}function c(e){var t=0,n=[];if(!e||!e.length)return n;for(;e[t];)n.push(e[t]),t++;return n}function d(e,t){return K(e,t)}function h(e,t){return X(e,t)}function f(e,t){return q(e,t)}function p(e,t){if(3===e.nodeType)t.removeChild(e);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(e.nodeName)>-1)for(var n=e.childNodes,o=n.length-1;o>=0;o--)p(n[o],e)}function g(e){for(var t;t=e.lastChild;)e.removeChild(t)}function m(e,t){se.test(t)?e.innerHTML=t:w(e,t)}function w(e,t){var n=e.firstChild;n&&3===n.nodeType&&null===n.nextSibling?ae?n.textContent=t:n.data=t:(g(e),e.appendChild(document.createTextNode(t)))}function v(e){for(var t=e;a(t)!==document.documentElement;){if(null===t)return!1;if(t.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(t.host){if(t.host.impl)return v(t.host.impl);if(t.host)return v(t.host);throw new Error("Lost in Web Components world")}return!1}if("none"===t.style.display)return!1;t=t.parentNode}return!0}function y(e){var t,n,o,r,i;if(r=document.documentElement,te()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName)return i=e.getBoundingClientRect(),{top:i.top+(window.pageYOffset||r.scrollTop)-(r.clientTop||0),left:i.left+(window.pageXOffset||r.scrollLeft)-(r.clientLeft||0)};for(t=e.offsetLeft,n=e.offsetTop,o=e;(e=e.offsetParent)&&e!==document.body;)t+=e.offsetLeft,n+=e.offsetTop,o=e;return o&&"fixed"===o.style.position&&(t+=window.pageXOffset||r.scrollLeft,n+=window.pageYOffset||r.scrollTop),{left:t,top:n}}function b(){var e=window.scrollY;return void 0===e&&(e=document.documentElement.scrollTop),e}function C(){var e=window.scrollX;return void 0===e&&(e=document.documentElement.scrollLeft),e}function R(e){return e===window?b():e.scrollTop}function _(e){return e===window?C():e.scrollLeft}function S(e){for(var t,n,o,r=e.parentNode,i=["auto","scroll"],s="",a="",l="",u="";r&&r.style&&document.body!==r;){if(t=r.style.overflow,n=r.style.overflowX,o=r.style.overflowY,"scroll"==t||"scroll"==n||"scroll"==o)return r;if(window.getComputedStyle&&(s=window.getComputedStyle(r),a=s.getPropertyValue("overflow"),l=s.getPropertyValue("overflow-y"),u=s.getPropertyValue("overflow-x"),"scroll"===a||"scroll"===u||"scroll"===l))return r;if(r.clientHeight<=r.scrollHeight&&(-1!==i.indexOf(o)||-1!==i.indexOf(t)||-1!==i.indexOf(a)||-1!==i.indexOf(l)))return r;if(r.clientWidth<=r.scrollWidth&&(-1!==i.indexOf(n)||-1!==i.indexOf(t)||-1!==i.indexOf(a)||-1!==i.indexOf(u)))return r;r=r.parentNode}return window}function E(e){for(var t=e.parentNode;t&&t.style&&document.body!==t;){if("visible"!==t.style.overflow&&""!==t.style.overflow)return t;if(window.getComputedStyle){var n=window.getComputedStyle(t);if("visible"!==n.getPropertyValue("overflow")&&""!==n.getPropertyValue("overflow"))return t}t=t.parentNode}return window}function T(e,t){if(e){if(e!==window){var n,o=e.style[t];return""!==o&&void 0!==o?o:(n=O(e),""!==n[t]&&void 0!==n[t]?n[t]:void 0)}if("width"===t)return window.innerWidth+"px";if("height"===t)return window.innerHeight+"px"}}function O(e){return e.currentStyle||document.defaultView.getComputedStyle(e)}function M(e){return e.offsetWidth}function k(e){return te()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName?e.offsetHeight+e.firstChild.offsetHeight:e.offsetHeight}function H(e){return e.clientHeight||e.innerHeight}function D(e){return e.clientWidth||e.innerWidth}function x(e,t,n){window.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function A(e,t,n){window.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)}function P(e){if(e.selectionStart)return e.selectionStart;if(document.selection){e.focus();var t=document.selection.createRange();if(null==t)return 0;var n=e.createTextRange(),o=n.duplicate();return n.moveToBookmark(t.getBookmark()),o.setEndPoint("EndToStart",n),o.text.length}return 0}function N(e){if(e.selectionEnd)return e.selectionEnd;if(document.selection){var t=document.selection.createRange();if(null==t)return 0;var n=e.createTextRange();return n.text.indexOf(t.text)+t.text.length}}function L(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e}function W(e,t,n){if(void 0===n&&(n=t),e.setSelectionRange){e.focus();try{e.setSelectionRange(t,n)}catch(o){var r=e.parentNode,i=r.style.display;r.style.display="block",e.setSelectionRange(t,n),r.style.display=i}}else if(e.createTextRange){var s=e.createTextRange();s.collapse(!0),s.moveEnd("character",n),s.moveStart("character",t),s.select()}}function I(){var e=document.createElement("p");e.style.width="100%",e.style.height="200px";var t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),(document.body||document.documentElement).appendChild(t);var n=e.offsetWidth;t.style.overflow="scroll";var o=e.offsetWidth;return n==o&&(o=t.clientWidth),(document.body||document.documentElement).removeChild(t),n-o}function j(){return void 0===ie&&(ie=I()),ie}function B(e,t,n){J()||Q()?(e.style.top=n,e.style.left=t):ee()?e.style["-webkit-transform"]="translate3d("+t+","+n+",0)":e.style.transform="translate3d("+t+","+n+",0)"}function V(e){var t;return e.style.transform&&""!==(t=e.style.transform)?["transform",t]:e.style["-webkit-transform"]&&""!==(t=e.style["-webkit-transform"])?["-webkit-transform",t]:-1}function F(e){e.transform&&""!==e.transform?e.transform="":e["-webkit-transform"]&&""!==e["-webkit-transform"]&&(e["-webkit-transform"]="")}function z(e){var t=["INPUT","SELECT","TEXTAREA"];return t.indexOf(e.nodeName)>-1||"true"===e.contentEditable}function Y(e){return z(e)&&-1==e.className.indexOf("handsontableInput")&&-1==e.className.indexOf("copyPaste")}function U(e){return ce.call(window,e)}function G(e){de.call(window,e)}Object.defineProperties(n,{closest:{get:function(){return o}},isChildOf:{get:function(){return r}},isChildOfWebComponentTable:{get:function(){return i}},polymerWrap:{get:function(){return s}},polymerUnwrap:{get:function(){return a}},index:{get:function(){return l}},overlayContainsElement:{get:function(){return u}},hasClass:{get:function(){return d}},addClass:{get:function(){return h}},removeClass:{get:function(){return f}},removeTextNodes:{get:function(){return p}},empty:{get:function(){return g}},HTML_CHARACTERS:{get:function(){return se}},fastInnerHTML:{get:function(){return m}},fastInnerText:{get:function(){return w}},isVisible:{get:function(){return v}},offset:{get:function(){return y}},getWindowScrollTop:{get:function(){return b}},getWindowScrollLeft:{get:function(){return C}},getScrollTop:{get:function(){return R}},getScrollLeft:{get:function(){return _}},getScrollableElement:{get:function(){return S}},getTrimmingContainer:{get:function(){return E}},getStyle:{get:function(){return T}},getComputedStyle:{get:function(){return O}},outerWidth:{get:function(){return M}},outerHeight:{get:function(){return k}},innerHeight:{get:function(){return H}},innerWidth:{get:function(){return D}},addEvent:{get:function(){return x}},removeEvent:{get:function(){return A}},getCaretPosition:{get:function(){return P}},getSelectionEndPosition:{get:function(){return N}},getSelectionText:{get:function(){return L}},setCaretPosition:{get:function(){return W}},getScrollbarWidth:{get:function(){return j}},setOverlayPosition:{get:function(){return B}},getCssTransform:{get:function(){return V}},resetCssTransform:{get:function(){return F}},isInput:{get:function(){return z}},isOutsideInput:{get:function(){return Y}},requestAnimationFrame:{get:function(){return U}},cancelAnimationFrame:{get:function(){return G}},__esModule:{value:!0}});var $,K,X,q,Z=($=e("../browser"),$&&$.__esModule&&$||{"default":$}),J=Z.isIE8,Q=Z.isIE9,ee=Z.isSafari,te=Z.hasCaptionProblem,ne=document.documentElement.classList?!0:!1;if(ne){var oe=function(){var e=document.createElement("div");return e.classList.add("test","test2"),e.classList.contains("test2")}();K=function(e,t){return""===t?!1:e.classList.contains(t)},X=function(e,t){var n=0;if("string"==typeof t&&(t=t.split(" ")),t=c(t),oe)e.classList.add.apply(e.classList,t);else for(;t&&t[n];)e.classList.add(t[n]),n++},q=function(e,t){var n=0;if("string"==typeof t&&(t=t.split(" ")),t=c(t),oe)e.classList.remove.apply(e.classList,t);else for(;t&&t[n];)e.classList.remove(t[n]),n++}}else{var re=function(e){return new RegExp("(\\s|^)"+e+"(\\s|$)")};K=function(e,t){return e.className.match(re(t))?!0:!1},X=function(e,t){var n=0,o=e.className;if("string"==typeof t&&(t=t.split(" ")),""===o)o=t.join(" ");else for(;t&&t[n];)re(t[n]).test(o)||(o+=" "+t[n]),n++;e.className=o},q=function(e,t){var n=0,o=e.className;for("string"==typeof t&&(t=t.split(" "));t&&t[n];)o=o.replace(re(t[n])," ").trim(),n++;e.className!==o&&(e.className=o)}}for(var ie,se=/(<(.*)>|&(.*);)/,ae=document.createTextNode("test").textContent?!0:!1,le=0,ue=["ms","moz","webkit","o"],ce=window.requestAnimationFrame,de=window.cancelAnimationFrame,he=0;he=t&&n(o)!==!1;);}function s(e,t){return t=parseInt(t.toString().replace("%",""),10),t=parseInt(e*t/100)}Object.defineProperties(n,{isNumeric:{get:function(){return o}},rangeEach:{get:function(){return r}},rangeEachReverse:{get:function(){return i}},valueAccordingPercent:{get:function(){return s}},__esModule:{value:!0}})},{}],50:[function(e,t,n){"use strict";function o(e){var t;return Array.isArray(e)?t=[]:(t={},p(e,function(e,n){e&&"object"==typeof e&&!Array.isArray(e)?t[n]=o(e):Array.isArray(e)?e.length&&"object"==typeof e[0]&&!Array.isArray(e[0])?t[n]=[o(e[0])]:t[n]=[]:t[n]=null})),t}function r(e,t){return t.prototype.constructor=t,e.prototype=new t,e.prototype.constructor=e,e}function i(e,t){return p(t,function(t,n){e[n]=t}),e}function s(e,t){p(t,function(n,o){t[o]&&"object"==typeof t[o]?(e[o]||(Array.isArray(t[o])?e[o]=[]:e[o]={}),s(e[o],t[o])):e[o]=t[o]})}function a(e){return"object"==typeof e?JSON.parse(JSON.stringify(e)):e}function l(e){var t={};return p(e,function(e,n){t[n]=e}),t}function u(e){for(var t=[],n=1;no;o++)n.prototype[t[o]]=void 0;return n}Object.defineProperties(n,{columnFactory:{get:function(){return o}},__esModule:{value:!0}});var r,i=(r=e("object"),r&&r.__esModule&&r||{"default":r}).inherit},{object:50}],52:[function(e,t,n){"use strict";function o(e){return e[0].toUpperCase()+e.substr(1)}function r(e,t){var n=!0;return p(t.length-1,function(o){return e.charAt(o)!==t.charAt(o)?(n=!1,!1):void 0}),n}function i(e,t){var n=!0,o=t.length-1,r=e.length-1;return p(o,function(i){var s=r-i,a=o-i;return e.charAt(s)!==t.charAt(a)?(n=!1,!1):void 0}),n}function s(){for(var e=[],t=0;t=t)return e;n=String(n);var o=n.length;o||(n=" ");var r=t-e.length,i=Math.ceil(r/n.length),s="";return p(i,function(e){s+=n}),s=s.slice(0,r),s+e}Object.defineProperties(n,{toUpperCaseFirst:{get:function(){return o}},startsWith:{get:function(){return r}},endsWith:{get:function(){return i}},equalsIgnoreCase:{get:function(){return s}},randomString:{get:function(){return a}},isPercentValue:{get:function(){return l}},substitute:{get:function(){return u}},padStart:{get:function(){return c}},__esModule:{value:!0}});var d,h,f=(d=e("mixed"),d&&d.__esModule&&d||{"default":d}).stringify,p=(h=e("number"),h&&h.__esModule&&h||{"default":h}).rangeEach},{mixed:48,number:49}],53:[function(e,t,n){"use strict";function o(e){return 32==e||e>=48&&57>=e||e>=96&&111>=e||e>=186&&192>=e||e>=219&&222>=e||e>=226||e>=65&&90>=e}function r(e){var t=[u.ARROW_DOWN,u.ARROW_UP,u.ARROW_LEFT,u.ARROW_RIGHT,u.HOME,u.END,u.DELETE,u.BACKSPACE,u.F1,u.F2,u.F3,u.F4,u.F5,u.F6,u.F7,u.F8,u.F9,u.F10,u.F11,u.F12,u.TAB,u.PAGE_DOWN,u.PAGE_UP,u.ENTER,u.ESCAPE,u.SHIFT,u.CAPS_LOCK,u.ALT];return-1!==t.indexOf(e)}function i(e){return-1!==[u.CONTROL_LEFT,224,u.COMMAND_LEFT,u.COMMAND_RIGHT].indexOf(e)}function s(e,t){var n=t.split("|"),o=!1;return l(n,function(t){return e===u[t]?(o=!0,!1):void 0}),o}Object.defineProperties(n,{KEY_CODES:{get:function(){return u}},isPrintableChar:{get:function(){return o}},isMetaKey:{get:function(){return r}},isCtrlKey:{get:function(){return i}},isKey:{get:function(){return s}},__esModule:{value:!0}});var a,l=(a=e("array"),a&&a.__esModule&&a||{"default":a}).arrayEach,u={MOUSE_LEFT:1,MOUSE_RIGHT:3,MOUSE_MIDDLE:2,BACKSPACE:8,COMMA:188,INSERT:45,DELETE:46,END:35,ENTER:13,ESCAPE:27,CONTROL_LEFT:91,COMMAND_LEFT:17,COMMAND_RIGHT:93,ALT:18,HOME:36,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,SPACE:32,SHIFT:16,CAPS_LOCK:20,TAB:9,ARROW_RIGHT:39,ARROW_LEFT:37,ARROW_UP:38,ARROW_DOWN:40,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,A:65,X:88,C:67,V:86}},{array:42}],54:[function(e,t,n){"use strict";Object.defineProperties(n,{localHooks:{get:function(){return l}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/array"),o&&o.__esModule&&o||{"default":o}).arrayEach,s=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).defineGetter,a="localHooks",l={_localHooks:Object.create(null),addLocalHook:function(e,t){this._localHooks[e]||(this._localHooks[e]=[]),this._localHooks[e].push(t)},runLocalHooks:function(e){for(var t=[],n=1;n=0?(t.skip=!0,!0):!1},has:function(e){var t=void 0!==arguments[1]?arguments[1]:null,n=this.getBucket(t);return void 0!==n[e]&&n[e].length?!0:!1},run:function(e,t,n,o,r,i,s,a){var l=this.globalBucket[t],u=-1,c=l?l.length:0;if(c)for(;++u=0},getRegistered:function(){return i}},{}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.Hooks=l},{"helpers/array":42,"helpers/object":50}],57:[function(e,t,n){"use strict";function o(e,t){e=c(e),Handsontable.plugins[e]=t,Handsontable.hooks.add("construct",function(){var n;d.has(this)||d.set(this,{}),n=d.get(this),n[e]||(n[e]=new t(this))}),Handsontable.hooks.add("afterDestroy",function(){if(d.has(this)){var e=d.get(this);u(e,function(e){return e.destroy()}),d["delete"](this)}})}function r(e,t){if("string"!=typeof t)throw Error('Only strings can be passed as "plugin" parameter');var n=c(t);if(d.has(e)&&d.get(e)[n])return d.get(e)[n]}function i(e){return d.has(e)?Object.keys(d.get(e)):[]}function s(e,t){var n=null;return d.has(e)&&u(d.get(e),function(e,o){e===t&&(n=o)}),n}Object.defineProperties(n,{registerPlugin:{get:function(){return o}},getPlugin:{get:function(){return r}},getRegistredPluginNames:{get:function(){return i}},getPluginName:{get:function(){return s}},__esModule:{value:!0}});var a,l,u=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}).objectEach,c=(l=e("helpers/string"),l&&l.__esModule&&l||{"default":l}).toUpperCaseFirst,d=new WeakMap;Handsontable.plugins=Handsontable.plugins||{},Handsontable.plugins.utils=Handsontable.plugins.utils||{},Handsontable.plugins.registerPlugin=o},{"helpers/object":50,"helpers/string":52}],58:[function(e,t,n){"use strict";Object.defineProperties(n,{"default":{get:function(){return m}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/object"),o&&o.__esModule&&o||{"default":o}),a=s.defineGetter,l=s.objectEach,u=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,c=(i=e("plugins"),i&&i.__esModule&&i||{"default":i}),d=c.getRegistredPluginNames,h=c.getPluginName,f=new WeakMap,p=null,g=function(e){var t=this;a(this,"hot",e,{writable:!1}),f.set(this,{hooks:{}}),p=null,this.pluginName=null,this.pluginsInitializedCallbacks=[],this.isPluginsReady=!1,this.enabled=!1,this.initialized=!1,this.hot.addHook("afterPluginsInitialized",function(){return t.onAfterPluginsInitialized()}),this.hot.addHook("afterUpdateSettings",function(){return t.onUpdateSettings()}),this.hot.addHook("beforeInit",function(){return t.init()})};$traceurRuntime.createClass(g,{init:function(){this.pluginName=h(this.hot,this),this.isEnabled&&this.isEnabled()&&this.enablePlugin(),p||(p=d(this.hot)),p.indexOf(this.pluginName)>=0&&p.splice(p.indexOf(this.pluginName),1),p.length||this.hot.runHooks("afterPluginsInitialized"),this.initialized=!0},enablePlugin:function(){this.enabled=!0},disablePlugin:function(){this.eventManager&&this.eventManager.clear(),this.clearHooks(),this.enabled=!1},addHook:function(e,t){var n=f.get(this).hooks[e]=f.get(this).hooks[e]||[];this.hot.addHook(e,t),n.push(t),f.get(this).hooks[e]=n},removeHooks:function(e){var t=this;u(f.get(this).hooks[e]||[],function(n){t.hot.removeHook(e,n)})},clearHooks:function(){var e=this,t=f.get(this).hooks;l(t,function(t,n){return e.removeHooks(n)}),t.length=0},callOnPluginsReady:function(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)},onAfterPluginsInitialized:function(){u(this.pluginsInitializedCallbacks,function(e){return e()}),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0},onUpdateSettings:function(){this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&this.updatePlugin())},updatePlugin:function(){},destroy:function(){var e=this;this.eventManager&&this.eventManager.destroy(),this.clearHooks(),l(this,function(t,n){"hot"!==n&&(e[n]=null)}),delete this.hot}},{});var m=g;Handsontable.plugins.BasePlugin=g},{"helpers/array":42,"helpers/object":50,plugins:57}],59:[function(e,t,n){"use strict";Object.defineProperties(n,{AutoColumnSize:{get:function(){return D}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c,d,h,f=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],p=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),g=p.arrayEach,m=p.arrayFilter,w=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),v=w.cancelAnimationFrame,y=w.requestAnimationFrame,b=w.isVisible,C=(s=e("utils/ghostTable"),s&&s.__esModule&&s||{"default":s}).GhostTable,R=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),_=R.isObject,S=(R.objectEach,l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}),E=S.valueAccordingPercent,T=S.rangeEach,O=(u=e("plugins"),u&&u.__esModule&&u||{"default":u}).registerPlugin,M=(c=e("utils/samplesGenerator"),c&&c.__esModule&&c||{"default":c}).SamplesGenerator,k=(d=e("helpers/string"),d&&d.__esModule&&d||{"default":d}).isPercentValue,H=(h=e("3rdparty/walkontable/src/calculator/viewportColumns"),h&&h.__esModule&&h||{"default":h}).WalkontableViewportColumnsCalculator,D=function(e){var t=this;$traceurRuntime.superConstructor(x).call(this,e),this.widths=[],this.ghostTable=new C(this.hot),this.samplesGenerator=new M(function(e,n){return t.hot.getDataAtCell(e,n)}),this.firstCalculation=!0,this.inProgress=!1,this.addHook("beforeColumnResize",function(e,n,o){return t.onBeforeColumnResize(e,n,o)})},x=D;$traceurRuntime.createClass(D,{isEnabled:function(){return this.hot.getSettings().autoColumnSize!==!1&&!this.hot.getSettings().colWidths},enablePlugin:function(){var e=this;if(!this.enabled){var t=this.hot.getSettings().autoColumnSize,n=t&&t.hasOwnProperty("samplingRatio")?this.hot.getSettings().autoColumnSize.samplingRatio:void 0;n&&!isNaN(n)&&(this.samplesGenerator.customSampleCount=parseInt(n,10)),this.addHook("afterLoadData",function(){return e.onAfterLoadData()}),this.addHook("beforeChange",function(t){return e.onBeforeChange(t)}),this.addHook("beforeRender",function(t){return e.onBeforeRender(t)}),this.addHook("modifyColWidth",function(t,n){return e.getColumnWidth(n,t)}),$traceurRuntime.superGet(this,x.prototype,"enablePlugin").call(this)}},disablePlugin:function(){$traceurRuntime.superGet(this,x.prototype,"disablePlugin").call(this)},calculateColumnsWidth:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countRows()-1},n=void 0!==arguments[2]?arguments[2]:!1,o=this;"number"==typeof e&&(e={from:e,to:e}),"number"==typeof t&&(t={from:t,to:t}),T(e.from,e.to,function(e){if(n||void 0===o.widths[e]&&!o.hot._getColWidthFromSettings(e)){var r=o.samplesGenerator.generateColumnSamples(e,t);r.forEach(function(e,t){return o.ghostTable.addColumn(t,e)})}}),this.ghostTable.columns.length&&(this.ghostTable.getWidths(function(e,t){return o.widths[e]=t}),this.ghostTable.clean())},calculateAllColumnsWidth:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=this,n=0,o=this.hot.countCols()-1,r=null;this.inProgress=!0;var i=function(){return t.hot?(t.calculateColumnsWidth({from:n,to:Math.min(n+x.CALCULATION_STEP,o)},e),n=n+x.CALCULATION_STEP+1,void(o>n?r=y(i):(v(r),t.inProgress=!1,t.hot.view.wt.wtOverlays.adjustElementsSize(!0),t.hot.view.wt.wtOverlays.leftOverlay.needFullRender&&t.hot.view.wt.wtOverlays.leftOverlay.clone.draw()))):(v(r),void(t.inProgress=!1))};this.firstCalculation&&this.getSyncCalculationLimit()&&(this.calculateColumnsWidth({from:0,to:this.getSyncCalculationLimit()},e),this.firstCalculation=!1,n=this.getSyncCalculationLimit()+1),o>n?i():this.inProgress=!1},recalculateAllColumnsWidth:function(){this.hot.view&&b(this.hot.view.wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllColumnsWidth())},getSyncCalculationLimit:function(){var e=x.SYNC_CALCULATION_LIMIT,t=this.hot.countCols()-1; +return _(this.hot.getSettings().autoColumnSize)&&(e=this.hot.getSettings().autoColumnSize.syncLimit,k(e)?e=E(t,e):e>>=0),Math.min(e,t)},getColumnWidth:function(e){var t=arguments[1],n=void 0!==arguments[2]?arguments[2]:!0,o=t;return void 0===o&&(o=this.widths[e],n&&"number"==typeof o&&(o=Math.max(o,H.DEFAULT_WIDTH))),o},getFirstVisibleColumn:function(){var e=this.hot.view.wt;return e.wtViewport.columnsVisibleCalculator?e.wtTable.getFirstVisibleColumn():e.wtViewport.columnsRenderCalculator?e.wtTable.getFirstRenderedColumn():-1},getLastVisibleColumn:function(){var e=this.hot.view.wt;return e.wtViewport.columnsVisibleCalculator?e.wtTable.getLastVisibleColumn():e.wtViewport.columnsRenderCalculator?e.wtTable.getLastRenderedColumn():-1},clearCache:function(){this.widths.length=0},isNeedRecalculate:function(){return m(this.widths,function(e){return void 0===e}).length?!0:!1},onBeforeRender:function(){var e=this.hot.renderCall;this.calculateColumnsWidth({from:this.getFirstVisibleColumn(),to:this.getLastVisibleColumn()},void 0,e),this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllColumnsWidth()},onAfterLoadData:function(){var e=this;this.hot.view?this.recalculateAllColumnsWidth():setTimeout(function(){e.hot&&e.recalculateAllColumnsWidth()},0)},onBeforeChange:function(e){var t=this;g(e,function(e){return t.widths[e[1]]=void 0})},onBeforeColumnResize:function(e,t,n){return n&&(this.calculateColumnsWidth(e,void 0,!0),t=this.getColumnWidth(e,void 0,!1)),t},destroy:function(){this.ghostTable.clean(),$traceurRuntime.superGet(this,x.prototype,"destroy").call(this)}},{get CALCULATION_STEP(){return 50},get SYNC_CALCULATION_LIMIT(){return 50}},f),O("autoColumnSize",D)},{"3rdparty/walkontable/src/calculator/viewportColumns":3,_base:58,"helpers/array":42,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/string":52,plugins:57,"utils/ghostTable":98,"utils/samplesGenerator":99}],60:[function(e,t,n){"use strict";Object.defineProperties(n,{AutoRowSize:{get:function(){return M}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c,d,h=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],f=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),p=(f.arrayEach,f.arrayFilter),g=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),m=g.cancelAnimationFrame,w=g.requestAnimationFrame,v=g.isVisible,y=(s=e("utils/ghostTable"),s&&s.__esModule&&s||{"default":s}).GhostTable,b=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),C=b.isObject,R=(b.objectEach,l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}),_=R.valueAccordingPercent,S=R.rangeEach,E=(u=e("plugins"),u&&u.__esModule&&u||{"default":u}).registerPlugin,T=(c=e("utils/samplesGenerator"),c&&c.__esModule&&c||{"default":c}).SamplesGenerator,O=(d=e("helpers/string"),d&&d.__esModule&&d||{"default":d}).isPercentValue,M=function(e){var t=this;$traceurRuntime.superConstructor(k).call(this,e),this.heights=[],this.ghostTable=new y(this.hot),this.samplesGenerator=new T(function(e,n){return t.hot.getDataAtCell(e,n)}),this.firstCalculation=!0,this.inProgress=!1,this.addHook("beforeRowResize",function(e,n,o){return t.onBeforeRowResize(e,n,o)})},k=M;$traceurRuntime.createClass(M,{isEnabled:function(){return this.hot.getSettings().autoRowSize===!0||C(this.hot.getSettings().autoRowSize)},enablePlugin:function(){var e=this;if(!this.enabled){var t=this.hot.getSettings().autoRowSize,n=t&&t.hasOwnProperty("samplingRatio")?this.hot.getSettings().autoRowSize.samplingRatio:void 0;n&&!isNaN(n)&&(this.samplesGenerator.customSampleCount=parseInt(n,10)),this.addHook("afterLoadData",function(){return e.onAfterLoadData()}),this.addHook("beforeChange",function(t){return e.onBeforeChange(t)}),this.addHook("beforeColumnMove",function(){return e.recalculateAllRowsHeight()}),this.addHook("beforeColumnResize",function(){return e.recalculateAllRowsHeight()}),this.addHook("beforeColumnSort",function(){return e.clearCache()}),this.addHook("beforeRender",function(t){return e.onBeforeRender(t)}),this.addHook("beforeRowMove",function(t,n){return e.onBeforeRowMove(t,n)}),this.addHook("modifyRowHeight",function(t,n){return e.getRowHeight(n,t)}),$traceurRuntime.superGet(this,k.prototype,"enablePlugin").call(this)}},disablePlugin:function(){$traceurRuntime.superGet(this,k.prototype,"disablePlugin").call(this)},calculateRowsHeight:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countCols()-1},n=void 0!==arguments[2]?arguments[2]:!1,o=this;"number"==typeof e&&(e={from:e,to:e}),"number"==typeof t&&(t={from:t,to:t}),S(e.from,e.to,function(e){if(n||void 0===o.heights[e]){var r=o.samplesGenerator.generateRowSamples(e,t);r.forEach(function(e,t){return o.ghostTable.addRow(t,e)})}}),this.ghostTable.rows.length&&(this.ghostTable.getHeights(function(e,t){return o.heights[e]=t}),this.ghostTable.clean())},calculateAllRowsHeight:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=this,n=0,o=this.hot.countRows()-1,r=null;this.inProgress=!0;var i=function(){return t.hot?(t.calculateRowsHeight({from:n,to:Math.min(n+k.CALCULATION_STEP,o)},e),n=n+k.CALCULATION_STEP+1,void(o>n?r=w(i):(m(r),t.inProgress=!1,t.hot.view.wt.wtOverlays.adjustElementsSize(!0),t.hot.view.wt.wtOverlays.leftOverlay.needFullRender&&t.hot.view.wt.wtOverlays.leftOverlay.clone.draw()))):(m(r),void(t.inProgress=!1))};this.firstCalculation&&this.getSyncCalculationLimit()&&(this.calculateRowsHeight({from:0,to:this.getSyncCalculationLimit()},e),this.firstCalculation=!1,n=this.getSyncCalculationLimit()+1),o>n?i():this.inProgress=!1},recalculateAllRowsHeight:function(){v(this.hot.view.wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllRowsHeight())},getSyncCalculationLimit:function(){var e=k.SYNC_CALCULATION_LIMIT,t=this.hot.countRows()-1;return C(this.hot.getSettings().autoRowSize)&&(e=this.hot.getSettings().autoRowSize.syncLimit,O(e)?e=_(t,e):e>>=0),Math.min(e,t)},getRowHeight:function(e){var t=arguments[1],n=t;return void 0!==this.heights[e]&&this.heights[e]>(t||0)&&(n=this.heights[e]),n},getFirstVisibleRow:function(){var e=this.hot.view.wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getFirstVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getFirstRenderedRow():-1},getLastVisibleRow:function(){var e=this.hot.view.wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getLastVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getLastRenderedRow():-1},clearCache:function(){this.heights.length=0},clearCacheByRange:function(e){var t=this;"number"==typeof e&&(e={from:e,to:e}),S(Math.min(e.from,e.to),Math.max(e.from,e.to),function(e){return t.heights[e]=void 0})},isNeedRecalculate:function(){return p(this.heights,function(e){return void 0===e}).length?!0:!1},onBeforeRender:function(){var e=this.hot.renderCall;this.calculateRowsHeight({from:this.getFirstVisibleRow(),to:this.getLastVisibleRow()},void 0,e),this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllRowsHeight()},onBeforeRowMove:function(e,t){this.clearCacheByRange({from:e,to:t}),this.calculateAllRowsHeight()},onBeforeRowResize:function(e,t,n){return n&&(this.calculateRowsHeight(e,void 0,!0),t=this.getRowHeight(e)),t},onAfterLoadData:function(){var e=this;this.hot.view?this.recalculateAllRowsHeight():setTimeout(function(){e.hot&&e.recalculateAllRowsHeight()},0)},onBeforeChange:function(e){var t=null;1===e.length?t=e[0][0]:e.length>1&&(t={from:e[0][0],to:e[e.length-1][0]}),null!==t&&this.clearCacheByRange(t)},destroy:function(){this.ghostTable.clean(),$traceurRuntime.superGet(this,k.prototype,"destroy").call(this)}},{get CALCULATION_STEP(){return 50},get SYNC_CALCULATION_LIMIT(){return 500}},h),E("autoRowSize",M)},{_base:58,"helpers/array":42,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/string":52,plugins:57,"utils/ghostTable":98,"utils/samplesGenerator":99}],61:[function(e,t,n){"use strict";function o(e,t,n,o){var r,i,s,a,l,u=n.length,c=n?n[0].length:0,d=[],h=[];if(r=t.row-e.row,i=t.col-e.col,-1!==["down","up"].indexOf(o)){for(var f=0;i>=f;f++)s=parseInt(n[0][f],10),a=parseInt(n[u-1][f],10),l=("down"===o?a-s:s-a)/(u-1)||0,h.push(l);d.push(h)}if(-1!==["right","left"].indexOf(o))for(var p=0;r>=p;p++)s=parseInt(n[p][0],10),a=parseInt(n[p][c-1],10),l=("right"===o?a-s:s-a)/(c-1)||0,h=[],h.push(l),d.push(h);return d}function r(e){function t(t){return e.autofill?void(e.autofill.handle&&e.autofill.handle.isDragged&&(e.autofill.handle.isDragged>1&&e.autofill.apply(),e.autofill.handle.isDragged=0,a=!1)):!0}function n(e){var t,n;return s.instance.autofill?(t=c(s.instance.table).top-(window.pageYOffset||document.documentElement.scrollTop)+d(s.instance.table),n=c(s.instance.table).left-(window.pageXOffset||document.documentElement.scrollLeft)+h(s.instance.table),s.addingStarted===!1&&s.instance.autofill.handle.isDragged>0&&e.clientY>t&&e.clientX<=n?(s.instance.mouseDragOutside=!0,s.addingStarted=!0):s.instance.mouseDragOutside=!1,void(s.instance.mouseDragOutside&&setTimeout(function(){s.addingStarted=!1,s.instance.alter("insert_row")},200))):!1}var o,r,i,s=this,a=!1;this.instance=e,this.addingStarted=!1,i=f(e),i.addEventListener(document,"mouseup",t),i.addEventListener(document,"mousemove",n),o=this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown,this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown=function(t){e.autofill.handle.isDragged=1,a=!0,o(t)},r=this.instance.view.wt.wtSettings.settings.onCellMouseOver,this.instance.view.wt.wtSettings.settings.onCellMouseOver=function(t,n,o,i){e.autofill&&a&&!e.view.isMouseDown()&&e.autofill.handle&&e.autofill.handle.isDragged&&(e.autofill.handle.isDragged++,e.autofill.showBorder(n),e.autofill.checkIfNewRowNeeded()),r(t,n,o,i)},this.instance.view.wt.wtSettings.settings.onCellCornerDblClick=function(){e.autofill.selectAdjacent()}}Object.defineProperties(n,{Autofill:{get:function(){return r}},__esModule:{value:!0}});var i,s,a,l,u=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),c=u.offset,d=u.outerHeight,h=u.outerWidth,f=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).eventManager,p=((a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin,(l=e("3rdparty/walkontable/src/cell/coords"),l&&l.__esModule&&l||{"default":l}).WalkontableCellCoords);r.prototype.init=function(){this.handle={}},r.prototype.disable=function(){this.handle.disabled=!0},r.prototype.selectAdjacent=function(){var e,t,n,o,r;e=this.instance.selection.isMultiple()?this.instance.view.wt.selections.area.getCorners():this.instance.view.wt.selections.current.getCorners(),t=this.instance.getData();e:for(n=e[2]+1;nt[3]?(s="right",n=new p(e[0],t[3]+1),r=new p(e[2],e[3])):e[0]t[2]&&e[1]===t[1]&&(s="down",n=new p(t[2]+1,e[1]),r=new p(e[2],e[3])),n&&n.row>-1&&n.col>-1?(l={from:this.instance.getSelectedRange().from,to:this.instance.getSelectedRange().to},i=this.instance.getData(l.from.row,l.from.col,l.to.row,l.to.col),a=o(n,r,i,s),Handsontable.hooks.run(this.instance,"beforeAutofill",n,r,i),this.instance.populateFromArray(n.row,n.col,i,r.row,r.col,"autofill",null,s,a),this.instance.selection.setRangeStart(new p(e[0],e[1])),this.instance.selection.setRangeEnd(new p(e[2],e[3]))):this.instance.selection.refreshBorders())},r.prototype.showBorder=function(e){var t=this.instance.getSelectedRange().getTopLeftCorner(),n=this.instance.getSelectedRange().getBottomRightCorner();if("horizontal"!==this.instance.getSettings().fillHandle&&(n.rowe.row))e=new p(e.row,n.col);else{if("vertical"===this.instance.getSettings().fillHandle)return;e=new p(n.row,e.col)}this.instance.view.wt.selections.fill.clear(),this.instance.view.wt.selections.fill.add(this.instance.getSelectedRange().from),this.instance.view.wt.selections.fill.add(this.instance.getSelectedRange().to),this.instance.view.wt.selections.fill.add(e),this.instance.view.render()},r.prototype.checkIfNewRowNeeded=function(){var e,t,n=this.instance.countRows(),o=this;this.instance.view.wt.selections.fill.cellRange&&this.addingStarted===!1&&(t=this.instance.getSelected(),e=this.instance.view.wt.selections.fill.getCorners(),t[2]n[1]?e?1:-1:0}},dateSort:function(e){return function(t,n){if(t[1]===n[1])return 0;if(null===t[1]||""===t[1])return 1;if(null===n[1]||""===n[1])return-1;var o=new Date(t[1]),r=new Date(n[1]);return r>o?e?-1:1:o>r?e?1:-1:0}},sort:function(){if("undefined"==typeof this.hot.sortOrder)return void(this.hot.sortIndex.length=0);var e,t;this.hot.sortingEnabled=!1,this.hot.sortIndex.length=0;for(var n=this.hot.colOffset(),o=0,r=this.hot.countRows()-this.hot.getSettings().minSpareRows;r>o;o++)this.hot.sortIndex.push([o,this.hot.getDataAtCell(o,this.hot.sortColumn+n)]);switch(e=this.hot.getCellMeta(0,this.hot.sortColumn),this.sortIndicators[this.hot.sortColumn]=e.sortIndicator,e.type){case"date":t=this.dateSort;break;default:t=this.defaultSort}this.hot.sortIndex.sort(t(this.hot.sortOrder));for(var o=this.hot.sortIndex.length;o=0&&-1===r&&u(n,"columnSorting"),f(n,"descending"),f(n,"ascending"),this.sortIndicators[e]&&e===this.hot.sortColumn&&("ascending"===this.sortOrderClass?u(n,"ascending"):"descending"===this.sortOrderClass&&u(n,"descending")))},isSorted:function(){return"undefined"!=typeof this.hot.sortColumn},afterCreateRow:function(e,t){if(this.isSorted()){for(var n=0;n=e&&(this.hot.sortIndex[n][0]+=t);for(var n=0;t>n;n++)this.hot.sortIndex.splice(e+n,0,[e+n,this.hot.getSourceData()[e+n][this.hot.sortColumn+this.hot.colOffset()]]);this.saveSortingState()}},afterRemoveRow:function(e,t){function n(e){return m(o,function(t,n){return e>n&&t++,t},0)}if(this.isSorted()){var o=this.hot.sortIndex.splice(e,t);o=g(o,function(e){return e[0]}),this.hot.sortIndex=g(this.hot.sortIndex,function(e,t){var o=n(e[0]);return o&&(e[0]-=o),e}),this.saveSortingState()}}},{},v),y("columnSorting",b)},{_base:58,eventManager:41,"helpers/array":42,"helpers/dom/element":45,plugins:57}],63:[function(e,t,n){"use strict";Object.defineProperties(n,{CommentEditor:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).addClass,i=function(){this.editor=this.createEditor(),this.editorStyle=this.editor.style,this.editorStyle.position="absolute",this.editorStyle.zIndex=100,this.hide()},s=i;$traceurRuntime.createClass(i,{setPosition:function(e,t){this.editorStyle.left=e+"px",this.editorStyle.top=t+"px"},show:function(){this.editorStyle.display="block"},hide:function(){this.editorStyle.display="none"},isVisible:function(){return"block"===this.editorStyle.display},setValue:function(){var e=void 0!==arguments[0]?arguments[0]:"";e=e||"",this.getInputElement().value=e},getValue:function(){return this.getInputElement().value},isFocused:function(){return document.activeElement===this.getInputElement()},focus:function(){this.getInputElement().focus()},createEditor:function(){var e,t,n=document.querySelector("."+s.CLASS_EDITOR_CONTAINER);return n||(n=document.createElement("div"),r(n,s.CLASS_EDITOR_CONTAINER),document.body.appendChild(n)),e=document.createElement("div"),r(e,s.CLASS_EDITOR),t=document.createElement("textarea"),r(t,s.CLASS_INPUT),e.appendChild(t),n.appendChild(e),e},getInputElement:function(){return this.editor.querySelector("."+s.CLASS_INPUT)},destroy:function(){this.editor.parentNode.removeChild(this.editor),this.editor=null,this.editorStyle=null}},{get CLASS_EDITOR_CONTAINER(){return"htCommentsContainer"},get CLASS_EDITOR(){return"htComments"},get CLASS_INPUT(){return"htCommentTextArea"},get CLASS_CELL(){return"htCommentCell"}})},{"helpers/dom/element":45}],64:[function(e,t,n){"use strict";Object.defineProperties(n,{Comments:{get:function(){return R}},__esModule:{value:!0}});var o,r,i,s,a,l,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),c=u.addClass,d=u.closest,h=u.getWindowScrollLeft,f=u.getWindowScrollTop,p=u.hasClass,g=u.offset,m=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,w=(i=e("3rdparty/walkontable/src/cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords,v=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}),y=v.registerPlugin,b=(v.getPlugin,(a=e("_base"),a&&a.__esModule&&a||{"default":a})["default"]),C=(l=e("commentEditor"),l&&l.__esModule&&l||{"default":l}).CommentEditor,R=function(e){$traceurRuntime.superConstructor(_).call(this,e),this.editor=null,this.eventManager=null,this.range={},this.mouseDown=!1,this.contextMenuEvent=!1,this.timer=null},_=R;$traceurRuntime.createClass(R,{isEnabled:function(){return this.hot.getSettings().comments},enablePlugin:function(){var e=this;this.enabled||(this.editor||(this.editor=new C),this.eventManager||(this.eventManager=new m(this)),this.addHook("afterContextMenuDefaultOptions",function(t){return e.addToContextMenu(t)}),this.addHook("afterRenderer",function(t,n,o,r,i,s){return e.onAfterRenderer(t,s)}),this.addHook("afterScrollHorizontally",function(){return e.refreshEditorPosition()}),this.addHook("afterScrollVertically",function(){return e.refreshEditorPosition()}),this.addHook("afterColumnResize",function(){return e.refreshEditorPosition()}),this.addHook("afterRowResize",function(){return e.refreshEditorPosition()}),this.registerListeners(),$traceurRuntime.superGet(this,_.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,_.prototype,"disablePlugin").call(this)},registerListeners:function(){var e=this;this.eventManager.addEventListener(document,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(document,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(document,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(document,"mouseup",function(t){return e.onMouseUp(t)}),this.eventManager.addEventListener(this.editor.getInputElement(),"blur",function(t){return e.onEditorBlur(t)})},setRange:function(e){this.range=e},clearRange:function(){this.range={}},targetIsCellWithComment:function(e){return p(e.target,"htCommentCell")&&d(e.target,[this.hot.rootElement])?!0:!1},targetIsCommentTextArea:function(e){return this.editor.getInputElement()===e.target},saveComment:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');var e=this.editor.getValue(),t=this.range.from.row,n=this.range.from.col;this.hot.setCellMeta(t,n,"comment",e),this.hot.render()},saveCommentAtCell:function(e,t){this.setRange({from:new w(e,t)}),this.saveComment()},removeComment:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');this.hot.removeCellMeta(this.range.from.row,this.range.from.col,"comment"),this.hot.render(),this.hide()},removeCommentAtCell:function(e,t){this.setRange({from:new w(e,t)}),this.removeComment()},show:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');var e=this.hot.getCellMeta(this.range.from.row,this.range.from.col);return this.refreshEditorPosition(!0),this.editor.setValue(e.comment||""),this.editor.show(),!0},showAtCell:function(e,t){return this.setRange({from:new w(e,t)}),this.show()},hide:function(){this.editor.hide()},refreshEditorPosition:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(e||this.range.from&&this.editor.isVisible()){var t=this.hot.view.wt.wtTable.getCell(this.range.from),n=g(t),o=this.hot.getColWidth(this.range.from.col),r=n.top,i=n.left,s=0,a=0;this.hot.view.wt.wtViewport.hasVerticalScroll()&&(r-=this.hot.view.wt.wtOverlays.topOverlay.getScrollPosition(),s=20),this.hot.view.wt.wtViewport.hasHorizontalScroll()&&(i-=this.hot.view.wt.wtOverlays.leftOverlay.getScrollPosition(),a=20);var l=i+o,u=r,c=this.hot.view.wt.wtTable.holder.getBoundingClientRect(),d={left:c.left+h()+a,right:c.right+h()-15,top:c.top+f()+s,bottom:c.bottom+f()};l<=d.left||l>d.right||u<=d.top||u>d.bottom?this.hide():this.editor.setPosition(l,u)}},onMouseDown:function(e){this.mouseDown=!0,this.hot.view&&this.hot.view.wt&&(this.contextMenuEvent||this.targetIsCommentTextArea(e)||this.targetIsCellWithComment(e)||this.hide(),this.contextMenuEvent=!1)},onMouseOver:function(e){if(!this.mouseDown&&!this.editor.isFocused())if(this.targetIsCellWithComment(e)){var t=this.hot.view.wt.wtTable.getCoords(e.target),n={from:new w(t.row,t.col)};this.setRange(n),this.show()}else this.targetIsCommentTextArea(e)||this.editor.isFocused()||this.hide()},onMouseMove:function(e){var t=this;this.targetIsCommentTextArea(e)&&(this.mouseDown=!0,clearTimeout(this.timer),this.timer=setTimeout(function(){t.mouseDown=!1},200))},onMouseUp:function(e){this.mouseDown=!1},onAfterRenderer:function(e,t){t.comment&&c(e,t.commentedCellClassName)},onEditorBlur:function(e){this.saveComment()},checkSelectionCommentsConsistency:function(){var e=this.hot.getSelectedRange();if(!e)return!1;var t=!1,n=e.from;return this.hot.getCellMeta(n.row,n.col).comment&&(t=!0),t},onContextMenuAddComment:function(){var e=this,t=this.hot.getSelectedRange();this.contextMenuEvent=!0,this.setRange({from:t.from}),this.show(),setTimeout(function(){e.hot&&(e.hot.deselectCell(),e.editor.focus())},10)},onContextMenuRemoveComment:function(e,t){this.contextMenuEvent=!0,this.removeCommentAtCell(t.start.row,t.start.col)},addToContextMenu:function(e){var t=this;e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR,{key:"commentsAddEdit",name:function(){return t.checkSelectionCommentsConsistency()?"Edit Comment":"Add Comment"},callback:function(){return t.onContextMenuAddComment()},disabled:function(){return this.getSelected()?!1:!0}},{key:"commentsRemove",name:function(){return"Delete Comment"},callback:function(e,n){return t.onContextMenuRemoveComment(e,n)},disabled:function(){return!t.checkSelectionCommentsConsistency()}})},destroy:function(){this.editor&&this.editor.destroy(),$traceurRuntime.superGet(this,_.prototype,"destroy").call(this)}},{},b),y("comments",R)},{"3rdparty/walkontable/src/cell/coords":5,_base:58,commentEditor:63,eventManager:41,"helpers/dom/element":45,plugins:57}],65:[function(e,t,n){"use strict";function o(e,t){var n;return i(t,function(t){var o=t.key?t.key.split(":"):null;return Array.isArray(o)&&o[1]===e?(n=t,!1):void 0}),n}Object.defineProperties(n,{CommandExecutor:{get:function(){return s}},__esModule:{value:!0}});var r,i=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,s=function(e){this.hot=e,this.commands={},this.commonCallback=null};$traceurRuntime.createClass(s,{registerCommand:function(e,t){this.commands[e]=t},setCommonCallback:function(e){this.commonCallback=e},execute:function(e){for(var t=[],n=1;n0;if(s)return}}else if(!(t(i)||v(i,"current")&&v(i,"wtBorder")))return;this.open(e)},onMenuAfterOpen:function(){this.hot.runHooks("afterContextMenuShow",this)},onMenuAfterClose:function(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)},destroy:function(){this.close(),this.menu&&this.menu.destroy(),$traceurRuntime.superGet(this,W.prototype,"destroy").call(this)}},{get DEFAULT_ITEMS(){return[E,T,N,O,M,N,k,H,N,D,x,N,A,N,P]}},p),L.SEPARATOR={name:N},Handsontable.hooks.register("afterContextMenuDefaultOptions"),Handsontable.hooks.register("afterContextMenuShow"),Handsontable.hooks.register("afterContextMenuHide"),Handsontable.hooks.register("afterContextMenuExecute"),R("contextMenu",L)},{_base:58,commandExecutor:65,eventManager:41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,itemsFactory:68,menu:69,plugins:57,predefinedItems:70}],67:[function(e,t,n){"use strict";Object.defineProperties(n,{Cursor:{get:function(){return d}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.getWindowScrollLeft,a=i.getWindowScrollTop,l=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}),u=l.pageX,c=l.pageY,d=function(e){var t,n,o,r,i,l,d,h,f=a(),p=s();this.type=this.getSourceType(e),"literal"===this.type?(t=parseInt(e.top,10),o=parseInt(e.left,10),d=e.height,h=e.width):"event"===this.type&&(t=parseInt(c(e),10),o=parseInt(u(e),10),d=e.target.clientHeight,h=e.target.clientWidth),n=t-f,r=o-p,i=f,l=p,this.top=t,this.topRelative=n,this.left=o,this.leftRelative=r,this.scrollTop=i,this.scrollLeft=l,this.cellHeight=d,this.cellWidth=h};$traceurRuntime.createClass(d,{getSourceType:function(e){var t="literal";return e instanceof Event&&(t="event"),t},fitsAbove:function(e){return this.topRelative>=e.offsetHeight},fitsBelow:function(e){var t=void 0!==arguments[1]?arguments[1]:window.innerHeight;return this.topRelative+e.offsetHeight<=t},fitsOnRight:function(e){var t=void 0!==arguments[1]?arguments[1]:window.innerWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=t},fitsOnLeft:function(e){return this.leftRelative>=e.offsetWidth}},{}),Handsontable.plugins.utils=Handsontable.plugins.utils||{},Handsontable.plugins.utils.Cursor=d},{"helpers/dom/element":45,"helpers/dom/event":46}],68:[function(e,t,n){"use strict";function o(){var e=void 0!==arguments[0]?arguments[0]:null,t=void 0!==arguments[1]?arguments[1]:[],n=void 0!==arguments[2]?arguments[2]:{},o=[];return e&&e.items?e=e.items:Array.isArray(e)||(e=t),u(e)?l(e,function(e,t){var r=n["string"==typeof e?e:t];r||(r=e),u(e)?c(r,e):"string"==typeof r&&(r={name:r}),void 0===r.key&&(r.key=t),o.push(r)}):d(e,function(e,t){var r=n[e];!r&&p.indexOf(e)>=0||(r||(r={name:e,key:t+""}),u(e)&&c(r,e),void 0===r.key&&(r.key=t),o.push(r))}),o[0].name===f&&o.shift(),o}Object.defineProperties(n,{ItemsFactory:{get:function(){return m}},__esModule:{value:!0}});var r,i,s,a=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}),l=a.objectEach,u=a.isObject,c=a.extend,d=(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,h=(s=e("predefinedItems"),s&&s.__esModule&&s||{"default":s}),f=h.SEPARATOR,p=h.ITEMS,g=h.predefinedItems,m=function(e){var t=void 0!==arguments[1]?arguments[1]:null;this.hot=e,this.predefinedItems=g(),this.defaultOrderPattern=t};$traceurRuntime.createClass(m,{setPredefinedItems:function(e){var t=this,n={};this.defaultOrderPattern.length=0,l(e,function(e,o){var r="";e.name===f?(n[f]=e,r=f):isNaN(parseInt(o,10))?(e.key=void 0===e.key?o:e.key,n[o]=e,r=e.key):(n[e.key]=e,r=e.key),t.defaultOrderPattern.push(r)}),this.predefinedItems=n},getVisibleItems:function(){var e=void 0!==arguments[0]?arguments[0]:null,t=this,n={};return l(this.predefinedItems,function(e,o){(!e.hidden||e.hidden&&!e.hidden.apply(t.hot))&&(n[o]=e)}),o(e,this.defaultOrderPattern,n)},getItems:function(){var e=void 0!==arguments[0]?arguments[0]:null;return o(e,this.defaultOrderPattern,this.predefinedItems)}},{})},{"helpers/array":42,"helpers/object":50,predefinedItems:70}],69:[function(e,t,n){"use strict";Object.defineProperties(n,{Menu:{get:function(){return W}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c,d,h,f=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),p=f.addClass,g=f.empty,m=f.fastInnerHTML,w=(f.getComputedStyle,f.getScrollbarWidth),v=(f.getWindowScrollLeft,f.getWindowScrollTop,f.hasClass,f.isChildOf),y=f.removeClass,b=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,C=(i=e("cursor"),i&&i.__esModule&&i||{"default":i}).Cursor,R=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).EventManager,_=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),S=(_.extend,_.isObject,_.objectEach,_.mixin),E=(l=e("utils"),l&&l.__esModule&&l||{"default":l}),T=E.isSeparator,O=E.isDisabled,M=E.isSelectionDisabled,k=E.hasSubMenu,H=E.normalizeSelection,D=(u=e("helpers/unicode"),u&&u.__esModule&&u||{"default":u}).KEY_CODES,x=(c=e("mixins/localHooks"),c&&c.__esModule&&c||{"default":c}).localHooks,A=(d=e("predefinedItems"),d&&d.__esModule&&d||{"default":d}),P=A.SEPARATOR,N=(A.predefinedItems,h=e("helpers/dom/event"),h&&h.__esModule&&h||{"default":h}),L=(N.stopPropagation,N.stopImmediatePropagation),W=(N.pageX,N.pageY,function(e){var t=void 0!==arguments[1]?arguments[1]:{parent:null,name:null,className:"",keepInViewport:!0};this.hot=e,this.options=t,this.eventManager=new R(this),this.container=this.createContainer(this.options.name),this.hotMenu=null,this.hotSubMenus={},this.parentMenu=this.options.parent||null,this.menuItems=null,this.origOutsideClickDeselects=null,this._afterScrollCallback=null,this.registerEvents()}),I=W;$traceurRuntime.createClass(W,{registerEvents:function(){var e=this;this.eventManager.addEventListener(document.documentElement,"mousedown",function(t){return e.onDocumentMouseDown(t)})},setMenuItems:function(e){this.menuItems=e},isSubMenu:function(){return null!==this.parentMenu},open:function(){var e=this;this.container.removeAttribute("style"),this.container.style.display="block";var t={data:this.menuItems,colHeaders:!1,colWidths:[200],autoRowSize:!1,readOnly:!0,copyPaste:!1,columns:[{data:"name",renderer:function(t,n,o,r,i,s){return e.menuItemRenderer(t,n,o,r,i,s)}}],renderAllRows:!0,fragmentSelection:"cell",beforeKeyDown:function(t){return e.onBeforeKeyDown(t)},afterOnCellMouseOver:function(t,n,o){return e.openSubMenu(n.row)}};this.origOutsideClickDeselects=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1,this.hotMenu=new Handsontable.Core(this.container,t),this.hotMenu.addHook("afterInit",function(){return e.onAfterInit()}),this.hotMenu.init(),this.hotMenu.listen(),this.blockMainTableCallbacks(),this.runLocalHooks("afterOpen")},close:function(){var e=void 0!==arguments[0]?arguments[0]:!1;this.isOpened()&&(e&&this.parentMenu?this.parentMenu.close():(this.closeAllSubMenus(),this.container.style.display="none",this.releaseMainTableCallbacks(),this.hotMenu.destroy(),this.hotMenu=null,this.hot.getSettings().outsideClickDeselects=this.origOutsideClickDeselects,this.runLocalHooks("afterClose")))},openSubMenu:function(e){var t=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!t||!k(t))return!1;var n=this.hotMenu.getSourceDataAtRow(e),o=new I(this.hot,{parent:this,name:n.name,className:this.options.className});return o.setMenuItems(n.submenu.items),o.open(),o.setPosition(t.getBoundingClientRect()),this.hotSubMenus[n.key]=o,o},closeSubMenu:function(e){var t=this.hotMenu.getSourceDataAtRow(e),n=this.hotSubMenus[t.key];n&&(n.destroy(),delete this.hotSubMenus[t.key])},closeAllSubMenus:function(){var e=this;b(this.hotMenu.getData(),function(t,n){return e.closeSubMenu(n)})},isAllSubMenusClosed:function(){return 0===Object.keys(this.hotSubMenus).length},destroy:function(){this.clearLocalHooks(),this.close(),this.parentMenu=null,this.eventManager.destroy()},isOpened:function(){return null!==this.hotMenu},executeCommand:function(e){if(this.isOpened()&&this.hotMenu.getSelected()){var t=this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelected()[0]);if(this.runLocalHooks("select",t,e),t.isCommand!==!1){var n=this.hot.getSelectedRange(),o=n?H(n):{};this.runLocalHooks("executeCommand",t.key,o,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",t.key,o,e),this.close(!0)}}},setPosition:function(e){var t=new C(e);this.options.keepInViewport?(t.fitsBelow(this.container)?this.setPositionBelowCursor(t):t.fitsAbove(this.container)?this.setPositionAboveCursor(t):this.setPositionBelowCursor(t),t.fitsOnRight(this.container)?this.setPositionOnRightOfCursor(t):this.setPositionOnLeftOfCursor(t)):(this.setPositionBelowCursor(t),this.setPositionOnRightOfCursor(t))},setPositionAboveCursor:function(e){var t=e.top-this.container.offsetHeight;this.isSubMenu()&&(t=window.scrollY+e.top+e.cellHeight-this.container.offsetHeight+3),this.container.style.top=t+"px"},setPositionBelowCursor:function(e){var t=e.top-1;this.isSubMenu()&&(t=e.top+window.scrollY-1),this.container.style.top=t+"px"},setPositionOnRightOfCursor:function(e){var t;t=this.isSubMenu()?window.scrollX+1+e.left+e.cellWidth:1+e.left,this.container.style.left=t+"px"},setPositionOnLeftOfCursor:function(e){this.container.style.left=e.left-this.container.offsetWidth+w()+4+"px"},selectFirstCell:function(){var e=this.hotMenu.getCell(0,0);T(e)||O(e)||M(e)?this.selectNextCell(0,0):this.hotMenu.selectCell(0,0)},selectLastCell:function(){var e=this.hotMenu.countRows()-1,t=this.hotMenu.getCell(e,0);T(t)||O(t)||M(t)?this.selectPrevCell(e,0):this.hotMenu.selectCell(e,0)},selectNextCell:function(e,t){var n=e+1,o=n=0?this.hotMenu.getCell(n,t):null;o&&(T(o)||O(o)||M(o)?this.selectPrevCell(n,t):this.hotMenu.selectCell(n,t))},menuItemRenderer:function(e,t,n,o,r,i){var s=this,a=e.getSourceDataAtRow(n),l=document.createElement("div"),u=function(e){return e.hasOwnProperty("submenu")},c=function(e){return new RegExp(P,"i").test(e.name)},d=function(e){return e.disabled===!0||"function"==typeof e.disabled&&e.disabled.call(s.hot)===!0},h=function(e){return"function"==typeof e.hidden&&e.hidden.call(s.hot)===!0},f=function(e){return e.disableSelection},w=h(a);"function"==typeof i&&(i=i.call(this.hot)),g(t),p(l,"htItemWrapper"),t.appendChild(l),c(a)?p(t,"htSeparator"):w||"function"!=typeof a.renderer?m(l,i):(p(t,"htCustomMenuRenderer"),t.appendChild(a.renderer(e,l,n,o,r,i))),w?t.parentNode&&p(t.parentNode,"htHidden"):d(a)?(p(t,"htDisabled"),this.eventManager.addEventListener(l,"mouseenter",function(){return e.deselectCell()})):f(a)?(p(t,"htSelectionDisabled"),this.eventManager.addEventListener(l,"mouseenter",function(){return e.deselectCell()})):u(a)?(p(t,"htSubmenu"),f(a)?this.eventManager.addEventListener(l,"mouseenter",function(){return e.deselectCell()}):this.eventManager.addEventListener(l,"mouseenter",function(){return e.selectCell(n,o,void 0,void 0,void 0,!1)})):(y(t,"htSubmenu"),y(t,"htDisabled"),f(a)?this.eventManager.addEventListener(l,"mouseenter",function(){return e.deselectCell()}):this.eventManager.addEventListener(l,"mouseenter",function(){return e.selectCell(n,o,void 0,void 0,void 0,!1)}))},createContainer:function(){var e=void 0!==arguments[0]?arguments[0]:null;e&&(e=e.replace(/ /g,"_"),e=this.options.className+"Sub_"+e);var t;return t=e?document.querySelector("."+this.options.className+"."+e):document.querySelector("."+this.options.className),t||(t=document.createElement("div"),p(t,"htMenu "+this.options.className),e&&p(t,e),document.getElementsByTagName("body")[0].appendChild(t)),t},blockMainTableCallbacks:function(){this._afterScrollCallback=function(){},this.hot.addHook("afterScrollVertically",this._afterScrollCallback),this.hot.addHook("afterScrollHorizontally",this._afterScrollCallback)},releaseMainTableCallbacks:function(){this._afterScrollCallback&&(this.hot.removeHook("afterScrollVertically",this._afterScrollCallback),this.hot.removeHook("afterScrollHorizontally",this._afterScrollCallback),this._afterScrollCallback=null)},onBeforeKeyDown:function(e){var t=this.hotMenu.getSelected(),n=!1;switch(e.keyCode){case D.ESCAPE:this.close(),n=!0;break;case D.ENTER:t&&(this.hotMenu.getSourceDataAtRow(t[0]).submenu?n=!0:(this.executeCommand(e),this.close(!0)));break;case D.ARROW_DOWN:t?this.selectNextCell(t[0],t[1]):this.selectFirstCell(),n=!0;break;case D.ARROW_UP:t?this.selectPrevCell(t[0],t[1]):this.selectLastCell(),n=!0;break;case D.ARROW_RIGHT:if(t){var o=this.openSubMenu(t[0]);o&&o.selectFirstCell()}n=!0;break;case D.ARROW_LEFT:t&&this.isSubMenu()&&(this.close(),this.parentMenu&&this.parentMenu.hotMenu.listen(),n=!0)}n&&(e.preventDefault(),L(e))},onAfterInit:function(){var e=this.hotMenu.getSettings().data,t=this.hotMenu.view.wt.wtTable.hider.style,n=this.hotMenu.view.wt.wtTable.holder.style,o=parseInt(t.width,10),r=0;b(e,function(e){return r+=e.name===P?1:26}),n.width=o+22+"px",n.height=r+4+"px"},onDocumentMouseDown:function(e){this.isOpened()&&(this.container&&v(e.target,this.container)&&this.executeCommand(e),(this.isAllSubMenusClosed()||this.isSubMenu())&&!v(e.target,".htMenu")&&v(e.target,document)&&this.close(!0))}},{}),S(W,x)},{cursor:67,eventManager:41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,"mixins/localHooks":54,predefinedItems:70,utils:71}],70:[function(e,t,n){"use strict";function o(){var e={};return c(D,function(t,n){return e[n]=d(t)}),e}function r(e,t){-1===H.indexOf(e)&&(D[e]=t)}var i;Object.defineProperties(n,{ROW_ABOVE:{get:function(){return v}},ROW_BELOW:{get:function(){return y}},COLUMN_LEFT:{get:function(){return b}},COLUMN_RIGHT:{get:function(){return C}},CLEAR_COLUMN:{get:function(){return R}},REMOVE_ROW:{get:function(){return _}},REMOVE_COLUMN:{get:function(){return S}},UNDO:{get:function(){return E}},REDO:{get:function(){return T}},READ_ONLY:{get:function(){return O}},ALIGNMENT:{get:function(){return M}},SEPARATOR:{get:function(){return k}},ITEMS:{get:function(){return H}},predefinedItems:{get:function(){return o}},addItem:{get:function(){return r}},__esModule:{value:!0}});var s,a,l,u=(s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}),c=u.objectEach,d=u.clone,h=((a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}).rangeEach,l=e("utils"),l&&l.__esModule&&l||{"default":l}),f=h.align,p=h.getAlignmentClasses,g=h.getValidSelection,m=h.checkSelectionConsistency,w=h.markLabelAsSelected,v="row_above",y="row_below",b="col_left",C="col_right",R="clear_column",_="remove_row",S="remove_col",E="undo",T="redo",O="make_read_only",M="alignment",k="---------",H=[v,y,b,C,R,_,S,E,T,O,M,k],D=(i={},Object.defineProperty(i,k,{value:{name:k},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,v,{value:{key:v,name:"Insert row above",callback:function(e,t){this.alter("insert_row",t.start.row)},disabled:function(){var e=g(this);if(!e||this.countRows()>=this.getSettings().maxRows)return!0;var t=this.countRows(),n=[0,e[1],t-1,e[1]];return n.join(",")===e.join(",")&&t>1},hidden:function(){return!this.getSettings().allowInsertRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,y,{value:{key:y,name:"Insert row below",callback:function(e,t){this.alter("insert_row",t.end.row+1)},disabled:function(){var e=g(this);if(!e||this.countRows()>=this.getSettings().maxRows)return!0;var t=this.countRows(),n=[0,e[1],t-1,e[1]];return n.join(",")===e.join(",")&&t>1},hidden:function(){return!this.getSettings().allowInsertRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,b,{value:{key:b,name:"Insert column on the left",callback:function(e,t){this.alter("insert_col",t.start.col)},disabled:function(){var e=g(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n},hidden:function(){return!this.getSettings().allowInsertColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,C,{value:{key:C,name:"Insert column on the right",callback:function(e,t){this.alter("insert_col",t.end.col+1)},disabled:function(){var e=g(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n},hidden:function(){return!this.getSettings().allowInsertColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,R,{value:{key:R,name:"Clear column",callback:function(e,t){var n=t.start.col;this.countRows()&&this.populateFromArray(0,n,[[null]],Math.max(t.start.row,t.end.row),n)},disabled:function(){var e=g(this);if(!e)return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,_,{value:{key:_,name:"Remove row",callback:function(e,t){var n=t.end.row-t.start.row+1;this.alter("remove_row",t.start.row,n)},disabled:function(){var e=g(this);if(!e)return!0;var t=[0,e[1],this.countRows()-1,e[1]];return t.join(",")===e.join(",")},hidden:function(){return!this.getSettings().allowRemoveRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,S,{value:{key:S,name:"Remove column",callback:function(e,t){var n=t.end.col-t.start.col+1;this.alter("remove_col",t.start.col,n)},disabled:function(){var e=g(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||n},hidden:function(){return!this.getSettings().allowRemoveColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,E,{value:{key:E,name:"Undo",callback:function(){this.undo()},disabled:function(){return this.undoRedo&&!this.undoRedo.isUndoAvailable()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,T,{value:{key:T,name:"Redo",callback:function(){this.redo()},disabled:function(){return this.undoRedo&&!this.undoRedo.isRedoAvailable()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,O,{value:{key:O,name:function(){var e=this,t="Read only",n=m(this.getSelectedRange(),function(t,n){return e.getCellMeta(t,n).readOnly});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=m(t,function(t,n){return e.getCellMeta(t,n).readOnly});t.forAll(function(t,o){e.getCellMeta(t,o).readOnly=n?!1:!0}),this.render()},disabled:function(){return this.getSelectedRange()?!1:!0}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,M,{value:{key:M,name:"Alignment",disabled:function(){return this.getSelectedRange()?!1:!0},submenu:{items:[{key:M+":left",name:function(){var e=this,t="Left",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htLeft")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htLeft";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":center",name:function(){var e=this,t="Center",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htCenter")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htCenter";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":right",name:function(){var e=this,t="Right",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htRight")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htRight";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":justify",name:function(){var e=this,t="Justify",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htJustify")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htJustify";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{name:k},{key:M+":top",name:function(){var e=this,t="Top",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htTop")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htTop";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":middle",name:function(){var e=this,t="Middle",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htMiddle")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htMiddle";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":bottom",name:function(){var e=this,t="Bottom",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htBottom")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htBottom";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1}]}},configurable:!0,enumerable:!0,writable:!0}),i)},{"helpers/number":49,"helpers/object":50,utils:71}],71:[function(e,t,n){"use strict";function o(e){return{start:e.getTopLeftCorner(),end:e.getBottomRightCorner()}}function r(e){return w(e,"htSeparator")}function i(e){return w(e,"htSubmenu")}function s(e){return w(e,"htDisabled")}function a(e){return w(e,"htSelectionDisabled")}function l(e){var t=e.getSelected();return t?t[0]<0?null:t:null}function u(e,t){return-1!=e.indexOf(t)?e:(e=e.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ",""),e+=" "+t)}function c(e,t){return-1!=e.indexOf(t)?e:(e=e.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ",""),e+=" "+t)}function d(e,t){for(var n={},o=e.from.row;o<=e.to.row;o++)for(var r=e.from.col;r<=e.to.col;r++)n[o]||(n[o]=[]),n[o][r]=t(o,r);return n}function h(e,t,n,o){if(e.from.row==e.to.row&&e.from.col==e.to.col)f(e.from.row,e.from.col,t,n,o);else for(var r=e.from.row;r<=e.to.row;r++)for(var i=e.from.col;i<=e.to.col;i++)f(r,i,t,n,o)}function f(e,t,n,o,r){var i=r(e,t),s=o;i.className&&(s="vertical"===n?u(i.className,o):c(i.className,o)),i.className=s}function p(e,t){var n=!1;return e&&e.forAll(function(e,o){return t(e,o)?(n=!0,!1):void 0}),n}function g(e){return''+String.fromCharCode(10003)+""+e}Object.defineProperties(n,{normalizeSelection:{get:function(){return o}},isSeparator:{get:function(){return r}},hasSubMenu:{get:function(){return i}},isDisabled:{get:function(){return s}},isSelectionDisabled:{get:function(){return a}},getValidSelection:{get:function(){return l}},prepareVerticalAlignClass:{get:function(){return u}},prepareHorizontalAlignClass:{get:function(){return c}},getAlignmentClasses:{get:function(){return d}},align:{get:function(){return h}},checkSelectionConsistency:{get:function(){return p}},markLabelAsSelected:{get:function(){return g}},__esModule:{value:!0}});var m,w=(m=e("helpers/dom/element"),m&&m.__esModule&&m||{"default":m}).hasClass},{"helpers/dom/element":45}],72:[function(e,t,n){"use strict";Object.defineProperties(n,{ContextMenuCopyPaste:{get:function(){return g}},__esModule:{value:!0}});var o,r,i,s,a,l,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).removeClass,c=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,d=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,h=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}).registerPlugin,f=(a=e("_base"),a&&a.__esModule&&a||{"default":a})["default"],p=(l=e("zeroclipboard"),l&&l.__esModule&&l||{"default":l})["default"],g=function(e){$traceurRuntime.superConstructor(m).call(this,e),this.eventManager=new d(this),this.swfPath=null,this.outsideClickDeselectsCache=null},m=g;$traceurRuntime.createClass(g,{isEnabled:function(){return this.hot.getSettings().contextMenuCopyPaste},enablePlugin:function(){var e=this;if(!this.enabled){"object"==typeof this.hot.getSettings().contextMenuCopyPaste&&(this.swfPath=this.hot.getSettings().contextMenuCopyPaste.swfPath),"undefined"==typeof p&&console.error("To be able to use the Copy/Paste feature from the context menu, you need to manually include ZeroClipboard.js file to your website.");try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(t){"undefined"==typeof navigator.mimeTypes["application/x-shockwave-flash"]&&console.error("To be able to use the Copy/Paste feature from the context menu, your browser needs to have Flash Plugin installed.")}this.swfPath&&p.config({swfPath:this.swfPath}),this.hot.addHook("afterContextMenuShow",function(){return e.onAfterContextMenuShow()}),this.hot.addHook("afterContextMenuDefaultOptions",function(t){return e.onAfterContextMenuDefaultOptions(t)}),this.registerEvents(),$traceurRuntime.superGet(this,m.prototype,"enablePlugin").call(this)}},disablePlugin:function(){$traceurRuntime.superGet(this,m.prototype,"disablePlugin").call(this)},registerEvents:function(){var e=this;this.eventManager.addEventListener(document,"mouseenter",function(){return e.removeCurrentClass()}),this.eventManager.addEventListener(document,"mouseleave",function(){return e.removeZeroClipboardClass()})},getCopyValue:function(){return this.hot.copyPaste.setCopyableText(),this.hot.copyPaste.copyPasteInstance.elTextarea.value},onAfterContextMenuDefaultOptions:function(e){e.items.unshift({key:"copy",name:"Copy"},{key:"paste",name:"Paste",callback:function(){this.copyPaste.triggerPaste()}},Handsontable.plugins.ContextMenu.SEPARATOR)},onAfterContextMenuShow:function(){var e=this,t=this.hot.getPlugin("contextMenu"),n=t.menu.hotMenu.getSourceData();c(n,function(n,o){if("copy"===n.key){var r=new p(t.menu.hotMenu.getCell(o,0));return r.off(),r.on("copy",function(t){var n=t.clipboardData;n.setData("text/plain",e.getCopyValue()),e.hot.getSettings().outsideClickDeselects=e.outsideClickDeselectsCache}),!1}})},removeCurrentClass:function(){var e=this.hot.getPlugin("contextMenu");if(e.menu.isOpened()){var t=e.menu.hotMenu.rootElement.querySelector("td.current");t&&u(t,"current")}this.outsideClickDeselectsCache=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1},removeZeroClipboardClass:function(){var e=this.hot.getPlugin("contextMenu");if(e.menu.isOpened()){var t=e.menu.hotMenu.rootElement.querySelector("td.zeroclipboard-is-hover");t&&u(t,"zeroclipboard-is-hover")}this.hot.getSettings().outsideClickDeselects=this.outsideClickDeselectsCache}},{},f),h("contextMenuCopyPaste",g)},{_base:58,eventManager:41,"helpers/array":42,"helpers/dom/element":45,plugins:57,zeroclipboard:"zeroclipboard"}],73:[function(e,t,n){"use strict";function o(e){function t(){e.isListening()&&e.selection.empty()}function n(t){var n,o,r,i,s,a,l,u,c,d;if(e.isListening()&&e.selection.isSelected()){n=t,o=w.parse(n),r=e.getSelected(),i=new M(r[0],r[1]),s=new M(r[2],r[3]),a=new k(i,i,s),l=a.getTopLeftCorner(),u=a.getBottomRightCorner(),c=l,d=new M(Math.max(u.row,o.length-1+l.row),Math.max(u.col,o[0].length-1+l.col));var h=s.row-i.row>=o.length-1,f=s.col-i.col>=o[0].length-1;e.addHookOnce("afterChange",function(t,n){var o=t?t.length:0;if(o){var r={row:0,col:0},i=-1;C(t,function(e,n){var s=o>n+1?t[n+1]:null;s&&(h||(r.row=r.row+Math.max(s[0]-e[0]-1,0)),!f&&e[1]>i&&(i=e[1],r.col=r.col+Math.max(s[1]-e[1]-1,0)))}),e.selectCell(c.row,c.col,d.row+r.row,d.col+r.col)}}),e.populateFromArray(c.row,c.col,o,d.row,d.col,"paste",e.getSettings().pasteMode)}}function o(t){if(e.getSelected()&&!(e.getActiveEditor()&&e.getActiveEditor().isOpened()||E(t))){if(b(t.keyCode)){if(e.getSettings().fragmentSelection&&T())return;return r.setCopyableText(),void S(t)}var n=(t.ctrlKey||t.metaKey)&&!t.altKey;t.keyCode==y.A&&n&&e._registerTimeout(setTimeout(O(r.setCopyableText,r),0))}}var r=this;this.copyPasteInstance=m(),this.copyPasteInstance.onCut(t),this.copyPasteInstance.onPaste(n),this.onPaste=n,e.addHook("beforeKeyDown",o),this.destroy=function(){this.copyPasteInstance&&(this.copyPasteInstance.removeCallback(t),this.copyPasteInstance.removeCallback(n),this.copyPasteInstance.destroy(),this.copyPasteInstance=null),e.removeHook("beforeKeyDown",o)},e.addHook("afterDestroy",O(this.destroy,this)),this.triggerPaste=O(this.copyPasteInstance.triggerPaste,this.copyPasteInstance),this.triggerCut=O(this.copyPasteInstance.triggerCut,this.copyPasteInstance),this.setCopyableText=function(){var t=e.getSettings(),n=t.copyRowsLimit,o=t.copyColsLimit,r=e.getSelectedRange(),i=r.getTopLeftCorner(),s=r.getBottomRightCorner(),a=i.row,l=i.col,u=s.row,c=s.col,d=Math.min(u,a+n-1),h=Math.min(c,l+o-1),f=[];f.push({startRow:a,startCol:l,endRow:d,endCol:h}),f=Handsontable.hooks.run(e,"modifyCopyableRange",f);var p=this.getRangedCopyableData(f);e.copyPaste.copyPasteInstance.copyable(p),(u!==d||c!==h)&&Handsontable.hooks.run(e,"afterCopyLimit",u-a+1,c-l+1,n,o)},this.getRangedCopyableData=function(t){var n=[],o=[],r=[];return C(t,function(e){R(e.startRow,e.endRow,function(e){-1===o.indexOf(e)&&o.push(e)}),R(e.startCol,e.endCol,function(e){-1===r.indexOf(e)&&r.push(e)})}),C(o,function(t){var o=[];C(r,function(n){o.push(e.getCopyableData(t,n))}),n.push(o)}),w.stringify(n)}}function r(){var e=this,t=e.getSettings().copyPaste!==!1;t&&!e.copyPaste?e.copyPaste=new o(e):!t&&e.copyPaste&&(e.copyPaste.destroy(),e.copyPaste=null)}Object.defineProperties(n,{CopyPastePlugin:{get:function(){return o}},__esModule:{value:!0}});var i,s,a,l,u,c,d,h,f,p,g,m=(i=e("copyPaste"),i&&i.__esModule&&i||{"default":i})["default"],w=(s=e("SheetClip"), +s&&s.__esModule&&s||{"default":s})["default"],v=(a=e("helpers/unicode"),a&&a.__esModule&&a||{"default":a}),y=v.KEY_CODES,b=v.isCtrlKey,C=(l=e("helpers/array"),l&&l.__esModule&&l||{"default":l}).arrayEach,R=(u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}).rangeEach,_=(c=e("helpers/dom/event"),c&&c.__esModule&&c||{"default":c}),S=_.stopImmediatePropagation,E=_.isImmediatePropagationStopped,T=(d=e("helpers/dom/element"),d&&d.__esModule&&d||{"default":d}).getSelectionText,O=(h=e("helpers/function"),h&&h.__esModule&&h||{"default":h}).proxy,M=((f=e("plugins"),f&&f.__esModule&&f||{"default":f}).registerPlugin,(p=e("3rdparty/walkontable/src/cell/coords"),p&&p.__esModule&&p||{"default":p}).WalkontableCellCoords),k=(g=e("3rdparty/walkontable/src/cell/range"),g&&g.__esModule&&g||{"default":g}).WalkontableCellRange;Handsontable.hooks.add("afterInit",r),Handsontable.hooks.add("afterUpdateSettings",r),Handsontable.hooks.register("afterCopyLimit"),Handsontable.hooks.register("modifyCopyableRange")},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,SheetClip:"SheetClip",copyPaste:"copyPaste","helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/function":47,"helpers/number":49,"helpers/unicode":53,plugins:57}],74:[function(e,t,n){"use strict";function o(){}var r,i,s,a,l=((r=e("plugins"),r&&r.__esModule&&r||{"default":r}).registerPlugin,(i=e("3rdparty/walkontable/src/cell/range"),i&&i.__esModule&&i||{"default":i}).WalkontableCellRange),u=(s=e("3rdparty/walkontable/src/selection"),s&&s.__esModule&&s||{"default":s}).WalkontableSelection,c=function(e){return"boolean"==typeof e&&e===!0?!0:"object"==typeof e&&e.length>0?!0:!1},d=function(){c(this.getSettings().customBorders)&&(this.customBorders||(a=this,this.customBorders=new o))},h=function(e){for(var t=0;t=0?a.view.wt.selections[o]=n:a.view.wt.selections.push(n)},p=function(e,t,n){var o=b(e,t);o=C(o,n),this.setCellMeta(e,t,"borders",o),f(o)},g=function(e){for(var t=e.range,n=t.from.row;n<=t.to.row;n++)for(var o=t.from.col;o<=t.to.col;o++){var r=b(n,o),i=0;n==t.from.row&&(i++,e.hasOwnProperty("top")&&(r.top=e.top)),n==t.to.row&&(i++,e.hasOwnProperty("bottom")&&(r.bottom=e.bottom)),o==t.from.col&&(i++,e.hasOwnProperty("left")&&(r.left=e.left)),o==t.to.col&&(i++,e.hasOwnProperty("right")&&(r.right=e.right)),i>0&&(this.setCellMeta(n,o,"borders",r),f(r))}},m=function(e,t){return"border_row"+e+"col"+t},w=function(){return{width:1,color:"#000"}},v=function(){return{hide:!0}},y=function(){return{width:1,color:"#000",cornerVisible:!1}},b=function(e,t){return{className:m(e,t),border:y(),row:e,col:t,top:v(),right:v(),bottom:v(),left:v()}},C=function(e,t){return t.hasOwnProperty("border")&&(e.border=t.border),t.hasOwnProperty("top")&&(e.top=t.top),t.hasOwnProperty("right")&&(e.right=t.right),t.hasOwnProperty("bottom")&&(e.bottom=t.bottom),t.hasOwnProperty("left")&&(e.left=t.left),e},R=function(e){for(var t=document.querySelectorAll("."+e),n=0;n'+String.fromCharCode(10003)+""+e},M=function(e){this.getSettings().customBorders&&(e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR),e.items.push({key:"borders",name:"Borders",submenu:{items:[{key:"borders:top",name:function(){var e="Top",t=T(this,"top");return t&&(e=O(e)),e},callback:function(){var e=T(this,"top");E.call(this,this.getSelectedRange(),"top",e)},disabled:!1},{key:"borders:right",name:function(){var e="Right",t=T(this,"right");return t&&(e=O(e)),e},callback:function(){var e=T(this,"right");E.call(this,this.getSelectedRange(),"right",e)},disabled:!1},{key:"borders:bottom",name:function(){var e="Bottom",t=T(this,"bottom");return t&&(e=O(e)),e},callback:function(){var e=T(this,"bottom");E.call(this,this.getSelectedRange(),"bottom",e)},disabled:!1},{key:"borders:left",name:function(){var e="Left",t=T(this,"left");return t&&(e=O(e)),e},callback:function(){var e=T(this,"left");E.call(this,this.getSelectedRange(),"left",e)},disabled:!1},{key:"borders:no_borders",name:"Remove border(s)",callback:function(){E.call(this,this.getSelectedRange(),"noBorders")},disabled:function(){return!T(this)}}]}}))};Handsontable.hooks.add("beforeInit",d),Handsontable.hooks.add("afterContextMenuDefaultOptions",M),Handsontable.hooks.add("afterInit",function(){var e=this.getSettings().customBorders;if(e){for(var t=0;tthis.boundaries.bottom&&(o=t-this.boundaries.bottom),ethis.boundaries.right&&(n=e-this.boundaries.right),this.callback(n,o)};var a,l=function(e){e.dragToScrollListening=!1;var t=e.view.wt.wtTable.holder;a=new o,t!==window&&(a.setBoundaries(t.getBoundingClientRect()),a.setCallback(function(e,n){0>e?t.scrollLeft-=50:e>0&&(t.scrollLeft+=50),0>n?t.scrollTop-=20:n>0&&(t.scrollTop+=20)}),e.dragToScrollListening=!0)};Handsontable.hooks.add("afterInit",function(){var e=this,t=s(this);t.addEventListener(document,"mouseup",function(){e.dragToScrollListening=!1}),t.addEventListener(document,"mousemove",function(t){e.dragToScrollListening&&a.check(t.clientX,t.clientY)})}),Handsontable.hooks.add("afterDestroy",function(){s(this).clear()}),Handsontable.hooks.add("afterOnCellMouseDown",function(){l(this)}),Handsontable.hooks.add("afterOnCellCornerMouseDown",function(){l(this)}),Handsontable.plugins.DragToScroll=o},{eventManager:41,plugins:57}],76:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualColumnFreeze:{get:function(){return a}},__esModule:{value:!0}});var o,r,i=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],s=(r=e("plugins"),r&&r.__esModule&&r||{"default":r}).registerPlugin,a=function(e){$traceurRuntime.superConstructor(l).call(this,e)},l=a;$traceurRuntime.createClass(a,{isEnabled:function(){return!!this.hot.getSettings().manualColumnFreeze},enablePlugin:function(){var e=this;this.enabled||(this.addHook("modifyCol",function(t){return e.onModifyCol(t)}),this.addHook("afterContextMenuDefaultOptions",function(t){return e.addContextMenuEntry(t)}),$traceurRuntime.superGet(this,l.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,l.prototype,"disablePlugin").call(this)},init:function(){$traceurRuntime.superGet(this,l.prototype,"init").call(this),"undefined"==typeof this.hot.manualColumnPositionsPluginUsages?this.hot.manualColumnPositionsPluginUsages=["manualColumnFreeze"]:this.hot.manualColumnPositionsPluginUsages.push("manualColumnFreeze"),this.fixedColumnsCount=this.hot.getSettings().fixedColumnsLeft},onModifyCol:function(e){return this.hot.manualColumnPositionsPluginUsages.length>1?e:this.getModifiedColumnIndex(e)},getModifiedColumnIndex:function(e){return this.hot.manualColumnPositions[e]},addContextMenuEntry:function(e){var t=this;e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR,{key:"freeze_column",name:function(){var e=t.hot.getSelected()[1];return e>t.fixedColumnsCount-1?"Freeze this column":"Unfreeze this column"},disabled:function(){var e=t.hot.getSelected();return e[1]!==e[3]},callback:function(){var e=t.hot.getSelected()[1];e>t.fixedColumnsCount-1?t.freezeColumn(e):t.unfreezeColumn(e)}})},freezeColumn:function(e){if(!(e<=this.fixedColumnsCount-1)){var t=this.getModifiedColumnIndex(e)||e;this.checkPositionData(t),this.modifyColumnOrder(t,e,null,"freeze"),this.addFixedColumn(),this.hot.view.wt.wtOverlays.leftOverlay.refresh(),this.hot.view.wt.wtOverlays.adjustElementsSize()}},unfreezeColumn:function(e){if(!(e>this.fixedColumnsCount-1)){var t=this.getBestColumnReturnPosition(e),n=this.getModifiedColumnIndex(e)||e;this.checkPositionData(n),this.modifyColumnOrder(n,e,t,"unfreeze"),this.removeFixedColumn(),this.hot.view.wt.wtOverlays.leftOverlay.refresh(),this.hot.view.wt.wtOverlays.adjustElementsSize()}},addFixedColumn:function(){this.hot.updateSettings({fixedColumnsLeft:this.fixedColumnsCount+1}),this.fixedColumnsCount++},removeFixedColumn:function(){this.hot.updateSettings({fixedColumnsLeft:this.fixedColumnsCount-1}),this.fixedColumnsCount--},checkPositionData:function(e){this.hot.manualColumnPositions&&0!==this.hot.manualColumnPositions.length||this.hot.manualColumnPositions||(this.hot.manualColumnPositions=[]),e?this.hot.manualColumnPositions[e]||this.createPositionData(e+1):this.createPositionData(this.hot.countCols())},createPositionData:function(e){if(this.hot.manualColumnPositions.lengtht;t++)this.hot.manualColumnPositions[t]=t},modifyColumnOrder:function(e,t,n,o){null==n&&(n=e),"freeze"===o?this.hot.manualColumnPositions.splice(this.fixedColumnsCount,0,this.hot.manualColumnPositions.splice(t,1)[0]):"unfreeze"===o&&this.hot.manualColumnPositions.splice(n,0,this.hot.manualColumnPositions.splice(t,1)[0])},getBestColumnReturnPosition:function(e){for(var t=this.fixedColumnsCount,n=this.getModifiedColumnIndex(t),o=this.getModifiedColumnIndex(e);o>n;)t++,n=this.getModifiedColumnIndex(t);return t-1}},{},i),s("manualColumnFreeze",a)},{_base:58,plugins:57}],77:[function(e,t,n){"use strict";function o(){function e(e){g=this,m=e;var t=this.view.wt.wtTable.getCoords(e).col;if(t>=0){f=t;var n=m.getBoundingClientRect();l=n.left,w.style.top=n.top+"px",w.style.left=l+"px",g.rootElement.appendChild(w)}}function t(e,t){var n=e.getBoundingClientRect(),o=6;t>0?w.style.left=n.left+n.width-o+"px":w.style.left=n.left+"px"}function n(){var e=this;u(w,"active"),u(v,"active");var t=m.getBoundingClientRect();v.style.width=t.width+"px",v.style.height=e.view.maximumVisibleElementHeight(0)+"px",v.style.top=w.style.top,v.style.left=l+"px",e.rootElement.appendChild(v)}function o(e){v.style.left=l+e+"px"}function r(){d(w,"active"),d(v,"active")}var i,s,a,l,f,g,m,w=document.createElement("DIV"),v=document.createElement("DIV"),y=h(this);w.className="manualColumnMover",v.className="manualColumnMoverGuide";var b=function(){var e=this;Handsontable.hooks.run(e,"persistentStateSave","manualColumnPositions",e.manualColumnPositions)},C=function(){var e=this,t={};return Handsontable.hooks.run(e,"persistentStateLoad","manualColumnPositions",t),t.value},R=function(e){return"BODY"!=e.tagName?"THEAD"==e.parentNode.tagName?!0:(e=e.parentNode,R(e)):!1},_=function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:_(e.parentNode):null},S=function(){var l,u=this;y.addEventListener(u.rootElement,"mouseover",function(n){if(R(n.target)){var o=_(n.target);if(o)if(l){var r=u.view.wt.wtTable.getCoords(o).col;r>=0&&(s=r,t(n.target,s-i))}else e.call(u,o)}}),y.addEventListener(u.rootElement,"mousedown",function(e){c(e.target,"manualColumnMover")&&(a=p(e),n.call(u),l=u,i=f,s=f)}),y.addEventListener(window,"mousemove",function(e){l&&o(p(e)-a)}),y.addEventListener(window,"mouseup",function(t){l&&(r(),l=!1,T(u.manualColumnPositions,u.countCols()),u.manualColumnPositions.splice(s,0,u.manualColumnPositions.splice(i,1)[0]),Handsontable.hooks.run(u,"beforeColumnMove",i,s),u.forceFullRender=!0,u.view.render(),b.call(u),Handsontable.hooks.run(u,"afterColumnMove",i,s),e.call(u,m))}),u.addHook("afterDestroy",E)},E=function(){y.clear()},T=function(e,t){if(e.lengthn;n++)e[n]=n};this.beforeInit=function(){this.manualColumnPositions=[]},this.init=function(e){var t=this,n=!!this.getSettings().manualColumnMove;if(n){var o=this.getSettings().manualColumnMove,r=C.call(t);"undefined"!=typeof r?this.manualColumnPositions=r:Array.isArray(o)?this.manualColumnPositions=o:this.manualColumnPositions=[],("afterInit"===e||"afterUpdateSettings"===e&&0===y.context.eventListeners.length)&&("undefined"==typeof t.manualColumnPositionsPluginUsages?t.manualColumnPositionsPluginUsages=["manualColumnMove"]:t.manualColumnPositionsPluginUsages.push("manualColumnMove"),S.call(this),this.manualColumnPositions.length>0&&(this.forceFullRender=!0,this.render()))}else{var i=t.manualColumnPositionsPluginUsages?t.manualColumnPositionsPluginUsages.indexOf("manualColumnMove"):-1;i>-1&&(E.call(this),this.manualColumnPositions=[],t.manualColumnPositionsPluginUsages[i]=void 0)}},this.modifyCol=function(e){return this.getSettings().manualColumnMove?("undefined"==typeof this.manualColumnPositions[e]&&T(this.manualColumnPositions,e+1),this.manualColumnPositions[e]):e},this.afterRemoveCol=function(e,t){if(this.getSettings().manualColumnMove){var n,o=this.manualColumnPositions;n=o.splice(e,t),o=o.map(function(e){var t,o=e;for(t=0;tn[t]&&o--;return o}),this.manualColumnPositions=o}},this.afterCreateCol=function(e,t){if(this.getSettings().manualColumnMove){var n=this.manualColumnPositions;if(n.length){for(var o=[],r=0;t>r;r++)o.push(e+r);e>=n.length?n.concat(o):(n=n.map(function(n){return n>=e?n+t:n}),n.splice.apply(n,[e,0].concat(o))),this.manualColumnPositions=n}}}}Object.defineProperties(n,{ManualColumnMove:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=l.addClass,c=l.hasClass,d=l.removeClass,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,f=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=f.pageX,g=(f.pageY,(a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin,new o);Handsontable.hooks.add("beforeInit",g.beforeInit),Handsontable.hooks.add("afterInit",function(){g.init.call(this,"afterInit")}),Handsontable.hooks.add("afterUpdateSettings",function(){g.init.call(this,"afterUpdateSettings")}),Handsontable.hooks.add("modifyCol",g.modifyCol),Handsontable.hooks.add("afterRemoveCol",g.afterRemoveCol),Handsontable.hooks.add("afterCreateCol",g.afterCreateCol),Handsontable.hooks.register("beforeColumnMove"),Handsontable.hooks.register("afterColumnMove")},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],78:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualColumnResize:{get:function(){return w}},__esModule:{value:!0}});var o,r,i,s,a,l=(o=e("_base.js"),o&&o.__esModule&&o||{"default":o})["default"],u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=u.addClass,d=u.hasClass,h=u.removeClass,f=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,p=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=p.pageX,m=(p.pageY,(a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin),w=function(e){$traceurRuntime.superConstructor(v).call(this,e),this.currentTH=null,this.currentCol=null,this.currentWidth=null,this.newSize=null,this.startY=null,this.startWidth=null,this.startOffset=null,this.handle=document.createElement("DIV"),this.guide=document.createElement("DIV"),this.eventManager=f(this),this.pressed=null,this.dblclick=0,this.autoresizeTimeout=null,this.manualColumnWidths=[],c(this.handle,"manualColumnResizer"),c(this.guide,"manualColumnResizerGuide")},v=w;$traceurRuntime.createClass(w,{isEnabled:function(){return this.hot.getSettings().manualColumnResize},enablePlugin:function(){var e=this;if(!this.enabled){this.manualColumnWidths=[];var t=this.hot.getSettings().manualColumnResize,n=this.loadManualColumnWidths();this.addHook("modifyColWidth",function(t,n){return e.onModifyColWidth(t,n)}),"undefined"!=typeof n?this.manualColumnWidths=n:Array.isArray(t)?this.manualColumnWidths=t:this.manualColumnWidths=[],Handsontable.hooks.register("beforeColumnResize"),Handsontable.hooks.register("afterColumnResize"),this.bindEvents(),$traceurRuntime.superGet(this,v.prototype,"enablePlugin").call(this)}},updatePlugin:function(){var e=this.hot.getSettings().manualColumnResize;Array.isArray(e)?this.manualColumnWidths=e:this.manualColumnWidths=[]},disablePlugin:function(){$traceurRuntime.superGet(this,v.prototype,"disablePlugin").call(this)},saveManualColumnWidths:function(){this.hot.runHooks("persistentStateSave","manualColumnWidths",this.manualColumnWidths)},loadManualColumnWidths:function(){var e={};return this.hot.runHooks("persistentStateLoad","manualColumnWidths",e),e.value},setupHandlePosition:function(e){this.currentTH=e;var t=this.hot.view.wt.wtTable.getCoords(e).col;if(t>=0){var n=this.currentTH.getBoundingClientRect();this.currentCol=t,this.startOffset=n.left-6,this.startWidth=parseInt(n.width,10),this.handle.style.top=n.top+"px",this.handle.style.left=this.startOffset+this.startWidth+"px",this.hot.rootElement.appendChild(this.handle)}},refreshHandlePosition:function(){this.handle.style.left=this.startOffset+this.currentWidth+"px"},setupGuidePosition:function(){c(this.handle,"active"),c(this.guide,"active"),this.guide.style.top=this.handle.style.top,this.guide.style.left=this.handle.style.left,this.guide.style.height=this.hot.view.maximumVisibleElementHeight(0)+"px",this.hot.rootElement.appendChild(this.guide)},refreshGuidePosition:function(){this.guide.style.left=this.handle.style.left},hideHandleAndGuide:function(){h(this.handle,"active"),h(this.guide,"active")},checkIfColumnHeader:function(e){return"BODY"!=e.tagName?"THEAD"==e.parentNode.tagName?!0:(e=e.parentNode,this.checkIfColumnHeader(e)):!1},getTHFromTargetElement:function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:this.getTHFromTargetElement(e.parentNode):null},onMouseOver:function(e){if(this.checkIfColumnHeader(e.target)){var t=this.getTHFromTargetElement(e.target);if(!t)return;var n=t.getAttribute("colspan");!t||null!==n&&1!==n||this.pressed||this.setupHandlePosition(t)}},afterMouseDownTimeout:function(){if(this.dblclick>=2){var e=this.hot.runHooks("beforeColumnResize",this.currentCol,this.newSize,!0);void 0!==e&&(this.newSize=e),this.setManualSize(this.currentCol,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.hot.runHooks("afterColumnResize",this.currentCol,this.newSize,!0)}this.dblclick=0,this.autoresizeTimeout=null},onMouseDown:function(e){var t=this;d(e.target,"manualColumnResizer")&&(this.setupGuidePosition(),this.pressed=this.hot,null===this.autoresizeTimeout&&(this.autoresizeTimeout=setTimeout(function(){return t.afterMouseDownTimeout()},500),this.hot._registerTimeout(this.autoresizeTimeout)),this.dblclick++,this.startX=g(e),this.newSize=this.startWidth)},onMouseMove:function(e){this.pressed&&(this.currentWidth=this.startWidth+(g(e)-this.startX),this.newSize=this.setManualSize(this.currentCol,this.currentWidth),this.refreshHandlePosition(),this.refreshGuidePosition())},onMouseUp:function(e){this.pressed&&(this.hideHandleAndGuide(),this.pressed=!1,this.newSize!=this.startWidth&&(this.hot.runHooks("beforeColumnResize",this.currentCol,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",this.currentCol,this.newSize)),this.setupHandlePosition(this.currentTH))},bindEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},setManualSize:function(e,t){return t=Math.max(t,20),e=this.hot.runHooks("modifyCol",e),this.manualColumnWidths[e]=t,t},onModifyColWidth:function(e,t){return this.enabled&&(t=this.hot.runHooks("modifyCol",t),this.hot.getSettings().manualColumnResize&&this.manualColumnWidths[t])?this.manualColumnWidths[t]:e}},{},l),m("manualColumnResize",w)},{"_base.js":58,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],79:[function(e,t,n){"use strict";function o(){function e(e){var t=this;g=e;var n=this.view.wt.wtTable.getCoords(e).row;if(n>=0){f=n;var o=g.getBoundingClientRect();l=o.top,m.style.top=l+"px",m.style.left=o.left+"px",t.rootElement.appendChild(m)}}function t(e,t){var n=e.getBoundingClientRect(),o=6;t>0?m.style.top=n.top+n.height-o+"px":m.style.top=n.top+"px"}function n(){var e=this;u(m,"active"),u(w,"active");var t=g.getBoundingClientRect();w.style.width=e.view.maximumVisibleElementWidth(0)+"px",w.style.height=t.height+"px",w.style.top=l+"px",w.style.left=m.style.left,e.rootElement.appendChild(w)}function o(e){w.style.top=l+e+"px"}function r(){d(m,"active"),d(w,"active")}var i,s,a,l,f,g,m=document.createElement("DIV"),w=document.createElement("DIV"),v=h(this);m.className="manualRowMover",w.className="manualRowMoverGuide";var y=function(){var e=this;Handsontable.hooks.run(e,"persistentStateSave","manualRowPositions",e.manualRowPositions)},b=function(){var e=this,t={};return Handsontable.hooks.run(e,"persistentStateLoad","manualRowPositions",t),t.value},C=function(e){return"BODY"!=e.tagName?"TBODY"==e.parentNode.tagName?!0:(e=e.parentNode,C(e)):!1},R=function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:R(e.parentNode):null},_=function(){var l,u=this;v.addEventListener(u.rootElement,"mouseover",function(n){if(C(n.target)){var o=R(n.target);o&&(l?(s=u.view.wt.wtTable.getCoords(o).row,t(o,s-i)):e.call(u,o))}}),v.addEventListener(u.rootElement,"mousedown",function(e){c(e.target,"manualRowMover")&&(a=p(e),n.call(u),l=u,i=f,s=f)}),v.addEventListener(window,"mousemove",function(e){l&&o(p(e)-a)}),v.addEventListener(window,"mouseup",function(t){l&&(r(),l=!1,E(u.manualRowPositions,u.countRows()),u.manualRowPositions.splice(s,0,u.manualRowPositions.splice(i,1)[0]),Handsontable.hooks.run(u,"beforeRowMove",i,s),u.forceFullRender=!0,u.view.render(),y.call(u),Handsontable.hooks.run(u,"afterRowMove",i,s),e.call(u,g))}),u.addHook("afterDestroy",S)},S=function(){v.clear()},E=function(e,t){if(e.lengthn;n++)e[n]=n};this.beforeInit=function(){this.manualRowPositions=[]},this.init=function(e){var t=this,n=!!t.getSettings().manualRowMove;if(n){var o=t.getSettings().manualRowMove,r=b.call(t);"undefined"==typeof t.manualRowPositionsPluginUsages?t.manualRowPositionsPluginUsages=["manualColumnMove"]:t.manualRowPositionsPluginUsages.push("manualColumnMove"),"undefined"!=typeof r?this.manualRowPositions=r:Array.isArray(o)?this.manualRowPositions=o:this.manualRowPositions=[],("afterInit"===e||"afterUpdateSettings"===e&&0===v.context.eventListeners.length)&&(_.call(this),this.manualRowPositions.length>0&&(t.forceFullRender=!0,t.render()))}else{var i=t.manualRowPositionsPluginUsages?t.manualRowPositionsPluginUsages.indexOf("manualColumnMove"):-1;i>-1&&(S.call(this),t.manualRowPositions=[],t.manualRowPositionsPluginUsages[i]=void 0)}},this.modifyRow=function(e){var t=this;return t.getSettings().manualRowMove?("undefined"==typeof t.manualRowPositions[e]&&E(this.manualRowPositions,e+1),t.manualRowPositions[e]):e}}Object.defineProperties(n,{ManualRowMove:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=l.addClass,c=l.hasClass,d=l.removeClass,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,f=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=(f.pageX,f.pageY),g=((a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin,new o);Handsontable.hooks.add("beforeInit",g.beforeInit),Handsontable.hooks.add("afterInit",function(){g.init.call(this,"afterInit")}),Handsontable.hooks.add("afterUpdateSettings",function(){g.init.call(this,"afterUpdateSettings")}),Handsontable.hooks.add("modifyRow",g.modifyRow),Handsontable.hooks.register("beforeRowMove"),Handsontable.hooks.register("afterRowMove")},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],80:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualRowResize:{get:function(){return w}},__esModule:{value:!0}});var o,r,i,s,a,l=(o=e("_base.js"),o&&o.__esModule&&o||{"default":o})["default"],u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=u.addClass,d=u.hasClass,h=u.removeClass,f=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,p=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=(p.pageX,p.pageY),m=(a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin,w=function(e){$traceurRuntime.superConstructor(v).call(this,e),this.currentTH=null,this.currentRow=null,this.currentHeight=null,this.newSize=null,this.startY=null,this.startHeight=null,this.startOffset=null,this.handle=document.createElement("DIV"),this.guide=document.createElement("DIV"),this.eventManager=f(this),this.pressed=null,this.dblclick=0,this.autoresizeTimeout=null,this.manualRowHeights=[],c(this.handle,"manualRowResizer"),c(this.guide,"manualRowResizerGuide")},v=w;$traceurRuntime.createClass(w,{isEnabled:function(){return this.hot.getSettings().manualRowResize},enablePlugin:function(){var e=this;if(!this.enabled){this.manualRowHeights=[];var t=this.hot.getSettings().manualRowResize,n=this.loadManualRowHeights();"undefined"!=typeof n?this.manualRowHeights=n:Array.isArray(t)?this.manualRowHeights=t:this.manualRowHeights=[],this.addHook("modifyRowHeight",function(t,n){return e.onModifyRowHeight(t,n)}),Handsontable.hooks.register("beforeRowResize"),Handsontable.hooks.register("afterRowResize"),this.bindEvents(),$traceurRuntime.superGet(this,v.prototype,"enablePlugin").call(this)}},updatePlugin:function(){var e=this.hot.getSettings().manualRowResize;Array.isArray(e)?this.manualRowHeights=e:this.manualRowHeights=[]},disablePlugin:function(){$traceurRuntime.superGet(this,v.prototype,"disablePlugin").call(this)},saveManualRowHeights:function(){this.hot.runHooks("persistentStateSave","manualRowHeights",this.manualRowHeights)},loadManualRowHeights:function(){var e={};return this.hot.runHooks("persistentStateLoad","manualRowHeights",e),e.value},setupHandlePosition:function(e){this.currentTH=e;var t=this.hot.view.wt.wtTable.getCoords(e).row;if(t>=0){var n=this.currentTH.getBoundingClientRect();this.currentRow=t,this.startOffset=n.top-6,this.startHeight=parseInt(n.height,10),this.handle.style.left=n.left+"px",this.handle.style.top=this.startOffset+this.startHeight+"px",this.hot.rootElement.appendChild(this.handle)}},refreshHandlePosition:function(){this.handle.style.top=this.startOffset+this.currentHeight+"px"},setupGuidePosition:function(){c(this.handle,"active"),c(this.guide,"active"),this.guide.style.top=this.handle.style.top,this.guide.style.left=this.handle.style.left,this.guide.style.width=this.hot.view.maximumVisibleElementWidth(0)+"px",this.hot.rootElement.appendChild(this.guide)},refreshGuidePosition:function(){this.guide.style.top=this.handle.style.top},hideHandleAndGuide:function(){h(this.handle,"active"),h(this.guide,"active")},checkIfRowHeader:function(e){return"BODY"!=e.tagName?"TBODY"==e.parentNode.tagName?!0:(e=e.parentNode,this.checkIfRowHeader(e)):!1},getTHFromTargetElement:function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:this.getTHFromTargetElement(e.parentNode):null},onMouseOver:function(e){if(this.checkIfRowHeader(e.target)){var t=this.getTHFromTargetElement(e.target);t&&(this.pressed||this.setupHandlePosition(t))}},afterMouseDownTimeout:function(){if(this.dblclick>=2){var e=this.hot.runHooks("beforeRowResize",this.currentRow,this.newSize,!0);void 0!==e&&(this.newSize=e),this.setManualSize(this.currentRow,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.hot.runHooks("afterRowResize",this.currentRow,this.newSize,!0)}this.dblclick=0,this.autoresizeTimeout=null},onMouseDown:function(e){var t=this;d(e.target,"manualRowResizer")&&(this.setupGuidePosition(),this.pressed=this.hot,null==this.autoresizeTimeout&&(this.autoresizeTimeout=setTimeout(function(){return t.afterMouseDownTimeout()},500),this.hot._registerTimeout(this.autoresizeTimeout)),this.dblclick++,this.startY=g(e),this.newSize=this.startHeight)},onMouseMove:function(e){this.pressed&&(this.currentHeight=this.startHeight+(g(e)-this.startY),this.newSize=this.setManualSize(this.currentRow,this.currentHeight),this.refreshHandlePosition(),this.refreshGuidePosition())},onMouseUp:function(e){this.pressed&&(this.hideHandleAndGuide(),this.pressed=!1,this.newSize!=this.startHeight&&(this.hot.runHooks("beforeRowResize",this.currentRow,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.currentRow,this.newSize)),this.setupHandlePosition(this.currentTH))},bindEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},setManualSize:function(e,t){return e=this.hot.runHooks("modifyRow",e),this.manualRowHeights[e]=t,t},onModifyRowHeight:function(e,t){if(this.enabled){var n=this.hot.getPlugin("autoRowSize"),o=n?n.heights[t]:null;t=this.hot.runHooks("modifyRow",t);var r=this.manualRowHeights[t];if(void 0!==r&&(r===o||r>(e||0)))return r}return e}},{},l),m("manualRowResize",w)},{"_base.js":58,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],81:[function(e,t,n){"use strict";function o(){var e=[];return e.getInfo=function(e,t){for(var n=0,o=this.length;o>n;n++)if(this[n].row<=e&&this[n].row+this[n].rowspan-1>=e&&this[n].col<=t&&this[n].col+this[n].colspan-1>=t)return this[n]},e.setInfo=function(e){for(var t=0,n=this.length;n>t;t++)if(this[t].row===e.row&&this[t].col===e.col)return void(this[t]=e);this.push(e)},e.removeInfo=function(e,t){for(var n=0,o=this.length;o>n;n++)if(this[n].row===e&&this[n].col===t){this.splice(n,1);break}},e}function r(e){if(this.mergedCellInfoCollection=new o,Array.isArray(e))for(var t=0,n=e.length;n>t;t++)this.mergedCellInfoCollection.setInfo(e[t])}function i(e,t){var n=this.getSettings().mergeCells;if(n&&!this.selection.isMultiple()){ +var o=this.mergeCells.mergedCellInfoCollection.getInfo(e[0],e[1]);o&&(e[0]=o.row,e[1]=o.col,e[2]=o.row+o.rowspan-1,e[3]=o.col+o.colspan-1)}}function s(e,t){this.mergeCells&&this.mergeCells.shiftCollection("right",e,t)}function a(e,t){this.mergeCells&&this.mergeCells.shiftCollection("left",e,t)}function l(e,t){this.mergeCells&&this.mergeCells.shiftCollection("down",e,t)}function u(e,t){this.mergeCells&&this.mergeCells.shiftCollection("up",e,t)}Object.defineProperties(n,{MergeCells:{get:function(){return r}},__esModule:{value:!0}});var c,d,h,f,p,g=((c=e("plugins"),c&&c.__esModule&&c||{"default":c}).registerPlugin,(d=e("helpers/dom/event"),d&&d.__esModule&&d||{"default":d}).stopImmediatePropagation),m=(h=e("3rdparty/walkontable/src/cell/coords"),h&&h.__esModule&&h||{"default":h}).WalkontableCellCoords,w=(f=e("3rdparty/walkontable/src/cell/range"),f&&f.__esModule&&f||{"default":f}).WalkontableCellRange,v=(p=e("3rdparty/walkontable/src/table"),p&&p.__esModule&&p||{"default":p}).WalkontableTable;r.prototype.canMergeRange=function(e){return!e.isSingle()},r.prototype.mergeRange=function(e){if(this.canMergeRange(e)){var t=e.getTopLeftCorner(),n=e.getBottomRightCorner(),o={};o.row=t.row,o.col=t.col,o.rowspan=n.row-t.row+1,o.colspan=n.col-t.col+1,this.mergedCellInfoCollection.setInfo(o)}},r.prototype.mergeOrUnmergeSelection=function(e){var t=this.mergedCellInfoCollection.getInfo(e.from.row,e.from.col);t?this.unmergeSelection(e.from):this.mergeSelection(e)},r.prototype.mergeSelection=function(e){this.mergeRange(e)},r.prototype.unmergeSelection=function(e){var t=this.mergedCellInfoCollection.getInfo(e.row,e.col);this.mergedCellInfoCollection.removeInfo(t.row,t.col)},r.prototype.applySpanProperties=function(e,t,n){var o=this.mergedCellInfoCollection.getInfo(t,n);o?o.row===t&&o.col===n?(e.setAttribute("rowspan",o.rowspan),e.setAttribute("colspan",o.colspan)):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"),e.style.display="none"):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"))},r.prototype.modifyTransform=function(e,t,n){var o=function(e,t){return t.row>=e.row&&t.row<=e.row+e.rowspan-1?!0:!1},r=function(e,t){return t.col>=e.col&&t.col<=e.col+e.colspan-1?!0:!1},i=function(e){return new m(t.to.row+e.row,t.to.col+e.col)},s={row:n.row,col:n.col};if("modifyTransformStart"==e){this.lastDesiredCoords||(this.lastDesiredCoords=new m(null,null));for(var a,l=new m(t.highlight.row,t.highlight.col),u=this.mergedCellInfoCollection.getInfo(l.row,l.col),c=0,d=this.mergedCellInfoCollection.length;d>c;c++){var h=this.mergedCellInfoCollection[c];if(h=new m(h.row+h.rowspan-1,h.col+h.colspan-1),t.includes(h)){a=!0;break}}if(u){var f=new m(u.row,u.col),p=new m(u.row+u.rowspan-1,u.col+u.colspan-1),g=new w(f,f,p);g.includes(this.lastDesiredCoords)||(this.lastDesiredCoords=new m(null,null)),s.row=this.lastDesiredCoords.row?this.lastDesiredCoords.row-l.row:s.row,s.col=this.lastDesiredCoords.col?this.lastDesiredCoords.col-l.col:s.col,n.row>0?s.row=u.row+u.rowspan-1-l.row+n.row:n.row<0&&(s.row=l.row-u.row+n.row),n.col>0?s.col=u.col+u.colspan-1-l.col+n.col:n.col<0&&(s.col=l.col-u.col+n.col)}var v=new m(t.highlight.row+s.row,t.highlight.col+s.col),y=this.mergedCellInfoCollection.getInfo(v.row,v.col);y&&(this.lastDesiredCoords=v,s={row:y.row-l.row,col:y.col-l.col})}else if("modifyTransformEnd"==e)for(var c=0,d=this.mergedCellInfoCollection.length;d>c;c++){var b=this.mergedCellInfoCollection[c],f=new m(b.row,b.col),p=new m(b.row+b.rowspan-1,b.col+b.colspan-1),C=new w(f,f,p),R=t.getBordersSharedWith(C);if(C.isEqual(t))t.setDirection("NW-SE");else if(R.length>0){var _=t.highlight.isEqual(C.from);R.indexOf("top")>-1?t.to.isSouthEastOf(C.from)&&_?t.setDirection("NW-SE"):t.to.isSouthWestOf(C.from)&&_&&t.setDirection("NE-SW"):R.indexOf("bottom")>-1&&(t.to.isNorthEastOf(C.from)&&_?t.setDirection("SW-NE"):t.to.isNorthWestOf(C.from)&&_&&t.setDirection("SE-NW"))}var v=i(s),S=o(b,v),E=r(b,v);t.includesRange(C)&&(C.includes(v)||S||E)&&(S&&(s.row<0?s.row-=b.rowspan-1:s.row>0&&(s.row+=b.rowspan-1)),E&&(s.col<0?s.col-=b.colspan-1:s.col>0&&(s.col+=b.colspan-1)))}0!==s.row&&(n.row=s.row),0!==s.col&&(n.col=s.col)},r.prototype.shiftCollection=function(e,t,n){var o=[0,0];switch(e){case"right":o[0]+=1;break;case"left":o[0]-=1;break;case"down":o[1]+=1;break;case"up":o[1]-=1}for(var r=0;rn;n++)e.mergeCells.mergedCellInfoCollection.setInfo(t[n])}else e.mergeCells=new r(t);else e.mergeCells&&(e.mergeCells.mergedCellInfoCollection=new o)},R=function(e){if(this.mergeCells){var t=(e.ctrlKey||e.metaKey)&&!e.altKey;t&&77===e.keyCode&&(this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()),this.render(),g(e))}},_=function(e){this.getSettings().mergeCells&&(e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR),e.items.push({key:"mergeCells",name:function(){var e=this.getSelected(),t=this.mergeCells.mergedCellInfoCollection.getInfo(e[0],e[1]);return t?"Unmerge cells":"Merge cells"},callback:function(){this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()),this.render()},disabled:function(){return!1}}))},S=function(e,t,n,o,r,i){this.mergeCells&&this.mergeCells.applySpanProperties(e,t,n)},E=function(e){return function(t){var n=this.getSettings().mergeCells;if(n){var o=this.getSelectedRange();if(this.mergeCells.modifyTransform(e,o,t),"modifyTransformEnd"===e){var r=this.countRows(),i=this.countCols();o.from.row<0?o.from.row=0:o.from.row>0&&o.from.row>=r&&(o.from.row=o.from-1),o.from.col<0?o.from.col=0:o.from.col>0&&o.from.col>=i&&(o.from.col=i-1)}}}},T=function(e){this.lastDesiredCoords=null;var t=this.getSettings().mergeCells;if(t){var n=this.getSelectedRange();n.highlight=new m(n.highlight.row,n.highlight.col),n.to=e;var o=!1;do{o=!1;for(var r=0,i=this.mergeCells.mergedCellInfoCollection.length;i>r;r++){var s=this.mergeCells.mergedCellInfoCollection[r],a=new m(s.row,s.col),l=new m(s.row+s.rowspan-1,s.col+s.colspan-1),u=new w(a,a,l);n.expandByRange(u)&&(e.row=n.to.row,e.col=n.to.col,o=!0)}}while(o)}},O=function(e,t){if(t&&"area"==t){var n=this.getSettings().mergeCells;if(n)for(var o=this.getSelectedRange(),r=new w(o.from,o.from,o.from),i=new w(o.to,o.to,o.to),s=0,a=this.mergeCells.mergedCellInfoCollection.length;a>s;s++){var l=this.mergeCells.mergedCellInfoCollection[s],u=new m(l.row,l.col),c=new m(l.row+l.rowspan-1,l.col+l.colspan-1),d=new w(u,u,c);r.expandByRange(d)&&(e[0]=r.from.row,e[1]=r.from.col),i.expandByRange(d)&&(e[2]=i.from.row,e[3]=i.from.col)}}},M=function(e,t,n){var o=this.getSettings().mergeCells;if(o){var r=this.mergeCells.mergedCellInfoCollection.getInfo(e,t);!r||r.row==e&&r.col==t||(n.copyable=!1)}},k=function(e){var t=this.getSettings().mergeCells;if(t)for(var n,o=this.countCols(),r=0;o>r;r++){if(n=this.mergeCells.mergedCellInfoCollection.getInfo(e.startRow,r),n&&n.rowe.endRow)return e.endRow=i,k.call(this,e)}}},H=function(e){var t=this.getSettings().mergeCells;if(t)for(var n,o=this.countRows(),r=0;o>r;r++){if(n=this.mergeCells.mergedCellInfoCollection.getInfo(r,e.startColumn),n&&n.cole.endColumn)return e.endColumn=i,H.call(this,e)}}},D=function(e){if(e&&this.mergeCells){var t=this.mergeCells.mergedCellInfoCollection,n=this.getSelectedRange();for(var o in t)if(n.highlight.row==t[o].row&&n.highlight.col==t[o].col&&n.to.row==t[o].row+t[o].rowspan-1&&n.to.col==t[o].col+t[o].colspan-1)return!1}return e};Handsontable.hooks.add("beforeInit",y),Handsontable.hooks.add("afterInit",b),Handsontable.hooks.add("afterUpdateSettings",C),Handsontable.hooks.add("beforeKeyDown",R),Handsontable.hooks.add("modifyTransformStart",E("modifyTransformStart")),Handsontable.hooks.add("modifyTransformEnd",E("modifyTransformEnd")),Handsontable.hooks.add("beforeSetRangeEnd",T),Handsontable.hooks.add("beforeDrawBorders",O),Handsontable.hooks.add("afterIsMultipleSelection",D),Handsontable.hooks.add("afterRenderer",S),Handsontable.hooks.add("afterContextMenuDefaultOptions",_),Handsontable.hooks.add("afterGetCellMeta",M),Handsontable.hooks.add("afterViewportRowCalculatorOverride",k),Handsontable.hooks.add("afterViewportColumnCalculatorOverride",H),Handsontable.hooks.add("afterAutofillApplyValues",i),Handsontable.hooks.add("afterCreateCol",s),Handsontable.hooks.add("afterRemoveCol",a),Handsontable.hooks.add("afterCreateRow",l),Handsontable.hooks.add("afterRemoveRow",u),Handsontable.MergeCells=r},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/table":20,"helpers/dom/event":46,plugins:57}],82:[function(e,t,n){"use strict";Object.defineProperties(n,{MultipleSelectionHandles:{get:function(){return p}},__esModule:{value:!0}});var o,r,i,s,a=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),l=a.getWindowScrollTop,u=a.hasClass,c=a.getWindowScrollLeft,d=(r=e("_base"),r&&r.__esModule&&r||{"default":r})["default"],h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,f=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}).registerPlugin,p=function(e){$traceurRuntime.superConstructor(g).call(this,e),this.dragged=[],this.eventManager=null,this.lastSetCell=null},g=p;$traceurRuntime.createClass(p,{isEnabled:function(){return Handsontable.mobileBrowser},enablePlugin:function(){this.enabled||(this.eventManager||(this.eventManager=new h(this)),this.registerListeners(),$traceurRuntime.superGet(this,g.prototype,"enablePlugin").call(this))},registerListeners:function(){function e(e){if(1===t.dragged.length)return t.dragged.splice(0,t.dragged.length),!0;var n=t.dragged.indexOf(e);return-1==n?!1:void(0===n?t.dragged=t.dragged.slice(0,1):1==n&&(t.dragged=t.dragged.slice(-1)))}var t=this;this.eventManager.addEventListener(this.hot.rootElement,"touchstart",function(e){var n;return u(e.target,"topLeftSelectionHandle-HitArea")?(n=t.hot.getSelectedRange(),t.dragged.push("topLeft"),t.touchStartRange={width:n.getWidth(),height:n.getHeight(),direction:n.getDirection()},e.preventDefault(),!1):u(e.target,"bottomRightSelectionHandle-HitArea")?(n=t.hot.getSelectedRange(),t.dragged.push("bottomRight"),t.touchStartRange={width:n.getWidth(),height:n.getHeight(),direction:n.getDirection()},e.preventDefault(),!1):void 0}),this.eventManager.addEventListener(this.hot.rootElement,"touchend",function(n){return u(n.target,"topLeftSelectionHandle-HitArea")?(e.call(t,"topLeft"),t.touchStartRange=void 0,n.preventDefault(),!1):u(n.target,"bottomRightSelectionHandle-HitArea")?(e.call(t,"bottomRight"),t.touchStartRange=void 0,n.preventDefault(),!1):void 0}),this.eventManager.addEventListener(this.hot.rootElement,"touchmove",function(e){var n,o,r,i,s,a,u,d=l(),h=c();0!==t.dragged.length&&(n=document.elementFromPoint(e.touches[0].screenX-h,e.touches[0].screenY-d),n&&n!==t.lastSetCell&&(("TD"==n.nodeName||"TH"==n.nodeName)&&(o=t.hot.getCoords(n),-1==o.col&&(o.col=0),r=t.hot.getSelectedRange(),i=r.getWidth(),s=r.getHeight(),a=r.getDirection(),1==i&&1==s&&t.hot.selection.setRangeEnd(o),u=t.getCurrentRangeCoords(r,o,t.touchStartRange.direction,a,t.dragged[0]),null!==u.start&&t.hot.selection.setRangeStart(u.start),t.hot.selection.setRangeEnd(u.end),t.lastSetCell=n),e.preventDefault()))})},getCurrentRangeCoords:function(e,t,n,o,r){var i=e.getTopLeftCorner(),s=e.getBottomRightCorner(),a=e.getBottomLeftCorner(),l=e.getTopRightCorner(),u={start:null,end:null};switch(n){case"NE-SW":switch(o){case"NE-SW":case"NW-SE":u="topLeft"==r?{start:new WalkontableCellCoords(t.row,e.highlight.col),end:new WalkontableCellCoords(a.row,t.col)}:{start:new WalkontableCellCoords(e.highlight.row,t.col),end:new WalkontableCellCoords(t.row,i.col)};break;case"SE-NW":"bottomRight"==r&&(u={start:new WalkontableCellCoords(s.row,t.col),end:new WalkontableCellCoords(t.row,i.col)})}break;case"NW-SE":switch(o){case"NE-SW":"topLeft"==r?u={start:t,end:a}:u.end=t;break;case"NW-SE":"topLeft"==r?u={start:t,end:s}:u.end=t;break;case"SE-NW":"topLeft"==r?u={start:t,end:i}:u.end=t;break;case"SW-NE":"topLeft"==r?u={start:t,end:l}:u.end=t}break;case"SW-NE":switch(o){case"NW-SE":u="bottomRight"==r?{start:new WalkontableCellCoords(t.row,i.col),end:new WalkontableCellCoords(a.row,t.col)}:{start:new WalkontableCellCoords(i.row,t.col),end:new WalkontableCellCoords(t.row,s.col)};break;case"SW-NE":u="topLeft"==r?{start:new WalkontableCellCoords(e.highlight.row,t.col),end:new WalkontableCellCoords(t.row,s.col)}:{start:new WalkontableCellCoords(t.row,i.col),end:new WalkontableCellCoords(i.row,t.col)};break;case"SE-NW":"bottomRight"==r?u={start:new WalkontableCellCoords(t.row,l.col),end:new WalkontableCellCoords(i.row,t.col)}:"topLeft"==r&&(u={start:a,end:t})}break;case"SE-NW":switch(o){case"NW-SE":case"NE-SW":case"SW-NE":"topLeft"==r&&(u.end=t);break;case"SE-NW":"topLeft"==r?u.end=t:u={start:t,end:i}}}return u},isDragged:function(){return this.dragged.length>0}},{},d),f("multipleSelectionHandles",p)},{_base:58,eventManager:41,"helpers/dom/element":45,plugins:57}],83:[function(e,t,n){"use strict";function o(){}function r(){var e=this,t=e.getSettings().observeChanges;t?(e.observer&&a.call(e),i.call(e),u.call(e)):t||a.call(e)}function i(){var e=this;e.observeChangesActive=!0,e.pauseObservingChanges=function(){e.observeChangesActive=!1},e.resumeObservingChanges=function(){e.observeChangesActive=!0},e.observedData=e.getSourceData(),e.observer=p.observe(e.observedData,function(t){e.observeChangesActive&&(s.call(e,t),e.render()),e.runHooks("afterChangesObserved")})}function s(e){function t(e){var t;return t=o(e),t=n(t)}function n(e){var t=[];return e.filter(function(e){var n=r(e.path);if(-1!=["add","remove"].indexOf(e.op)&&!isNaN(n.col)){if(-1!=t.indexOf(n.col))return!1;t.push(n.col)}return!0})}function o(e){return e.filter(function(e){return!/[\/]length/gi.test(e.path)})}function r(e){var t=e.match(/^\/(\d+)\/?(.*)?$/);return{row:parseInt(t[1],10),col:/^\d*$/.test(t[2])?parseInt(t[2],10):t[2]}}for(var i=this,s=t(e),a=0,l=s.length;l>a;a++){var u=s[a],c=r(u.path);switch(u.op){case"add":isNaN(c.col)?i.runHooks("afterCreateRow",c.row):i.runHooks("afterCreateCol",c.col);break;case"remove":isNaN(c.col)?i.runHooks("afterRemoveRow",c.row,1):i.runHooks("afterRemoveCol",c.col,1);break;case"replace":i.runHooks("afterChange",[c.row,c.col,null,u.value],"external")}}}function a(){var e=this;e.observer&&(l.call(e),c.call(e))}function l(){var e=this;p.unobserve(e.observedData,e.observer),delete e.observedData,delete e.observeChangesActive,delete e.pauseObservingChanges,delete e.resumeObservingChanges}function u(){var e=this;e.addHook("afterDestroy",a),e.addHook("afterCreateRow",d),e.addHook("afterRemoveRow",d),e.addHook("afterCreateCol",d),e.addHook("afterRemoveCol",d),e.addHook("afterChange",function(e,t){"loadData"!=t&&d.call(this)})}function c(){var e=this;e.removeHook("afterDestroy",a),e.removeHook("afterCreateRow",d),e.removeHook("afterRemoveRow",d),e.removeHook("afterCreateCol",d),e.removeHook("afterRemoveCol",d),e.removeHook("afterChange",d)}function d(){var e=this;e.pauseObservingChanges(),e.addHookOnce("afterChangesObserved",function(){e.resumeObservingChanges()})}Object.defineProperties(n,{ObserveChanges:{get:function(){return o}},__esModule:{value:!0}});var h,f,p=((h=e("plugins"),h&&h.__esModule&&h||{"default":h}).registerPlugin,(f=e("jsonpatch"),f&&f.__esModule&&f||{"default":f})["default"]);Handsontable.hooks.add("afterLoadData",r),Handsontable.hooks.add("afterUpdateSettings",r),Handsontable.hooks.register("afterChangesObserved")},{jsonpatch:"jsonpatch",plugins:57}],84:[function(e,t,n){"use strict";function o(e){var t,n=function(){window.localStorage[e+"__persistentStateKeys"]=JSON.stringify(t)},o=function(){var n=window.localStorage[e+"__persistentStateKeys"],o="string"==typeof n?JSON.parse(n):void 0;t=o?o:[]},r=function(){t=[],n()};o(),this.saveValue=function(o,r){window.localStorage[e+"_"+o]=JSON.stringify(r),-1==t.indexOf(o)&&(t.push(o),n())},this.loadValue=function(t,n){t="undefined"==typeof t?n:t;var o=window.localStorage[e+"_"+t];return"undefined"==typeof o?void 0:JSON.parse(o)},this.reset=function(t){window.localStorage.removeItem(e+"_"+t)},this.resetAll=function(){for(var n=0;na;a++)for(var l=0;i>l;l++){var u=e.getDataAtCell(a,l),c=e.getCellMeta(a,l),d=c.search.callback||n,h=c.search.queryMethod||o,f=h(t,u);if(f){var p={row:a,col:l,data:u};s.push(p)}d&&d(e,a,l,u,f)}return s}},Handsontable.Search.DEFAULT_CALLBACK=function(e,t,n,o,r){e.getCellMeta(t,n).isSearchResult=r},Handsontable.Search.DEFAULT_QUERY_METHOD=function(e,t){return"undefined"!=typeof e&&null!=e&&e.toLowerCase&&0!==e.length?"undefined"==typeof t||null==t?!1:-1!=t.toString().toLowerCase().indexOf(e.toLowerCase()):!1},Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS="htSearchResult",Handsontable.Search.global=function(){var e=Handsontable.Search.DEFAULT_CALLBACK,t=Handsontable.Search.DEFAULT_QUERY_METHOD,n=Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS;return{getDefaultCallback:function(){return e},setDefaultCallback:function(t){e=t},getDefaultQueryMethod:function(){return t},setDefaultQueryMethod:function(e){t=e},getDefaultSearchResultClass:function(){return n},setDefaultSearchResultClass:function(e){n=e}}}(),Handsontable.SearchCellDecorator=function(e,t,n,o,r,i,s){var u=null!==s.search&&"object"==typeof s.search&&s.search.searchResultClass||Handsontable.Search.global.getDefaultSearchResultClass();s.isSearchResult?a(t,u):l(t,u)};var h=d("base");c("base",function(e,t,n,o,r,i,s){h.apply(this,arguments),Handsontable.SearchCellDecorator.apply(this,arguments)}),Handsontable.hooks.add("afterInit",o),Handsontable.hooks.add("afterUpdateSettings",o)},{"helpers/dom/element":45,renderers:88}],86:[function(e,t,n){"use strict";Object.defineProperties(n,{TouchScroll:{get:function(){return d}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=s.addClass,l=s.removeClass,u=(r=e("_base"),r&&r.__esModule&&r||{"default":r})["default"],c=(i=e("plugins"),i&&i.__esModule&&i||{"default":i}).registerPlugin,d=function(e){var t=this;$traceurRuntime.superConstructor(h).call(this,e),this.hot.addHook("afterInit",function(){return t.afterInit()}),this.hot.addHook("afterUpdateSettings",function(){return t.onAfterUpdateSettings()}),this.scrollbars=[],this.clones=[]},h=d;$traceurRuntime.createClass(d,{afterInit:function(){this.registerEvents(),this.onAfterUpdateSettings()},onAfterUpdateSettings:function(){var e=this;this.hot.addHookOnce("afterRender",function(){var t=e.hot.view.wt.wtOverlays;e.scrollbars=[],e.scrollbars.push(t.topOverlay),t.bottomOverlay.clone&&e.scrollbars.push(t.bottomOverlay),e.scrollbars.push(t.leftOverlay),t.topLeftCornerOverlay&&e.scrollbars.push(t.topLeftCornerOverlay),t.bottomLeftCornerOverlay&&t.bottomLeftCornerOverlay.clone&&e.scrollbars.push(t.bottomLeftCornerOverlay),e.clones=[],t.topOverlay.needFullRender&&e.clones.push(t.topOverlay.clone.wtTable.holder.parentNode),t.bottomOverlay.needFullRender&&e.clones.push(t.bottomOverlay.clone.wtTable.holder.parentNode),t.leftOverlay.needFullRender&&e.clones.push(t.leftOverlay.clone.wtTable.holder.parentNode),t.topLeftCornerOverlay&&e.clones.push(t.topLeftCornerOverlay.clone.wtTable.holder.parentNode),t.bottomLeftCornerOverlay&&t.bottomLeftCornerOverlay.clone&&e.clones.push(t.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode)})},registerEvents:function(){var e=this;this.hot.addHook("beforeTouchScroll",function(){return e.onBeforeTouchScroll()}),this.hot.addHook("afterMomentumScroll",function(){return e.onAfterMomentumScroll()})},onBeforeTouchScroll:function(){Handsontable.freezeOverlays=!0;for(var e=0,t=this.clones.length;t>e;e++)a(this.clones[e],"hide-tween")},onAfterMomentumScroll:function(){Handsontable.freezeOverlays=!1;for(var e=this,t=0,n=this.clones.length;n>t;t++)l(this.clones[t],"hide-tween");for(var o=0,r=this.clones.length;r>o;o++)a(this.clones[o],"show-tween");setTimeout(function(){for(var t=0,n=e.clones.length;n>t;t++)l(e.clones[t],"show-tween")},400);for(var i=0,s=this.scrollbars.length;s>i;i++)this.scrollbars[i].refresh(),this.scrollbars[i].resetFixedPosition();this.hot.view.wt.wtOverlays.syncScrollWithMaster()}},{},u),c("touchScroll",d)},{_base:58,"helpers/dom/element":45,plugins:57}],87:[function(e,t,n){"use strict";function o(){var e=this,t="undefined"==typeof e.getSettings().undo||e.getSettings().undo;t?e.undoRedo||(e.undoRedo=new Handsontable.UndoRedo(e),s(e),e.addHook("beforeKeyDown",r),e.addHook("afterChange",i)):e.undoRedo&&(delete e.undoRedo,a(e),e.removeHook("beforeKeyDown",r),e.removeHook("afterChange",i))}function r(e){var t=this,n=(e.ctrlKey||e.metaKey)&&!e.altKey;n&&(89===e.keyCode||e.shiftKey&&90===e.keyCode?(t.undoRedo.redo(),f(e)):90===e.keyCode&&(t.undoRedo.undo(),f(e)))}function i(e,t){var n=this;return"loadData"==t?n.undoRedo.clear():void 0}function s(e){e.undo=function(){return e.undoRedo.undo()},e.redo=function(){return e.undoRedo.redo()},e.isUndoAvailable=function(){return e.undoRedo.isUndoAvailable()},e.isRedoAvailable=function(){return e.undoRedo.isRedoAvailable()},e.clearUndo=function(){return e.undoRedo.clear()}}function a(e){delete e.undo,delete e.redo,delete e.isUndoAvailable,delete e.isRedoAvailable,delete e.clearUndo}var l,u,c=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),d=c.inherit,h=c.deepClone,f=(u=e("helpers/dom/event"),u&&u.__esModule&&u||{"default":u}).stopImmediatePropagation;Handsontable.UndoRedo=function(e){var t=this;this.instance=e,this.doneActions=[],this.undoneActions=[],this.ignoreNewActions=!1,e.addHook("afterChange",function(e,n){if(e){var o=new Handsontable.UndoRedo.ChangeAction(e);t.done(o)}}),e.addHook("afterCreateRow",function(e,n,o){if(!o){var r=new Handsontable.UndoRedo.CreateRowAction(e,n);t.done(r)}}),e.addHook("beforeRemoveRow",function(e,n){var o=t.instance.getSourceData();e=(o.length+e)%o.length;var r=o.slice(e,e+n),i=new Handsontable.UndoRedo.RemoveRowAction(e,r);t.done(i)}),e.addHook("afterCreateCol",function(e,n,o){if(!o){var r=new Handsontable.UndoRedo.CreateColumnAction(e,n);t.done(r)}}),e.addHook("beforeRemoveCol",function(n,o){var r=t.instance.getSourceData();n=(t.instance.countCols()+n)%t.instance.countCols();for(var i=[],s=0,a=r.length;a>s;s++)i[s]=r[s].slice(n,n+o);var l;Array.isArray(e.getSettings().colHeaders)&&(l=e.getSettings().colHeaders.slice(n,n+i.length));var u=new Handsontable.UndoRedo.RemoveColumnAction(n,i,l);t.done(u)}),e.addHook("beforeCellAlignment",function(e,n,o,r){var i=new Handsontable.UndoRedo.CellAlignmentAction(e,n,o,r);t.done(i)})},Handsontable.UndoRedo.prototype.done=function(e){this.ignoreNewActions||(this.doneActions.push(e),this.undoneActions.length=0)},Handsontable.UndoRedo.prototype.undo=function(){if(this.isUndoAvailable()){var e=this.doneActions.pop();this.ignoreNewActions=!0;var t=this;e.undo(this.instance,function(){t.ignoreNewActions=!1,t.undoneActions.push(e)})}},Handsontable.UndoRedo.prototype.redo=function(){if(this.isRedoAvailable()){var e=this.undoneActions.pop();this.ignoreNewActions=!0;var t=this;e.redo(this.instance,function(){t.ignoreNewActions=!1,t.doneActions.push(e)})}},Handsontable.UndoRedo.prototype.isUndoAvailable=function(){return this.doneActions.length>0},Handsontable.UndoRedo.prototype.isRedoAvailable=function(){return this.undoneActions.length>0},Handsontable.UndoRedo.prototype.clear=function(){this.doneActions.length=0,this.undoneActions.length=0},Handsontable.UndoRedo.Action=function(){},Handsontable.UndoRedo.Action.prototype.undo=function(){},Handsontable.UndoRedo.Action.prototype.redo=function(){},Handsontable.UndoRedo.ChangeAction=function(e){this.changes=e},d(Handsontable.UndoRedo.ChangeAction,Handsontable.UndoRedo.Action),Handsontable.UndoRedo.ChangeAction.prototype.undo=function(e,t){for(var n=h(this.changes),o=e.countEmptyRows(!0),r=e.countEmptyCols(!0),i=0,s=n.length;s>i;i++)n[i].splice(3,1);e.addHookOnce("afterChange",t),e.setDataAtRowProp(n,null,null,"undo");for(var i=0,s=n.length;s>i;i++)e.getSettings().minSpareRows&&n[i][0]+1+e.getSettings().minSpareRows===e.countRows()&&o==e.getSettings().minSpareRows&&(e.alter("remove_row",parseInt(n[i][0]+1,10),e.getSettings().minSpareRows),e.undoRedo.doneActions.pop()),e.getSettings().minSpareCols&&n[i][1]+1+e.getSettings().minSpareCols===e.countCols()&&r==e.getSettings().minSpareCols&&(e.alter("remove_col",parseInt(n[i][1]+1,10),e.getSettings().minSpareCols),e.undoRedo.doneActions.pop())},Handsontable.UndoRedo.ChangeAction.prototype.redo=function(e,t){for(var n=h(this.changes),o=0,r=n.length;r>o;o++)n[o].splice(2,1);e.addHookOnce("afterChange",t),e.setDataAtRowProp(n,null,null,"redo")},Handsontable.UndoRedo.CreateRowAction=function(e,t){this.index=e,this.amount=t},d(Handsontable.UndoRedo.CreateRowAction,Handsontable.UndoRedo.Action),Handsontable.UndoRedo.CreateRowAction.prototype.undo=function(e,t){var n=e.countRows(),o=e.getSettings().minSpareRows;this.index>=n&&this.index-or;r++)n=e.getSourceDataAtRow(r),o=[this.index,0],Array.prototype.push.apply(o,this.data[r]),Array.prototype.splice.apply(n,o);"undefined"!=typeof this.headers&&(o=[this.index,0],Array.prototype.push.apply(o,this.headers),Array.prototype.splice.apply(e.getSettings().colHeaders,o)),e.addHookOnce("afterRender",t),e.render()},Handsontable.UndoRedo.RemoveColumnAction.prototype.redo=function(e,t){e.addHookOnce("afterRemoveCol",t),e.alter("remove_col",this.index,this.amount)},Handsontable.hooks.add("afterInit",o),Handsontable.hooks.add("afterUpdateSettings",o)},{"helpers/dom/event":46,"helpers/object":50}],88:[function(e,t,n){"use strict";function o(e,t){var n;l[e]=t,n=a(e)+"Renderer",Handsontable.renderers[n]=t,Handsontable[n]=t}function r(e){if("function"==typeof e)return e;if("string"!=typeof e)throw Error('Only strings and functions can be passed as "renderer" parameter');if(!(e in l))throw Error('No editor registered under name "'+e+'"');return l[e]}function i(e){return e in l}Object.defineProperties(n,{registerRenderer:{get:function(){return o}},getRenderer:{get:function(){return r}},hasRenderer:{get:function(){return i}},__esModule:{value:!0}});var s,a=(s=e("helpers/string"),s&&s.__esModule&&s||{"default":s}).toUpperCaseFirst,l={};Handsontable.renderers=Handsontable.renderers||{},Handsontable.renderers.registerRenderer=o,Handsontable.renderers.getRenderer=r},{"helpers/string":52}],89:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){s.className&&(t.className?t.className=t.className+" "+s.className:t.className=s.className),s.readOnly&&a(t,s.readOnlyCellClassName),s.valid===!1&&s.invalidCellClassName?a(t,s.invalidCellClassName):l(t,s.invalidCellClassName),s.wordWrap===!1&&s.noWordWrapClassName&&a(t,s.noWordWrapClassName),!i&&s.placeholder&&a(t,s.placeholderCellClassName)}Object.defineProperties(n,{cellDecorator:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),a=s.addClass,l=s.removeClass,u=(i=e("renderers"),i&&i.__esModule&&i||{"default":i}).registerRenderer;u("base",o),Handsontable.renderers.cellDecorator=o},{"helpers/dom/element":45,renderers:88}],90:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){var a=(m.cloneNode(!0),w.cloneNode(!0)); +if(f("text")(e,t,n,o,r,i,s),t.appendChild(a),u(t,"htAutocomplete"),t.firstChild||t.appendChild(document.createTextNode(String.fromCharCode(160))),!e.acArrowListener){var l=d(e);e.acArrowListener=function(r){c(r.target,"htAutocompleteArrow")&&e.view.wt.getSetting("onCellDblClick",null,new g(n,o),t)},l.addEventListener(e.rootElement,"mousedown",e.acArrowListener),e.addHookOnce("afterDestroy",function(){l.destroy()})}}Object.defineProperties(n,{autocompleteRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=l.addClass,c=l.hasClass,d=(l.empty,(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager),h=(s=e("renderers"),s&&s.__esModule&&s||{"default":s}),f=h.getRenderer,p=h.registerRenderer,g=(a=e("3rdparty/walkontable/src/cell/coords"),a&&a.__esModule&&a||{"default":a}).WalkontableCellCoords,m=document.createElement("DIV");m.className="htAutocompleteWrapper";var w=document.createElement("DIV");w.className="htAutocompleteArrow",w.appendChild(document.createTextNode(String.fromCharCode(9660)));p("autocomplete",o)},{"3rdparty/walkontable/src/cell/coords":5,eventManager:41,"helpers/dom/element":45,renderers:88}],91:[function(e,t,n){"use strict";function o(e,t,n,o,a,l,u){function c(e){var t=[C.SPACE,C.ENTER,C.DELETE,C.BACKSPACE];-1===t.indexOf(e.keyCode)||E(e)||f(function(){S(e),e.preventDefault()}),(e.keyCode==C.SPACE||e.keyCode==C.ENTER)&&d(),(e.keyCode==C.DELETE||e.keyCode==C.BACKSPACE)&&d(!1)}function d(){var e=void 0!==arguments[0]?arguments[0]:null;f(function(t){for(var n=0,o=t.length;o>n;n++){if(m(t[n],O)&&null===e)return;h(t[n],e)}})}function h(e){var t=void 0!==arguments[1]?arguments[1]:null;null===t?e.checked=!e.checked:e.checked=t,y.fireEvent(e,"change")}function f(t){for(var n=e.getSelectedRange(),o=n.getTopLeftCorner(),r=n.getBottomRightCorner(),i=o.row;i<=r.row;i++)for(var s=o.col;s<=r.col;s++){var a=e.getCell(i,s),l=e.getCellMeta(i,s),u=a.querySelectorAll("input[type=checkbox]");u.length>0&&!l.readOnly&&t(u)}}var y=new v(e),b=r(),R=u.label,M=!1;if("undefined"==typeof u.checkedTemplate&&(u.checkedTemplate=!0),"undefined"==typeof u.uncheckedTemplate&&(u.uncheckedTemplate=!1),p(t),l===u.checkedTemplate||w(l,u.checkedTemplate)?b.checked=!0:l===u.uncheckedTemplate||w(l,u.uncheckedTemplate)?b.checked=!1:null===l?g(b,"noValue"):(b.style.display="none",g(b,O),M=!0),!M&&R){var k="";R.value?k="function"==typeof R.value?R.value.call(this,n,o,a,l):R.value:R.property&&(k=e.getDataAtRowProp(n,R.property));var H=i(k);"before"===R.position?H.appendChild(b):H.insertBefore(b,H.firstChild),b=H}t.appendChild(b),M&&t.appendChild(document.createTextNode("#bad-value#")),u.readOnly?y.addEventListener(b,"click",s):(y.addEventListener(b,"mousedown",_),y.addEventListener(b,"mouseup",_),y.addEventListener(b,"change",function(t){e.setDataAtRowProp(n,a,t.target.checked?u.checkedTemplate:u.uncheckedTemplate)})),T.has(e)||(T.set(e,!0),e.addHook("beforeKeyDown",c))}function r(){var e=document.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("autocomplete","off"),e.cloneNode(!1)}function i(e){var t=document.createElement("label");return t.className="htCheckboxRendererLabel",t.appendChild(document.createTextNode(e)),t.cloneNode(!0)}function s(e){e.preventDefault()}Object.defineProperties(n,{checkboxRenderer:{get:function(){return o}},__esModule:{value:!0}});var a,l,u,c,d,h,f=(a=e("helpers/dom/element"),a&&a.__esModule&&a||{"default":a}),p=f.empty,g=f.addClass,m=f.hasClass,w=(l=e("helpers/string"),l&&l.__esModule&&l||{"default":l}).equalsIgnoreCase,v=(u=e("eventManager"),u&&u.__esModule&&u||{"default":u}).EventManager,y=(c=e("renderers"),c&&c.__esModule&&c||{"default":c}),b=(y.getRenderer,y.registerRenderer),C=(d=e("helpers/unicode"),d&&d.__esModule&&d||{"default":d}).KEY_CODES,R=(h=e("helpers/dom/event"),h&&h.__esModule&&h||{"default":h}),_=R.stopPropagation,S=R.stopImmediatePropagation,E=R.isImmediatePropagationStopped,T=new WeakMap,O="htBadValue";b("checkbox",o)},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/string":52,"helpers/unicode":53,renderers:88}],92:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,a){l("base").apply(this,arguments),s(t,i)}Object.defineProperties(n,{htmlRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}).fastInnerHTML,a=(i=e("renderers"),i&&i.__esModule&&i||{"default":i}),l=a.getRenderer,u=a.registerRenderer;u("html",o)},{"helpers/dom/element":45,renderers:88}],93:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){f(i)&&("undefined"!=typeof s.language&&l.language(s.language),i=l(i).format(s.format||"0"),u(t,"htNumeric")),d("text")(e,t,n,o,r,i,s)}Object.defineProperties(n,{numericRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l=(r=e("numeral"),r&&r.__esModule&&r||{"default":r})["default"],u=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).addClass,c=(s=e("renderers"),s&&s.__esModule&&s||{"default":s}),d=c.getRenderer,h=c.registerRenderer,f=(a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}).isNumeric;h("numeric",o)},{"helpers/dom/element":45,"helpers/number":49,numeral:"numeral",renderers:88}],94:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,a){l("text").apply(this,arguments),i=t.innerHTML;var u,c=a.hashLength||i.length,d=a.hashSymbol||"*";for(u="";u.split(d).length-13?("function"==typeof o&&(e.__proto__=o),e.prototype=d(a(o),i(t))):e.prototype=t,f(e,"prototype",{configurable:!1,writable:!1}),h(e,i(n))}function a(e){if("function"==typeof e){var t=e.prototype;if(u(t)===t||null===t)return e.prototype;throw new c("super prototype must be an Object or null")}if(null===e)return null;throw new c("Super expression must either be null or a function, not "+typeof e+".")}function l(e,t,o){null!==g(t)&&n(e,t,"constructor",o)}var u=Object,c=TypeError,d=u.create,h=$traceurRuntime.defineProperties,f=$traceurRuntime.defineProperty,p=$traceurRuntime.getOwnPropertyDescriptor,g=Object.getPrototypeOf,m=$traceurRuntime.toProperty,w=Object,v=w.getOwnPropertyNames,y=w.getOwnPropertySymbols;$traceurRuntime.createClass=s,$traceurRuntime.defaultSuperCall=l,$traceurRuntime.superCall=n,$traceurRuntime.superConstructor=t,$traceurRuntime.superGet=o,$traceurRuntime.superSet=r}()},{}],97:[function(e,t,n){"use strict";function o(e){var t=this,n=this;this.eventManager=b(e),this.instance=e,this.settings=e.getSettings(),this.selectionMouseDown=!1;var o=e.rootElement.getAttribute("style");o&&e.rootElement.setAttribute("data-originalstyle",o),d(e.rootElement,"handsontable");var r=document.createElement("TABLE");d(r,"htCore"),e.getSettings().tableClassName&&d(r,e.getSettings().tableClassName),this.THEAD=document.createElement("THEAD"),r.appendChild(this.THEAD),this.TBODY=document.createElement("TBODY"),r.appendChild(this.TBODY),e.table=r,e.container.insertBefore(r,e.container.firstChild),this.eventManager.addEventListener(e.rootElement,"mousedown",function(e){this.selectionMouseDown=!0,n.isTextSelectionAllowed(e.target)||(s(),e.preventDefault(),window.focus())}),this.eventManager.addEventListener(e.rootElement,"mouseup",function(e){this.selectionMouseDown=!1}),this.eventManager.addEventListener(e.rootElement,"mousemove",function(e){this.selectionMouseDown&&!n.isTextSelectionAllowed(e.target)&&(s(),e.preventDefault())}),this.eventManager.addEventListener(document.documentElement,"keyup",function(t){e.selection.isInProgress()&&!t.shiftKey&&e.selection.finish()});var i;this.isMouseDown=function(){return i},this.eventManager.addEventListener(document.documentElement,"mouseup",function(t){e.selection.isInProgress()&&1===t.which&&e.selection.finish(),i=!1,y(document.activeElement)&&e.unlisten()}),this.eventManager.addEventListener(document.documentElement,"mousedown",function(t){var o=t.target,r=t.x||t.clientX,s=t.y||t.clientY;if(!i&&e.rootElement){if(o===e.view.wt.wtTable.holder){var a=g();if(document.elementFromPoint(r+a,s)!==e.view.wt.wtTable.holder||document.elementFromPoint(r,s+a)!==e.view.wt.wtTable.holder)return}else for(;o!==document.documentElement;){if(null===o){if(t.isTargetWebComponent)break;return}if(o===e.rootElement)return;o=o.parentNode}n.settings.outsideClickDeselects?e.deselectCell():e.destroyEditor()}}),this.eventManager.addEventListener(r,"selectstart",function(e){n.settings.fragmentSelection||v(e.target)||e.preventDefault()});var s=function(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty()},a=[new E({className:"current",border:{width:2,color:"#5292F7",cornerVisible:function(){return n.settings.fillHandle&&!n.isCellEdited()&&!e.selection.isMultiple()},multipleSelectionHandlesVisible:function(){return!n.isCellEdited()&&!e.selection.isMultiple()}}}),new E({className:"area",border:{width:1,color:"#89AFF9",cornerVisible:function(){return n.settings.fillHandle&&!n.isCellEdited()&&e.selection.isMultiple()},multipleSelectionHandlesVisible:function(){return!n.isCellEdited()&&e.selection.isMultiple()}}}),new E({className:"highlight",highlightRowClassName:n.settings.currentRowClassName,highlightColumnClassName:n.settings.currentColClassName}),new E({className:"fill",border:{width:1,color:"red"}})];a.current=a[0],a.area=a[1],a.highlight=a[2],a.fill=a[3];var l={debug:function(){return n.settings.debug},externalRowCalculator:this.instance.getPlugin("autoRowSize")&&this.instance.getPlugin("autoRowSize").isEnabled(),table:r,preventOverflow:function(){return t.settings.preventOverflow},stretchH:this.settings.stretchH,data:e.getDataAtCell,totalRows:function(){return e.countRows()},totalColumns:function(){return e.countCols()},fixedColumnsLeft:function(){return n.settings.fixedColumnsLeft},fixedRowsTop:function(){return n.settings.fixedRowsTop},fixedRowsBottom:function(){return n.settings.fixedRowsBottom},minSpareRows:function(){return n.settings.minSpareRows},renderAllRows:n.settings.renderAllRows,rowHeaders:function(){var t=[];return e.hasRowHeaders()&&t.push(function(e,t){n.appendRowHeader(e,t)}),Handsontable.hooks.run(e,"afterGetRowHeaderRenderers",t),t},columnHeaders:function(){var t=[];return e.hasColHeaders()&&t.push(function(e,t){n.appendColHeader(e,t)}),Handsontable.hooks.run(e,"afterGetColumnHeaderRenderers",t),t},columnWidth:e.getColWidth,rowHeight:e.getRowHeight,cellRenderer:function(e,t,o){var r=n.instance.colToProp(t),i=n.instance.getCellMeta(e,t),s=n.instance.getCellRenderer(i),a=n.instance.getDataAtRowProp(e,r);s(n.instance,o,e,t,r,a,i),Handsontable.hooks.run(n.instance,"afterRenderer",o,e,t,r,a,i)},selections:a,hideBorderOnMouseDownOver:function(){return n.settings.fragmentSelection},onCellMouseDown:function(t,o,r,s){var a,l,u=r.parentNode,c=u.parentNode;if(e.listen(),n.activeWt=s,i=!0,Handsontable.hooks.run(e,"beforeOnCellMouseDown",t,o,r),e.selection.setSelectedHeaders(!1,!1),!_(t)){if(2===t.button&&e.selection.inInSelection(o));else t.shiftKey?o.row>=0&&o.col>=0&&e.selection.setRangeEnd(o):(o.row<0||o.col<0)&&(o.row>=0||o.col>=0)?(o.row<0&&(a=c.childNodes.length-Array.prototype.indexOf.call(c.childNodes,u)-1,l=e.getHeaderColspan(o.col,a),e.selection.setSelectedHeaders(!1,!0),e.selectCell(0,o.col,e.countRows()-1,o.col+Math.max(0,l-1))),o.col<0&&(e.selection.setSelectedHeaders(!0,!1),e.selectCell(o.row,0,o.row,e.countCols()-1))):(o.row=o.row<0?0:o.row,o.col=o.col<0?0:o.col,e.selection.setRangeStart(o));Handsontable.hooks.run(e,"afterOnCellMouseDown",t,o,r),n.activeWt=n.wt}},onCellMouseOver:function(t,o,r,s){n.activeWt=s,o.row>=0&&o.col>=0?i&&e.selection.setRangeEnd(o):i&&(o.row<0&&(e.selection.selectedHeader.cols?(e.selection.setRangeEnd(new S(e.countRows()-1,o.col)),e.selection.setSelectedHeaders(!1,!0)):e.selection.setRangeEnd(new S(o.row,o.col))),o.col<0&&(e.selection.selectedHeader.rows?(e.selection.setRangeEnd(new S(o.row,e.countCols()-1)),e.selection.setSelectedHeaders(!0,!1)):e.selection.setRangeEnd(new S(o.row,o.col)))),Handsontable.hooks.run(e,"afterOnCellMouseOver",t,o,r),n.activeWt=n.wt},onCellCornerMouseDown:function(t){t.preventDefault(),Handsontable.hooks.run(e,"afterOnCellCornerMouseDown",t)},beforeDraw:function(e){n.beforeRender(e)},onDraw:function(e){n.onDraw(e)},onScrollVertically:function(){e.runHooks("afterScrollVertically")},onScrollHorizontally:function(){e.runHooks("afterScrollHorizontally")},onBeforeDrawBorders:function(t,n){e.runHooks("beforeDrawBorders",t,n)},onBeforeTouchScroll:function(){e.runHooks("beforeTouchScroll")},onAfterMomentumScroll:function(){e.runHooks("afterMomentumScroll")},viewportRowCalculatorOverride:function(t){var o=e.countRows(),r=n.settings.viewportRowRenderingOffset;if("auto"===r&&n.settings.fixedRowsTop&&(r=10),"number"==typeof r&&(t.startRow=Math.max(t.startRow-r,0),t.endRow=Math.min(t.endRow+r,o-1)),"auto"===r){var i=t.startRow+t.endRow-t.startRow,s=Math.ceil(i/o*12);t.startRow=Math.max(t.startRow-s,0),t.endRow=Math.min(t.endRow+s,o-1)}e.runHooks("afterViewportRowCalculatorOverride",t)},viewportColumnCalculatorOverride:function(t){var o=e.countCols(),r=n.settings.viewportColumnRenderingOffset;if("auto"===r&&n.settings.fixedColumnsLeft&&(r=10),"number"==typeof r&&(t.startColumn=Math.max(t.startColumn-r,0),t.endColumn=Math.min(t.endColumn+r,o-1)),"auto"===r){var i=t.startColumn+t.endColumn-t.startColumn,s=Math.ceil(i/o*12);t.startRow=Math.max(t.startColumn-s,0),t.endColumn=Math.min(t.endColumn+s,o-1)}e.runHooks("afterViewportColumnCalculatorOverride",t)}};Handsontable.hooks.run(e,"beforeInitWalkontable",l),this.wt=new T(l),this.activeWt=this.wt,this.eventManager.addEventListener(n.wt.wtTable.spreader,"mousedown",function(e){e.target===n.wt.wtTable.spreader&&3===e.which&&R(e)}),this.eventManager.addEventListener(n.wt.wtTable.spreader,"contextmenu",function(e){e.target===n.wt.wtTable.spreader&&3===e.which&&R(e)}),this.eventManager.addEventListener(document.documentElement,"click",function(){n.settings.observeDOMVisibility&&n.wt.drawInterrupted&&(n.instance.forceFullRender=!0,n.render())})}Object.defineProperties(n,{TableView:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l,u,c=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),d=c.addClass,h=c.empty,f=c.fastInnerHTML,p=c.fastInnerText,g=c.getScrollbarWidth,m=c.hasClass,w=c.isChildOf,v=c.isInput,y=c.isOutsideInput,b=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,C=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),R=C.stopPropagation,_=C.isImmediatePropagationStopped,S=(a=e("3rdparty/walkontable/src/cell/coords"),a&&a.__esModule&&a||{"default":a}).WalkontableCellCoords,E=(l=e("3rdparty/walkontable/src/selection"),l&&l.__esModule&&l||{"default":l}).WalkontableSelection,T=(u=e("3rdparty/walkontable/src/core"),u&&u.__esModule&&u||{"default":u}).Walkontable;Handsontable.TableView=o,o.prototype.isTextSelectionAllowed=function(e){if(v(e))return!0;var t=w(e,this.instance.view.wt.wtTable.spreader);return this.settings.fragmentSelection===!0&&t?!0:"cell"===this.settings.fragmentSelection&&this.isSelectedOnlyCell()&&t?!0:!1},o.prototype.isSelectedOnlyCell=function(){var e=this.instance.getSelected()||[],t=e[0],n=e[1],o=e[2],r=e[3];return void 0!==t&&t===o&&n===r},o.prototype.isCellEdited=function(){var e=this.instance.getActiveEditor();return e&&e.isOpened()},o.prototype.beforeRender=function(e){e&&Handsontable.hooks.run(this.instance,"beforeRender",this.instance.forceFullRender)},o.prototype.onDraw=function(e){e&&Handsontable.hooks.run(this.instance,"afterRender",this.instance.forceFullRender)},o.prototype.render=function(){this.wt.draw(!this.instance.forceFullRender),this.instance.forceFullRender=!1,this.instance.renderCall=!1},o.prototype.getCellAtCoords=function(e,t){var n=this.wt.getCell(e,t);return 0>n?null:n},o.prototype.scrollViewport=function(e){this.wt.scrollViewport(e)},o.prototype.appendRowHeader=function(e,t){if(t.firstChild){var n=t.firstChild;if(!m(n,"relative"))return h(t),void this.appendRowHeader(e,t);this.updateCellHeader(n.querySelector(".rowHeader"),e,this.instance.getRowHeader)}else{var o=document.createElement("div"),r=document.createElement("span");o.className="relative",r.className="rowHeader",this.updateCellHeader(r,e,this.instance.getRowHeader),o.appendChild(r),t.appendChild(o)}Handsontable.hooks.run(this.instance,"afterGetRowHeader",e,t)},o.prototype.appendColHeader=function(e,t){if(t.firstChild){var n=t.firstChild;m(n,"relative")?this.updateCellHeader(n.querySelector(".colHeader"),e,this.instance.getColHeader):(h(t),this.appendColHeader(e,t))}else{var o=document.createElement("div"),r=document.createElement("span");o.className="relative",r.className="colHeader",this.updateCellHeader(r,e,this.instance.getColHeader),o.appendChild(r),t.appendChild(o)}Handsontable.hooks.run(this.instance,"afterGetColHeader",e,t)},o.prototype.updateCellHeader=function(e,t,n){t>-1?f(e,n(t)):(p(e,String.fromCharCode(160)),d(e,"cornerHeader"))},o.prototype.maximumVisibleElementWidth=function(e){var t=this.wt.wtViewport.getWorkspaceWidth(),n=t-e;return n>0?n:0},o.prototype.maximumVisibleElementHeight=function(e){var t=this.wt.wtViewport.getWorkspaceHeight(),n=t-e;return n>0?n:0},o.prototype.mainViewIsActive=function(){return this.wt===this.activeWt},o.prototype.destroy=function(){this.wt.destroy(),this.eventManager.destroy()}},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/core":7,"3rdparty/walkontable/src/selection":18,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46}],98:[function(e,t,n){"use strict";Object.defineProperties(n,{GhostTable:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s,a,l=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),u=l.addClass,c=l.outerHeight,d=l.outerWidth,h=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,f=((i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}).objectEach,(s=e("helpers/number"),s&&s.__esModule&&s||{"default":s}).rangeEach,(a=e("helpers/mixed"),a&&a.__esModule&&a||{"default":a}).stringify,function(e){this.hot=e,this.container=null,this.injected=!1,this.rows=[],this.columns=[],this.samples=null});$traceurRuntime.createClass(f,{addRow:function(e,t){if(this.columns.length)throw new Error("Doesn't support multi-dimensional table");this.rows.length||(this.container=this.createContainer(this.hot.rootElement.className));var n={row:e};this.rows.push(n),this.samples=t,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol()),this.table.tr.appendChild(this.createRow(e)),this.container.container.appendChild(this.table.fragment),n.table=this.table.table},addColumn:function(e,t){if(this.rows.length)throw new Error("Doesn't support multi-dimensional table");this.columns.length||(this.container=this.createContainer(this.hot.rootElement.className));var n={col:e};this.columns.push(n),this.samples=t,this.table=this.createTable(this.hot.table.className),null!==this.hot.getColHeader(e)&&this.hot.view.appendColHeader(e,this.table.th),this.table.tBody.appendChild(this.createCol(e)),this.container.container.appendChild(this.table.fragment),n.table=this.table.table},getHeights:function(e){this.injected||this.injectTable(),h(this.rows,function(t){e(t.row,c(t.table)-1)})},getWidths:function(e){this.injected||this.injectTable(),h(this.columns,function(t){e(t.col,d(t.table))})},createColGroupsCol:function(){var e=this,t=document,n=t.createDocumentFragment();return n.appendChild(this.createColElement(-1)),this.samples.forEach(function(t){h(t.strings,function(t){n.appendChild(e.createColElement(t.col))})}),n},createRow:function(e){var t=this,n=document,o=n.createDocumentFragment(),r=n.createElement("th");return null!==this.hot.getRowHeader(e)&&this.hot.view.appendRowHeader(e,r),o.appendChild(r),this.samples.forEach(function(r){h(r.strings,function(r){var i=r.col,s=t.hot.getCellMeta(e,i);s.col=i,s.row=e;var a=t.hot.getCellRenderer(s),l=n.createElement("td");a(t.hot,l,e,i,t.hot.colToProp(i),r.value,s),o.appendChild(l)})}),o},createCol:function(e){var t=this,n=document,o=n.createDocumentFragment();return this.samples.forEach(function(r){h(r.strings,function(r){var i=r.row,s=t.hot.getCellMeta(i,e);s.col=e,s.row=i;var a=t.hot.getCellRenderer(s),l=n.createElement("td"),u=n.createElement("tr");a(t.hot,l,i,e,t.hot.colToProp(i),r.value,s),u.appendChild(l),o.appendChild(u)})}),o},clean:function(){this.rows.length=0,this.columns.length=0,this.samples&&this.samples.clear(),this.samples=null,this.removeTable()},injectTable:function(){var e=void 0!==arguments[0]?arguments[0]:null;this.injected||((e||this.hot.rootElement).appendChild(this.container.fragment),this.injected=!0)},removeTable:function(){this.injected&&this.container.container.parentNode&&(this.container.container.parentNode.removeChild(this.container.container),this.container=null,this.injected=!1)},createColElement:function(e){var t=document,n=t.createElement("col");return n.style.width=this.hot.view.wt.wtTable.getStretchedColumnWidth(e)+"px",n},createTable:function(){var e=void 0!==arguments[0]?arguments[0]:"",t=document,n=t.createDocumentFragment(),o=t.createElement("table"),r=t.createElement("thead"),i=t.createElement("tbody"),s=t.createElement("colgroup"),a=t.createElement("tr"),l=t.createElement("th");return this.isVertical()&&o.appendChild(s),this.isHorizontal()&&(a.appendChild(l),r.appendChild(a),o.style.tableLayout="auto",o.style.width="auto"),o.appendChild(r),this.isVertical()&&i.appendChild(a),o.appendChild(i),u(o,e),n.appendChild(o),{fragment:n,table:o,tHead:r,tBody:i,colGroup:s,tr:a,th:l}},createContainer:function(){var e=void 0!==arguments[0]?arguments[0]:"",t=document,n=t.createDocumentFragment(),o=t.createElement("div");return e="htGhostTable htAutoSize "+e.trim(),u(o,e),n.appendChild(o),{fragment:n,container:o}},isVertical:function(){return this.rows.length&&!this.columns.length?!0:!1},isHorizontal:function(){return this.columns.length&&!this.rows.length?!0:!1}},{}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.GhostTable=f},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],99:[function(e,t,n){"use strict";var o;Object.defineProperties(n,{SamplesGenerator:{get:function(){return h}},__esModule:{value:!0}});var r,i,s,a,l,u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=(u.addClass,u.outerHeight,u.outerWidth,(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,(s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}).objectEach,(a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}).rangeEach),d=(l=e("helpers/mixed"),l&&l.__esModule&&l||{"default":l}).stringify,h=function(e){this.samples=null,this.dataFactory=e,this.customSampleCount=null},f=h;$traceurRuntime.createClass(h,(o={},Object.defineProperty(o,"getSampleCount",{value:function(){return this.customSampleCount?this.customSampleCount:f.SAMPLE_COUNT},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateRowSamples",{value:function(e,t){return this.generateSamples("row",t,e)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateColumnSamples",{value:function(e,t){return this.generateSamples("col",t,e)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateSamples",{value:function(e,t,n){var o=this,r=new Map;return"number"==typeof n&&(n={from:n,to:n}),c(n.from,n.to,function(n){var i=o.generateSample(e,t,n);r.set(n,i)}),r},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateSample",{value:function(e,t,n){var o=this,r=new Map,i=[];return c(t.from,t.to,function(t){var s,a;if("row"===e)a=o.dataFactory(n,t);else{if("col"!==e)throw new Error("Unsupported sample type");a=o.dataFactory(t,n)}Array.isArray(a)||(a=d(a));var l=a.length;r.has(l)||r.set(l,{needed:o.getSampleCount(),strings:[]});var u=r.get(l);if(u.needed){var c=i.indexOf(a)>-1;if(!c){var h="row"===e?"col":"row";u.strings.push((s={},Object.defineProperty(s,"value",{value:a,configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(s,h,{value:t,configurable:!0,enumerable:!0,writable:!0}),s)),i.push(a),u.needed--}}}),r},configurable:!0,enumerable:!0,writable:!0}),o),{get SAMPLE_COUNT(){return 3}}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.SamplesGenerator=h},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],100:[function(e,t,n){"use strict";function o(e,t){var n=e,o="string"==typeof n?n.toLowerCase():null;return function(e){for(var r=!1,s=0,a=e.length;a>s;s++){if(n===e[s]){r=!0;break}if(o===i(e[s]).toLowerCase()){r=!0;break}}t(r)}}var r,i=(r=e("helpers/mixed"),r&&r.__esModule&&r||{"default":r}).stringify;Handsontable.AutocompleteValidator=function(e,t){this.strict&&this.source?"function"==typeof this.source?this.source(e,o(e,t)):o(e,t)(this.source):t(!0)}},{"helpers/mixed":48}],101:[function(e,t,n){"use strict";var o,r,i=(o=e("moment"),o&&o.__esModule&&o||{"default":o})["default"],s=(r=e("editors"),r&&r.__esModule&&r||{"default":r}).getEditor;Handsontable.DateValidator=function(e,t){var n=!0,o=s("date",this.instance);null===e&&(e="");var r=i(new Date(e)).isValid(),l=i(e,this.dateFormat||o.defaultDateFormat,!0).isValid();if(r||(n=!1),!r&&l&&(n=!0),r&&!l)if(this.correctFormat===!0){var u=a(e,this.dateFormat);this.instance.setDataAtCell(this.row,this.col,u,"dateValidator"),n=!0}else n=!1;t(n)};var a=function(e,t){var n=i(new Date(e)),o=n.format("YYYY"),r=i().format("YYYY");return o.substr(0,2)!==r.substr(0,2)?e.match(new RegExp(o))||n.year(o.replace(o.substr(0,2),r.substr(0,2))):o.length>4&&n.year((n.year()+"").substr(0,4)),n.format(t)}},{editors:29,moment:"moment"}],102:[function(e,t,n){"use strict";Handsontable.NumericValidator=function(e,t){null===e&&(e=""),t(/^-?\d*(\.|\,)?\d*$/.test(e))}},{}],SheetClip:[function(e,t,n){"use strict";!function(e){function t(e){return e.split('"').length-1}var o={parse:function(e){var n,o,r,i,s,a,l,u=[],c=0;for(r=e.split("\n"),r.length>1&&""===r[r.length-1]&&r.pop(),n=0,o=r.length;o>n;n+=1){for(r[n]=r[n].split(" "),i=0,s=r[n].length;s>i;i+=1)u[c]||(u[c]=[]),a&&0===i?(l=u[c].length-1,u[c][l]=u[c][l]+"\n"+r[n][0],a&&1&t(r[n][0])&&(a=!1, +u[c][l]=u[c][l].substring(0,u[c][l].length-1).replace(/""/g,'"'))):i===s-1&&0===r[n][i].indexOf('"')&&1&t(r[n][i])?(u[c].push(r[n][i].substring(1).replace(/""/g,'"')),a=!0):(u[c].push(r[n][i].replace(/""/g,'"')),a=!1);a||(c+=1)}return u},stringify:function(e){var t,n,o,r,i,s="";for(t=0,n=e.length;n>t;t+=1){for(r=e[t].length,o=0;r>o;o+=1)o>0&&(s+=" "),i=e[t][o],s+="string"==typeof i?i.indexOf("\n")>-1?'"'+i.replace(/"/g,'""')+'"':i:null===i||void 0===i?"":i;s+="\n"}return s}};"undefined"!=typeof n?(n.parse=o.parse,n.stringify=o.stringify):e.SheetClip=o}(window)},{}],autoResize:[function(e,t,n){"use strict";function o(){var e,t={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300},n=document.body,o=document.createTextNode(""),r=document.createElement("SPAN"),i=function(e,t,n){window.attachEvent?e.attachEvent("on"+t,n):e.addEventListener(t,n,!1)},s=function(e,t,n){window.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)},a=function(i){var s,a;i?/^[a-zA-Z \.,\\\/\|0-9]$/.test(i)||(i="."):i="",void 0!==o.textContent?o.textContent=e.value+i:o.data=e.value+i,r.style.fontSize=Handsontable.Dom.getComputedStyle(e).fontSize,r.style.fontFamily=Handsontable.Dom.getComputedStyle(e).fontFamily,r.style.whiteSpace="pre",n.appendChild(r),s=r.clientWidth+2,n.removeChild(r),e.style.height=t.minHeight+"px",t.minWidth>s?e.style.width=t.minWidth+"px":s>t.maxWidth?e.style.width=t.maxWidth+"px":e.style.width=s+"px",a=e.scrollHeight?e.scrollHeight-1:0,t.minHeight>a?e.style.height=t.minHeight+"px":t.maxHeight-1||"true"===e.contentEditable}var n=this,o=!1;if(e.metaKey?o=!0:e.ctrlKey&&-1===navigator.userAgent.indexOf("Mac")&&(o=!0),o){if(document.activeElement!==this.elTextarea&&(""!==this.getSelectionText()||t()))return;this.selectNodeText(this.elTextarea),setTimeout(function(){document.activeElement!==n.elTextarea&&n.selectNodeText(n.elTextarea)},0)}!o||67!==e.keyCode&&86!==e.keyCode&&88!==e.keyCode||(88===e.keyCode?setTimeout(function(){n.triggerCut(e)},0):86===e.keyCode&&setTimeout(function(){n.triggerPaste(e)},0))},r.prototype.selectNodeText=function(e){e&&e.select()},r.prototype.getSelectionText=function(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e},r.prototype.copyable=function(e){if("string"!=typeof e&&void 0===e.toString)throw new Error("copyable requires string parameter");this.elTextarea.value=e,this.selectNodeText(this.elTextarea)},r.prototype.onCut=function(e){this.cutCallbacks.push(e)},r.prototype.onPaste=function(e){this.pasteCallbacks.push(e)},r.prototype.removeCallback=function(e){var t,n;for(t=0,n=this.copyCallbacks.length;n>t;t++)if(this.copyCallbacks[t]===e)return this.copyCallbacks.splice(t,1),!0;for(t=0,n=this.cutCallbacks.length;n>t;t++)if(this.cutCallbacks[t]===e)return this.cutCallbacks.splice(t,1),!0;for(t=0,n=this.pasteCallbacks.length;n>t;t++)if(this.pasteCallbacks[t]===e)return this.pasteCallbacks.splice(t,1),!0;return!1},r.prototype.triggerCut=function(e){var t=this;t.cutCallbacks&&setTimeout(function(){for(var n=0,o=t.cutCallbacks.length;o>n;n++)t.cutCallbacks[n](e)},50)},r.prototype.triggerPaste=function(e,t){var n=this;n.pasteCallbacks&&setTimeout(function(){for(var o=t||n.elTextarea.value,r=0,i=n.pasteCallbacks.length;i>r;r++)n.pasteCallbacks[r](o,e)},50)},r.prototype.destroy=function(){this.hasBeenDestroyed()||0!==--this.refCounter||(this.elDiv&&this.elDiv.parentNode&&(this.elDiv.parentNode.removeChild(this.elDiv),this.elDiv=null,this.elTextarea=null),document.documentElement.removeEventListener("keydown",this.onKeyDownRef),this.onKeyDownRef=null)},r.prototype.hasBeenDestroyed=function(){return!this.refCounter}},{}],es6collections:[function(e,t,n){"use strict";!function(e){function t(e,t){function o(e){return this&&this.constructor===o?(this._keys=[],this._values=[],this._itp=[],this.objectOnly=t,void(e&&n.call(this,e))):new o(e)}return t||y(e,"size",{get:m}),e.constructor=o,o.prototype=e,o}function n(e){this.add?e.forEach(this.add,this):e.forEach(function(e){this.set(e[0],e[1])},this)}function o(e){return this.has(e)&&(this._keys.splice(v,1),this._values.splice(v,1),this._itp.forEach(function(e){v-1}function r(e){return this.has(e)?this._values[v]:void 0}function i(e,t){if(this.objectOnly&&t!==Object(t))throw new TypeError("Invalid value used as weak collection key");if(t!=t||0===t)for(v=e.length;v--&&!b(e[v],t););else v=e.indexOf(t);return v>-1}function s(e){return i.call(this,this._values,e)}function a(e){return i.call(this,this._keys,e)}function l(e,t){return this.has(e)?this._values[v]=t:this._values[this._keys.push(e)-1]=t,this}function u(e){return this.has(e)||this._values.push(e),this}function c(){this._values.length=0}function d(){return g(this._itp,this._keys)}function h(){return g(this._itp,this._values)}function f(){return g(this._itp,this._keys,this._values)}function p(){return g(this._itp,this._values,this._values)}function g(e,t,n){var o=[0],r=!1;return e.push(o),{next:function(){var i,s=o[0];return!r&&st;t++)if(v[t].obj===e)return v[t]}function i(e){for(var t=0,n=v.length;n>t;t++)v[t]===e&&v.splice(t,1)}function s(e,t){for(var n=0,o=e.observers.length;o>n;n++)if(e.observers[n].callback===t)return e.observers[n].observer}function a(e,t){for(var n=0,o=e.observers.length;o>n;n++)if(e.observers[n].observer===t)return e.observers.splice(n,1),void(e.observers.length||i(e))}function l(e,t){h(t),Object.observe?d(t,e):clearTimeout(t.next);var n=r(e);a(n,t)}function u(e,t){var n,i=[],a=e,l=r(e);if(l?n=s(l,t):(l=new y(e),v.push(l)),n)return n;if(Object.observe)n=function(r){d(n,e),c(n,e);for(var s=0,l=r.length;l>s;){if(("length"!==r[s].name||!R(r[s].object))&&"__Jasmine_been_here_before__"!==r[s].name){var u=r[s].type;switch(u){case"new":u="add";break;case"deleted":u="delete";break;case"updated":u="update"}w[u].call(r[s],i,o(a,r[s].object))}s++}i&&t&&t(i),n.patches=i,i=[]};else if(n={},l.value=JSON.parse(JSON.stringify(e)),t){n.callback=t,n.next=null;var u=this.intervals||[100,1e3,1e4,6e4],f=0,p=function(){h(n)},g=function(){clearTimeout(n.next),n.next=setTimeout(function(){p(),f=0,n.next=setTimeout(m,u[f++])},0)},m=function(){p(),f==u.length&&(f=u.length-1),n.next=setTimeout(m,u[f++])};"undefined"!=typeof window&&(window.addEventListener?(window.addEventListener("mousedown",g),window.addEventListener("mouseup",g),window.addEventListener("keydown",g)):(window.attachEvent("onmousedown",g),window.attachEvent("onmouseup",g),window.attachEvent("onkeydown",g))),n.next=setTimeout(m,u[f++])}return n.patches=i,n.object=e,l.observers.push(new b(t,n)),c(n,e)}function c(e,t){if(Object.observe){Object.observe(t,e);for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];o&&"object"==typeof o&&c(e,o)}}return e}function d(e,t){if(Object.observe){Object.unobserve(t,e);for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];o&&"object"==typeof o&&d(e,o)}}return e}function h(e){if(Object.observe)Object.deliverChangeRecords(e);else{for(var t,n=0,o=v.length;o>n;n++)if(v[n].obj===e.object){t=v[n];break}t&&f(t.value,e.object,e.patches,"")}var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function f(e,n,o,r){for(var i=C(n),s=C(e),a=!1,l=!1,u=s.length-1;u>=0;u--){var c=s[u],d=e[c];if(n.hasOwnProperty(c)){var h=n[c];d instanceof Object?f(d,h,o,r+"/"+t(c)):d!=h&&(a=!0,o.push({op:"replace",path:r+"/"+t(c),value:h}),e[c]=h)}else o.push({op:"remove",path:r+"/"+t(c)}),delete e[c],l=!0}if(l||i.length!=s.length)for(var u=0;ur;){n=t[r];for(var s=n.path.split("/"),a=e,l=1,u=s.length;;)if(R(a)){var c=parseInt(s[l],10);if(l++,l>=u){o=m[n.op].call(n,a,c,e);break}a=a[c]}else{var d=s[l];if(-1!=d.indexOf("~")&&(d=d.replace(/~1/g,"/").replace(/~0/g,"~")),l++,l>=u){o=g[n.op].call(n,a,d,e);break}a=a[d]}r++}return o}var g={add:function(e,t){return e[t]=this.value,!0},remove:function(e,t){return delete e[t],!0},replace:function(e,t){return e[t]=this.value,!0},move:function(e,t,n){var o={op:"_get",path:this.from};return p(n,[o]),p(n,[{op:"remove",path:this.from}]),p(n,[{op:"add",path:this.path,value:o.value}]),!0},copy:function(e,t,n){var o={op:"_get",path:this.from};return p(n,[o]),p(n,[{op:"add",path:this.path,value:o.value}]),!0},test:function(e,t){return JSON.stringify(e[t])===JSON.stringify(this.value)},_get:function(e,t){this.value=e[t]}},m={add:function(e,t){return e.splice(t,0,this.value),!0},remove:function(e,t){return e.splice(t,1),!0},replace:function(e,t){return e[t]=this.value,!0},move:g.move,copy:g.copy,test:g.test,_get:g._get},w={add:function(e,n){var o={op:"add",path:n+t(this.name),value:this.object[this.name]};e.push(o)},"delete":function(e,n){var o={op:"remove",path:n+t(this.name)};e.push(o)},update:function(e,n){var o={op:"replace",path:n+t(this.name),value:this.object[this.name]};e.push(o)}},v=[];e.intervals;var y=function(){function e(e){this.observers=[],this.obj=e}return e}(),b=function(){function e(e,t){this.callback=e,this.observer=t}return e}();e.unobserve=l,e.observe=u,e.generate=h;var C;C=Object.keys?Object.keys:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t};var R;R=Array.isArray?Array.isArray:function(e){return e.push&&"number"==typeof e.length},e.apply=p}(o||(o={})),"undefined"!=typeof n&&(n.apply=o.apply,n.observe=o.observe,n.unobserve=o.unobserve,n.generate=o.generate)},{}],moment:[function(t,n,o){ //! moment.js //! version : 2.10.6 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com -!function(t,r){"object"==typeof o&&"undefined"!=typeof n?n.exports=r():"function"==typeof e&&e.amd?e(r):t.moment=r()}(this,function(){"use strict";function e(){return Ln.apply(null,arguments)}function o(e){Ln=e}function r(e){return"[object Array]"===Object.prototype.toString.call(e)}function i(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function s(e,t){var n,o=[];for(n=0;n0)for(n in In)o=In[n],r=t[o],"undefined"!=typeof r&&(e[o]=r);return e}function g(t){p(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),jn===!1&&(jn=!0,e.updateOffset(this),jn=!1)}function m(e){return e instanceof g||null!=e&&null!=e._isAMomentObject}function v(e){return 0>e?Math.ceil(e):Math.floor(e)}function w(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=v(t)),n}function y(e,t,n){var o,r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),s=0;for(o=0;r>o;o++)(n&&e[o]!==t[o]||!n&&w(e[o])!==w(t[o]))&&s++;return s+i}function b(){}function C(e){return e?e.toLowerCase().replace("_","-"):e}function R(e){for(var t,n,o,r,i=0;i0;){if(o=_(r.slice(0,t).join("-")))return o;if(n&&n.length>=t&&y(r,n,!0)>=t-1)break;t--}i++}return null}function _(e){var o=null;if(!Bn[e]&&"undefined"!=typeof n&&n&&n.exports)try{o=Wn._abbr,t("./locale/"+e),S(o)}catch(r){}return Bn[e]}function S(e,t){var n;return e&&(n="undefined"==typeof t?T(e):E(e,t),n&&(Wn=n)),Wn._abbr}function E(e,t){return null!==t?(t.abbr=e,Bn[e]=Bn[e]||new b,Bn[e].set(t),S(e),Bn[e]):(delete Bn[e],null)}function T(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Wn;if(!r(e)){if(t=_(e))return t;e=[e]}return R(e)}function O(e,t){var n=e.toLowerCase();Fn[n]=Fn[n+"s"]=Fn[t]=e}function M(e){return"string"==typeof e?Fn[e]||Fn[e.toLowerCase()]:void 0}function k(e){var t,n,o={};for(n in e)a(e,n)&&(t=M(n),t&&(o[t]=e[n]));return o}function H(t,n){return function(o){return null!=o?(A(this,t,o),e.updateOffset(this,n),this):D(this,t)}}function D(e,t){return e._d["get"+(e._isUTC?"UTC":"")+t]()}function A(e,t,n){return e._d["set"+(e._isUTC?"UTC":"")+t](n)}function x(e,t){var n;if("object"==typeof e)for(n in e)this.set(n,e[n]);else if(e=M(e),"function"==typeof this[e])return this[e](t);return this}function P(e,t,n){var o=""+Math.abs(e),r=t-o.length,i=e>=0;return(i?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+o}function N(e,t,n,o){var r=o;"string"==typeof o&&(r=function(){return this[o]()}),e&&(Un[e]=r),t&&(Un[t[0]]=function(){return P(r.apply(this,arguments),t[1],t[2])}),n&&(Un[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),e)})}function L(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function W(e){var t,n,o=e.match(Vn);for(t=0,n=o.length;n>t;t++)Un[o[t]]?o[t]=Un[o[t]]:o[t]=L(o[t]);return function(r){var i="";for(t=0;n>t;t++)i+=o[t]instanceof Function?o[t].call(r,e):o[t];return i}}function I(e,t){return e.isValid()?(t=j(t,e.localeData()),Yn[t]=Yn[t]||W(t),Yn[t](e)):e.localeData().invalidDate()}function j(e,t){function n(e){return t.longDateFormat(e)||e}var o=5;for(zn.lastIndex=0;o>=0&&zn.test(e);)e=e.replace(zn,n),zn.lastIndex=0,o-=1;return e}function B(e){return"function"==typeof e&&"[object Function]"===Object.prototype.toString.call(e)}function F(e,t,n){so[e]=B(t)?t:function(e){return e&&n?n:t}}function V(e,t){return a(so,e)?so[e](t._strict,t._locale):new RegExp(z(e))}function z(e){return e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,o,r){return t||n||o||r}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Y(e,t){var n,o=t;for("string"==typeof e&&(e=[e]),"number"==typeof t&&(o=function(e,n){n[t]=w(e)}),n=0;no;o++){if(r=u([2e3,o]),n&&!this._longMonthsParse[o]&&(this._longMonthsParse[o]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[o]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),n||this._monthsParse[o]||(i="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[o]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[o].test(e))return o;if(n&&"MMM"===t&&this._shortMonthsParse[o].test(e))return o;if(!n&&this._monthsParse[o].test(e))return o}}function Z(e,t){var n;return"string"==typeof t&&(t=e.localeData().monthsParse(t),"number"!=typeof t)?e:(n=Math.min(e.date(),$(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e)}function J(t){return null!=t?(Z(this,t),e.updateOffset(this,!0),this):D(this,"Month")}function Q(){return $(this.year(),this.month())}function ee(e){var t,n=e._a;return n&&-2===d(e).overflow&&(t=n[uo]<0||n[uo]>11?uo:n[co]<1||n[co]>$(n[lo],n[uo])?co:n[ho]<0||n[ho]>24||24===n[ho]&&(0!==n[fo]||0!==n[po]||0!==n[go])?ho:n[fo]<0||n[fo]>59?fo:n[po]<0||n[po]>59?po:n[go]<0||n[go]>999?go:-1,d(e)._overflowDayOfYear&&(lo>t||t>co)&&(t=co),d(e).overflow=t),e}function te(t){e.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function ne(e,t){var n=!0;return l(function(){return n&&(te(e+"\n"+(new Error).stack),n=!1),t.apply(this,arguments)},t)}function oe(e,t){wo[e]||(te(t),wo[e]=!0)}function re(e){var t,n,o=e._i,r=yo.exec(o);if(r){for(d(e).iso=!0,t=0,n=bo.length;n>t;t++)if(bo[t][1].exec(o)){e._f=bo[t][0];break}for(t=0,n=Co.length;n>t;t++)if(Co[t][1].exec(o)){e._f+=(r[6]||" ")+Co[t][0];break}o.match(oo)&&(e._f+="Z"),_e(e)}else e._isValid=!1}function ie(t){var n=Ro.exec(t._i);return null!==n?void(t._d=new Date(+n[1])):(re(t),void(t._isValid===!1&&(delete t._isValid,e.createFromInputFallback(t))))}function se(e,t,n,o,r,i,s){var a=new Date(e,t,n,o,r,i,s);return 1970>e&&a.setFullYear(e),a}function ae(e){var t=new Date(Date.UTC.apply(null,arguments));return 1970>e&&t.setUTCFullYear(e),t}function le(e){return ue(e)?366:365}function ue(e){return e%4===0&&e%100!==0||e%400===0}function ce(){return ue(this.year())}function de(e,t,n){var o,r=n-t,i=n-e.day();return i>r&&(i-=7),r-7>i&&(i+=7),o=De(e).add(i,"d"),{week:Math.ceil(o.dayOfYear()/7),year:o.year()}}function he(e){return de(e,this._week.dow,this._week.doy).week}function fe(){return this._week.dow}function pe(){return this._week.doy}function ge(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function me(e){var t=de(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function ve(e,t,n,o,r){var i,s=6+r-o,a=ae(e,0,1+s),l=a.getUTCDay();return r>l&&(l+=7),n=null!=n?1*n:r,i=1+s+7*(t-1)-l+n,{year:i>0?e:e-1,dayOfYear:i>0?i:le(e-1)+i}}function we(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}function ye(e,t,n){return null!=e?e:null!=t?t:n}function be(e){var t=new Date;return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Ce(e){var t,n,o,r,i=[];if(!e._d){for(o=be(e),e._w&&null==e._a[co]&&null==e._a[uo]&&Re(e),e._dayOfYear&&(r=ye(e._a[lo],o[lo]),e._dayOfYear>le(r)&&(d(e)._overflowDayOfYear=!0),n=ae(r,0,e._dayOfYear),e._a[uo]=n.getUTCMonth(),e._a[co]=n.getUTCDate()),t=0;3>t&&null==e._a[t];++t)e._a[t]=i[t]=o[t];for(;7>t;t++)e._a[t]=i[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ho]&&0===e._a[fo]&&0===e._a[po]&&0===e._a[go]&&(e._nextDay=!0,e._a[ho]=0),e._d=(e._useUTC?ae:se).apply(null,i),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ho]=24)}}function Re(e){var t,n,o,r,i,s,a;t=e._w,null!=t.GG||null!=t.W||null!=t.E?(i=1,s=4,n=ye(t.GG,e._a[lo],de(De(),1,4).year),o=ye(t.W,1),r=ye(t.E,1)):(i=e._locale._week.dow,s=e._locale._week.doy,n=ye(t.gg,e._a[lo],de(De(),i,s).year),o=ye(t.w,1),null!=t.d?(r=t.d,i>r&&++o):r=null!=t.e?t.e+i:i),a=ve(n,o,r,s,i),e._a[lo]=a.year,e._dayOfYear=a.dayOfYear}function _e(t){if(t._f===e.ISO_8601)return void re(t);t._a=[],d(t).empty=!0;var n,o,r,i,s,a=""+t._i,l=a.length,u=0;for(r=j(t._f,t._locale).match(Vn)||[],n=0;n0&&d(t).unusedInput.push(s),a=a.slice(a.indexOf(o)+o.length),u+=o.length),Un[i]?(o?d(t).empty=!1:d(t).unusedTokens.push(i),G(i,o,t)):t._strict&&!o&&d(t).unusedTokens.push(i);d(t).charsLeftOver=l-u,a.length>0&&d(t).unusedInput.push(a),d(t).bigHour===!0&&t._a[ho]<=12&&t._a[ho]>0&&(d(t).bigHour=void 0),t._a[ho]=Se(t._locale,t._a[ho],t._meridiem),Ce(t),ee(t)}function Se(e,t,n){var o;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?(o=e.isPM(n),o&&12>t&&(t+=12),o||12!==t||(t=0),t):t}function Ee(e){var t,n,o,r,i;if(0===e._f.length)return d(e).invalidFormat=!0,void(e._d=new Date(NaN));for(r=0;ri)&&(o=i,n=t));l(e,n||t)}function Te(e){if(!e._d){var t=k(e._i);e._a=[t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],Ce(e)}}function Oe(e){var t=new g(ee(Me(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Me(e){var t=e._i,n=e._f;return e._locale=e._locale||T(e._l),null===t||void 0===n&&""===t?f({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),m(t)?new g(ee(t)):(r(n)?Ee(e):n?_e(e):i(t)?e._d=t:ke(e),e))}function ke(t){var n=t._i;void 0===n?t._d=new Date:i(n)?t._d=new Date(+n):"string"==typeof n?ie(t):r(n)?(t._a=s(n.slice(0),function(e){return parseInt(e,10)}),Ce(t)):"object"==typeof n?Te(t):"number"==typeof n?t._d=new Date(n):e.createFromInputFallback(t)}function He(e,t,n,o,r){var i={};return"boolean"==typeof n&&(o=n,n=void 0),i._isAMomentObject=!0,i._useUTC=i._isUTC=r,i._l=n,i._i=e,i._f=t,i._strict=o,Oe(i)}function De(e,t,n,o){return He(e,t,n,o,!1)}function Ae(e,t){var n,o;if(1===t.length&&r(t[0])&&(t=t[0]),!t.length)return De();for(n=t[0],o=1;oe&&(e=-e,n="-"),n+P(~~(e/60),2)+t+P(~~e%60,2)})}function Ie(e){var t=(e||"").match(oo)||[],n=t[t.length-1]||[],o=(n+"").match(Oo)||["-",0,0],r=+(60*o[1])+w(o[2]);return"+"===o[0]?r:-r}function je(t,n){var o,r;return n._isUTC?(o=n.clone(),r=(m(t)||i(t)?+t:+De(t))-+o,o._d.setTime(+o._d+r),e.updateOffset(o,!1),o):De(t).local()}function Be(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Fe(t,n){var o,r=this._offset||0;return null!=t?("string"==typeof t&&(t=Ie(t)),Math.abs(t)<16&&(t=60*t),!this._isUTC&&n&&(o=Be(this)),this._offset=t,this._isUTC=!0,null!=o&&this.add(o,"m"),r!==t&&(!n||this._changeInProgress?ot(this,Je(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?r:Be(this)}function Ve(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function ze(e){return this.utcOffset(0,e)}function Ye(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Be(this),"m")),this}function Ue(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Ie(this._i)),this}function Ge(e){return e=e?De(e).utcOffset():0,(this.utcOffset()-e)%60===0}function $e(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ke(){if("undefined"!=typeof this._isDSTShifted)return this._isDSTShifted;var e={};if(p(e,this),e=Me(e),e._a){var t=e._isUTC?u(e._a):De(e._a);this._isDSTShifted=this.isValid()&&y(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Xe(){return!this._isUTC}function qe(){return this._isUTC}function Ze(){return this._isUTC&&0===this._offset}function Je(e,t){var n,o,r,i=e,s=null;return Le(e)?i={ms:e._milliseconds,d:e._days,M:e._months}:"number"==typeof e?(i={},t?i[t]=e:i.milliseconds=e):(s=Mo.exec(e))?(n="-"===s[1]?-1:1,i={y:0,d:w(s[co])*n,h:w(s[ho])*n,m:w(s[fo])*n,s:w(s[po])*n,ms:w(s[go])*n}):(s=ko.exec(e))?(n="-"===s[1]?-1:1,i={y:Qe(s[2],n),M:Qe(s[3],n),d:Qe(s[4],n),h:Qe(s[5],n),m:Qe(s[6],n),s:Qe(s[7],n),w:Qe(s[8],n)}):null==i?i={}:"object"==typeof i&&("from"in i||"to"in i)&&(r=tt(De(i.from),De(i.to)),i={},i.ms=r.milliseconds,i.M=r.months),o=new Ne(i),Le(e)&&a(e,"_locale")&&(o._locale=e._locale),o}function Qe(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function et(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function tt(e,t){var n;return t=je(t,e),e.isBefore(t)?n=et(e,t):(n=et(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n}function nt(e,t){return function(n,o){var r,i;return null===o||isNaN(+o)||(oe(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period)."),i=n,n=o,o=i),n="string"==typeof n?+n:n,r=Je(n,o),ot(this,r,e),this}}function ot(t,n,o,r){var i=n._milliseconds,s=n._days,a=n._months;r=null==r?!0:r,i&&t._d.setTime(+t._d+i*o),s&&A(t,"Date",D(t,"Date")+s*o),a&&Z(t,D(t,"Month")+a*o),r&&e.updateOffset(t,s||a)}function rt(e,t){var n=e||De(),o=je(n,this).startOf("day"),r=this.diff(o,"days",!0),i=-6>r?"sameElse":-1>r?"lastWeek":0>r?"lastDay":1>r?"sameDay":2>r?"nextDay":7>r?"nextWeek":"sameElse";return this.format(t&&t[i]||this.localeData().calendar(i,this,De(n)))}function it(){return new g(this)}function st(e,t){var n;return t=M("undefined"!=typeof t?t:"millisecond"),"millisecond"===t?(e=m(e)?e:De(e),+this>+e):(n=m(e)?+e:+De(e),n<+this.clone().startOf(t))}function at(e,t){var n;return t=M("undefined"!=typeof t?t:"millisecond"),"millisecond"===t?(e=m(e)?e:De(e),+e>+this):(n=m(e)?+e:+De(e),+this.clone().endOf(t)t-i?(n=e.clone().add(r-1,"months"),o=(t-i)/(i-n)):(n=e.clone().add(r+1,"months"),o=(t-i)/(n-i)),-(r+o)}function ht(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ft(){var e=this.clone().utc();return 0t;t++)if(this._weekdaysParse[t]||(n=De([2e3,1]).day(t),o="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[t]=new RegExp(o.replace(".",""),"i")),this._weekdaysParse[t].test(e))return t}function zt(e){var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=It(e,this.localeData()),this.add(e-t,"d")):t}function Yt(e){var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function Ut(e){return null==e?this.day()||7:this.day(this.day()%7?e:e-7)}function Gt(e,t){N(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function $t(e,t){return t._meridiemParse}function Kt(e){return"p"===(e+"").toLowerCase().charAt(0)}function Xt(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}function qt(e,t){t[go]=w(1e3*("0."+e))}function Zt(){return this._isUTC?"UTC":""}function Jt(){return this._isUTC?"Coordinated Universal Time":""}function Qt(e){return De(1e3*e)}function en(){return De.apply(null,arguments).parseZone()}function tn(e,t,n){var o=this._calendar[e];return"function"==typeof o?o.call(t,n):o}function nn(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])}function on(){return this._invalidDate}function rn(e){return this._ordinal.replace("%d",e)}function sn(e){return e}function an(e,t,n,o){var r=this._relativeTime[n];return"function"==typeof r?r(e,t,n,o):r.replace(/%d/i,e)}function ln(e,t){var n=this._relativeTime[e>0?"future":"past"];return"function"==typeof n?n(t):n.replace(/%s/i,t)}function un(e){var t,n;for(n in e)t=e[n],"function"==typeof t?this[n]=t:this["_"+n]=t;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function cn(e,t,n,o){var r=T(),i=u().set(o,t);return r[n](i,e)}function dn(e,t,n,o,r){if("number"==typeof e&&(t=e,e=void 0),e=e||"",null!=t)return cn(e,t,n,r);var i,s=[];for(i=0;o>i;i++)s[i]=cn(e,i,n,r);return s}function hn(e,t){return dn(e,t,"months",12,"month")}function fn(e,t){return dn(e,t,"monthsShort",12,"month")}function pn(e,t){return dn(e,t,"weekdays",7,"day")}function gn(e,t){return dn(e,t,"weekdaysShort",7,"day")}function mn(e,t){return dn(e,t,"weekdaysMin",7,"day")}function vn(){var e=this._data;return this._milliseconds=Jo(this._milliseconds),this._days=Jo(this._days),this._months=Jo(this._months),e.milliseconds=Jo(e.milliseconds),e.seconds=Jo(e.seconds),e.minutes=Jo(e.minutes),e.hours=Jo(e.hours),e.months=Jo(e.months),e.years=Jo(e.years),this}function wn(e,t,n,o){var r=Je(t,n);return e._milliseconds+=o*r._milliseconds,e._days+=o*r._days,e._months+=o*r._months,e._bubble()}function yn(e,t){return wn(this,e,t,1)}function bn(e,t){return wn(this,e,t,-1)}function Cn(e){return 0>e?Math.floor(e):Math.ceil(e)}function Rn(){var e,t,n,o,r,i=this._milliseconds,s=this._days,a=this._months,l=this._data;return i>=0&&s>=0&&a>=0||0>=i&&0>=s&&0>=a||(i+=864e5*Cn(Sn(a)+s),s=0,a=0),l.milliseconds=i%1e3,e=v(i/1e3),l.seconds=e%60,t=v(e/60),l.minutes=t%60,n=v(t/60),l.hours=n%24,s+=v(n/24),r=v(_n(s)),a+=r,s-=Cn(Sn(r)),o=v(a/12),a%=12,l.days=s,l.months=a,l.years=o,this}function _n(e){return 4800*e/146097}function Sn(e){return 146097*e/4800}function En(e){var t,n,o=this._milliseconds;if(e=M(e),"month"===e||"year"===e)return t=this._days+o/864e5,n=this._months+_n(t),"month"===e?n:n/12;switch(t=this._days+Math.round(Sn(this._months)),e){case"week":return t/7+o/6048e5;case"day":return t+o/864e5;case"hour":return 24*t+o/36e5;case"minute":return 1440*t+o/6e4;case"second":return 86400*t+o/1e3;case"millisecond":return Math.floor(864e5*t)+o;default:throw new Error("Unknown unit "+e)}}function Tn(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*w(this._months/12)}function On(e){return function(){return this.as(e)}}function Mn(e){return e=M(e),this[e+"s"]()}function kn(e){return function(){return this._data[e]}}function Hn(){return v(this.days()/7)}function Dn(e,t,n,o,r){return r.relativeTime(t||1,!!n,e,o)}function An(e,t,n){var o=Je(e).abs(),r=pr(o.as("s")),i=pr(o.as("m")),s=pr(o.as("h")),a=pr(o.as("d")),l=pr(o.as("M")),u=pr(o.as("y")),c=r0,c[4]=n,Dn.apply(null,c)}function xn(e,t){return void 0===gr[e]?!1:void 0===t?gr[e]:(gr[e]=t,!0)}function Pn(e){var t=this.localeData(),n=An(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)}function Nn(){var e,t,n,o=mr(this._milliseconds)/1e3,r=mr(this._days),i=mr(this._months);e=v(o/60),t=v(e/60),o%=60,e%=60,n=v(i/12),i%=12;var s=n,a=i,l=r,u=t,c=e,d=o,h=this.asSeconds();return h?(0>h?"-":"")+"P"+(s?s+"Y":"")+(a?a+"M":"")+(l?l+"D":"")+(u||c||d?"T":"")+(u?u+"H":"")+(c?c+"M":"")+(d?d+"S":""):"P0D"}var Ln,Wn,In=e.momentProperties=[],jn=!1,Bn={},Fn={},Vn=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,zn=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Yn={},Un={},Gn=/\d/,$n=/\d\d/,Kn=/\d{3}/,Xn=/\d{4}/,qn=/[+-]?\d{6}/,Zn=/\d\d?/,Jn=/\d{1,3}/,Qn=/\d{1,4}/,eo=/[+-]?\d{1,6}/,to=/\d+/,no=/[+-]?\d+/,oo=/Z|[+-]\d\d:?\d\d/gi,ro=/[+-]?\d+(\.\d{1,3})?/,io=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,so={},ao={},lo=0,uo=1,co=2,ho=3,fo=4,po=5,go=6;N("M",["MM",2],"Mo",function(){return this.month()+1}),N("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),N("MMMM",0,0,function(e){return this.localeData().months(this,e)}),O("month","M"),F("M",Zn),F("MM",Zn,$n),F("MMM",io),F("MMMM",io),Y(["M","MM"],function(e,t){t[uo]=w(e)-1}),Y(["MMM","MMMM"],function(e,t,n,o){var r=n._locale.monthsParse(e,o,n._strict);null!=r?t[uo]=r:d(n).invalidMonth=e});var mo="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),vo="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),wo={};e.suppressDeprecationWarnings=!1;var yo=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,bo=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],Co=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],Ro=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=ne("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),N(0,["YY",2],0,function(){return this.year()%100}),N(0,["YYYY",4],0,"year"),N(0,["YYYYY",5],0,"year"),N(0,["YYYYYY",6,!0],0,"year"),O("year","y"),F("Y",no),F("YY",Zn,$n),F("YYYY",Qn,Xn),F("YYYYY",eo,qn),F("YYYYYY",eo,qn),Y(["YYYYY","YYYYYY"],lo),Y("YYYY",function(t,n){n[lo]=2===t.length?e.parseTwoDigitYear(t):w(t)}),Y("YY",function(t,n){n[lo]=e.parseTwoDigitYear(t)}),e.parseTwoDigitYear=function(e){return w(e)+(w(e)>68?1900:2e3)};var _o=H("FullYear",!1);N("w",["ww",2],"wo","week"),N("W",["WW",2],"Wo","isoWeek"),O("week","w"),O("isoWeek","W"),F("w",Zn),F("ww",Zn,$n),F("W",Zn),F("WW",Zn,$n),U(["w","ww","W","WW"],function(e,t,n,o){t[o.substr(0,1)]=w(e)});var So={dow:0,doy:6};N("DDD",["DDDD",3],"DDDo","dayOfYear"),O("dayOfYear","DDD"),F("DDD",Jn),F("DDDD",Kn),Y(["DDD","DDDD"],function(e,t,n){n._dayOfYear=w(e)}),e.ISO_8601=function(){};var Eo=ne("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var e=De.apply(null,arguments);return this>e?this:e}),To=ne("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var e=De.apply(null,arguments);return e>this?this:e});We("Z",":"),We("ZZ",""),F("Z",oo),F("ZZ",oo),Y(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Ie(e)});var Oo=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var Mo=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,ko=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Je.fn=Ne.prototype;var Ho=nt(1,"add"),Do=nt(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Ao=ne("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});N(0,["gg",2],0,function(){return this.weekYear()%100}),N(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Dt("gggg","weekYear"),Dt("ggggg","weekYear"),Dt("GGGG","isoWeekYear"),Dt("GGGGG","isoWeekYear"),O("weekYear","gg"),O("isoWeekYear","GG"),F("G",no),F("g",no),F("GG",Zn,$n),F("gg",Zn,$n),F("GGGG",Qn,Xn),F("gggg",Qn,Xn),F("GGGGG",eo,qn),F("ggggg",eo,qn),U(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,o){t[o.substr(0,2)]=w(e)}),U(["gg","GG"],function(t,n,o,r){n[r]=e.parseTwoDigitYear(t)}),N("Q",0,0,"quarter"),O("quarter","Q"),F("Q",Gn),Y("Q",function(e,t){t[uo]=3*(w(e)-1)}),N("D",["DD",2],"Do","date"),O("date","D"),F("D",Zn),F("DD",Zn,$n),F("Do",function(e,t){return e?t._ordinalParse:t._ordinalParseLenient}),Y(["D","DD"],co),Y("Do",function(e,t){t[co]=w(e.match(Zn)[0],10)});var xo=H("Date",!0);N("d",0,"do","day"),N("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),N("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),N("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),N("e",0,0,"weekday"),N("E",0,0,"isoWeekday"),O("day","d"),O("weekday","e"),O("isoWeekday","E"),F("d",Zn),F("e",Zn),F("E",Zn),F("dd",io),F("ddd",io),F("dddd",io),U(["dd","ddd","dddd"],function(e,t,n){var o=n._locale.weekdaysParse(e);null!=o?t.d=o:d(n).invalidWeekday=e}),U(["d","e","E"],function(e,t,n,o){t[o]=w(e)});var Po="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),No="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Lo="Su_Mo_Tu_We_Th_Fr_Sa".split("_");N("H",["HH",2],0,"hour"),N("h",["hh",2],0,function(){return this.hours()%12||12}),Gt("a",!0),Gt("A",!1),O("hour","h"),F("a",$t),F("A",$t),F("H",Zn),F("h",Zn),F("HH",Zn,$n),F("hh",Zn,$n),Y(["H","HH"],ho),Y(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),Y(["h","hh"],function(e,t,n){t[ho]=w(e),d(n).bigHour=!0});var Wo=/[ap]\.?m?\.?/i,Io=H("Hours",!0);N("m",["mm",2],0,"minute"),O("minute","m"),F("m",Zn),F("mm",Zn,$n),Y(["m","mm"],fo);var jo=H("Minutes",!1);N("s",["ss",2],0,"second"),O("second","s"),F("s",Zn),F("ss",Zn,$n),Y(["s","ss"],po);var Bo=H("Seconds",!1);N("S",0,0,function(){return~~(this.millisecond()/100)}),N(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),N(0,["SSS",3],0,"millisecond"),N(0,["SSSS",4],0,function(){return 10*this.millisecond()}),N(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),N(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),N(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),N(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),N(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),O("millisecond","ms"),F("S",Jn,Gn),F("SS",Jn,$n),F("SSS",Jn,Kn);var Fo;for(Fo="SSSS";Fo.length<=9;Fo+="S")F(Fo,to);for(Fo="S";Fo.length<=9;Fo+="S")Y(Fo,qt);var Vo=H("Milliseconds",!1);N("z",0,0,"zoneAbbr"),N("zz",0,0,"zoneName");var zo=g.prototype;zo.add=Ho,zo.calendar=rt,zo.clone=it,zo.diff=ct,zo.endOf=Rt,zo.format=pt,zo.from=gt,zo.fromNow=mt,zo.to=vt,zo.toNow=wt,zo.get=x,zo.invalidAt=Ht,zo.isAfter=st,zo.isBefore=at,zo.isBetween=lt,zo.isSame=ut,zo.isValid=Mt,zo.lang=Ao,zo.locale=yt,zo.localeData=bt,zo.max=To,zo.min=Eo,zo.parsingFlags=kt,zo.set=x,zo.startOf=Ct,zo.subtract=Do,zo.toArray=Tt,zo.toObject=Ot,zo.toDate=Et,zo.toISOString=ft,zo.toJSON=ft,zo.toString=ht,zo.unix=St,zo.valueOf=_t,zo.year=_o,zo.isLeapYear=ce,zo.weekYear=xt,zo.isoWeekYear=Pt,zo.quarter=zo.quarters=Wt,zo.month=J,zo.daysInMonth=Q,zo.week=zo.weeks=ge,zo.isoWeek=zo.isoWeeks=me,zo.weeksInYear=Lt,zo.isoWeeksInYear=Nt,zo.date=xo,zo.day=zo.days=zt,zo.weekday=Yt,zo.isoWeekday=Ut,zo.dayOfYear=we,zo.hour=zo.hours=Io,zo.minute=zo.minutes=jo,zo.second=zo.seconds=Bo,zo.millisecond=zo.milliseconds=Vo,zo.utcOffset=Fe, -zo.utc=ze,zo.local=Ye,zo.parseZone=Ue,zo.hasAlignedHourOffset=Ge,zo.isDST=$e,zo.isDSTShifted=Ke,zo.isLocal=Xe,zo.isUtcOffset=qe,zo.isUtc=Ze,zo.isUTC=Ze,zo.zoneAbbr=Zt,zo.zoneName=Jt,zo.dates=ne("dates accessor is deprecated. Use date instead.",xo),zo.months=ne("months accessor is deprecated. Use month instead",J),zo.years=ne("years accessor is deprecated. Use year instead",_o),zo.zone=ne("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Ve);var Yo=zo,Uo={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Go={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},$o="Invalid date",Ko="%d",Xo=/\d{1,2}/,qo={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Zo=b.prototype;Zo._calendar=Uo,Zo.calendar=tn,Zo._longDateFormat=Go,Zo.longDateFormat=nn,Zo._invalidDate=$o,Zo.invalidDate=on,Zo._ordinal=Ko,Zo.ordinal=rn,Zo._ordinalParse=Xo,Zo.preparse=sn,Zo.postformat=sn,Zo._relativeTime=qo,Zo.relativeTime=an,Zo.pastFuture=ln,Zo.set=un,Zo.months=K,Zo._months=mo,Zo.monthsShort=X,Zo._monthsShort=vo,Zo.monthsParse=q,Zo.week=he,Zo._week=So,Zo.firstDayOfYear=pe,Zo.firstDayOfWeek=fe,Zo.weekdays=jt,Zo._weekdays=Po,Zo.weekdaysMin=Ft,Zo._weekdaysMin=Lo,Zo.weekdaysShort=Bt,Zo._weekdaysShort=No,Zo.weekdaysParse=Vt,Zo.isPM=Kt,Zo._meridiemParse=Wo,Zo.meridiem=Xt,S("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=1===w(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}}),e.lang=ne("moment.lang is deprecated. Use moment.locale instead.",S),e.langData=ne("moment.langData is deprecated. Use moment.localeData instead.",T);var Jo=Math.abs,Qo=On("ms"),er=On("s"),tr=On("m"),nr=On("h"),or=On("d"),rr=On("w"),ir=On("M"),sr=On("y"),ar=kn("milliseconds"),lr=kn("seconds"),ur=kn("minutes"),cr=kn("hours"),dr=kn("days"),hr=kn("months"),fr=kn("years"),pr=Math.round,gr={s:45,m:45,h:22,d:26,M:11},mr=Math.abs,vr=Ne.prototype;vr.abs=vn,vr.add=yn,vr.subtract=bn,vr.as=En,vr.asMilliseconds=Qo,vr.asSeconds=er,vr.asMinutes=tr,vr.asHours=nr,vr.asDays=or,vr.asWeeks=rr,vr.asMonths=ir,vr.asYears=sr,vr.valueOf=Tn,vr._bubble=Rn,vr.get=Mn,vr.milliseconds=ar,vr.seconds=lr,vr.minutes=ur,vr.hours=cr,vr.days=dr,vr.weeks=Hn,vr.months=hr,vr.years=fr,vr.humanize=Pn,vr.toISOString=Nn,vr.toString=Nn,vr.toJSON=Nn,vr.locale=yt,vr.localeData=bt,vr.toIsoString=ne("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Nn),vr.lang=Ao,N("X",0,0,"unix"),N("x",0,0,"valueOf"),F("x",no),F("X",ro),Y("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),Y("x",function(e,t,n){n._d=new Date(w(e))}),e.version="2.10.6",o(De),e.fn=Yo,e.min=xe,e.max=Pe,e.utc=u,e.unix=Qt,e.months=hn,e.isDate=i,e.locale=S,e.invalid=f,e.duration=Je,e.isMoment=m,e.weekdays=pn,e.parseZone=en,e.localeData=T,e.isDuration=Le,e.monthsShort=fn,e.weekdaysMin=mn,e.defineLocale=E,e.weekdaysShort=gn,e.normalizeUnits=M,e.relativeTimeThreshold=xn;var wr=e;return wr})},{}],numeral:[function(t,n,o){"use strict";(function(){function t(e){this._value=e}function o(e,t,n,o){var r,i,s=Math.pow(10,t);return i=(n(e*s)/s).toFixed(t),o&&(r=new RegExp("0{1,"+o+"}$"),i=i.replace(r,"")),i}function r(e,t,n){var o;return o=t.indexOf("$")>-1?s(e,t,n):t.indexOf("%")>-1?a(e,t,n):t.indexOf(":")>-1?l(e,t):c(e._value,t,n)}function i(e,t){var n,o,r,i,s,a=t,l=["KB","MB","GB","TB","PB","EB","ZB","YB"],c=!1;if(t.indexOf(":")>-1)e._value=u(t);else if(t===w)e._value=0;else{for("."!==m[v].delimiters.decimal&&(t=t.replace(/\./g,"").replace(m[v].delimiters.decimal,".")),n=new RegExp("[^a-zA-Z]"+m[v].abbreviations.thousand+"(?:\\)|(\\"+m[v].currency.symbol+")?(?:\\))?)?$"),o=new RegExp("[^a-zA-Z]"+m[v].abbreviations.million+"(?:\\)|(\\"+m[v].currency.symbol+")?(?:\\))?)?$"),r=new RegExp("[^a-zA-Z]"+m[v].abbreviations.billion+"(?:\\)|(\\"+m[v].currency.symbol+")?(?:\\))?)?$"),i=new RegExp("[^a-zA-Z]"+m[v].abbreviations.trillion+"(?:\\)|(\\"+m[v].currency.symbol+")?(?:\\))?)?$"),s=0;s<=l.length&&!(c=t.indexOf(l[s])>-1?Math.pow(1024,s+1):!1);s++);e._value=(c?c:1)*(a.match(n)?Math.pow(10,3):1)*(a.match(o)?Math.pow(10,6):1)*(a.match(r)?Math.pow(10,9):1)*(a.match(i)?Math.pow(10,12):1)*(t.indexOf("%")>-1?.01:1)*((t.split("-").length+Math.min(t.split("(").length-1,t.split(")").length-1))%2?1:-1)*Number(t.replace(/[^0-9\.]+/g,"")),e._value=c?Math.ceil(e._value):e._value}return e._value}function s(e,t,n){var o,r,i=t.indexOf("$"),s=t.indexOf("("),a=t.indexOf("-"),l="";return t.indexOf(" $")>-1?(l=" ",t=t.replace(" $","")):t.indexOf("$ ")>-1?(l=" ",t=t.replace("$ ","")):t=t.replace("$",""),r=c(e._value,t,n),1>=i?r.indexOf("(")>-1||r.indexOf("-")>-1?(r=r.split(""),o=1,(s>i||a>i)&&(o=0),r.splice(o,0,m[v].currency.symbol+l),r=r.join("")):r=m[v].currency.symbol+l+r:r.indexOf(")")>-1?(r=r.split(""),r.splice(-1,0,l+m[v].currency.symbol),r=r.join("")):r=r+l+m[v].currency.symbol,r}function a(e,t,n){var o,r="",i=100*e._value;return t.indexOf(" %")>-1?(r=" ",t=t.replace(" %","")):t=t.replace("%",""),o=c(i,t,n),o.indexOf(")")>-1?(o=o.split(""),o.splice(-1,0,r+"%"),o=o.join("")):o=o+r+"%",o}function l(e){var t=Math.floor(e._value/60/60),n=Math.floor((e._value-60*t*60)/60),o=Math.round(e._value-60*t*60-60*n);return t+":"+(10>n?"0"+n:n)+":"+(10>o?"0"+o:o)}function u(e){var t=e.split(":"),n=0;return 3===t.length?(n+=60*Number(t[0])*60,n+=60*Number(t[1]),n+=Number(t[2])):2===t.length&&(n+=60*Number(t[0]),n+=Number(t[1])),Number(n)}function c(e,t,n){var r,i,s,a,l,u,c=!1,d=!1,h=!1,f="",p=!1,g=!1,y=!1,b=!1,C=!1,R="",_="",S=Math.abs(e),E=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],T="",O=!1;if(0===e&&null!==w)return w;if(t.indexOf("(")>-1?(c=!0,t=t.slice(1,-1)):t.indexOf("+")>-1&&(d=!0,t=t.replace(/\+/g,"")),t.indexOf("a")>-1&&(p=t.indexOf("aK")>=0,g=t.indexOf("aM")>=0,y=t.indexOf("aB")>=0,b=t.indexOf("aT")>=0,C=p||g||y||b,t.indexOf(" a")>-1?(f=" ",t=t.replace(" a","")):t=t.replace("a",""),S>=Math.pow(10,12)&&!C||b?(f+=m[v].abbreviations.trillion,e/=Math.pow(10,12)):S=Math.pow(10,9)&&!C||y?(f+=m[v].abbreviations.billion,e/=Math.pow(10,9)):S=Math.pow(10,6)&&!C||g?(f+=m[v].abbreviations.million,e/=Math.pow(10,6)):(S=Math.pow(10,3)&&!C||p)&&(f+=m[v].abbreviations.thousand,e/=Math.pow(10,3))),t.indexOf("b")>-1)for(t.indexOf(" b")>-1?(R=" ",t=t.replace(" b","")):t=t.replace("b",""),s=0;s<=E.length;s++)if(r=Math.pow(1024,s),i=Math.pow(1024,s+1),e>=r&&i>e){R+=E[s],r>0&&(e/=r);break}return t.indexOf("o")>-1&&(t.indexOf(" o")>-1?(_=" ",t=t.replace(" o","")):t=t.replace("o",""),_+=m[v].ordinal(e)),t.indexOf("[.]")>-1&&(h=!0,t=t.replace("[.]",".")),a=e.toString().split(".")[0],l=t.split(".")[1],u=t.indexOf(","),l?(l.indexOf("[")>-1?(l=l.replace("]",""),l=l.split("["),T=o(e,l[0].length+l[1].length,n,l[1].length)):T=o(e,l.length,n),a=T.split(".")[0],T=T.split(".")[1].length?m[v].delimiters.decimal+T.split(".")[1]:"",h&&0===Number(T.slice(1))&&(T="")):a=o(e,null,n),a.indexOf("-")>-1&&(a=a.slice(1),O=!0),u>-1&&(a=a.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+m[v].delimiters.thousands)),0===t.indexOf(".")&&(a=""),(c&&O?"(":"")+(!c&&O?"-":"")+(!O&&d?"+":"")+a+T+(_?_:"")+(f?f:"")+(R?R:"")+(c&&O?")":"")}function d(e,t){m[e]=t}function h(e){var t=e.toString().split(".");return t.length<2?1:Math.pow(10,t[1].length)}function f(){var e=Array.prototype.slice.call(arguments);return e.reduce(function(e,t){var n=h(e),o=h(t);return n>o?n:o},-(1/0))}var p,g="1.5.3",m={},v="en",w=null,y="0,0",b="undefined"!=typeof n&&n.exports;p=function(e){return p.isNumeral(e)?e=e.value():0===e||"undefined"==typeof e?e=0:Number(e)||(e=p.fn.unformat(e)),new t(Number(e))},p.version=g,p.isNumeral=function(e){return e instanceof t},p.language=function(e,t){if(!e)return v;if(e&&!t){if(!m[e])throw new Error("Unknown language : "+e);v=e}return(t||!m[e])&&d(e,t),p},p.languageData=function(e){if(!e)return m[v];if(!m[e])throw new Error("Unknown language : "+e);return m[e]},p.language("en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var t=e%10;return 1===~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$"}}),p.zeroFormat=function(e){w="string"==typeof e?e:null},p.defaultFormat=function(e){y="string"==typeof e?e:"0.0"},p.validate=function(e,t){var n,o,r,i,s,a,l,u;if("string"!=typeof e&&(e+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",e)),e=e.trim(),""===e)return!1;e=e.replace(/^[+-]?/,"");try{l=p.languageData(t)}catch(c){l=p.languageData(p.language())}return r=l.currency.symbol,s=l.abbreviations,n=l.delimiters.decimal,o="."===l.delimiters.thousands?"\\.":l.delimiters.thousands,u=e.match(/^[^\d\.\,]+/),null!==u&&(e=e.substr(1),u[0]!==r)?!1:(u=e.match(/[^\d]+$/),null!==u&&(e=e.slice(0,-1),u[0]!==s.thousand&&u[0]!==s.million&&u[0]!==s.billion&&u[0]!==s.trillion)?!1:e.match(/^\d+$/)?!0:(a=new RegExp(o+"{2}"),e.match(/[^\d.,]/g)?!1:(i=e.split(n),i.length>2?!1:i.length<2?!!i[0].match(/^\d+.*\d$/)&&!i[0].match(a):""===i[0]?!i[0].match(a)&&!!i[1].match(/^\d+$/):1===i[0].length?!!i[0].match(/^\d+$/)&&!i[0].match(a)&&!!i[1].match(/^\d+$/):!!i[0].match(/^\d+.*\d$/)&&!i[0].match(a)&&!!i[1].match(/^\d+$/))))},"function"!=typeof Array.prototype.reduce&&(Array.prototype.reduce=function(e,t){if(null===this||"undefined"==typeof this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof e)throw new TypeError(e+" is not a function");var n,o,r=this.length>>>0,i=!1;for(1n;++n)this.hasOwnProperty(n)&&(i?o=e(o,this[n],n,this):(o=this[n],i=!0));if(!i)throw new TypeError("Reduce of empty array with no initial value");return o}),p.fn=t.prototype={clone:function(){return p(this)},format:function(e,t){return r(this,e?e:y,void 0!==t?t:Math.round)},unformat:function(e){return"[object Number]"===Object.prototype.toString.call(e)?e:i(this,e?e:y)},value:function(){return this._value},valueOf:function(){return this._value},set:function(e){return this._value=Number(e),this},add:function(e){function t(e,t,o,r){return e+n*t}var n=f.call(null,this._value,e);return this._value=[this._value,e].reduce(t,0)/n,this},subtract:function(e){function t(e,t,o,r){return e-n*t}var n=f.call(null,this._value,e);return this._value=[e].reduce(t,this._value*n)/n,this},multiply:function(e){function t(e,t,n,o){var r=f(e,t);return e*r*(t*r)/(r*r)}return this._value=[this._value,e].reduce(t,1),this},divide:function(e){function t(e,t,n,o){var r=f(e,t);return e*r/(t*r)}return this._value=[this._value,e].reduce(t),this},difference:function(e){return Math.abs(p(this._value).subtract(e).value())}},b&&(n.exports=p),"undefined"==typeof ender&&(this.numeral=p),"function"==typeof e&&e.amd&&e([],function(){return p})}).call(window)},{}],pikaday:[function(t,n,o){/*! +!function(t,r){"object"==typeof o&&"undefined"!=typeof n?n.exports=r():"function"==typeof e&&e.amd?e(r):t.moment=r()}(this,function(){"use strict";function e(){return Ln.apply(null,arguments)}function o(e){Ln=e}function r(e){return"[object Array]"===Object.prototype.toString.call(e)}function i(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function s(e,t){var n,o=[];for(n=0;n0)for(n in In)o=In[n],r=t[o],"undefined"!=typeof r&&(e[o]=r);return e}function g(t){p(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),jn===!1&&(jn=!0,e.updateOffset(this),jn=!1)}function m(e){return e instanceof g||null!=e&&null!=e._isAMomentObject}function w(e){return 0>e?Math.ceil(e):Math.floor(e)}function v(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=w(t)),n}function y(e,t,n){var o,r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),s=0;for(o=0;r>o;o++)(n&&e[o]!==t[o]||!n&&v(e[o])!==v(t[o]))&&s++;return s+i}function b(){}function C(e){return e?e.toLowerCase().replace("_","-"):e}function R(e){for(var t,n,o,r,i=0;i0;){if(o=_(r.slice(0,t).join("-")))return o;if(n&&n.length>=t&&y(r,n,!0)>=t-1)break;t--}i++}return null}function _(e){var o=null;if(!Bn[e]&&"undefined"!=typeof n&&n&&n.exports)try{o=Wn._abbr,t("./locale/"+e),S(o)}catch(r){}return Bn[e]}function S(e,t){var n;return e&&(n="undefined"==typeof t?T(e):E(e,t),n&&(Wn=n)),Wn._abbr}function E(e,t){return null!==t?(t.abbr=e,Bn[e]=Bn[e]||new b,Bn[e].set(t),S(e),Bn[e]):(delete Bn[e],null)}function T(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Wn;if(!r(e)){if(t=_(e))return t;e=[e]}return R(e)}function O(e,t){var n=e.toLowerCase();Vn[n]=Vn[n+"s"]=Vn[t]=e}function M(e){return"string"==typeof e?Vn[e]||Vn[e.toLowerCase()]:void 0}function k(e){var t,n,o={};for(n in e)a(e,n)&&(t=M(n),t&&(o[t]=e[n]));return o}function H(t,n){return function(o){return null!=o?(x(this,t,o),e.updateOffset(this,n),this):D(this,t)}}function D(e,t){return e._d["get"+(e._isUTC?"UTC":"")+t]()}function x(e,t,n){return e._d["set"+(e._isUTC?"UTC":"")+t](n)}function A(e,t){var n;if("object"==typeof e)for(n in e)this.set(n,e[n]);else if(e=M(e),"function"==typeof this[e])return this[e](t);return this}function P(e,t,n){var o=""+Math.abs(e),r=t-o.length,i=e>=0;return(i?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+o}function N(e,t,n,o){var r=o;"string"==typeof o&&(r=function(){return this[o]()}),e&&(Un[e]=r),t&&(Un[t[0]]=function(){return P(r.apply(this,arguments),t[1],t[2])}),n&&(Un[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),e)})}function L(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function W(e){var t,n,o=e.match(Fn);for(t=0,n=o.length;n>t;t++)Un[o[t]]?o[t]=Un[o[t]]:o[t]=L(o[t]);return function(r){var i="";for(t=0;n>t;t++)i+=o[t]instanceof Function?o[t].call(r,e):o[t];return i}}function I(e,t){return e.isValid()?(t=j(t,e.localeData()),Yn[t]=Yn[t]||W(t),Yn[t](e)):e.localeData().invalidDate()}function j(e,t){function n(e){return t.longDateFormat(e)||e}var o=5;for(zn.lastIndex=0;o>=0&&zn.test(e);)e=e.replace(zn,n),zn.lastIndex=0,o-=1;return e}function B(e){return"function"==typeof e&&"[object Function]"===Object.prototype.toString.call(e)}function V(e,t,n){so[e]=B(t)?t:function(e){return e&&n?n:t}}function F(e,t){return a(so,e)?so[e](t._strict,t._locale):new RegExp(z(e))}function z(e){return e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,o,r){return t||n||o||r}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Y(e,t){var n,o=t;for("string"==typeof e&&(e=[e]),"number"==typeof t&&(o=function(e,n){n[t]=v(e)}),n=0;no;o++){if(r=u([2e3,o]),n&&!this._longMonthsParse[o]&&(this._longMonthsParse[o]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[o]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),n||this._monthsParse[o]||(i="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[o]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[o].test(e))return o;if(n&&"MMM"===t&&this._shortMonthsParse[o].test(e))return o;if(!n&&this._monthsParse[o].test(e))return o}}function Z(e,t){var n;return"string"==typeof t&&(t=e.localeData().monthsParse(t),"number"!=typeof t)?e:(n=Math.min(e.date(),$(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e)}function J(t){return null!=t?(Z(this,t),e.updateOffset(this,!0),this):D(this,"Month")}function Q(){return $(this.year(),this.month())}function ee(e){var t,n=e._a;return n&&-2===d(e).overflow&&(t=n[uo]<0||n[uo]>11?uo:n[co]<1||n[co]>$(n[lo],n[uo])?co:n[ho]<0||n[ho]>24||24===n[ho]&&(0!==n[fo]||0!==n[po]||0!==n[go])?ho:n[fo]<0||n[fo]>59?fo:n[po]<0||n[po]>59?po:n[go]<0||n[go]>999?go:-1,d(e)._overflowDayOfYear&&(lo>t||t>co)&&(t=co),d(e).overflow=t),e}function te(t){e.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function ne(e,t){var n=!0;return l(function(){return n&&(te(e+"\n"+(new Error).stack),n=!1),t.apply(this,arguments)},t)}function oe(e,t){vo[e]||(te(t),vo[e]=!0)}function re(e){var t,n,o=e._i,r=yo.exec(o);if(r){for(d(e).iso=!0,t=0,n=bo.length;n>t;t++)if(bo[t][1].exec(o)){e._f=bo[t][0];break}for(t=0,n=Co.length;n>t;t++)if(Co[t][1].exec(o)){e._f+=(r[6]||" ")+Co[t][0];break}o.match(oo)&&(e._f+="Z"),_e(e)}else e._isValid=!1}function ie(t){var n=Ro.exec(t._i);return null!==n?void(t._d=new Date(+n[1])):(re(t),void(t._isValid===!1&&(delete t._isValid,e.createFromInputFallback(t))))}function se(e,t,n,o,r,i,s){var a=new Date(e,t,n,o,r,i,s);return 1970>e&&a.setFullYear(e),a}function ae(e){var t=new Date(Date.UTC.apply(null,arguments));return 1970>e&&t.setUTCFullYear(e),t}function le(e){return ue(e)?366:365}function ue(e){return e%4===0&&e%100!==0||e%400===0}function ce(){return ue(this.year())}function de(e,t,n){var o,r=n-t,i=n-e.day();return i>r&&(i-=7),r-7>i&&(i+=7),o=De(e).add(i,"d"),{week:Math.ceil(o.dayOfYear()/7),year:o.year()}}function he(e){return de(e,this._week.dow,this._week.doy).week}function fe(){return this._week.dow}function pe(){return this._week.doy}function ge(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function me(e){var t=de(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function we(e,t,n,o,r){var i,s=6+r-o,a=ae(e,0,1+s),l=a.getUTCDay();return r>l&&(l+=7),n=null!=n?1*n:r,i=1+s+7*(t-1)-l+n,{year:i>0?e:e-1,dayOfYear:i>0?i:le(e-1)+i}}function ve(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}function ye(e,t,n){return null!=e?e:null!=t?t:n}function be(e){var t=new Date;return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Ce(e){var t,n,o,r,i=[];if(!e._d){for(o=be(e),e._w&&null==e._a[co]&&null==e._a[uo]&&Re(e),e._dayOfYear&&(r=ye(e._a[lo],o[lo]),e._dayOfYear>le(r)&&(d(e)._overflowDayOfYear=!0),n=ae(r,0,e._dayOfYear),e._a[uo]=n.getUTCMonth(),e._a[co]=n.getUTCDate()),t=0;3>t&&null==e._a[t];++t)e._a[t]=i[t]=o[t];for(;7>t;t++)e._a[t]=i[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ho]&&0===e._a[fo]&&0===e._a[po]&&0===e._a[go]&&(e._nextDay=!0,e._a[ho]=0),e._d=(e._useUTC?ae:se).apply(null,i),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ho]=24)}}function Re(e){var t,n,o,r,i,s,a;t=e._w,null!=t.GG||null!=t.W||null!=t.E?(i=1,s=4,n=ye(t.GG,e._a[lo],de(De(),1,4).year),o=ye(t.W,1),r=ye(t.E,1)):(i=e._locale._week.dow,s=e._locale._week.doy,n=ye(t.gg,e._a[lo],de(De(),i,s).year),o=ye(t.w,1),null!=t.d?(r=t.d,i>r&&++o):r=null!=t.e?t.e+i:i),a=we(n,o,r,s,i),e._a[lo]=a.year,e._dayOfYear=a.dayOfYear}function _e(t){if(t._f===e.ISO_8601)return void re(t);t._a=[],d(t).empty=!0;var n,o,r,i,s,a=""+t._i,l=a.length,u=0;for(r=j(t._f,t._locale).match(Fn)||[],n=0;n0&&d(t).unusedInput.push(s),a=a.slice(a.indexOf(o)+o.length),u+=o.length),Un[i]?(o?d(t).empty=!1:d(t).unusedTokens.push(i),G(i,o,t)):t._strict&&!o&&d(t).unusedTokens.push(i);d(t).charsLeftOver=l-u,a.length>0&&d(t).unusedInput.push(a),d(t).bigHour===!0&&t._a[ho]<=12&&t._a[ho]>0&&(d(t).bigHour=void 0),t._a[ho]=Se(t._locale,t._a[ho],t._meridiem),Ce(t),ee(t)}function Se(e,t,n){var o;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?(o=e.isPM(n),o&&12>t&&(t+=12),o||12!==t||(t=0),t):t}function Ee(e){var t,n,o,r,i;if(0===e._f.length)return d(e).invalidFormat=!0,void(e._d=new Date(NaN));for(r=0;ri)&&(o=i,n=t));l(e,n||t)}function Te(e){if(!e._d){var t=k(e._i);e._a=[t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],Ce(e)}}function Oe(e){var t=new g(ee(Me(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Me(e){var t=e._i,n=e._f;return e._locale=e._locale||T(e._l),null===t||void 0===n&&""===t?f({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),m(t)?new g(ee(t)):(r(n)?Ee(e):n?_e(e):i(t)?e._d=t:ke(e),e))}function ke(t){var n=t._i;void 0===n?t._d=new Date:i(n)?t._d=new Date(+n):"string"==typeof n?ie(t):r(n)?(t._a=s(n.slice(0),function(e){return parseInt(e,10)}),Ce(t)):"object"==typeof n?Te(t):"number"==typeof n?t._d=new Date(n):e.createFromInputFallback(t)}function He(e,t,n,o,r){var i={};return"boolean"==typeof n&&(o=n,n=void 0),i._isAMomentObject=!0,i._useUTC=i._isUTC=r,i._l=n,i._i=e,i._f=t,i._strict=o,Oe(i)}function De(e,t,n,o){return He(e,t,n,o,!1)}function xe(e,t){var n,o;if(1===t.length&&r(t[0])&&(t=t[0]),!t.length)return De();for(n=t[0],o=1;oe&&(e=-e,n="-"),n+P(~~(e/60),2)+t+P(~~e%60,2)})}function Ie(e){var t=(e||"").match(oo)||[],n=t[t.length-1]||[],o=(n+"").match(Oo)||["-",0,0],r=+(60*o[1])+v(o[2]);return"+"===o[0]?r:-r}function je(t,n){var o,r;return n._isUTC?(o=n.clone(),r=(m(t)||i(t)?+t:+De(t))-+o,o._d.setTime(+o._d+r),e.updateOffset(o,!1),o):De(t).local()}function Be(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Ve(t,n){var o,r=this._offset||0;return null!=t?("string"==typeof t&&(t=Ie(t)),Math.abs(t)<16&&(t=60*t),!this._isUTC&&n&&(o=Be(this)),this._offset=t,this._isUTC=!0,null!=o&&this.add(o,"m"),r!==t&&(!n||this._changeInProgress?ot(this,Je(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?r:Be(this)}function Fe(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function ze(e){return this.utcOffset(0,e)}function Ye(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Be(this),"m")),this}function Ue(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Ie(this._i)),this}function Ge(e){return e=e?De(e).utcOffset():0,(this.utcOffset()-e)%60===0}function $e(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ke(){if("undefined"!=typeof this._isDSTShifted)return this._isDSTShifted;var e={};if(p(e,this),e=Me(e),e._a){var t=e._isUTC?u(e._a):De(e._a);this._isDSTShifted=this.isValid()&&y(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Xe(){return!this._isUTC}function qe(){return this._isUTC}function Ze(){return this._isUTC&&0===this._offset}function Je(e,t){var n,o,r,i=e,s=null;return Le(e)?i={ms:e._milliseconds,d:e._days,M:e._months}:"number"==typeof e?(i={},t?i[t]=e:i.milliseconds=e):(s=Mo.exec(e))?(n="-"===s[1]?-1:1,i={y:0,d:v(s[co])*n,h:v(s[ho])*n,m:v(s[fo])*n,s:v(s[po])*n,ms:v(s[go])*n}):(s=ko.exec(e))?(n="-"===s[1]?-1:1,i={y:Qe(s[2],n),M:Qe(s[3],n),d:Qe(s[4],n),h:Qe(s[5],n),m:Qe(s[6],n),s:Qe(s[7],n),w:Qe(s[8],n)}):null==i?i={}:"object"==typeof i&&("from"in i||"to"in i)&&(r=tt(De(i.from),De(i.to)),i={},i.ms=r.milliseconds,i.M=r.months),o=new Ne(i),Le(e)&&a(e,"_locale")&&(o._locale=e._locale),o}function Qe(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function et(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function tt(e,t){var n;return t=je(t,e),e.isBefore(t)?n=et(e,t):(n=et(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n}function nt(e,t){return function(n,o){var r,i;return null===o||isNaN(+o)||(oe(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period)."),i=n,n=o,o=i),n="string"==typeof n?+n:n,r=Je(n,o),ot(this,r,e),this}}function ot(t,n,o,r){var i=n._milliseconds,s=n._days,a=n._months;r=null==r?!0:r,i&&t._d.setTime(+t._d+i*o),s&&x(t,"Date",D(t,"Date")+s*o),a&&Z(t,D(t,"Month")+a*o),r&&e.updateOffset(t,s||a)}function rt(e,t){var n=e||De(),o=je(n,this).startOf("day"),r=this.diff(o,"days",!0),i=-6>r?"sameElse":-1>r?"lastWeek":0>r?"lastDay":1>r?"sameDay":2>r?"nextDay":7>r?"nextWeek":"sameElse";return this.format(t&&t[i]||this.localeData().calendar(i,this,De(n)))}function it(){return new g(this)}function st(e,t){var n;return t=M("undefined"!=typeof t?t:"millisecond"),"millisecond"===t?(e=m(e)?e:De(e),+this>+e):(n=m(e)?+e:+De(e),n<+this.clone().startOf(t))}function at(e,t){var n;return t=M("undefined"!=typeof t?t:"millisecond"),"millisecond"===t?(e=m(e)?e:De(e),+e>+this):(n=m(e)?+e:+De(e),+this.clone().endOf(t)t-i?(n=e.clone().add(r-1,"months"),o=(t-i)/(i-n)):(n=e.clone().add(r+1,"months"),o=(t-i)/(n-i)),-(r+o)}function ht(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ft(){var e=this.clone().utc();return 0t;t++)if(this._weekdaysParse[t]||(n=De([2e3,1]).day(t),o="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[t]=new RegExp(o.replace(".",""),"i")),this._weekdaysParse[t].test(e))return t}function zt(e){var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=It(e,this.localeData()),this.add(e-t,"d")):t}function Yt(e){var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function Ut(e){return null==e?this.day()||7:this.day(this.day()%7?e:e-7)}function Gt(e,t){N(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function $t(e,t){return t._meridiemParse}function Kt(e){return"p"===(e+"").toLowerCase().charAt(0)}function Xt(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}function qt(e,t){t[go]=v(1e3*("0."+e))}function Zt(){return this._isUTC?"UTC":""}function Jt(){return this._isUTC?"Coordinated Universal Time":""}function Qt(e){return De(1e3*e)}function en(){return De.apply(null,arguments).parseZone()}function tn(e,t,n){var o=this._calendar[e];return"function"==typeof o?o.call(t,n):o}function nn(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])}function on(){return this._invalidDate}function rn(e){return this._ordinal.replace("%d",e)}function sn(e){return e}function an(e,t,n,o){var r=this._relativeTime[n];return"function"==typeof r?r(e,t,n,o):r.replace(/%d/i,e)}function ln(e,t){var n=this._relativeTime[e>0?"future":"past"];return"function"==typeof n?n(t):n.replace(/%s/i,t)}function un(e){var t,n;for(n in e)t=e[n],"function"==typeof t?this[n]=t:this["_"+n]=t;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function cn(e,t,n,o){var r=T(),i=u().set(o,t);return r[n](i,e)}function dn(e,t,n,o,r){if("number"==typeof e&&(t=e,e=void 0),e=e||"",null!=t)return cn(e,t,n,r);var i,s=[];for(i=0;o>i;i++)s[i]=cn(e,i,n,r);return s}function hn(e,t){return dn(e,t,"months",12,"month")}function fn(e,t){return dn(e,t,"monthsShort",12,"month")}function pn(e,t){return dn(e,t,"weekdays",7,"day")}function gn(e,t){return dn(e,t,"weekdaysShort",7,"day")}function mn(e,t){return dn(e,t,"weekdaysMin",7,"day")}function wn(){var e=this._data;return this._milliseconds=Jo(this._milliseconds),this._days=Jo(this._days),this._months=Jo(this._months),e.milliseconds=Jo(e.milliseconds),e.seconds=Jo(e.seconds),e.minutes=Jo(e.minutes),e.hours=Jo(e.hours),e.months=Jo(e.months),e.years=Jo(e.years),this}function vn(e,t,n,o){var r=Je(t,n);return e._milliseconds+=o*r._milliseconds,e._days+=o*r._days,e._months+=o*r._months,e._bubble()}function yn(e,t){return vn(this,e,t,1)}function bn(e,t){return vn(this,e,t,-1)}function Cn(e){return 0>e?Math.floor(e):Math.ceil(e)}function Rn(){var e,t,n,o,r,i=this._milliseconds,s=this._days,a=this._months,l=this._data;return i>=0&&s>=0&&a>=0||0>=i&&0>=s&&0>=a||(i+=864e5*Cn(Sn(a)+s),s=0,a=0),l.milliseconds=i%1e3,e=w(i/1e3),l.seconds=e%60,t=w(e/60),l.minutes=t%60,n=w(t/60),l.hours=n%24,s+=w(n/24),r=w(_n(s)),a+=r,s-=Cn(Sn(r)),o=w(a/12),a%=12,l.days=s,l.months=a,l.years=o,this}function _n(e){return 4800*e/146097}function Sn(e){return 146097*e/4800}function En(e){var t,n,o=this._milliseconds;if(e=M(e),"month"===e||"year"===e)return t=this._days+o/864e5,n=this._months+_n(t),"month"===e?n:n/12;switch(t=this._days+Math.round(Sn(this._months)),e){case"week":return t/7+o/6048e5;case"day":return t+o/864e5;case"hour":return 24*t+o/36e5;case"minute":return 1440*t+o/6e4;case"second":return 86400*t+o/1e3;case"millisecond":return Math.floor(864e5*t)+o;default:throw new Error("Unknown unit "+e)}}function Tn(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*v(this._months/12)}function On(e){return function(){return this.as(e)}}function Mn(e){return e=M(e),this[e+"s"]()}function kn(e){return function(){return this._data[e]}}function Hn(){return w(this.days()/7)}function Dn(e,t,n,o,r){return r.relativeTime(t||1,!!n,e,o)}function xn(e,t,n){var o=Je(e).abs(),r=pr(o.as("s")),i=pr(o.as("m")),s=pr(o.as("h")),a=pr(o.as("d")),l=pr(o.as("M")),u=pr(o.as("y")),c=r0,c[4]=n,Dn.apply(null,c)}function An(e,t){return void 0===gr[e]?!1:void 0===t?gr[e]:(gr[e]=t,!0)}function Pn(e){var t=this.localeData(),n=xn(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)}function Nn(){var e,t,n,o=mr(this._milliseconds)/1e3,r=mr(this._days),i=mr(this._months);e=w(o/60),t=w(e/60),o%=60,e%=60,n=w(i/12),i%=12;var s=n,a=i,l=r,u=t,c=e,d=o,h=this.asSeconds();return h?(0>h?"-":"")+"P"+(s?s+"Y":"")+(a?a+"M":"")+(l?l+"D":"")+(u||c||d?"T":"")+(u?u+"H":"")+(c?c+"M":"")+(d?d+"S":""):"P0D"}var Ln,Wn,In=e.momentProperties=[],jn=!1,Bn={},Vn={},Fn=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,zn=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Yn={},Un={},Gn=/\d/,$n=/\d\d/,Kn=/\d{3}/,Xn=/\d{4}/,qn=/[+-]?\d{6}/,Zn=/\d\d?/,Jn=/\d{1,3}/,Qn=/\d{1,4}/,eo=/[+-]?\d{1,6}/,to=/\d+/,no=/[+-]?\d+/,oo=/Z|[+-]\d\d:?\d\d/gi,ro=/[+-]?\d+(\.\d{1,3})?/,io=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,so={},ao={},lo=0,uo=1,co=2,ho=3,fo=4,po=5,go=6;N("M",["MM",2],"Mo",function(){return this.month()+1}),N("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),N("MMMM",0,0,function(e){return this.localeData().months(this,e)}),O("month","M"),V("M",Zn),V("MM",Zn,$n),V("MMM",io),V("MMMM",io),Y(["M","MM"],function(e,t){t[uo]=v(e)-1}),Y(["MMM","MMMM"],function(e,t,n,o){var r=n._locale.monthsParse(e,o,n._strict);null!=r?t[uo]=r:d(n).invalidMonth=e});var mo="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),wo="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),vo={};e.suppressDeprecationWarnings=!1;var yo=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,bo=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],Co=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],Ro=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=ne("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),N(0,["YY",2],0,function(){return this.year()%100}),N(0,["YYYY",4],0,"year"),N(0,["YYYYY",5],0,"year"),N(0,["YYYYYY",6,!0],0,"year"),O("year","y"),V("Y",no),V("YY",Zn,$n),V("YYYY",Qn,Xn),V("YYYYY",eo,qn),V("YYYYYY",eo,qn),Y(["YYYYY","YYYYYY"],lo),Y("YYYY",function(t,n){n[lo]=2===t.length?e.parseTwoDigitYear(t):v(t)}),Y("YY",function(t,n){n[lo]=e.parseTwoDigitYear(t)}),e.parseTwoDigitYear=function(e){return v(e)+(v(e)>68?1900:2e3)};var _o=H("FullYear",!1);N("w",["ww",2],"wo","week"),N("W",["WW",2],"Wo","isoWeek"),O("week","w"),O("isoWeek","W"),V("w",Zn),V("ww",Zn,$n),V("W",Zn),V("WW",Zn,$n),U(["w","ww","W","WW"],function(e,t,n,o){t[o.substr(0,1)]=v(e)});var So={dow:0,doy:6};N("DDD",["DDDD",3],"DDDo","dayOfYear"),O("dayOfYear","DDD"),V("DDD",Jn),V("DDDD",Kn),Y(["DDD","DDDD"],function(e,t,n){n._dayOfYear=v(e)}),e.ISO_8601=function(){};var Eo=ne("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var e=De.apply(null,arguments);return this>e?this:e}),To=ne("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var e=De.apply(null,arguments);return e>this?this:e});We("Z",":"),We("ZZ",""),V("Z",oo),V("ZZ",oo),Y(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Ie(e)});var Oo=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var Mo=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,ko=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Je.fn=Ne.prototype;var Ho=nt(1,"add"),Do=nt(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var xo=ne("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});N(0,["gg",2],0,function(){return this.weekYear()%100}),N(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Dt("gggg","weekYear"),Dt("ggggg","weekYear"),Dt("GGGG","isoWeekYear"),Dt("GGGGG","isoWeekYear"),O("weekYear","gg"),O("isoWeekYear","GG"),V("G",no),V("g",no),V("GG",Zn,$n),V("gg",Zn,$n),V("GGGG",Qn,Xn),V("gggg",Qn,Xn),V("GGGGG",eo,qn),V("ggggg",eo,qn),U(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,o){t[o.substr(0,2)]=v(e)}),U(["gg","GG"],function(t,n,o,r){n[r]=e.parseTwoDigitYear(t)}),N("Q",0,0,"quarter"),O("quarter","Q"),V("Q",Gn),Y("Q",function(e,t){t[uo]=3*(v(e)-1)}),N("D",["DD",2],"Do","date"),O("date","D"),V("D",Zn),V("DD",Zn,$n),V("Do",function(e,t){return e?t._ordinalParse:t._ordinalParseLenient}),Y(["D","DD"],co),Y("Do",function(e,t){t[co]=v(e.match(Zn)[0],10)});var Ao=H("Date",!0);N("d",0,"do","day"),N("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),N("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),N("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),N("e",0,0,"weekday"),N("E",0,0,"isoWeekday"),O("day","d"),O("weekday","e"),O("isoWeekday","E"),V("d",Zn),V("e",Zn),V("E",Zn),V("dd",io),V("ddd",io),V("dddd",io),U(["dd","ddd","dddd"],function(e,t,n){var o=n._locale.weekdaysParse(e);null!=o?t.d=o:d(n).invalidWeekday=e}),U(["d","e","E"],function(e,t,n,o){t[o]=v(e)});var Po="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),No="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Lo="Su_Mo_Tu_We_Th_Fr_Sa".split("_");N("H",["HH",2],0,"hour"),N("h",["hh",2],0,function(){return this.hours()%12||12}),Gt("a",!0),Gt("A",!1),O("hour","h"),V("a",$t),V("A",$t),V("H",Zn),V("h",Zn),V("HH",Zn,$n),V("hh",Zn,$n),Y(["H","HH"],ho),Y(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),Y(["h","hh"],function(e,t,n){t[ho]=v(e),d(n).bigHour=!0});var Wo=/[ap]\.?m?\.?/i,Io=H("Hours",!0);N("m",["mm",2],0,"minute"),O("minute","m"),V("m",Zn),V("mm",Zn,$n),Y(["m","mm"],fo);var jo=H("Minutes",!1);N("s",["ss",2],0,"second"),O("second","s"),V("s",Zn),V("ss",Zn,$n),Y(["s","ss"],po);var Bo=H("Seconds",!1);N("S",0,0,function(){return~~(this.millisecond()/100)}),N(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),N(0,["SSS",3],0,"millisecond"),N(0,["SSSS",4],0,function(){return 10*this.millisecond()}),N(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),N(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),N(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),N(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),N(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),O("millisecond","ms"),V("S",Jn,Gn),V("SS",Jn,$n),V("SSS",Jn,Kn);var Vo;for(Vo="SSSS";Vo.length<=9;Vo+="S")V(Vo,to);for(Vo="S";Vo.length<=9;Vo+="S")Y(Vo,qt);var Fo=H("Milliseconds",!1);N("z",0,0,"zoneAbbr"),N("zz",0,0,"zoneName");var zo=g.prototype;zo.add=Ho,zo.calendar=rt,zo.clone=it,zo.diff=ct,zo.endOf=Rt,zo.format=pt,zo.from=gt,zo.fromNow=mt,zo.to=wt,zo.toNow=vt,zo.get=A,zo.invalidAt=Ht,zo.isAfter=st,zo.isBefore=at,zo.isBetween=lt,zo.isSame=ut,zo.isValid=Mt,zo.lang=xo,zo.locale=yt,zo.localeData=bt,zo.max=To,zo.min=Eo,zo.parsingFlags=kt,zo.set=A,zo.startOf=Ct,zo.subtract=Do,zo.toArray=Tt,zo.toObject=Ot,zo.toDate=Et,zo.toISOString=ft,zo.toJSON=ft,zo.toString=ht,zo.unix=St,zo.valueOf=_t,zo.year=_o,zo.isLeapYear=ce,zo.weekYear=At,zo.isoWeekYear=Pt,zo.quarter=zo.quarters=Wt,zo.month=J,zo.daysInMonth=Q,zo.week=zo.weeks=ge,zo.isoWeek=zo.isoWeeks=me,zo.weeksInYear=Lt,zo.isoWeeksInYear=Nt,zo.date=Ao,zo.day=zo.days=zt,zo.weekday=Yt,zo.isoWeekday=Ut,zo.dayOfYear=ve,zo.hour=zo.hours=Io,zo.minute=zo.minutes=jo,zo.second=zo.seconds=Bo,zo.millisecond=zo.milliseconds=Fo,zo.utcOffset=Ve, +zo.utc=ze,zo.local=Ye,zo.parseZone=Ue,zo.hasAlignedHourOffset=Ge,zo.isDST=$e,zo.isDSTShifted=Ke,zo.isLocal=Xe,zo.isUtcOffset=qe,zo.isUtc=Ze,zo.isUTC=Ze,zo.zoneAbbr=Zt,zo.zoneName=Jt,zo.dates=ne("dates accessor is deprecated. Use date instead.",Ao),zo.months=ne("months accessor is deprecated. Use month instead",J),zo.years=ne("years accessor is deprecated. Use year instead",_o),zo.zone=ne("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Fe);var Yo=zo,Uo={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Go={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},$o="Invalid date",Ko="%d",Xo=/\d{1,2}/,qo={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Zo=b.prototype;Zo._calendar=Uo,Zo.calendar=tn,Zo._longDateFormat=Go,Zo.longDateFormat=nn,Zo._invalidDate=$o,Zo.invalidDate=on,Zo._ordinal=Ko,Zo.ordinal=rn,Zo._ordinalParse=Xo,Zo.preparse=sn,Zo.postformat=sn,Zo._relativeTime=qo,Zo.relativeTime=an,Zo.pastFuture=ln,Zo.set=un,Zo.months=K,Zo._months=mo,Zo.monthsShort=X,Zo._monthsShort=wo,Zo.monthsParse=q,Zo.week=he,Zo._week=So,Zo.firstDayOfYear=pe,Zo.firstDayOfWeek=fe,Zo.weekdays=jt,Zo._weekdays=Po,Zo.weekdaysMin=Vt,Zo._weekdaysMin=Lo,Zo.weekdaysShort=Bt,Zo._weekdaysShort=No,Zo.weekdaysParse=Ft,Zo.isPM=Kt,Zo._meridiemParse=Wo,Zo.meridiem=Xt,S("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=1===v(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}}),e.lang=ne("moment.lang is deprecated. Use moment.locale instead.",S),e.langData=ne("moment.langData is deprecated. Use moment.localeData instead.",T);var Jo=Math.abs,Qo=On("ms"),er=On("s"),tr=On("m"),nr=On("h"),or=On("d"),rr=On("w"),ir=On("M"),sr=On("y"),ar=kn("milliseconds"),lr=kn("seconds"),ur=kn("minutes"),cr=kn("hours"),dr=kn("days"),hr=kn("months"),fr=kn("years"),pr=Math.round,gr={s:45,m:45,h:22,d:26,M:11},mr=Math.abs,wr=Ne.prototype;wr.abs=wn,wr.add=yn,wr.subtract=bn,wr.as=En,wr.asMilliseconds=Qo,wr.asSeconds=er,wr.asMinutes=tr,wr.asHours=nr,wr.asDays=or,wr.asWeeks=rr,wr.asMonths=ir,wr.asYears=sr,wr.valueOf=Tn,wr._bubble=Rn,wr.get=Mn,wr.milliseconds=ar,wr.seconds=lr,wr.minutes=ur,wr.hours=cr,wr.days=dr,wr.weeks=Hn,wr.months=hr,wr.years=fr,wr.humanize=Pn,wr.toISOString=Nn,wr.toString=Nn,wr.toJSON=Nn,wr.locale=yt,wr.localeData=bt,wr.toIsoString=ne("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Nn),wr.lang=xo,N("X",0,0,"unix"),N("x",0,0,"valueOf"),V("x",no),V("X",ro),Y("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),Y("x",function(e,t,n){n._d=new Date(v(e))}),e.version="2.10.6",o(De),e.fn=Yo,e.min=Ae,e.max=Pe,e.utc=u,e.unix=Qt,e.months=hn,e.isDate=i,e.locale=S,e.invalid=f,e.duration=Je,e.isMoment=m,e.weekdays=pn,e.parseZone=en,e.localeData=T,e.isDuration=Le,e.monthsShort=fn,e.weekdaysMin=mn,e.defineLocale=E,e.weekdaysShort=gn,e.normalizeUnits=M,e.relativeTimeThreshold=An;var vr=e;return vr})},{}],numeral:[function(t,n,o){"use strict";(function(){function t(e){this._value=e}function o(e,t,n,o){var r,i,s=Math.pow(10,t);return i=(n(e*s)/s).toFixed(t),o&&(r=new RegExp("0{1,"+o+"}$"),i=i.replace(r,"")),i}function r(e,t,n){var o;return o=t.indexOf("$")>-1?s(e,t,n):t.indexOf("%")>-1?a(e,t,n):t.indexOf(":")>-1?l(e,t):c(e._value,t,n)}function i(e,t){var n,o,r,i,s,a=t,l=["KB","MB","GB","TB","PB","EB","ZB","YB"],c=!1;if(t.indexOf(":")>-1)e._value=u(t);else if(t===v)e._value=0;else{for("."!==m[w].delimiters.decimal&&(t=t.replace(/\./g,"").replace(m[w].delimiters.decimal,".")),n=new RegExp("[^a-zA-Z]"+m[w].abbreviations.thousand+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),o=new RegExp("[^a-zA-Z]"+m[w].abbreviations.million+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),r=new RegExp("[^a-zA-Z]"+m[w].abbreviations.billion+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),i=new RegExp("[^a-zA-Z]"+m[w].abbreviations.trillion+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),s=0;s<=l.length&&!(c=t.indexOf(l[s])>-1?Math.pow(1024,s+1):!1);s++);e._value=(c?c:1)*(a.match(n)?Math.pow(10,3):1)*(a.match(o)?Math.pow(10,6):1)*(a.match(r)?Math.pow(10,9):1)*(a.match(i)?Math.pow(10,12):1)*(t.indexOf("%")>-1?.01:1)*((t.split("-").length+Math.min(t.split("(").length-1,t.split(")").length-1))%2?1:-1)*Number(t.replace(/[^0-9\.]+/g,"")),e._value=c?Math.ceil(e._value):e._value}return e._value}function s(e,t,n){var o,r,i=t.indexOf("$"),s=t.indexOf("("),a=t.indexOf("-"),l="";return t.indexOf(" $")>-1?(l=" ",t=t.replace(" $","")):t.indexOf("$ ")>-1?(l=" ",t=t.replace("$ ","")):t=t.replace("$",""),r=c(e._value,t,n),1>=i?r.indexOf("(")>-1||r.indexOf("-")>-1?(r=r.split(""),o=1,(s>i||a>i)&&(o=0),r.splice(o,0,m[w].currency.symbol+l),r=r.join("")):r=m[w].currency.symbol+l+r:r.indexOf(")")>-1?(r=r.split(""),r.splice(-1,0,l+m[w].currency.symbol),r=r.join("")):r=r+l+m[w].currency.symbol,r}function a(e,t,n){var o,r="",i=100*e._value;return t.indexOf(" %")>-1?(r=" ",t=t.replace(" %","")):t=t.replace("%",""),o=c(i,t,n),o.indexOf(")")>-1?(o=o.split(""),o.splice(-1,0,r+"%"),o=o.join("")):o=o+r+"%",o}function l(e){var t=Math.floor(e._value/60/60),n=Math.floor((e._value-60*t*60)/60),o=Math.round(e._value-60*t*60-60*n);return t+":"+(10>n?"0"+n:n)+":"+(10>o?"0"+o:o)}function u(e){var t=e.split(":"),n=0;return 3===t.length?(n+=60*Number(t[0])*60,n+=60*Number(t[1]),n+=Number(t[2])):2===t.length&&(n+=60*Number(t[0]),n+=Number(t[1])),Number(n)}function c(e,t,n){var r,i,s,a,l,u,c=!1,d=!1,h=!1,f="",p=!1,g=!1,y=!1,b=!1,C=!1,R="",_="",S=Math.abs(e),E=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],T="",O=!1;if(0===e&&null!==v)return v;if(t.indexOf("(")>-1?(c=!0,t=t.slice(1,-1)):t.indexOf("+")>-1&&(d=!0,t=t.replace(/\+/g,"")),t.indexOf("a")>-1&&(p=t.indexOf("aK")>=0,g=t.indexOf("aM")>=0,y=t.indexOf("aB")>=0,b=t.indexOf("aT")>=0,C=p||g||y||b,t.indexOf(" a")>-1?(f=" ",t=t.replace(" a","")):t=t.replace("a",""),S>=Math.pow(10,12)&&!C||b?(f+=m[w].abbreviations.trillion,e/=Math.pow(10,12)):S=Math.pow(10,9)&&!C||y?(f+=m[w].abbreviations.billion,e/=Math.pow(10,9)):S=Math.pow(10,6)&&!C||g?(f+=m[w].abbreviations.million,e/=Math.pow(10,6)):(S=Math.pow(10,3)&&!C||p)&&(f+=m[w].abbreviations.thousand,e/=Math.pow(10,3))),t.indexOf("b")>-1)for(t.indexOf(" b")>-1?(R=" ",t=t.replace(" b","")):t=t.replace("b",""),s=0;s<=E.length;s++)if(r=Math.pow(1024,s),i=Math.pow(1024,s+1),e>=r&&i>e){R+=E[s],r>0&&(e/=r);break}return t.indexOf("o")>-1&&(t.indexOf(" o")>-1?(_=" ",t=t.replace(" o","")):t=t.replace("o",""),_+=m[w].ordinal(e)),t.indexOf("[.]")>-1&&(h=!0,t=t.replace("[.]",".")),a=e.toString().split(".")[0],l=t.split(".")[1],u=t.indexOf(","),l?(l.indexOf("[")>-1?(l=l.replace("]",""),l=l.split("["),T=o(e,l[0].length+l[1].length,n,l[1].length)):T=o(e,l.length,n),a=T.split(".")[0],T=T.split(".")[1].length?m[w].delimiters.decimal+T.split(".")[1]:"",h&&0===Number(T.slice(1))&&(T="")):a=o(e,null,n),a.indexOf("-")>-1&&(a=a.slice(1),O=!0),u>-1&&(a=a.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+m[w].delimiters.thousands)),0===t.indexOf(".")&&(a=""),(c&&O?"(":"")+(!c&&O?"-":"")+(!O&&d?"+":"")+a+T+(_?_:"")+(f?f:"")+(R?R:"")+(c&&O?")":"")}function d(e,t){m[e]=t}function h(e){var t=e.toString().split(".");return t.length<2?1:Math.pow(10,t[1].length)}function f(){var e=Array.prototype.slice.call(arguments);return e.reduce(function(e,t){var n=h(e),o=h(t);return n>o?n:o},-(1/0))}var p,g="1.5.3",m={},w="en",v=null,y="0,0",b="undefined"!=typeof n&&n.exports;p=function(e){return p.isNumeral(e)?e=e.value():0===e||"undefined"==typeof e?e=0:Number(e)||(e=p.fn.unformat(e)),new t(Number(e))},p.version=g,p.isNumeral=function(e){return e instanceof t},p.language=function(e,t){if(!e)return w;if(e&&!t){if(!m[e])throw new Error("Unknown language : "+e);w=e}return(t||!m[e])&&d(e,t),p},p.languageData=function(e){if(!e)return m[w];if(!m[e])throw new Error("Unknown language : "+e);return m[e]},p.language("en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var t=e%10;return 1===~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$"}}),p.zeroFormat=function(e){v="string"==typeof e?e:null},p.defaultFormat=function(e){y="string"==typeof e?e:"0.0"},p.validate=function(e,t){var n,o,r,i,s,a,l,u;if("string"!=typeof e&&(e+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",e)),e=e.trim(),""===e)return!1;e=e.replace(/^[+-]?/,"");try{l=p.languageData(t)}catch(c){l=p.languageData(p.language())}return r=l.currency.symbol,s=l.abbreviations,n=l.delimiters.decimal,o="."===l.delimiters.thousands?"\\.":l.delimiters.thousands,u=e.match(/^[^\d\.\,]+/),null!==u&&(e=e.substr(1),u[0]!==r)?!1:(u=e.match(/[^\d]+$/),null!==u&&(e=e.slice(0,-1),u[0]!==s.thousand&&u[0]!==s.million&&u[0]!==s.billion&&u[0]!==s.trillion)?!1:e.match(/^\d+$/)?!0:(a=new RegExp(o+"{2}"),e.match(/[^\d.,]/g)?!1:(i=e.split(n),i.length>2?!1:i.length<2?!!i[0].match(/^\d+.*\d$/)&&!i[0].match(a):""===i[0]?!i[0].match(a)&&!!i[1].match(/^\d+$/):1===i[0].length?!!i[0].match(/^\d+$/)&&!i[0].match(a)&&!!i[1].match(/^\d+$/):!!i[0].match(/^\d+.*\d$/)&&!i[0].match(a)&&!!i[1].match(/^\d+$/))))},"function"!=typeof Array.prototype.reduce&&(Array.prototype.reduce=function(e,t){if(null===this||"undefined"==typeof this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof e)throw new TypeError(e+" is not a function");var n,o,r=this.length>>>0,i=!1;for(1n;++n)this.hasOwnProperty(n)&&(i?o=e(o,this[n],n,this):(o=this[n],i=!0));if(!i)throw new TypeError("Reduce of empty array with no initial value");return o}),p.fn=t.prototype={clone:function(){return p(this)},format:function(e,t){return r(this,e?e:y,void 0!==t?t:Math.round)},unformat:function(e){return"[object Number]"===Object.prototype.toString.call(e)?e:i(this,e?e:y)},value:function(){return this._value},valueOf:function(){return this._value},set:function(e){return this._value=Number(e),this},add:function(e){function t(e,t,o,r){return e+n*t}var n=f.call(null,this._value,e);return this._value=[this._value,e].reduce(t,0)/n,this},subtract:function(e){function t(e,t,o,r){return e-n*t}var n=f.call(null,this._value,e);return this._value=[e].reduce(t,this._value*n)/n,this},multiply:function(e){function t(e,t,n,o){var r=f(e,t);return e*r*(t*r)/(r*r)}return this._value=[this._value,e].reduce(t,1),this},divide:function(e){function t(e,t,n,o){var r=f(e,t);return e*r/(t*r)}return this._value=[this._value,e].reduce(t),this},difference:function(e){return Math.abs(p(this._value).subtract(e).value())}},b&&(n.exports=p),"undefined"==typeof ender&&(this.numeral=p),"function"==typeof e&&e.amd&&e([],function(){return p})}).call(window)},{}],pikaday:[function(t,n,o){/*! * Pikaday * * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday */ -!function(r,i){"use strict";var s;if("object"==typeof o){try{s=t("moment")}catch(a){}n.exports=i(s)}else"function"==typeof e&&e.amd?e(function(e){var t="moment";try{s=e(t)}catch(n){}return i(s)}):r.Pikaday=i(r.moment)}(this,function(e){"use strict";var t="function"==typeof e,n=!!window.addEventListener,o=window.document,r=window.setTimeout,i=function(e,t,o,r){n?e.addEventListener(t,o,!!r):e.attachEvent("on"+t,o)},s=function(e,t,o,r){n?e.removeEventListener(t,o,!!r):e.detachEvent("on"+t,o)},a=function(e,t,n){var r;o.createEvent?(r=o.createEvent("HTMLEvents"),r.initEvent(t,!0,!1),r=y(r,n),e.dispatchEvent(r)):o.createEventObject&&(r=o.createEventObject(),r=y(r,n),e.fireEvent("on"+t,r))},l=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},u=function(e,t){return-1!==(" "+e.className+" ").indexOf(" "+t+" ")},c=function(e,t){u(e,t)||(e.className=""===e.className?t:e.className+" "+t)},d=function(e,t){e.className=l((" "+e.className+" ").replace(" "+t+" "," "))},h=function(e){return/Array/.test(Object.prototype.toString.call(e))},f=function(e){return/Date/.test(Object.prototype.toString.call(e))&&!isNaN(e.getTime())},p=function(e){var t=e.getDay();return 0===t||6===t},g=function(e){return e%4===0&&e%100!==0||e%400===0},m=function(e,t){return[31,g(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},v=function(e){f(e)&&e.setHours(0,0,0,0)},w=function(e,t){return e.getTime()===t.getTime()},y=function(e,t,n){var o,r;for(o in t)r=void 0!==e[o],r&&"object"==typeof t[o]&&null!==t[o]&&void 0===t[o].nodeName?f(t[o])?n&&(e[o]=new Date(t[o].getTime())):h(t[o])?n&&(e[o]=t[o].slice(0)):e[o]=y({},t[o],n):(n||!r)&&(e[o]=t[o]);return e},b=function(e){return e.month<0&&(e.year-=Math.ceil(Math.abs(e.month)/12),e.month+=12),e.month>11&&(e.year+=Math.floor(Math.abs(e.month)/12),e.month-=12),e},C={field:null,bound:void 0,position:"bottom left",reposition:!0,format:"YYYY-MM-DD",defaultDate:null,setDefaultDate:!1,firstDay:0,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,onSelect:null,onOpen:null,onClose:null,onDraw:null},R=function(e,t,n){for(t+=e.firstDay;t>=7;)t-=7;return n?e.i18n.weekdaysShort[t]:e.i18n.weekdays[t]},_=function(e){if(e.isEmpty)return'';var t=[];return e.isDisabled&&t.push("is-disabled"),e.isToday&&t.push("is-today"),e.isSelected&&t.push("is-selected"),e.isInRange&&t.push("is-inrange"),e.isStartRange&&t.push("is-startrange"),e.isEndRange&&t.push("is-endrange"),'"},S=function(e,t,n){var o=new Date(n,0,1),r=Math.ceil(((new Date(n,t,e)-o)/864e5+o.getDay()+1)/7);return''+r+""},E=function(e,t){return""+(t?e.reverse():e).join("")+""},T=function(e){return""+e.join("")+""},O=function(e){var t,n=[];for(e.showWeekNumber&&n.push(""),t=0;7>t;t++)n.push(''+R(e,t,!0)+"");return""+(e.isRTL?n.reverse():n).join("")+""},M=function(e,t,n,o,r){var i,s,a,l,u,c=e._o,d=n===c.minYear,f=n===c.maxYear,p='
',g=!0,m=!0;for(a=[],i=0;12>i;i++)a.push('");for(l='
'+c.i18n.months[o]+'
",h(c.yearRange)?(i=c.yearRange[0],s=c.yearRange[1]+1):(i=n-c.yearRange,s=1+n+c.yearRange),a=[];s>i&&i<=c.maxYear;i++)i>=c.minYear&&a.push('");return u='
'+n+c.yearSuffix+'
",p+=c.showMonthAfterYear?u+l:l+u,d&&(0===o||c.minMonth>=o)&&(g=!1),f&&(11===o||c.maxMonth<=o)&&(m=!1),0===t&&(p+='"),t===e._o.numberOfMonths-1&&(p+='"),p+="
"},k=function(e,t){return''+O(e)+T(t)+"
"},H=function(s){var a=this,l=a.config(s);a._onMouseDown=function(e){if(a._v){e=e||window.event;var t=e.target||e.srcElement;if(t)if(u(t,"is-disabled")||(u(t,"pika-button")&&!u(t,"is-empty")?(a.setDate(new Date(t.getAttribute("data-pika-year"),t.getAttribute("data-pika-month"),t.getAttribute("data-pika-day"))),l.bound&&r(function(){a.hide(),l.field&&l.field.blur()},100)):u(t,"pika-prev")?a.prevMonth():u(t,"pika-next")&&a.nextMonth()),u(t,"pika-select"))a._c=!0;else{if(!e.preventDefault)return e.returnValue=!1,!1;e.preventDefault()}}},a._onChange=function(e){e=e||window.event;var t=e.target||e.srcElement;t&&(u(t,"pika-select-month")?a.gotoMonth(t.value):u(t,"pika-select-year")&&a.gotoYear(t.value))},a._onInputChange=function(n){var o;n.firedBy!==a&&(t?(o=e(l.field.value,l.format),o=o&&o.isValid()?o.toDate():null):o=new Date(Date.parse(l.field.value)),f(o)&&a.setDate(o),a._v||a.show())},a._onInputFocus=function(){a.show()},a._onInputClick=function(){a.show()},a._onInputBlur=function(){var e=o.activeElement;do if(u(e,"pika-single"))return;while(e=e.parentNode);a._c||(a._b=r(function(){a.hide()},50)),a._c=!1},a._onClick=function(e){e=e||window.event;var t=e.target||e.srcElement,o=t;if(t){!n&&u(t,"pika-select")&&(t.onchange||(t.setAttribute("onchange","return;"),i(t,"change",a._onChange)));do if(u(o,"pika-single")||o===l.trigger)return;while(o=o.parentNode);a._v&&t!==l.trigger&&o!==l.trigger&&a.hide()}},a.el=o.createElement("div"),a.el.className="pika-single"+(l.isRTL?" is-rtl":"")+(l.theme?" "+l.theme:""),i(a.el,"mousedown",a._onMouseDown,!0),i(a.el,"touchend",a._onMouseDown,!0),i(a.el,"change",a._onChange),l.field&&(l.container?l.container.appendChild(a.el):l.bound?o.body.appendChild(a.el):l.field.parentNode.insertBefore(a.el,l.field.nextSibling),i(l.field,"change",a._onInputChange),l.defaultDate||(t&&l.field.value?l.defaultDate=e(l.field.value,l.format).toDate():l.defaultDate=new Date(Date.parse(l.field.value)),l.setDefaultDate=!0));var c=l.defaultDate;f(c)?l.setDefaultDate?a.setDate(c,!0):a.gotoDate(c):a.gotoDate(new Date),l.bound?(this.hide(),a.el.className+=" is-bound",i(l.trigger,"click",a._onInputClick),i(l.trigger,"focus",a._onInputFocus),i(l.trigger,"blur",a._onInputBlur)):this.show()};return H.prototype={config:function(e){this._o||(this._o=y({},C,!0));var t=y(this._o,e,!0);t.isRTL=!!t.isRTL,t.field=t.field&&t.field.nodeName?t.field:null,t.theme="string"==typeof t.theme&&t.theme?t.theme:null,t.bound=!!(void 0!==t.bound?t.field&&t.bound:t.field),t.trigger=t.trigger&&t.trigger.nodeName?t.trigger:t.field,t.disableWeekends=!!t.disableWeekends,t.disableDayFn="function"==typeof t.disableDayFn?t.disableDayFn:null;var n=parseInt(t.numberOfMonths,10)||1;if(t.numberOfMonths=n>4?4:n,f(t.minDate)||(t.minDate=!1),f(t.maxDate)||(t.maxDate=!1),t.minDate&&t.maxDate&&t.maxDate100&&(t.yearRange=100);return t},toString:function(n){return f(this._d)?t?e(this._d).format(n||this._o.format):this._d.toDateString():""},getMoment:function(){return t?e(this._d):null},setMoment:function(n,o){t&&e.isMoment(n)&&this.setDate(n.toDate(),o)},getDate:function(){return f(this._d)?new Date(this._d.getTime()):null},setDate:function(e,t){if(!e)return this._d=null,this._o.field&&(this._o.field.value="",a(this._o.field,"change",{firedBy:this})),this.draw();if("string"==typeof e&&(e=new Date(Date.parse(e))),f(e)){var n=this._o.minDate,o=this._o.maxDate;f(n)&&n>e?e=n:f(o)&&e>o&&(e=o),this._d=new Date(e.getTime()),v(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),a(this._o.field,"change",{firedBy:this})),t||"function"!=typeof this._o.onSelect||this._o.onSelect.call(this,this.getDate())}},gotoDate:function(e){var t=!0;if(f(e)){if(this.calendars){var n=new Date(this.calendars[0].year,this.calendars[0].month,1),o=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),r=e.getTime();o.setMonth(o.getMonth()+1),o.setDate(o.getDate()-1),t=r=o&&(this._y=o,!isNaN(s)&&this._m>s&&(this._m=s));for(var l=0;l'+M(this,l,this.calendars[l].year,this.calendars[l].month,this.calendars[0].year)+this.render(this.calendars[l].year,this.calendars[l].month)+"";if(this.el.innerHTML=a,t.bound&&"hidden"!==t.field.type&&r(function(){t.trigger.focus()},1),"function"==typeof this._o.onDraw){var u=this;r(function(){u._o.onDraw.call(u)},0)}}},adjustPosition:function(){var e,t,n,r,i,s,a,l,u,c;if(!this._o.container){if(this.el.style.position="absolute",e=this._o.trigger,t=e,n=this.el.offsetWidth,r=this.el.offsetHeight,i=window.innerWidth||o.documentElement.clientWidth,s=window.innerHeight||o.documentElement.clientHeight,a=window.pageYOffset||o.body.scrollTop||o.documentElement.scrollTop,"function"==typeof e.getBoundingClientRect)c=e.getBoundingClientRect(),l=c.left+window.pageXOffset,u=c.bottom+window.pageYOffset;else for(l=t.offsetLeft,u=t.offsetTop+t.offsetHeight;t=t.offsetParent;)l+=t.offsetLeft,u+=t.offsetTop;(this._o.reposition&&l+n>i||this._o.position.indexOf("right")>-1&&l-n+e.offsetWidth>0)&&(l=l-n+e.offsetWidth),(this._o.reposition&&u+r>s+a||this._o.position.indexOf("top")>-1&&u-r-e.offsetHeight>0)&&(u=u-r-e.offsetHeight),this.el.style.left=l+"px",this.el.style.top=u+"px"}},render:function(e,t){var n=this._o,o=new Date,r=m(e,t),i=new Date(e,t,1).getDay(),s=[],a=[];v(o),n.firstDay>0&&(i-=n.firstDay,0>i&&(i+=7));for(var l=r+i,u=l;u>7;)u-=7;l+=7-u;for(var c=0,d=0;l>c;c++){var h=new Date(e,t,1+(c-i)),g=f(this._d)?w(h,this._d):!1,y=w(h,o),b=i>c||c>=r+i,C=n.startRange&&w(n.startRange,h),R=n.endRange&&w(n.endRange,h),T=n.startRange&&n.endRange&&n.startRangen.maxDate||n.disableWeekends&&p(h)||n.disableDayFn&&n.disableDayFn(h),M={day:1+(c-i),month:t,year:e,isSelected:g,isToday:y,isDisabled:O,isEmpty:b,isStartRange:C,isEndRange:R,isInRange:T};a.push(_(M)),7===++d&&(n.showWeekNumber&&a.unshift(S(c-i,t,e)),s.push(E(a,n.isRTL)),a=[],d=0)}return k(n,s)},isVisible:function(){return this._v},show:function(){this._v||(d(this.el,"is-hidden"),this._v=!0,this.draw(),this._o.bound&&(i(o,"click",this._onClick),this.adjustPosition()),"function"==typeof this._o.onOpen&&this._o.onOpen.call(this))},hide:function(){var e=this._v;e!==!1&&(this._o.bound&&s(o,"click",this._onClick),this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto",c(this.el,"is-hidden"),this._v=!1,void 0!==e&&"function"==typeof this._o.onClose&&this._o.onClose.call(this))},destroy:function(){this.hide(),s(this.el,"mousedown",this._onMouseDown,!0),s(this.el,"touchend",this._onMouseDown,!0),s(this.el,"change",this._onChange),this._o.field&&(s(this._o.field,"change",this._onInputChange),this._o.bound&&(s(this._o.trigger,"click",this._onInputClick),s(this._o.trigger,"focus",this._onInputFocus),s(this._o.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}},H})},{moment:"moment"}],zeroclipboard:[function(t,n,o){/*! +!function(r,i){"use strict";var s;if("object"==typeof o){try{s=t("moment")}catch(a){}n.exports=i(s)}else"function"==typeof e&&e.amd?e(function(e){var t="moment";try{s=e(t)}catch(n){}return i(s)}):r.Pikaday=i(r.moment)}(this,function(e){"use strict";var t="function"==typeof e,n=!!window.addEventListener,o=window.document,r=window.setTimeout,i=function(e,t,o,r){n?e.addEventListener(t,o,!!r):e.attachEvent("on"+t,o)},s=function(e,t,o,r){n?e.removeEventListener(t,o,!!r):e.detachEvent("on"+t,o)},a=function(e,t,n){var r;o.createEvent?(r=o.createEvent("HTMLEvents"),r.initEvent(t,!0,!1),r=y(r,n),e.dispatchEvent(r)):o.createEventObject&&(r=o.createEventObject(),r=y(r,n),e.fireEvent("on"+t,r))},l=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},u=function(e,t){return-1!==(" "+e.className+" ").indexOf(" "+t+" ")},c=function(e,t){u(e,t)||(e.className=""===e.className?t:e.className+" "+t)},d=function(e,t){e.className=l((" "+e.className+" ").replace(" "+t+" "," "))},h=function(e){return/Array/.test(Object.prototype.toString.call(e))},f=function(e){return/Date/.test(Object.prototype.toString.call(e))&&!isNaN(e.getTime())},p=function(e){var t=e.getDay();return 0===t||6===t},g=function(e){return e%4===0&&e%100!==0||e%400===0},m=function(e,t){return[31,g(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},w=function(e){f(e)&&e.setHours(0,0,0,0)},v=function(e,t){return e.getTime()===t.getTime()},y=function(e,t,n){var o,r;for(o in t)r=void 0!==e[o],r&&"object"==typeof t[o]&&null!==t[o]&&void 0===t[o].nodeName?f(t[o])?n&&(e[o]=new Date(t[o].getTime())):h(t[o])?n&&(e[o]=t[o].slice(0)):e[o]=y({},t[o],n):(n||!r)&&(e[o]=t[o]);return e},b=function(e){return e.month<0&&(e.year-=Math.ceil(Math.abs(e.month)/12),e.month+=12),e.month>11&&(e.year+=Math.floor(Math.abs(e.month)/12),e.month-=12),e},C={field:null,bound:void 0,position:"bottom left",reposition:!0,format:"YYYY-MM-DD",defaultDate:null,setDefaultDate:!1,firstDay:0,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,onSelect:null,onOpen:null,onClose:null,onDraw:null},R=function(e,t,n){for(t+=e.firstDay;t>=7;)t-=7;return n?e.i18n.weekdaysShort[t]:e.i18n.weekdays[t]},_=function(e){if(e.isEmpty)return'';var t=[];return e.isDisabled&&t.push("is-disabled"),e.isToday&&t.push("is-today"),e.isSelected&&t.push("is-selected"),e.isInRange&&t.push("is-inrange"),e.isStartRange&&t.push("is-startrange"),e.isEndRange&&t.push("is-endrange"),'"},S=function(e,t,n){var o=new Date(n,0,1),r=Math.ceil(((new Date(n,t,e)-o)/864e5+o.getDay()+1)/7);return''+r+""},E=function(e,t){return""+(t?e.reverse():e).join("")+""},T=function(e){return""+e.join("")+""},O=function(e){var t,n=[];for(e.showWeekNumber&&n.push(""),t=0;7>t;t++)n.push(''+R(e,t,!0)+"");return""+(e.isRTL?n.reverse():n).join("")+""},M=function(e,t,n,o,r){var i,s,a,l,u,c=e._o,d=n===c.minYear,f=n===c.maxYear,p='
',g=!0,m=!0;for(a=[],i=0;12>i;i++)a.push('");for(l='
'+c.i18n.months[o]+'
",h(c.yearRange)?(i=c.yearRange[0],s=c.yearRange[1]+1):(i=n-c.yearRange,s=1+n+c.yearRange),a=[];s>i&&i<=c.maxYear;i++)i>=c.minYear&&a.push('");return u='
'+n+c.yearSuffix+'
",p+=c.showMonthAfterYear?u+l:l+u,d&&(0===o||c.minMonth>=o)&&(g=!1),f&&(11===o||c.maxMonth<=o)&&(m=!1),0===t&&(p+='"),t===e._o.numberOfMonths-1&&(p+='"),p+="
"},k=function(e,t){return''+O(e)+T(t)+"
"},H=function(s){var a=this,l=a.config(s);a._onMouseDown=function(e){if(a._v){e=e||window.event;var t=e.target||e.srcElement;if(t)if(u(t,"is-disabled")||(u(t,"pika-button")&&!u(t,"is-empty")?(a.setDate(new Date(t.getAttribute("data-pika-year"),t.getAttribute("data-pika-month"),t.getAttribute("data-pika-day"))),l.bound&&r(function(){a.hide(),l.field&&l.field.blur()},100)):u(t,"pika-prev")?a.prevMonth():u(t,"pika-next")&&a.nextMonth()),u(t,"pika-select"))a._c=!0;else{if(!e.preventDefault)return e.returnValue=!1,!1;e.preventDefault()}}},a._onChange=function(e){e=e||window.event;var t=e.target||e.srcElement;t&&(u(t,"pika-select-month")?a.gotoMonth(t.value):u(t,"pika-select-year")&&a.gotoYear(t.value))},a._onInputChange=function(n){var o;n.firedBy!==a&&(t?(o=e(l.field.value,l.format),o=o&&o.isValid()?o.toDate():null):o=new Date(Date.parse(l.field.value)),f(o)&&a.setDate(o),a._v||a.show())},a._onInputFocus=function(){a.show()},a._onInputClick=function(){a.show()},a._onInputBlur=function(){var e=o.activeElement;do if(u(e,"pika-single"))return;while(e=e.parentNode);a._c||(a._b=r(function(){a.hide()},50)),a._c=!1},a._onClick=function(e){e=e||window.event;var t=e.target||e.srcElement,o=t;if(t){!n&&u(t,"pika-select")&&(t.onchange||(t.setAttribute("onchange","return;"),i(t,"change",a._onChange)));do if(u(o,"pika-single")||o===l.trigger)return;while(o=o.parentNode);a._v&&t!==l.trigger&&o!==l.trigger&&a.hide()}},a.el=o.createElement("div"),a.el.className="pika-single"+(l.isRTL?" is-rtl":"")+(l.theme?" "+l.theme:""),i(a.el,"mousedown",a._onMouseDown,!0),i(a.el,"touchend",a._onMouseDown,!0),i(a.el,"change",a._onChange),l.field&&(l.container?l.container.appendChild(a.el):l.bound?o.body.appendChild(a.el):l.field.parentNode.insertBefore(a.el,l.field.nextSibling),i(l.field,"change",a._onInputChange),l.defaultDate||(t&&l.field.value?l.defaultDate=e(l.field.value,l.format).toDate():l.defaultDate=new Date(Date.parse(l.field.value)),l.setDefaultDate=!0));var c=l.defaultDate;f(c)?l.setDefaultDate?a.setDate(c,!0):a.gotoDate(c):a.gotoDate(new Date),l.bound?(this.hide(),a.el.className+=" is-bound",i(l.trigger,"click",a._onInputClick),i(l.trigger,"focus",a._onInputFocus),i(l.trigger,"blur",a._onInputBlur)):this.show()};return H.prototype={config:function(e){this._o||(this._o=y({},C,!0));var t=y(this._o,e,!0);t.isRTL=!!t.isRTL,t.field=t.field&&t.field.nodeName?t.field:null,t.theme="string"==typeof t.theme&&t.theme?t.theme:null,t.bound=!!(void 0!==t.bound?t.field&&t.bound:t.field),t.trigger=t.trigger&&t.trigger.nodeName?t.trigger:t.field,t.disableWeekends=!!t.disableWeekends,t.disableDayFn="function"==typeof t.disableDayFn?t.disableDayFn:null;var n=parseInt(t.numberOfMonths,10)||1;if(t.numberOfMonths=n>4?4:n,f(t.minDate)||(t.minDate=!1),f(t.maxDate)||(t.maxDate=!1),t.minDate&&t.maxDate&&t.maxDate100&&(t.yearRange=100);return t},toString:function(n){return f(this._d)?t?e(this._d).format(n||this._o.format):this._d.toDateString():""},getMoment:function(){return t?e(this._d):null},setMoment:function(n,o){t&&e.isMoment(n)&&this.setDate(n.toDate(),o)},getDate:function(){return f(this._d)?new Date(this._d.getTime()):null},setDate:function(e,t){if(!e)return this._d=null,this._o.field&&(this._o.field.value="",a(this._o.field,"change",{firedBy:this})),this.draw();if("string"==typeof e&&(e=new Date(Date.parse(e))),f(e)){var n=this._o.minDate,o=this._o.maxDate;f(n)&&n>e?e=n:f(o)&&e>o&&(e=o),this._d=new Date(e.getTime()),w(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),a(this._o.field,"change",{firedBy:this})),t||"function"!=typeof this._o.onSelect||this._o.onSelect.call(this,this.getDate())}},gotoDate:function(e){var t=!0;if(f(e)){if(this.calendars){var n=new Date(this.calendars[0].year,this.calendars[0].month,1),o=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),r=e.getTime();o.setMonth(o.getMonth()+1),o.setDate(o.getDate()-1),t=r=o&&(this._y=o,!isNaN(s)&&this._m>s&&(this._m=s));for(var l=0;l'+M(this,l,this.calendars[l].year,this.calendars[l].month,this.calendars[0].year)+this.render(this.calendars[l].year,this.calendars[l].month)+"";if(this.el.innerHTML=a,t.bound&&"hidden"!==t.field.type&&r(function(){t.trigger.focus()},1),"function"==typeof this._o.onDraw){var u=this;r(function(){u._o.onDraw.call(u)},0)}}},adjustPosition:function(){var e,t,n,r,i,s,a,l,u,c;if(!this._o.container){if(this.el.style.position="absolute",e=this._o.trigger,t=e,n=this.el.offsetWidth,r=this.el.offsetHeight,i=window.innerWidth||o.documentElement.clientWidth,s=window.innerHeight||o.documentElement.clientHeight,a=window.pageYOffset||o.body.scrollTop||o.documentElement.scrollTop,"function"==typeof e.getBoundingClientRect)c=e.getBoundingClientRect(),l=c.left+window.pageXOffset,u=c.bottom+window.pageYOffset;else for(l=t.offsetLeft,u=t.offsetTop+t.offsetHeight;t=t.offsetParent;)l+=t.offsetLeft,u+=t.offsetTop;(this._o.reposition&&l+n>i||this._o.position.indexOf("right")>-1&&l-n+e.offsetWidth>0)&&(l=l-n+e.offsetWidth),(this._o.reposition&&u+r>s+a||this._o.position.indexOf("top")>-1&&u-r-e.offsetHeight>0)&&(u=u-r-e.offsetHeight),this.el.style.left=l+"px",this.el.style.top=u+"px"}},render:function(e,t){var n=this._o,o=new Date,r=m(e,t),i=new Date(e,t,1).getDay(),s=[],a=[];w(o),n.firstDay>0&&(i-=n.firstDay,0>i&&(i+=7));for(var l=r+i,u=l;u>7;)u-=7;l+=7-u;for(var c=0,d=0;l>c;c++){var h=new Date(e,t,1+(c-i)),g=f(this._d)?v(h,this._d):!1,y=v(h,o),b=i>c||c>=r+i,C=n.startRange&&v(n.startRange,h),R=n.endRange&&v(n.endRange,h),T=n.startRange&&n.endRange&&n.startRangen.maxDate||n.disableWeekends&&p(h)||n.disableDayFn&&n.disableDayFn(h),M={day:1+(c-i),month:t,year:e,isSelected:g,isToday:y,isDisabled:O,isEmpty:b,isStartRange:C,isEndRange:R,isInRange:T};a.push(_(M)),7===++d&&(n.showWeekNumber&&a.unshift(S(c-i,t,e)),s.push(E(a,n.isRTL)),a=[],d=0)}return k(n,s)},isVisible:function(){return this._v},show:function(){this._v||(d(this.el,"is-hidden"),this._v=!0,this.draw(),this._o.bound&&(i(o,"click",this._onClick),this.adjustPosition()),"function"==typeof this._o.onOpen&&this._o.onOpen.call(this))},hide:function(){var e=this._v;e!==!1&&(this._o.bound&&s(o,"click",this._onClick),this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto",c(this.el,"is-hidden"),this._v=!1,void 0!==e&&"function"==typeof this._o.onClose&&this._o.onClose.call(this))},destroy:function(){this.hide(),s(this.el,"mousedown",this._onMouseDown,!0),s(this.el,"touchend",this._onMouseDown,!0),s(this.el,"change",this._onChange),this._o.field&&(s(this._o.field,"change",this._onInputChange),this._o.bound&&(s(this._o.trigger,"click",this._onInputClick),s(this._o.trigger,"focus",this._onInputFocus),s(this._o.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}},H})},{moment:"moment"}],zeroclipboard:[function(t,n,o){/*! * ZeroClipboard * The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface. * Copyright (c) 2009-2014 Jon Rohan, James M. Greene @@ -56,4 +56,4 @@ zo.utc=ze,zo.local=Ye,zo.parseZone=Ue,zo.hasAlignedHourOffset=Ge,zo.isDST=$e,zo. * http://zeroclipboard.org/ * v2.2.0 */ -!function(t,o){"use strict";var r,i,s,a=t,l=a.document,u=a.navigator,c=a.setTimeout,d=a.clearTimeout,h=a.setInterval,f=a.clearInterval,p=a.getComputedStyle,g=a.encodeURIComponent,m=a.ActiveXObject,v=a.Error,w=a.Number.parseInt||a.parseInt,y=a.Number.parseFloat||a.parseFloat,b=a.Number.isNaN||a.isNaN,C=a.Date.now,R=a.Object.keys,_=a.Object.defineProperty,S=a.Object.prototype.hasOwnProperty,E=a.Array.prototype.slice,T=function(){var e=function(e){return e};if("function"==typeof a.wrap&&"function"==typeof a.unwrap)try{var t=l.createElement("div"),n=a.unwrap(t);1===t.nodeType&&n&&1===n.nodeType&&(e=a.unwrap)}catch(o){}return e}(),O=function(e){return E.call(e,0)},M=function(){var e,t,n,r,i,s,a=O(arguments),l=a[0]||{};for(e=1,t=a.length;t>e;e++)if(null!=(n=a[e]))for(r in n)S.call(n,r)&&(i=l[r],s=n[r],l!==s&&s!==o&&(l[r]=s));return l},k=function(e){var t,n,o,r;if("object"!=typeof e||null==e||"number"==typeof e.nodeType)t=e;else if("number"==typeof e.length)for(t=[],n=0,o=e.length;o>n;n++)S.call(e,n)&&(t[n]=k(e[n]));else{t={};for(r in e)S.call(e,r)&&(t[r]=k(e[r]))}return t},H=function(e,t){for(var n={},o=0,r=t.length;r>o;o++)t[o]in e&&(n[t[o]]=e[t[o]]);return n},D=function(e,t){var n={};for(var o in e)-1===t.indexOf(o)&&(n[o]=e[o]);return n},A=function(e){if(e)for(var t in e)S.call(e,t)&&delete e[t];return e},x=function(e,t){if(e&&1===e.nodeType&&e.ownerDocument&&t&&(1===t.nodeType&&t.ownerDocument&&t.ownerDocument===e.ownerDocument||9===t.nodeType&&!t.ownerDocument&&t===e.ownerDocument))do{if(e===t)return!0;e=e.parentNode}while(e);return!1},P=function(e){var t;return"string"==typeof e&&e&&(t=e.split("#")[0].split("?")[0],t=e.slice(0,e.lastIndexOf("/")+1)),t},N=function(e){var t,n;return"string"==typeof e&&e&&(n=e.match(/^(?:|[^:@]*@|.+\)@(?=http[s]?|file)|.+?\s+(?: at |@)(?:[^:\(]+ )*[\(]?)((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/),n&&n[1]?t=n[1]:(n=e.match(/\)@((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/),n&&n[1]&&(t=n[1]))),t},L=function(){var e,t;try{throw new v}catch(n){t=n}return t&&(e=t.sourceURL||t.fileName||N(t.stack)),e},W=function(){var e,t,n;if(l.currentScript&&(e=l.currentScript.src))return e;if(t=l.getElementsByTagName("script"),1===t.length)return t[0].src||o;if("readyState"in t[0])for(n=t.length;n--;)if("interactive"===t[n].readyState&&(e=t[n].src))return e;return"loading"===l.readyState&&(e=t[t.length-1].src)?e:(e=L())?e:o},I=function(){var e,t,n,r=l.getElementsByTagName("script");for(e=r.length;e--;){if(!(n=r[e].src)){t=null;break}if(n=P(n),null==t)t=n;else if(t!==n){t=null;break}}return t||o},j=function(){var e=P(W())||I()||"";return e+"ZeroClipboard.swf"},B=function(){return null==t.opener&&(!!t.top&&t!=t.top||!!t.parent&&t!=t.parent)}(),F={bridge:null,version:"0.0.0",pluginType:"unknown",disabled:null,outdated:null,sandboxed:null,unavailable:null,degraded:null,deactivated:null,overdue:null,ready:null},V="11.0.0",z={},Y={},U=null,G=0,$=0,K={ready:"Flash communication is established",error:{"flash-disabled":"Flash is disabled or not installed. May also be attempting to run Flash in a sandboxed iframe, which is impossible.","flash-outdated":"Flash is too outdated to support ZeroClipboard","flash-sandboxed":"Attempting to run Flash in a sandboxed iframe, which is impossible","flash-unavailable":"Flash is unable to communicate bidirectionally with JavaScript","flash-degraded":"Flash is unable to preserve data fidelity when communicating with JavaScript","flash-deactivated":"Flash is too outdated for your browser and/or is configured as click-to-activate.\nThis may also mean that the ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity.\nMay also be attempting to run Flash in a sandboxed iframe, which is impossible.","flash-overdue":"Flash communication was established but NOT within the acceptable time limit","version-mismatch":"ZeroClipboard JS version number does not match ZeroClipboard SWF version number","clipboard-error":"At least one error was thrown while ZeroClipboard was attempting to inject your data into the clipboard","config-mismatch":"ZeroClipboard configuration does not match Flash's reality","swf-not-found":"The ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity"}},X=["flash-unavailable","flash-degraded","flash-overdue","version-mismatch","config-mismatch","clipboard-error"],q=["flash-disabled","flash-outdated","flash-sandboxed","flash-unavailable","flash-degraded","flash-deactivated","flash-overdue"],Z=new RegExp("^flash-("+q.map(function(e){return e.replace(/^flash-/,"")}).join("|")+")$"),J=new RegExp("^flash-("+q.slice(1).map(function(e){return e.replace(/^flash-/,"")}).join("|")+")$"),Q={swfPath:j(),trustedDomains:t.location.host?[t.location.host]:[],cacheBust:!0,forceEnhancedClipboard:!1,flashLoadTimeout:3e4,autoActivate:!0,bubbleEvents:!0,containerId:"global-zeroclipboard-html-bridge",containerClass:"global-zeroclipboard-container",swfObjectId:"global-zeroclipboard-flash-bridge",hoverClass:"zeroclipboard-is-hover",activeClass:"zeroclipboard-is-active",forceHandCursor:!1,title:null,zIndex:999999999},ee=function(e){if("object"==typeof e&&null!==e)for(var t in e)if(S.call(e,t))if(/^(?:forceHandCursor|title|zIndex|bubbleEvents)$/.test(t))Q[t]=e[t];else if(null==F.bridge)if("containerId"===t||"swfObjectId"===t){if(!ge(e[t]))throw new Error("The specified `"+t+"` value is not valid as an HTML4 Element ID");Q[t]=e[t]}else Q[t]=e[t];{if("string"!=typeof e||!e)return k(Q);if(S.call(Q,e))return Q[e]}},te=function(){return $e(),{browser:H(u,["userAgent","platform","appName"]),flash:D(F,["bridge"]),zeroclipboard:{version:Xe.version,config:Xe.config()}}},ne=function(){return!!(F.disabled||F.outdated||F.sandboxed||F.unavailable||F.degraded||F.deactivated)},oe=function(e,t){var n,i,s,a={};if("string"==typeof e&&e)s=e.toLowerCase().split(/\s+/);else if("object"==typeof e&&e&&"undefined"==typeof t)for(n in e)S.call(e,n)&&"string"==typeof n&&n&&"function"==typeof e[n]&&Xe.on(n,e[n]);if(s&&s.length){for(n=0,i=s.length;i>n;n++)e=s[n].replace(/^on/,""),a[e]=!0,z[e]||(z[e]=[]),z[e].push(t);if(a.ready&&F.ready&&Xe.emit({type:"ready"}),a.error){for(n=0,i=q.length;i>n;n++)if(F[q[n].replace(/^flash-/,"")]===!0){Xe.emit({type:"error",name:q[n]});break}r!==o&&Xe.version!==r&&Xe.emit({type:"error",name:"version-mismatch",jsVersion:Xe.version,swfVersion:r})}}return Xe},re=function(e,t){var n,o,r,i,s;if(0===arguments.length)i=R(z);else if("string"==typeof e&&e)i=e.split(/\s+/);else if("object"==typeof e&&e&&"undefined"==typeof t)for(n in e)S.call(e,n)&&"string"==typeof n&&n&&"function"==typeof e[n]&&Xe.off(n,e[n]);if(i&&i.length)for(n=0,o=i.length;o>n;n++)if(e=i[n].toLowerCase().replace(/^on/,""),s=z[e],s&&s.length)if(t)for(r=s.indexOf(t);-1!==r;)s.splice(r,1),r=s.indexOf(t,r);else s.length=0;return Xe},ie=function(e){var t;return t="string"==typeof e&&e?k(z[e])||null:k(z)},se=function(e){var t,n,o;return e=me(e),e&&!_e(e)?"ready"===e.type&&F.overdue===!0?Xe.emit({type:"error",name:"flash-overdue"}):(t=M({},e),Ce.call(this,t),"copy"===e.type&&(o=De(Y),n=o.data,U=o.formatMap),n):void 0},ae=function(){var e=F.sandboxed;if($e(),"boolean"!=typeof F.ready&&(F.ready=!1),F.sandboxed!==e&&F.sandboxed===!0)F.ready=!1,Xe.emit({type:"error",name:"flash-sandboxed"});else if(!Xe.isFlashUnusable()&&null===F.bridge){var t=Q.flashLoadTimeout;"number"==typeof t&&t>=0&&(G=c(function(){"boolean"!=typeof F.deactivated&&(F.deactivated=!0),F.deactivated===!0&&Xe.emit({type:"error",name:"flash-deactivated"})},t)),F.overdue=!1,ke()}},le=function(){Xe.clearData(),Xe.blur(),Xe.emit("destroy"),He(),Xe.off()},ue=function(e,t){var n;if("object"==typeof e&&e&&"undefined"==typeof t)n=e,Xe.clearData();else{if("string"!=typeof e||!e)return;n={},n[e]=t}for(var o in n)"string"==typeof o&&o&&S.call(n,o)&&"string"==typeof n[o]&&n[o]&&(Y[o]=n[o])},ce=function(e){"undefined"==typeof e?(A(Y),U=null):"string"==typeof e&&S.call(Y,e)&&delete Y[e]},de=function(e){return"undefined"==typeof e?k(Y):"string"==typeof e&&S.call(Y,e)?Y[e]:void 0},he=function(e){if(e&&1===e.nodeType){i&&(je(i,Q.activeClass),i!==e&&je(i,Q.hoverClass)),i=e,Ie(e,Q.hoverClass);var t=e.getAttribute("title")||Q.title;if("string"==typeof t&&t){var n=Me(F.bridge);n&&n.setAttribute("title",t)}var o=Q.forceHandCursor===!0||"pointer"===Be(e,"cursor");Ue(o),Ye()}},fe=function(){var e=Me(F.bridge);e&&(e.removeAttribute("title"),e.style.left="0px",e.style.top="-9999px",e.style.width="1px",e.style.height="1px"),i&&(je(i,Q.hoverClass),je(i,Q.activeClass),i=null)},pe=function(){return i||null},ge=function(e){return"string"==typeof e&&e&&/^[A-Za-z][A-Za-z0-9_:\-\.]*$/.test(e)},me=function(e){var t;if("string"==typeof e&&e?(t=e,e={}):"object"==typeof e&&e&&"string"==typeof e.type&&e.type&&(t=e.type),t){t=t.toLowerCase(),!e.target&&(/^(copy|aftercopy|_click)$/.test(t)||"error"===t&&"clipboard-error"===e.name)&&(e.target=s),M(e,{type:t,target:e.target||i||null,relatedTarget:e.relatedTarget||null,currentTarget:F&&F.bridge||null,timeStamp:e.timeStamp||C()||null});var n=K[e.type];return"error"===e.type&&e.name&&n&&(n=n[e.name]),n&&(e.message=n),"ready"===e.type&&M(e,{target:null,version:F.version}),"error"===e.type&&(Z.test(e.name)&&M(e,{target:null,minimumVersion:V}),J.test(e.name)&&M(e,{version:F.version})),"copy"===e.type&&(e.clipboardData={setData:Xe.setData,clearData:Xe.clearData}),"aftercopy"===e.type&&(e=Ae(e,U)),e.target&&!e.relatedTarget&&(e.relatedTarget=ve(e.target)),we(e)}},ve=function(e){var t=e&&e.getAttribute&&e.getAttribute("data-clipboard-target");return t?l.getElementById(t):null},we=function(e){if(e&&/^_(?:click|mouse(?:over|out|down|up|move))$/.test(e.type)){var t=e.target,n="_mouseover"===e.type&&e.relatedTarget?e.relatedTarget:o,r="_mouseout"===e.type&&e.relatedTarget?e.relatedTarget:o,i=Fe(t),s=a.screenLeft||a.screenX||0,u=a.screenTop||a.screenY||0,c=l.body.scrollLeft+l.documentElement.scrollLeft,d=l.body.scrollTop+l.documentElement.scrollTop,h=i.left+("number"==typeof e._stageX?e._stageX:0),f=i.top+("number"==typeof e._stageY?e._stageY:0),p=h-c,g=f-d,m=s+p,v=u+g,w="number"==typeof e.movementX?e.movementX:0,y="number"==typeof e.movementY?e.movementY:0;delete e._stageX,delete e._stageY,M(e,{srcElement:t,fromElement:n,toElement:r,screenX:m,screenY:v,pageX:h,pageY:f,clientX:p,clientY:g,x:p,y:g,movementX:w,movementY:y,offsetX:0,offsetY:0,layerX:0,layerY:0})}return e},ye=function(e){var t=e&&"string"==typeof e.type&&e.type||"";return!/^(?:(?:before)?copy|destroy)$/.test(t)},be=function(e,t,n,o){o?c(function(){e.apply(t,n)},0):e.apply(t,n)},Ce=function(e){if("object"==typeof e&&e&&e.type){var t=ye(e),n=z["*"]||[],o=z[e.type]||[],r=n.concat(o);if(r&&r.length){var i,s,l,u,c,d=this;for(i=0,s=r.length;s>i;i++)l=r[i],u=d,"string"==typeof l&&"function"==typeof a[l]&&(l=a[l]),"object"==typeof l&&l&&"function"==typeof l.handleEvent&&(u=l,l=l.handleEvent),"function"==typeof l&&(c=M({},e),be(l,u,[c],t))}return this}},Re=function(e){var t=null;return(B===!1||e&&"error"===e.type&&e.name&&-1!==X.indexOf(e.name))&&(t=!1),t},_e=function(e){var t=e.target||i||null,n="swf"===e._source;switch(delete e._source,e.type){case"error":var o="flash-sandboxed"===e.name||Re(e);"boolean"==typeof o&&(F.sandboxed=o),-1!==q.indexOf(e.name)?M(F,{disabled:"flash-disabled"===e.name,outdated:"flash-outdated"===e.name,unavailable:"flash-unavailable"===e.name,degraded:"flash-degraded"===e.name,deactivated:"flash-deactivated"===e.name,overdue:"flash-overdue"===e.name,ready:!1}):"version-mismatch"===e.name&&(r=e.swfVersion,M(F,{disabled:!1,outdated:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:!1,ready:!1})),ze();break;case"ready":r=e.swfVersion;var a=F.deactivated===!0;M(F,{disabled:!1,outdated:!1,sandboxed:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:a,ready:!a}),ze();break;case"beforecopy":s=t;break;case"copy":var l,u,c=e.relatedTarget;!Y["text/html"]&&!Y["text/plain"]&&c&&(u=c.value||c.outerHTML||c.innerHTML)&&(l=c.value||c.textContent||c.innerText)?(e.clipboardData.clearData(),e.clipboardData.setData("text/plain",l),u!==l&&e.clipboardData.setData("text/html",u)):!Y["text/plain"]&&e.target&&(l=e.target.getAttribute("data-clipboard-text"))&&(e.clipboardData.clearData(),e.clipboardData.setData("text/plain",l));break;case"aftercopy":Se(e),Xe.clearData(),t&&t!==We()&&t.focus&&t.focus();break;case"_mouseover":Xe.focus(t),Q.bubbleEvents===!0&&n&&(t&&t!==e.relatedTarget&&!x(e.relatedTarget,t)&&Ee(M({},e,{type:"mouseenter",bubbles:!1,cancelable:!1})),Ee(M({},e,{type:"mouseover"})));break;case"_mouseout":Xe.blur(),Q.bubbleEvents===!0&&n&&(t&&t!==e.relatedTarget&&!x(e.relatedTarget,t)&&Ee(M({},e,{type:"mouseleave",bubbles:!1,cancelable:!1})),Ee(M({},e,{type:"mouseout"})));break;case"_mousedown":Ie(t,Q.activeClass),Q.bubbleEvents===!0&&n&&Ee(M({},e,{type:e.type.slice(1)}));break;case"_mouseup":je(t,Q.activeClass),Q.bubbleEvents===!0&&n&&Ee(M({},e,{type:e.type.slice(1)}));break;case"_click":s=null,Q.bubbleEvents===!0&&n&&Ee(M({},e,{type:e.type.slice(1)}));break;case"_mousemove":Q.bubbleEvents===!0&&n&&Ee(M({},e,{type:e.type.slice(1)}))}return/^_(?:click|mouse(?:over|out|down|up|move))$/.test(e.type)?!0:void 0},Se=function(e){if(e.errors&&e.errors.length>0){var t=k(e);M(t,{type:"error",name:"clipboard-error"}),delete t.success,c(function(){Xe.emit(t)},0)}},Ee=function(e){if(e&&"string"==typeof e.type&&e){var t,n=e.target||null,o=n&&n.ownerDocument||l,r={view:o.defaultView||a,canBubble:!0,cancelable:!0,detail:"click"===e.type?1:0,button:"number"==typeof e.which?e.which-1:"number"==typeof e.button?e.button:o.createEvent?0:1},i=M(r,e);n&&o.createEvent&&n.dispatchEvent&&(i=[i.type,i.canBubble,i.cancelable,i.view,i.detail,i.screenX,i.screenY,i.clientX,i.clientY,i.ctrlKey,i.altKey,i.shiftKey,i.metaKey,i.button,i.relatedTarget],t=o.createEvent("MouseEvents"),t.initMouseEvent&&(t.initMouseEvent.apply(t,i),t._source="js",n.dispatchEvent(t)))}},Te=function(){var e=Q.flashLoadTimeout;if("number"==typeof e&&e>=0){var t=Math.min(1e3,e/10),n=Q.swfObjectId+"_fallbackContent";$=h(function(){var e=l.getElementById(n);Ve(e)&&(ze(),F.deactivated=null,Xe.emit({type:"error",name:"swf-not-found"}))},t)}},Oe=function(){var e=l.createElement("div");return e.id=Q.containerId,e.className=Q.containerClass,e.style.position="absolute",e.style.left="0px",e.style.top="-9999px",e.style.width="1px",e.style.height="1px",e.style.zIndex=""+Ge(Q.zIndex),e},Me=function(e){for(var t=e&&e.parentNode;t&&"OBJECT"===t.nodeName&&t.parentNode;)t=t.parentNode;return t||null},ke=function(){var e,t=F.bridge,n=Me(t);if(!t){var o=Le(a.location.host,Q),r="never"===o?"none":"all",i=Pe(M({jsVersion:Xe.version},Q)),s=Q.swfPath+xe(Q.swfPath,Q);n=Oe();var u=l.createElement("div");n.appendChild(u),l.body.appendChild(n);var c=l.createElement("div"),d="activex"===F.pluginType;c.innerHTML='"+(d?'':"")+'
 
',t=c.firstChild,c=null,T(t).ZeroClipboard=Xe,n.replaceChild(t,u),Te()}return t||(t=l[Q.swfObjectId],t&&(e=t.length)&&(t=t[e-1]),!t&&n&&(t=n.firstChild)),F.bridge=t||null,t},He=function(){var e=F.bridge;if(e){var t=Me(e);t&&("activex"===F.pluginType&&"readyState"in e?(e.style.display="none",function n(){if(4===e.readyState){for(var o in e)"function"==typeof e[o]&&(e[o]=null);e.parentNode&&e.parentNode.removeChild(e),t.parentNode&&t.parentNode.removeChild(t)}else c(n,10)}()):(e.parentNode&&e.parentNode.removeChild(e),t.parentNode&&t.parentNode.removeChild(t))),ze(),F.ready=null,F.bridge=null,F.deactivated=null,r=o}},De=function(e){var t={},n={};if("object"==typeof e&&e){for(var o in e)if(o&&S.call(e,o)&&"string"==typeof e[o]&&e[o])switch(o.toLowerCase()){case"text/plain":case"text":case"air:text":case"flash:text":t.text=e[o],n.text=o;break;case"text/html":case"html":case"air:html":case"flash:html":t.html=e[o],n.html=o;break;case"application/rtf":case"text/rtf":case"rtf":case"richtext":case"air:rtf":case"flash:rtf":t.rtf=e[o],n.rtf=o}return{data:t,formatMap:n}}},Ae=function(e,t){if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;var n={};for(var o in e)if(S.call(e,o))if("errors"===o){n[o]=e[o]?e[o].slice():[];for(var r=0,i=n[o].length;i>r;r++)n[o][r].format=t[n[o][r].format]}else if("success"!==o&&"data"!==o)n[o]=e[o];else{n[o]={};var s=e[o];for(var a in s)a&&S.call(s,a)&&S.call(t,a)&&(n[o][t[a]]=s[a])}return n},xe=function(e,t){var n=null==t||t&&t.cacheBust===!0;return n?(-1===e.indexOf("?")?"?":"&")+"noCache="+C():""},Pe=function(e){var t,n,o,r,i="",s=[];if(e.trustedDomains&&("string"==typeof e.trustedDomains?r=[e.trustedDomains]:"object"==typeof e.trustedDomains&&"length"in e.trustedDomains&&(r=e.trustedDomains)),r&&r.length)for(t=0,n=r.length;n>t;t++)if(S.call(r,t)&&r[t]&&"string"==typeof r[t]){if(o=Ne(r[t]),!o)continue;if("*"===o){s.length=0,s.push(o);break}s.push.apply(s,[o,"//"+o,a.location.protocol+"//"+o])}return s.length&&(i+="trustedOrigins="+g(s.join(","))),e.forceEnhancedClipboard===!0&&(i+=(i?"&":"")+"forceEnhancedClipboard=true"),"string"==typeof e.swfObjectId&&e.swfObjectId&&(i+=(i?"&":"")+"swfObjectId="+g(e.swfObjectId)),"string"==typeof e.jsVersion&&e.jsVersion&&(i+=(i?"&":"")+"jsVersion="+g(e.jsVersion)),i},Ne=function(e){if(null==e||""===e)return null;if(e=e.replace(/^\s+|\s+$/g,""),""===e)return null;var t=e.indexOf("//");e=-1===t?e:e.slice(t+2);var n=e.indexOf("/");return e=-1===n?e:-1===t||0===n?null:e.slice(0,n),e&&".swf"===e.slice(-4).toLowerCase()?null:e||null},Le=function(){var e=function(e){var t,n,o,r=[];if("string"==typeof e&&(e=[e]),"object"!=typeof e||!e||"number"!=typeof e.length)return r;for(t=0,n=e.length;n>t;t++)if(S.call(e,t)&&(o=Ne(e[t]))){if("*"===o){r.length=0,r.push("*");break}-1===r.indexOf(o)&&r.push(o)}return r};return function(t,n){var o=Ne(n.swfPath);null===o&&(o=t);var r=e(n.trustedDomains),i=r.length;if(i>0){if(1===i&&"*"===r[0])return"always";if(-1!==r.indexOf(t))return 1===i&&t===o?"sameDomain":"always"}return"never"}}(),We=function(){try{return l.activeElement}catch(e){return null}},Ie=function(e,t){var n,o,r,i=[];if("string"==typeof t&&t&&(i=t.split(/\s+/)),e&&1===e.nodeType&&i.length>0)if(e.classList)for(n=0,o=i.length;o>n;n++)e.classList.add(i[n]);else if(e.hasOwnProperty("className")){for(r=" "+e.className+" ",n=0,o=i.length;o>n;n++)-1===r.indexOf(" "+i[n]+" ")&&(r+=i[n]+" ");e.className=r.replace(/^\s+|\s+$/g,"")}return e},je=function(e,t){var n,o,r,i=[];if("string"==typeof t&&t&&(i=t.split(/\s+/)),e&&1===e.nodeType&&i.length>0)if(e.classList&&e.classList.length>0)for(n=0,o=i.length;o>n;n++)e.classList.remove(i[n]);else if(e.className){for(r=(" "+e.className+" ").replace(/[\r\n\t]/g," "),n=0,o=i.length;o>n;n++)r=r.replace(" "+i[n]+" "," ");e.className=r.replace(/^\s+|\s+$/g,"")}return e},Be=function(e,t){var n=p(e,null).getPropertyValue(t);return"cursor"!==t||n&&"auto"!==n||"A"!==e.nodeName?n:"pointer"},Fe=function(e){var t={left:0,top:0,width:0,height:0};if(e.getBoundingClientRect){var n=e.getBoundingClientRect(),o=a.pageXOffset,r=a.pageYOffset,i=l.documentElement.clientLeft||0,s=l.documentElement.clientTop||0,u=0,c=0;if("relative"===Be(l.body,"position")){var d=l.body.getBoundingClientRect(),h=l.documentElement.getBoundingClientRect();u=d.left-h.left||0,c=d.top-h.top||0}t.left=n.left+o-i-u,t.top=n.top+r-s-c,t.width="width"in n?n.width:n.right-n.left,t.height="height"in n?n.height:n.bottom-n.top}return t},Ve=function(e){if(!e)return!1;var t=p(e,null),n=y(t.height)>0,o=y(t.width)>0,r=y(t.top)>=0,i=y(t.left)>=0,s=n&&o&&r&&i,a=s?null:Fe(e),l="none"!==t.display&&"collapse"!==t.visibility&&(s||!!a&&(n||a.height>0)&&(o||a.width>0)&&(r||a.top>=0)&&(i||a.left>=0));return l},ze=function(){d(G),G=0,f($),$=0},Ye=function(){var e;if(i&&(e=Me(F.bridge))){var t=Fe(i);M(e.style,{width:t.width+"px",height:t.height+"px",top:t.top+"px",left:t.left+"px",zIndex:""+Ge(Q.zIndex)})}},Ue=function(e){F.ready===!0&&(F.bridge&&"function"==typeof F.bridge.setHandCursor?F.bridge.setHandCursor(e):F.ready=!1)},Ge=function(e){if(/^(?:auto|inherit)$/.test(e))return e;var t;return"number"!=typeof e||b(e)?"string"==typeof e&&(t=Ge(w(e,10))):t=e,"number"==typeof t?t:"auto"},$e=function(e){var n,o,r,i=F.sandboxed,s=null;if(e=e===!0,B===!1)s=!1;else{try{o=t.frameElement||null}catch(a){r={name:a.name,message:a.message}}if(o&&1===o.nodeType&&"IFRAME"===o.nodeName)try{s=o.hasAttribute("sandbox")}catch(a){s=null}else{try{n=document.domain||null}catch(a){n=null}(null===n||r&&"SecurityError"===r.name&&/(^|[\s\(\[@])sandbox(es|ed|ing|[\s\.,!\)\]@]|$)/.test(r.message.toLowerCase()))&&(s=!0)}}return F.sandboxed=s,i===s||e||Ke(m),s},Ke=function(e){function t(e){var t=e.match(/[\d]+/g);return t.length=3,t.join(".")}function n(e){return!!e&&(e=e.toLowerCase())&&(/^(pepflashplayer\.dll|libpepflashplayer\.so|pepperflashplayer\.plugin)$/.test(e)||"chrome.plugin"===e.slice(-13))}function o(e){e&&(a=!0,e.version&&(d=t(e.version)),!d&&e.description&&(d=t(e.description)),e.filename&&(c=n(e.filename)))}var r,i,s,a=!1,l=!1,c=!1,d="";if(u.plugins&&u.plugins.length)r=u.plugins["Shockwave Flash"],o(r),u.plugins["Shockwave Flash 2.0"]&&(a=!0,d="2.0.0.11");else if(u.mimeTypes&&u.mimeTypes.length)s=u.mimeTypes["application/x-shockwave-flash"],r=s&&s.enabledPlugin,o(r);else if("undefined"!=typeof e){l=!0;try{i=new e("ShockwaveFlash.ShockwaveFlash.7"),a=!0,d=t(i.GetVariable("$version"))}catch(h){try{i=new e("ShockwaveFlash.ShockwaveFlash.6"),a=!0,d="6.0.21"}catch(f){try{i=new e("ShockwaveFlash.ShockwaveFlash"),a=!0,d=t(i.GetVariable("$version"))}catch(p){l=!1}}}}F.disabled=a!==!0,F.outdated=d&&y(d)n;n++)e=s[n].replace(/^on/,""),a[e]=!0,u[e]||(u[e]=[]),u[e].push(t);if(a.ready&&F.ready&&this.emit({type:"ready",client:this}),a.error){for(n=0,i=q.length;i>n;n++)if(F[q[n].replace(/^flash-/,"")]){this.emit({type:"error",name:q[n],client:this});break}r!==o&&Xe.version!==r&&this.emit({type:"error",name:"version-mismatch",jsVersion:Xe.version,swfVersion:r})}}return this},ot=function(e,t){var n,o,r,i,s,a=Ze[this.id],l=a&&a.handlers;if(!l)return this;if(0===arguments.length)i=R(l);else if("string"==typeof e&&e)i=e.split(/\s+/);else if("object"==typeof e&&e&&"undefined"==typeof t)for(n in e)S.call(e,n)&&"string"==typeof n&&n&&"function"==typeof e[n]&&this.off(n,e[n]);if(i&&i.length)for(n=0,o=i.length;o>n;n++)if(e=i[n].toLowerCase().replace(/^on/,""),s=l[e],s&&s.length)if(t)for(r=s.indexOf(t);-1!==r;)s.splice(r,1),r=s.indexOf(t,r);else s.length=0;return this},rt=function(e){var t=null,n=Ze[this.id]&&Ze[this.id].handlers;return n&&(t="string"==typeof e&&e?n[e]?n[e].slice(0):[]:k(n)),t},it=function(e){if(ct.call(this,e)){"object"==typeof e&&e&&"string"==typeof e.type&&e.type&&(e=M({},e));var t=M({},me(e),{client:this});dt.call(this,t)}return this},st=function(e){if(!Ze[this.id])throw new Error("Attempted to clip element(s) to a destroyed ZeroClipboard client instance");e=ht(e);for(var t=0;t0,r=!e.target||o&&-1!==n.indexOf(e.target),i=e.relatedTarget&&o&&-1!==n.indexOf(e.relatedTarget),s=e.client&&e.client===this;return t&&(r||i||s)?!0:!1},dt=function(e){var t=Ze[this.id];if("object"==typeof e&&e&&e.type&&t){var n=ye(e),o=t&&t.handlers["*"]||[],r=t&&t.handlers[e.type]||[],i=o.concat(r);if(i&&i.length){var s,l,u,c,d,h=this;for(s=0,l=i.length;l>s;s++)u=i[s],c=h,"string"==typeof u&&"function"==typeof a[u]&&(u=a[u]),"object"==typeof u&&u&&"function"==typeof u.handleEvent&&(c=u,u=u.handleEvent),"function"==typeof u&&(d=M({},e),be(u,c,[d],n))}}},ht=function(e){return"string"==typeof e&&(e=[]),"number"!=typeof e.length?[e]:e},ft=function(e){if(e&&1===e.nodeType){var t=function(e){(e||(e=a.event))&&("js"!==e._source&&(e.stopImmediatePropagation(),e.preventDefault()),delete e._source)},n=function(n){(n||(n=a.event))&&(t(n),Xe.focus(e))};e.addEventListener("mouseover",n,!1),e.addEventListener("mouseout",t,!1),e.addEventListener("mouseenter",t,!1),e.addEventListener("mouseleave",t,!1),e.addEventListener("mousemove",t,!1),et[e.zcClippingId]={mouseover:n,mouseout:t,mouseenter:t,mouseleave:t,mousemove:t}}},pt=function(e){if(e&&1===e.nodeType){var t=et[e.zcClippingId];if("object"==typeof t&&t){for(var n,o,r=["move","leave","enter","out","over"],i=0,s=r.length;s>i;i++)n="mouse"+r[i],o=t[n],"function"==typeof o&&e.removeEventListener(n,o,!1);delete et[e.zcClippingId]}}};Xe._createClient=function(){tt.apply(this,O(arguments))},Xe.prototype.on=function(){return nt.apply(this,O(arguments))},Xe.prototype.off=function(){return ot.apply(this,O(arguments))},Xe.prototype.handlers=function(){return rt.apply(this,O(arguments))},Xe.prototype.emit=function(){return it.apply(this,O(arguments))},Xe.prototype.clip=function(){return st.apply(this,O(arguments))},Xe.prototype.unclip=function(){return at.apply(this,O(arguments))},Xe.prototype.elements=function(){return lt.apply(this,O(arguments))},Xe.prototype.destroy=function(){return ut.apply(this,O(arguments))},Xe.prototype.setText=function(e){if(!Ze[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.setData("text/plain",e),this},Xe.prototype.setHtml=function(e){if(!Ze[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.setData("text/html",e),this},Xe.prototype.setRichText=function(e){if(!Ze[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.setData("application/rtf",e),this},Xe.prototype.setData=function(){if(!Ze[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.setData.apply(this,O(arguments)),this},Xe.prototype.clearData=function(){if(!Ze[this.id])throw new Error("Attempted to clear pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.clearData.apply(this,O(arguments)),this},Xe.prototype.getData=function(){if(!Ze[this.id])throw new Error("Attempted to get pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.getData.apply(this,O(arguments))},"function"==typeof e&&e.amd?e(function(){return Xe}):"object"==typeof n&&n&&"object"==typeof n.exports&&n.exports?n.exports=Xe:t.ZeroClipboard=Xe}(function(){return this||window}())},{}]},{},[23,59,61,60,62,83,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,84,85,86,87,100,101,102,90,91,92,93,94,95,31,35,32,33,40,34,36,37,38,39])("zeroclipboard")}); \ No newline at end of file +!function(t,o){"use strict";var r,i,s,a=t,l=a.document,u=a.navigator,c=a.setTimeout,d=a.clearTimeout,h=a.setInterval,f=a.clearInterval,p=a.getComputedStyle,g=a.encodeURIComponent,m=a.ActiveXObject,w=a.Error,v=a.Number.parseInt||a.parseInt,y=a.Number.parseFloat||a.parseFloat,b=a.Number.isNaN||a.isNaN,C=a.Date.now,R=a.Object.keys,_=a.Object.defineProperty,S=a.Object.prototype.hasOwnProperty,E=a.Array.prototype.slice,T=function(){var e=function(e){return e};if("function"==typeof a.wrap&&"function"==typeof a.unwrap)try{var t=l.createElement("div"),n=a.unwrap(t);1===t.nodeType&&n&&1===n.nodeType&&(e=a.unwrap)}catch(o){}return e}(),O=function(e){return E.call(e,0)},M=function(){var e,t,n,r,i,s,a=O(arguments),l=a[0]||{};for(e=1,t=a.length;t>e;e++)if(null!=(n=a[e]))for(r in n)S.call(n,r)&&(i=l[r],s=n[r],l!==s&&s!==o&&(l[r]=s));return l},k=function(e){var t,n,o,r;if("object"!=typeof e||null==e||"number"==typeof e.nodeType)t=e;else if("number"==typeof e.length)for(t=[],n=0,o=e.length;o>n;n++)S.call(e,n)&&(t[n]=k(e[n]));else{t={};for(r in e)S.call(e,r)&&(t[r]=k(e[r]))}return t},H=function(e,t){for(var n={},o=0,r=t.length;r>o;o++)t[o]in e&&(n[t[o]]=e[t[o]]);return n},D=function(e,t){var n={};for(var o in e)-1===t.indexOf(o)&&(n[o]=e[o]);return n},x=function(e){if(e)for(var t in e)S.call(e,t)&&delete e[t];return e},A=function(e,t){if(e&&1===e.nodeType&&e.ownerDocument&&t&&(1===t.nodeType&&t.ownerDocument&&t.ownerDocument===e.ownerDocument||9===t.nodeType&&!t.ownerDocument&&t===e.ownerDocument))do{if(e===t)return!0;e=e.parentNode}while(e);return!1},P=function(e){var t;return"string"==typeof e&&e&&(t=e.split("#")[0].split("?")[0],t=e.slice(0,e.lastIndexOf("/")+1)),t},N=function(e){var t,n;return"string"==typeof e&&e&&(n=e.match(/^(?:|[^:@]*@|.+\)@(?=http[s]?|file)|.+?\s+(?: at |@)(?:[^:\(]+ )*[\(]?)((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/),n&&n[1]?t=n[1]:(n=e.match(/\)@((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/),n&&n[1]&&(t=n[1]))),t},L=function(){var e,t;try{throw new w}catch(n){t=n}return t&&(e=t.sourceURL||t.fileName||N(t.stack)),e},W=function(){var e,t,n;if(l.currentScript&&(e=l.currentScript.src))return e;if(t=l.getElementsByTagName("script"),1===t.length)return t[0].src||o;if("readyState"in t[0])for(n=t.length;n--;)if("interactive"===t[n].readyState&&(e=t[n].src))return e;return"loading"===l.readyState&&(e=t[t.length-1].src)?e:(e=L())?e:o},I=function(){var e,t,n,r=l.getElementsByTagName("script");for(e=r.length;e--;){if(!(n=r[e].src)){t=null;break}if(n=P(n),null==t)t=n;else if(t!==n){t=null;break}}return t||o},j=function(){var e=P(W())||I()||"";return e+"ZeroClipboard.swf"},B=function(){return null==t.opener&&(!!t.top&&t!=t.top||!!t.parent&&t!=t.parent)}(),V={bridge:null,version:"0.0.0",pluginType:"unknown",disabled:null,outdated:null,sandboxed:null,unavailable:null,degraded:null,deactivated:null,overdue:null,ready:null},F="11.0.0",z={},Y={},U=null,G=0,$=0,K={ready:"Flash communication is established",error:{"flash-disabled":"Flash is disabled or not installed. May also be attempting to run Flash in a sandboxed iframe, which is impossible.","flash-outdated":"Flash is too outdated to support ZeroClipboard","flash-sandboxed":"Attempting to run Flash in a sandboxed iframe, which is impossible","flash-unavailable":"Flash is unable to communicate bidirectionally with JavaScript","flash-degraded":"Flash is unable to preserve data fidelity when communicating with JavaScript","flash-deactivated":"Flash is too outdated for your browser and/or is configured as click-to-activate.\nThis may also mean that the ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity.\nMay also be attempting to run Flash in a sandboxed iframe, which is impossible.","flash-overdue":"Flash communication was established but NOT within the acceptable time limit","version-mismatch":"ZeroClipboard JS version number does not match ZeroClipboard SWF version number","clipboard-error":"At least one error was thrown while ZeroClipboard was attempting to inject your data into the clipboard","config-mismatch":"ZeroClipboard configuration does not match Flash's reality","swf-not-found":"The ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity"}},X=["flash-unavailable","flash-degraded","flash-overdue","version-mismatch","config-mismatch","clipboard-error"],q=["flash-disabled","flash-outdated","flash-sandboxed","flash-unavailable","flash-degraded","flash-deactivated","flash-overdue"],Z=new RegExp("^flash-("+q.map(function(e){return e.replace(/^flash-/,"")}).join("|")+")$"),J=new RegExp("^flash-("+q.slice(1).map(function(e){return e.replace(/^flash-/,"")}).join("|")+")$"),Q={swfPath:j(),trustedDomains:t.location.host?[t.location.host]:[],cacheBust:!0,forceEnhancedClipboard:!1,flashLoadTimeout:3e4,autoActivate:!0,bubbleEvents:!0,containerId:"global-zeroclipboard-html-bridge",containerClass:"global-zeroclipboard-container",swfObjectId:"global-zeroclipboard-flash-bridge",hoverClass:"zeroclipboard-is-hover",activeClass:"zeroclipboard-is-active",forceHandCursor:!1,title:null,zIndex:999999999},ee=function(e){if("object"==typeof e&&null!==e)for(var t in e)if(S.call(e,t))if(/^(?:forceHandCursor|title|zIndex|bubbleEvents)$/.test(t))Q[t]=e[t];else if(null==V.bridge)if("containerId"===t||"swfObjectId"===t){if(!ge(e[t]))throw new Error("The specified `"+t+"` value is not valid as an HTML4 Element ID");Q[t]=e[t]}else Q[t]=e[t];{if("string"!=typeof e||!e)return k(Q);if(S.call(Q,e))return Q[e]}},te=function(){return $e(),{browser:H(u,["userAgent","platform","appName"]),flash:D(V,["bridge"]),zeroclipboard:{version:Xe.version,config:Xe.config()}}},ne=function(){return!!(V.disabled||V.outdated||V.sandboxed||V.unavailable||V.degraded||V.deactivated)},oe=function(e,t){var n,i,s,a={};if("string"==typeof e&&e)s=e.toLowerCase().split(/\s+/);else if("object"==typeof e&&e&&"undefined"==typeof t)for(n in e)S.call(e,n)&&"string"==typeof n&&n&&"function"==typeof e[n]&&Xe.on(n,e[n]);if(s&&s.length){for(n=0,i=s.length;i>n;n++)e=s[n].replace(/^on/,""),a[e]=!0,z[e]||(z[e]=[]),z[e].push(t);if(a.ready&&V.ready&&Xe.emit({type:"ready"}),a.error){for(n=0,i=q.length;i>n;n++)if(V[q[n].replace(/^flash-/,"")]===!0){Xe.emit({type:"error",name:q[n]});break}r!==o&&Xe.version!==r&&Xe.emit({type:"error",name:"version-mismatch",jsVersion:Xe.version,swfVersion:r})}}return Xe},re=function(e,t){var n,o,r,i,s;if(0===arguments.length)i=R(z);else if("string"==typeof e&&e)i=e.split(/\s+/);else if("object"==typeof e&&e&&"undefined"==typeof t)for(n in e)S.call(e,n)&&"string"==typeof n&&n&&"function"==typeof e[n]&&Xe.off(n,e[n]);if(i&&i.length)for(n=0,o=i.length;o>n;n++)if(e=i[n].toLowerCase().replace(/^on/,""),s=z[e],s&&s.length)if(t)for(r=s.indexOf(t);-1!==r;)s.splice(r,1),r=s.indexOf(t,r);else s.length=0;return Xe},ie=function(e){var t;return t="string"==typeof e&&e?k(z[e])||null:k(z)},se=function(e){var t,n,o;return e=me(e),e&&!_e(e)?"ready"===e.type&&V.overdue===!0?Xe.emit({type:"error",name:"flash-overdue"}):(t=M({},e),Ce.call(this,t),"copy"===e.type&&(o=De(Y),n=o.data,U=o.formatMap),n):void 0},ae=function(){var e=V.sandboxed;if($e(),"boolean"!=typeof V.ready&&(V.ready=!1),V.sandboxed!==e&&V.sandboxed===!0)V.ready=!1,Xe.emit({type:"error",name:"flash-sandboxed"});else if(!Xe.isFlashUnusable()&&null===V.bridge){var t=Q.flashLoadTimeout;"number"==typeof t&&t>=0&&(G=c(function(){"boolean"!=typeof V.deactivated&&(V.deactivated=!0),V.deactivated===!0&&Xe.emit({type:"error",name:"flash-deactivated"})},t)),V.overdue=!1,ke()}},le=function(){Xe.clearData(),Xe.blur(),Xe.emit("destroy"),He(),Xe.off()},ue=function(e,t){var n;if("object"==typeof e&&e&&"undefined"==typeof t)n=e,Xe.clearData();else{if("string"!=typeof e||!e)return;n={},n[e]=t}for(var o in n)"string"==typeof o&&o&&S.call(n,o)&&"string"==typeof n[o]&&n[o]&&(Y[o]=n[o])},ce=function(e){"undefined"==typeof e?(x(Y),U=null):"string"==typeof e&&S.call(Y,e)&&delete Y[e]},de=function(e){return"undefined"==typeof e?k(Y):"string"==typeof e&&S.call(Y,e)?Y[e]:void 0},he=function(e){if(e&&1===e.nodeType){i&&(je(i,Q.activeClass),i!==e&&je(i,Q.hoverClass)),i=e,Ie(e,Q.hoverClass);var t=e.getAttribute("title")||Q.title;if("string"==typeof t&&t){var n=Me(V.bridge);n&&n.setAttribute("title",t)}var o=Q.forceHandCursor===!0||"pointer"===Be(e,"cursor");Ue(o),Ye()}},fe=function(){var e=Me(V.bridge);e&&(e.removeAttribute("title"),e.style.left="0px",e.style.top="-9999px",e.style.width="1px",e.style.height="1px"),i&&(je(i,Q.hoverClass),je(i,Q.activeClass),i=null)},pe=function(){return i||null},ge=function(e){return"string"==typeof e&&e&&/^[A-Za-z][A-Za-z0-9_:\-\.]*$/.test(e)},me=function(e){var t;if("string"==typeof e&&e?(t=e,e={}):"object"==typeof e&&e&&"string"==typeof e.type&&e.type&&(t=e.type),t){t=t.toLowerCase(),!e.target&&(/^(copy|aftercopy|_click)$/.test(t)||"error"===t&&"clipboard-error"===e.name)&&(e.target=s),M(e,{type:t,target:e.target||i||null,relatedTarget:e.relatedTarget||null,currentTarget:V&&V.bridge||null,timeStamp:e.timeStamp||C()||null});var n=K[e.type];return"error"===e.type&&e.name&&n&&(n=n[e.name]),n&&(e.message=n),"ready"===e.type&&M(e,{target:null,version:V.version}),"error"===e.type&&(Z.test(e.name)&&M(e,{target:null,minimumVersion:F}),J.test(e.name)&&M(e,{version:V.version})),"copy"===e.type&&(e.clipboardData={setData:Xe.setData,clearData:Xe.clearData}),"aftercopy"===e.type&&(e=xe(e,U)),e.target&&!e.relatedTarget&&(e.relatedTarget=we(e.target)),ve(e)}},we=function(e){var t=e&&e.getAttribute&&e.getAttribute("data-clipboard-target");return t?l.getElementById(t):null},ve=function(e){if(e&&/^_(?:click|mouse(?:over|out|down|up|move))$/.test(e.type)){var t=e.target,n="_mouseover"===e.type&&e.relatedTarget?e.relatedTarget:o,r="_mouseout"===e.type&&e.relatedTarget?e.relatedTarget:o,i=Ve(t),s=a.screenLeft||a.screenX||0,u=a.screenTop||a.screenY||0,c=l.body.scrollLeft+l.documentElement.scrollLeft,d=l.body.scrollTop+l.documentElement.scrollTop,h=i.left+("number"==typeof e._stageX?e._stageX:0),f=i.top+("number"==typeof e._stageY?e._stageY:0),p=h-c,g=f-d,m=s+p,w=u+g,v="number"==typeof e.movementX?e.movementX:0,y="number"==typeof e.movementY?e.movementY:0;delete e._stageX,delete e._stageY,M(e,{srcElement:t,fromElement:n,toElement:r,screenX:m,screenY:w,pageX:h,pageY:f,clientX:p,clientY:g,x:p,y:g,movementX:v,movementY:y,offsetX:0,offsetY:0,layerX:0,layerY:0})}return e},ye=function(e){var t=e&&"string"==typeof e.type&&e.type||"";return!/^(?:(?:before)?copy|destroy)$/.test(t)},be=function(e,t,n,o){o?c(function(){e.apply(t,n)},0):e.apply(t,n)},Ce=function(e){if("object"==typeof e&&e&&e.type){var t=ye(e),n=z["*"]||[],o=z[e.type]||[],r=n.concat(o);if(r&&r.length){var i,s,l,u,c,d=this;for(i=0,s=r.length;s>i;i++)l=r[i],u=d,"string"==typeof l&&"function"==typeof a[l]&&(l=a[l]),"object"==typeof l&&l&&"function"==typeof l.handleEvent&&(u=l,l=l.handleEvent),"function"==typeof l&&(c=M({},e),be(l,u,[c],t))}return this}},Re=function(e){var t=null;return(B===!1||e&&"error"===e.type&&e.name&&-1!==X.indexOf(e.name))&&(t=!1),t},_e=function(e){var t=e.target||i||null,n="swf"===e._source;switch(delete e._source,e.type){case"error":var o="flash-sandboxed"===e.name||Re(e);"boolean"==typeof o&&(V.sandboxed=o),-1!==q.indexOf(e.name)?M(V,{disabled:"flash-disabled"===e.name,outdated:"flash-outdated"===e.name,unavailable:"flash-unavailable"===e.name,degraded:"flash-degraded"===e.name,deactivated:"flash-deactivated"===e.name,overdue:"flash-overdue"===e.name,ready:!1}):"version-mismatch"===e.name&&(r=e.swfVersion,M(V,{disabled:!1,outdated:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:!1,ready:!1})),ze();break;case"ready":r=e.swfVersion;var a=V.deactivated===!0;M(V,{disabled:!1,outdated:!1,sandboxed:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:a,ready:!a}),ze();break;case"beforecopy":s=t;break;case"copy":var l,u,c=e.relatedTarget;!Y["text/html"]&&!Y["text/plain"]&&c&&(u=c.value||c.outerHTML||c.innerHTML)&&(l=c.value||c.textContent||c.innerText)?(e.clipboardData.clearData(),e.clipboardData.setData("text/plain",l),u!==l&&e.clipboardData.setData("text/html",u)):!Y["text/plain"]&&e.target&&(l=e.target.getAttribute("data-clipboard-text"))&&(e.clipboardData.clearData(),e.clipboardData.setData("text/plain",l));break;case"aftercopy":Se(e),Xe.clearData(),t&&t!==We()&&t.focus&&t.focus();break;case"_mouseover":Xe.focus(t),Q.bubbleEvents===!0&&n&&(t&&t!==e.relatedTarget&&!A(e.relatedTarget,t)&&Ee(M({},e,{type:"mouseenter",bubbles:!1,cancelable:!1})),Ee(M({},e,{type:"mouseover"})));break;case"_mouseout":Xe.blur(),Q.bubbleEvents===!0&&n&&(t&&t!==e.relatedTarget&&!A(e.relatedTarget,t)&&Ee(M({},e,{type:"mouseleave",bubbles:!1,cancelable:!1})),Ee(M({},e,{type:"mouseout"})));break;case"_mousedown":Ie(t,Q.activeClass),Q.bubbleEvents===!0&&n&&Ee(M({},e,{type:e.type.slice(1)}));break;case"_mouseup":je(t,Q.activeClass),Q.bubbleEvents===!0&&n&&Ee(M({},e,{type:e.type.slice(1)}));break;case"_click":s=null,Q.bubbleEvents===!0&&n&&Ee(M({},e,{type:e.type.slice(1)}));break;case"_mousemove":Q.bubbleEvents===!0&&n&&Ee(M({},e,{type:e.type.slice(1)}))}return/^_(?:click|mouse(?:over|out|down|up|move))$/.test(e.type)?!0:void 0},Se=function(e){if(e.errors&&e.errors.length>0){var t=k(e);M(t,{type:"error",name:"clipboard-error"}),delete t.success,c(function(){Xe.emit(t)},0)}},Ee=function(e){if(e&&"string"==typeof e.type&&e){var t,n=e.target||null,o=n&&n.ownerDocument||l,r={view:o.defaultView||a,canBubble:!0,cancelable:!0,detail:"click"===e.type?1:0,button:"number"==typeof e.which?e.which-1:"number"==typeof e.button?e.button:o.createEvent?0:1},i=M(r,e);n&&o.createEvent&&n.dispatchEvent&&(i=[i.type,i.canBubble,i.cancelable,i.view,i.detail,i.screenX,i.screenY,i.clientX,i.clientY,i.ctrlKey,i.altKey,i.shiftKey,i.metaKey,i.button,i.relatedTarget],t=o.createEvent("MouseEvents"),t.initMouseEvent&&(t.initMouseEvent.apply(t,i),t._source="js",n.dispatchEvent(t)))}},Te=function(){var e=Q.flashLoadTimeout;if("number"==typeof e&&e>=0){var t=Math.min(1e3,e/10),n=Q.swfObjectId+"_fallbackContent";$=h(function(){var e=l.getElementById(n);Fe(e)&&(ze(),V.deactivated=null,Xe.emit({type:"error",name:"swf-not-found"}))},t)}},Oe=function(){var e=l.createElement("div");return e.id=Q.containerId,e.className=Q.containerClass,e.style.position="absolute",e.style.left="0px",e.style.top="-9999px",e.style.width="1px",e.style.height="1px",e.style.zIndex=""+Ge(Q.zIndex),e},Me=function(e){for(var t=e&&e.parentNode;t&&"OBJECT"===t.nodeName&&t.parentNode;)t=t.parentNode;return t||null},ke=function(){var e,t=V.bridge,n=Me(t);if(!t){var o=Le(a.location.host,Q),r="never"===o?"none":"all",i=Pe(M({jsVersion:Xe.version},Q)),s=Q.swfPath+Ae(Q.swfPath,Q);n=Oe();var u=l.createElement("div");n.appendChild(u),l.body.appendChild(n);var c=l.createElement("div"),d="activex"===V.pluginType;c.innerHTML='"+(d?'':"")+'
 
',t=c.firstChild,c=null,T(t).ZeroClipboard=Xe,n.replaceChild(t,u),Te()}return t||(t=l[Q.swfObjectId],t&&(e=t.length)&&(t=t[e-1]),!t&&n&&(t=n.firstChild)),V.bridge=t||null,t},He=function(){var e=V.bridge;if(e){var t=Me(e);t&&("activex"===V.pluginType&&"readyState"in e?(e.style.display="none",function n(){if(4===e.readyState){for(var o in e)"function"==typeof e[o]&&(e[o]=null);e.parentNode&&e.parentNode.removeChild(e),t.parentNode&&t.parentNode.removeChild(t)}else c(n,10)}()):(e.parentNode&&e.parentNode.removeChild(e),t.parentNode&&t.parentNode.removeChild(t))),ze(),V.ready=null,V.bridge=null,V.deactivated=null,r=o}},De=function(e){var t={},n={};if("object"==typeof e&&e){for(var o in e)if(o&&S.call(e,o)&&"string"==typeof e[o]&&e[o])switch(o.toLowerCase()){case"text/plain":case"text":case"air:text":case"flash:text":t.text=e[o],n.text=o;break;case"text/html":case"html":case"air:html":case"flash:html":t.html=e[o],n.html=o;break;case"application/rtf":case"text/rtf":case"rtf":case"richtext":case"air:rtf":case"flash:rtf":t.rtf=e[o],n.rtf=o}return{data:t,formatMap:n}}},xe=function(e,t){if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;var n={};for(var o in e)if(S.call(e,o))if("errors"===o){n[o]=e[o]?e[o].slice():[];for(var r=0,i=n[o].length;i>r;r++)n[o][r].format=t[n[o][r].format]}else if("success"!==o&&"data"!==o)n[o]=e[o];else{n[o]={};var s=e[o];for(var a in s)a&&S.call(s,a)&&S.call(t,a)&&(n[o][t[a]]=s[a])}return n},Ae=function(e,t){var n=null==t||t&&t.cacheBust===!0;return n?(-1===e.indexOf("?")?"?":"&")+"noCache="+C():""},Pe=function(e){var t,n,o,r,i="",s=[];if(e.trustedDomains&&("string"==typeof e.trustedDomains?r=[e.trustedDomains]:"object"==typeof e.trustedDomains&&"length"in e.trustedDomains&&(r=e.trustedDomains)),r&&r.length)for(t=0,n=r.length;n>t;t++)if(S.call(r,t)&&r[t]&&"string"==typeof r[t]){if(o=Ne(r[t]),!o)continue;if("*"===o){s.length=0,s.push(o);break}s.push.apply(s,[o,"//"+o,a.location.protocol+"//"+o])}return s.length&&(i+="trustedOrigins="+g(s.join(","))),e.forceEnhancedClipboard===!0&&(i+=(i?"&":"")+"forceEnhancedClipboard=true"),"string"==typeof e.swfObjectId&&e.swfObjectId&&(i+=(i?"&":"")+"swfObjectId="+g(e.swfObjectId)),"string"==typeof e.jsVersion&&e.jsVersion&&(i+=(i?"&":"")+"jsVersion="+g(e.jsVersion)),i},Ne=function(e){if(null==e||""===e)return null;if(e=e.replace(/^\s+|\s+$/g,""),""===e)return null;var t=e.indexOf("//");e=-1===t?e:e.slice(t+2);var n=e.indexOf("/");return e=-1===n?e:-1===t||0===n?null:e.slice(0,n),e&&".swf"===e.slice(-4).toLowerCase()?null:e||null},Le=function(){var e=function(e){var t,n,o,r=[];if("string"==typeof e&&(e=[e]),"object"!=typeof e||!e||"number"!=typeof e.length)return r;for(t=0,n=e.length;n>t;t++)if(S.call(e,t)&&(o=Ne(e[t]))){if("*"===o){r.length=0,r.push("*");break}-1===r.indexOf(o)&&r.push(o)}return r};return function(t,n){var o=Ne(n.swfPath);null===o&&(o=t);var r=e(n.trustedDomains),i=r.length;if(i>0){if(1===i&&"*"===r[0])return"always";if(-1!==r.indexOf(t))return 1===i&&t===o?"sameDomain":"always"}return"never"}}(),We=function(){try{return l.activeElement}catch(e){return null}},Ie=function(e,t){var n,o,r,i=[];if("string"==typeof t&&t&&(i=t.split(/\s+/)),e&&1===e.nodeType&&i.length>0)if(e.classList)for(n=0,o=i.length;o>n;n++)e.classList.add(i[n]);else if(e.hasOwnProperty("className")){for(r=" "+e.className+" ",n=0,o=i.length;o>n;n++)-1===r.indexOf(" "+i[n]+" ")&&(r+=i[n]+" ");e.className=r.replace(/^\s+|\s+$/g,"")}return e},je=function(e,t){var n,o,r,i=[];if("string"==typeof t&&t&&(i=t.split(/\s+/)),e&&1===e.nodeType&&i.length>0)if(e.classList&&e.classList.length>0)for(n=0,o=i.length;o>n;n++)e.classList.remove(i[n]);else if(e.className){for(r=(" "+e.className+" ").replace(/[\r\n\t]/g," "),n=0,o=i.length;o>n;n++)r=r.replace(" "+i[n]+" "," ");e.className=r.replace(/^\s+|\s+$/g,"")}return e},Be=function(e,t){var n=p(e,null).getPropertyValue(t);return"cursor"!==t||n&&"auto"!==n||"A"!==e.nodeName?n:"pointer"},Ve=function(e){var t={left:0,top:0,width:0,height:0};if(e.getBoundingClientRect){var n=e.getBoundingClientRect(),o=a.pageXOffset,r=a.pageYOffset,i=l.documentElement.clientLeft||0,s=l.documentElement.clientTop||0,u=0,c=0;if("relative"===Be(l.body,"position")){var d=l.body.getBoundingClientRect(),h=l.documentElement.getBoundingClientRect();u=d.left-h.left||0,c=d.top-h.top||0}t.left=n.left+o-i-u,t.top=n.top+r-s-c,t.width="width"in n?n.width:n.right-n.left,t.height="height"in n?n.height:n.bottom-n.top}return t},Fe=function(e){if(!e)return!1;var t=p(e,null),n=y(t.height)>0,o=y(t.width)>0,r=y(t.top)>=0,i=y(t.left)>=0,s=n&&o&&r&&i,a=s?null:Ve(e),l="none"!==t.display&&"collapse"!==t.visibility&&(s||!!a&&(n||a.height>0)&&(o||a.width>0)&&(r||a.top>=0)&&(i||a.left>=0));return l},ze=function(){d(G),G=0,f($),$=0},Ye=function(){var e;if(i&&(e=Me(V.bridge))){var t=Ve(i);M(e.style,{width:t.width+"px",height:t.height+"px",top:t.top+"px",left:t.left+"px",zIndex:""+Ge(Q.zIndex)})}},Ue=function(e){V.ready===!0&&(V.bridge&&"function"==typeof V.bridge.setHandCursor?V.bridge.setHandCursor(e):V.ready=!1)},Ge=function(e){if(/^(?:auto|inherit)$/.test(e))return e;var t;return"number"!=typeof e||b(e)?"string"==typeof e&&(t=Ge(v(e,10))):t=e,"number"==typeof t?t:"auto"},$e=function(e){var n,o,r,i=V.sandboxed,s=null;if(e=e===!0,B===!1)s=!1;else{try{o=t.frameElement||null}catch(a){r={name:a.name,message:a.message}}if(o&&1===o.nodeType&&"IFRAME"===o.nodeName)try{s=o.hasAttribute("sandbox")}catch(a){s=null}else{try{n=document.domain||null}catch(a){n=null}(null===n||r&&"SecurityError"===r.name&&/(^|[\s\(\[@])sandbox(es|ed|ing|[\s\.,!\)\]@]|$)/.test(r.message.toLowerCase()))&&(s=!0)}}return V.sandboxed=s,i===s||e||Ke(m),s},Ke=function(e){function t(e){var t=e.match(/[\d]+/g);return t.length=3,t.join(".")}function n(e){return!!e&&(e=e.toLowerCase())&&(/^(pepflashplayer\.dll|libpepflashplayer\.so|pepperflashplayer\.plugin)$/.test(e)||"chrome.plugin"===e.slice(-13))}function o(e){e&&(a=!0,e.version&&(d=t(e.version)),!d&&e.description&&(d=t(e.description)),e.filename&&(c=n(e.filename)))}var r,i,s,a=!1,l=!1,c=!1,d="";if(u.plugins&&u.plugins.length)r=u.plugins["Shockwave Flash"],o(r),u.plugins["Shockwave Flash 2.0"]&&(a=!0,d="2.0.0.11");else if(u.mimeTypes&&u.mimeTypes.length)s=u.mimeTypes["application/x-shockwave-flash"],r=s&&s.enabledPlugin,o(r);else if("undefined"!=typeof e){l=!0;try{i=new e("ShockwaveFlash.ShockwaveFlash.7"),a=!0,d=t(i.GetVariable("$version"))}catch(h){try{i=new e("ShockwaveFlash.ShockwaveFlash.6"),a=!0,d="6.0.21"}catch(f){try{i=new e("ShockwaveFlash.ShockwaveFlash"),a=!0,d=t(i.GetVariable("$version"))}catch(p){l=!1}}}}V.disabled=a!==!0,V.outdated=d&&y(d)n;n++)e=s[n].replace(/^on/,""),a[e]=!0,u[e]||(u[e]=[]),u[e].push(t);if(a.ready&&V.ready&&this.emit({type:"ready",client:this}),a.error){for(n=0,i=q.length;i>n;n++)if(V[q[n].replace(/^flash-/,"")]){this.emit({type:"error",name:q[n],client:this});break}r!==o&&Xe.version!==r&&this.emit({type:"error",name:"version-mismatch",jsVersion:Xe.version,swfVersion:r})}}return this},ot=function(e,t){var n,o,r,i,s,a=Ze[this.id],l=a&&a.handlers;if(!l)return this;if(0===arguments.length)i=R(l);else if("string"==typeof e&&e)i=e.split(/\s+/);else if("object"==typeof e&&e&&"undefined"==typeof t)for(n in e)S.call(e,n)&&"string"==typeof n&&n&&"function"==typeof e[n]&&this.off(n,e[n]);if(i&&i.length)for(n=0,o=i.length;o>n;n++)if(e=i[n].toLowerCase().replace(/^on/,""),s=l[e],s&&s.length)if(t)for(r=s.indexOf(t);-1!==r;)s.splice(r,1),r=s.indexOf(t,r);else s.length=0;return this},rt=function(e){var t=null,n=Ze[this.id]&&Ze[this.id].handlers;return n&&(t="string"==typeof e&&e?n[e]?n[e].slice(0):[]:k(n)),t},it=function(e){if(ct.call(this,e)){"object"==typeof e&&e&&"string"==typeof e.type&&e.type&&(e=M({},e));var t=M({},me(e),{client:this});dt.call(this,t)}return this},st=function(e){if(!Ze[this.id])throw new Error("Attempted to clip element(s) to a destroyed ZeroClipboard client instance");e=ht(e);for(var t=0;t0,r=!e.target||o&&-1!==n.indexOf(e.target),i=e.relatedTarget&&o&&-1!==n.indexOf(e.relatedTarget),s=e.client&&e.client===this;return t&&(r||i||s)?!0:!1},dt=function(e){var t=Ze[this.id];if("object"==typeof e&&e&&e.type&&t){var n=ye(e),o=t&&t.handlers["*"]||[],r=t&&t.handlers[e.type]||[],i=o.concat(r);if(i&&i.length){var s,l,u,c,d,h=this;for(s=0,l=i.length;l>s;s++)u=i[s],c=h,"string"==typeof u&&"function"==typeof a[u]&&(u=a[u]),"object"==typeof u&&u&&"function"==typeof u.handleEvent&&(c=u,u=u.handleEvent),"function"==typeof u&&(d=M({},e),be(u,c,[d],n))}}},ht=function(e){return"string"==typeof e&&(e=[]),"number"!=typeof e.length?[e]:e},ft=function(e){if(e&&1===e.nodeType){var t=function(e){(e||(e=a.event))&&("js"!==e._source&&(e.stopImmediatePropagation(),e.preventDefault()),delete e._source)},n=function(n){(n||(n=a.event))&&(t(n),Xe.focus(e))};e.addEventListener("mouseover",n,!1),e.addEventListener("mouseout",t,!1),e.addEventListener("mouseenter",t,!1),e.addEventListener("mouseleave",t,!1),e.addEventListener("mousemove",t,!1),et[e.zcClippingId]={mouseover:n,mouseout:t,mouseenter:t,mouseleave:t,mousemove:t}}},pt=function(e){if(e&&1===e.nodeType){var t=et[e.zcClippingId];if("object"==typeof t&&t){for(var n,o,r=["move","leave","enter","out","over"],i=0,s=r.length;s>i;i++)n="mouse"+r[i],o=t[n],"function"==typeof o&&e.removeEventListener(n,o,!1);delete et[e.zcClippingId]}}};Xe._createClient=function(){tt.apply(this,O(arguments))},Xe.prototype.on=function(){return nt.apply(this,O(arguments))},Xe.prototype.off=function(){return ot.apply(this,O(arguments))},Xe.prototype.handlers=function(){return rt.apply(this,O(arguments))},Xe.prototype.emit=function(){return it.apply(this,O(arguments))},Xe.prototype.clip=function(){return st.apply(this,O(arguments))},Xe.prototype.unclip=function(){return at.apply(this,O(arguments))},Xe.prototype.elements=function(){return lt.apply(this,O(arguments))},Xe.prototype.destroy=function(){return ut.apply(this,O(arguments))},Xe.prototype.setText=function(e){if(!Ze[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.setData("text/plain",e),this},Xe.prototype.setHtml=function(e){if(!Ze[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.setData("text/html",e),this},Xe.prototype.setRichText=function(e){if(!Ze[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.setData("application/rtf",e),this},Xe.prototype.setData=function(){if(!Ze[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.setData.apply(this,O(arguments)),this},Xe.prototype.clearData=function(){if(!Ze[this.id])throw new Error("Attempted to clear pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.clearData.apply(this,O(arguments)),this},Xe.prototype.getData=function(){if(!Ze[this.id])throw new Error("Attempted to get pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.getData.apply(this,O(arguments))},"function"==typeof e&&e.amd?e(function(){return Xe}):"object"==typeof n&&n&&"object"==typeof n.exports&&n.exports?n.exports=Xe:t.ZeroClipboard=Xe}(function(){return this||window}())},{}]},{},[23,59,61,60,62,83,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,84,85,86,87,100,101,102,90,91,92,93,94,95,31,35,32,33,40,34,36,37,38,39])("zeroclipboard")}); \ No newline at end of file diff --git a/bower_components/handsontable/dist/handsontable.js b/bower_components/handsontable/dist/handsontable.js index 5f263e5..5aa0fff 100644 --- a/bower_components/handsontable/dist/handsontable.js +++ b/bower_components/handsontable/dist/handsontable.js @@ -628,7 +628,9 @@ var $WalkontableViewportColumnsCalculator = WalkontableViewportColumnsCalculator this.stretchAllColumnsWidth = []; this.needVerifyLastColumnWidth = true; } else if (this.stretch === 'last' && totalWidth !== Infinity) { - this.stretchLastWidth = -remainingSize + this._getColumnWidth(totalColumns - 1); + var columnWidth$__1 = this._getColumnWidth(totalColumns - 1); + var lastColumnWidth = -remainingSize + columnWidth$__1; + this.stretchLastWidth = lastColumnWidth >= 0 ? lastColumnWidth : columnWidth$__1; } }, getStretchedColumnWidth: function(column, baseWidth) { @@ -1306,15 +1308,16 @@ function WalkontableEvent(instance) { } }, 30); }; - var lastMouseOver; var onMouseOver = function(event) { var table, - td; + td, + mainWOT; if (that.instance.hasSetting('onCellMouseOver')) { table = that.instance.wtTable.TABLE; td = closest(event.realTarget, ['TD', 'TH'], table); - if (td && td !== lastMouseOver && isChildOf(td, table)) { - lastMouseOver = td; + mainWOT = that.instance.cloneSource || that.instance; + if (td && td !== mainWOT.lastMouseOver && isChildOf(td, table)) { + mainWOT.lastMouseOver = td; that.instance.getSetting('onCellMouseOver', event, that.instance.wtTable.getCoords(td), td, that.instance); } } @@ -1518,13 +1521,13 @@ var WalkontableOverlay = function WalkontableOverlay(wotInstance) { defineGetter(this, 'wot', wotInstance, {writable: false}); this.instance = this.wot; this.type = ''; + this.mainTableScrollableElement = null; this.TABLE = this.wot.wtTable.TABLE; this.hider = this.wot.wtTable.hider; this.spreader = this.wot.wtTable.spreader; this.holder = this.wot.wtTable.holder; this.wtRootElement = this.wot.wtTable.wtRootElement; this.trimmingContainer = getTrimmingContainer(this.hider.parentNode.parentNode); - this.mainTableScrollableElement = getScrollableElement(this.wot.wtTable.TABLE); this.needFullRender = this.shouldBeRendered(); this.areElementSizesAdjusted = false; }; @@ -1548,6 +1551,12 @@ var $WalkontableOverlay = WalkontableOverlay; clone.appendChild(clonedTable); this.type = direction; this.wot.wtTable.wtRootElement.parentNode.appendChild(clone); + var preventOverflow = this.wot.getSetting('preventOverflow'); + if (preventOverflow === true || preventOverflow === 'horizontal' && this.type === $WalkontableOverlay.CLONE_TOP || preventOverflow === 'vertical' && this.type === $WalkontableOverlay.CLONE_LEFT) { + this.mainTableScrollableElement = window; + } else { + this.mainTableScrollableElement = getScrollableElement(this.wot.wtTable.TABLE); + } return new Walkontable({ cloneSource: this.wot, cloneOverlay: this, @@ -1650,6 +1659,7 @@ var $__0 = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47 getWindowScrollTop = $__0.getWindowScrollTop, hasClass = $__0.hasClass, outerWidth = $__0.outerWidth, + innerHeight = $__0.innerHeight, removeClass = $__0.removeClass, setOverlayPosition = $__0.setOverlayPosition; var WalkontableOverlay = ($___95_base__ = require("_base"), $___95_base__ && $___95_base__.__esModule && $___95_base__ || {default: $___95_base__}).WalkontableOverlay; @@ -1668,7 +1678,8 @@ var $WalkontableLeftOverlay = WalkontableLeftOverlay; } var overlayRoot = this.clone.wtTable.holder.parentNode; var headerPosition = 0; - if (this.trimmingContainer === window) { + var preventOverflow = this.wot.getSetting('preventOverflow'); + if (this.trimmingContainer === window && (!preventOverflow || preventOverflow !== 'horizontal')) { var box = this.wot.wtTable.hider.getBoundingClientRect(); var left = Math.ceil(box.left); var right = Math.ceil(box.right); @@ -1724,9 +1735,12 @@ var $WalkontableLeftOverlay = WalkontableLeftOverlay; var scrollbarHeight = masterHolder.clientHeight === masterHolder.offsetHeight ? 0 : getScrollbarWidth(); var overlayRoot = this.clone.wtTable.holder.parentNode; var overlayRootStyle = overlayRoot.style; + var preventOverflow = this.wot.getSetting('preventOverflow'); var tableWidth; - if (this.trimmingContainer !== window) { - overlayRootStyle.height = this.wot.wtViewport.getWorkspaceHeight() - scrollbarHeight + 'px'; + if (this.trimmingContainer !== window || preventOverflow === 'vertical') { + var height = this.wot.wtViewport.getWorkspaceHeight() - scrollbarHeight; + height = Math.min(height, innerHeight(this.wot.wtTable.wtRootElement)); + overlayRootStyle.height = height + 'px'; } this.clone.wtTable.holder.style.height = overlayRootStyle.height; tableWidth = outerWidth(this.clone.wtTable.TABLE); @@ -1783,11 +1797,12 @@ var $WalkontableLeftOverlay = WalkontableLeftOverlay; this.setScrollPosition(newX); }, getTableParentOffset: function() { - if (this.trimmingContainer === window) { - return this.wot.wtTable.holderOffset.left; - } else { - return 0; + var preventOverflow = this.wot.getSetting('preventOverflow'); + var offset = 0; + if (!preventOverflow && this.trimmingContainer === window) { + offset = this.wot.wtTable.holderOffset.left; } + return offset; }, getScrollPosition: function() { return getScrollLeft(this.mainTableScrollableElement); @@ -1833,6 +1848,7 @@ var $__0 = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47 getWindowScrollLeft = $__0.getWindowScrollLeft, hasClass = $__0.hasClass, outerHeight = $__0.outerHeight, + innerWidth = $__0.innerWidth, removeClass = $__0.removeClass, setOverlayPosition = $__0.setOverlayPosition; var WalkontableOverlay = ($___95_base__ = require("_base"), $___95_base__ && $___95_base__.__esModule && $___95_base__ || {default: $___95_base__}).WalkontableOverlay; @@ -1851,7 +1867,8 @@ var $WalkontableTopOverlay = WalkontableTopOverlay; } var overlayRoot = this.clone.wtTable.holder.parentNode; var headerPosition = 0; - if (this.wot.wtOverlays.leftOverlay.trimmingContainer === window) { + var preventOverflow = this.wot.getSetting('preventOverflow'); + if (this.trimmingContainer === window && (!preventOverflow || preventOverflow !== 'vertical')) { var box = this.wot.wtTable.hider.getBoundingClientRect(); var top = Math.ceil(box.top); var bottom = Math.ceil(box.bottom); @@ -1908,9 +1925,12 @@ var $WalkontableTopOverlay = WalkontableTopOverlay; var scrollbarWidth = masterHolder.clientWidth === masterHolder.offsetWidth ? 0 : getScrollbarWidth(); var overlayRoot = this.clone.wtTable.holder.parentNode; var overlayRootStyle = overlayRoot.style; + var preventOverflow = this.wot.getSetting('preventOverflow'); var tableHeight; - if (this.trimmingContainer !== window) { - overlayRootStyle.width = this.wot.wtViewport.getWorkspaceWidth() - scrollbarWidth + 'px'; + if (this.trimmingContainer !== window || preventOverflow === 'horizontal') { + var width = this.wot.wtViewport.getWorkspaceWidth() - scrollbarWidth; + width = Math.min(width, innerWidth(this.wot.wtTable.wtRootElement)); + overlayRootStyle.width = width + 'px'; } this.clone.wtTable.holder.style.width = overlayRootStyle.width; tableHeight = outerHeight(this.clone.wtTable.TABLE); @@ -1984,7 +2004,7 @@ var $WalkontableTopOverlay = WalkontableTopOverlay; if (this.wot.getSetting('fixedRowsTop') === 0 && this.wot.getSetting('columnHeaders').length > 0) { var masterParent = this.wot.wtTable.holder.parentNode; var previousState = hasClass(masterParent, 'innerBorderTop'); - if (position) { + if (position || this.wot.getSetting('totalRows') === 0) { addClass(masterParent, 'innerBorderTop'); } else { removeClass(masterParent, 'innerBorderTop'); @@ -2039,23 +2059,24 @@ var $WalkontableTopLeftCornerOverlay = WalkontableTopLeftCornerOverlay; var overlayRoot = this.clone.wtTable.holder.parentNode; var tableHeight = outerHeight(this.clone.wtTable.TABLE); var tableWidth = outerWidth(this.clone.wtTable.TABLE); + var preventOverflow = this.wot.getSetting('preventOverflow'); if (this.trimmingContainer === window) { var box = this.wot.wtTable.hider.getBoundingClientRect(); var top = Math.ceil(box.top); var left = Math.ceil(box.left); var bottom = Math.ceil(box.bottom); var right = Math.ceil(box.right); - var finalLeft; - var finalTop; - if (left < 0 && (right - overlayRoot.offsetWidth) > 0) { - finalLeft = -left + 'px'; - } else { - finalLeft = '0'; + var finalLeft = '0'; + var finalTop = '0'; + if (!preventOverflow || preventOverflow === 'vertical') { + if (left < 0 && (right - overlayRoot.offsetWidth) > 0) { + finalLeft = -left + 'px'; + } } - if (top < 0 && (bottom - overlayRoot.offsetHeight) > 0) { - finalTop = -top + 'px'; - } else { - finalTop = '0'; + if (!preventOverflow || preventOverflow === 'horizontal') { + if (top < 0 && (bottom - overlayRoot.offsetHeight) > 0) { + finalTop = -top + 'px'; + } } setOverlayPosition(overlayRoot, finalLeft, finalTop); } @@ -2092,7 +2113,7 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { this.eventManager = new EventManager(this.wot); this.wot.update('scrollbarWidth', getScrollbarWidth()); this.wot.update('scrollbarHeight', getScrollbarWidth()); - this.mainTableScrollableElement = getScrollableElement(this.wot.wtTable.TABLE); + this.scrollableElement = getScrollableElement(this.wot.wtTable.TABLE); this.topOverlay = WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP, this.wot); if (typeof WalkontableBottomOverlay === 'undefined') { this.bottomOverlay = {needFullRender: false}; @@ -2170,9 +2191,16 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { this.eventManager.addEventListener(document, 'visibilitychange', (function() { return $__3.onKeyUp(); })); - this.eventManager.addEventListener(this.mainTableScrollableElement, 'scroll', (function(event) { + var topOverlayScrollable = this.topOverlay.mainTableScrollableElement; + var leftOverlayScrollable = this.leftOverlay.mainTableScrollableElement; + this.eventManager.addEventListener(topOverlayScrollable, 'scroll', (function(event) { return $__3.onTableScroll(event); })); + if (topOverlayScrollable !== leftOverlayScrollable) { + this.eventManager.addEventListener(leftOverlayScrollable, 'scroll', (function(event) { + return $__3.onTableScroll(event); + })); + } if (this.topOverlay.needFullRender) { this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder, 'scroll', (function(event) { return $__3.onTableScroll(event); @@ -2223,8 +2251,13 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { if (Handsontable.mobileBrowser) { return; } - if (this.keyPressed && this.mainTableScrollableElement !== window && !event.target.contains(this.mainTableScrollableElement)) { - return; + var masterHorizontal = this.leftOverlay.mainTableScrollableElement; + var masterVertical = this.topOverlay.mainTableScrollableElement; + var target = event.target; + if (this.keyPressed) { + if ((masterVertical !== window && target !== window && !event.target.contains(masterVertical)) || (masterHorizontal !== window && target !== window && !event.target.contains(masterHorizontal))) { + return; + } } if (event.type === 'scroll') { this.syncScrollPositions(event); @@ -2273,7 +2306,8 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { this.syncScrollWithMaster(); return; } - var master = this.mainTableScrollableElement; + var masterHorizontal = this.leftOverlay.mainTableScrollableElement; + var masterVertical = this.topOverlay.mainTableScrollableElement; var target = event.target; var tempScrollValue = 0; var scrollValueChanged = false; @@ -2281,6 +2315,7 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { var leftOverlay; var bottomOverlay; var delegatedScroll = false; + var preventOverflow = this.wot.getSetting('preventOverflow'); if (this.topOverlay.needFullRender) { topOverlay = this.topOverlay.clone.wtTable.holder; } @@ -2293,19 +2328,23 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { if (target === document) { target = window; } - if (target === master) { - tempScrollValue = getScrollLeft(target); + if (target === masterHorizontal || target === masterVertical) { + if (preventOverflow) { + tempScrollValue = getScrollLeft(this.scrollableElement); + } else { + tempScrollValue = getScrollLeft(target); + } if (this.overlayScrollPositions.master.left !== tempScrollValue) { this.horizontalScrolling = true; this.overlayScrollPositions.master.left = tempScrollValue; scrollValueChanged = true; if (topOverlay) { topOverlay.scrollLeft = tempScrollValue; - delegatedScroll = (this.mainTableScrollableElement !== window); + delegatedScroll = (masterHorizontal !== window); } if (bottomOverlay) { bottomOverlay.scrollLeft = tempScrollValue; - delegatedScroll = (this.mainTableScrollableElement !== window); + delegatedScroll = (masterHorizontal !== window); } } tempScrollValue = getScrollTop(target); @@ -2315,7 +2354,7 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { scrollValueChanged = true; if (leftOverlay) { leftOverlay.scrollTop = tempScrollValue; - delegatedScroll = (this.mainTableScrollableElement !== window); + delegatedScroll = (masterVertical !== window); } } } else if (target === bottomOverlay) { @@ -2324,11 +2363,11 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { this.horizontalScrolling = true; this.overlayScrollPositions.bottom.left = tempScrollValue; scrollValueChanged = true; - master.scrollLeft = tempScrollValue; + masterHorizontal.scrollLeft = tempScrollValue; } if (fakeScrollValue !== null) { scrollValueChanged = true; - master.scrollTop += fakeScrollValue; + masterVertical.scrollTop += fakeScrollValue; } } else if (target === topOverlay) { tempScrollValue = getScrollLeft(target); @@ -2336,11 +2375,11 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { this.horizontalScrolling = true; this.overlayScrollPositions.top.left = tempScrollValue; scrollValueChanged = true; - master.scrollLeft = tempScrollValue; + masterHorizontal.scrollLeft = tempScrollValue; } if (fakeScrollValue !== null) { scrollValueChanged = true; - master.scrollTop += fakeScrollValue; + masterVertical.scrollTop += fakeScrollValue; } } else if (target === leftOverlay) { tempScrollValue = getScrollTop(target); @@ -2348,11 +2387,11 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { this.verticalScrolling = true; this.overlayScrollPositions.left.top = tempScrollValue; scrollValueChanged = true; - master.scrollTop = tempScrollValue; + masterVertical.scrollTop = tempScrollValue; } if (fakeScrollValue !== null) { scrollValueChanged = true; - master.scrollLeft += fakeScrollValue; + masterVertical.scrollLeft += fakeScrollValue; } } if (!this.keyPressed && scrollValueChanged && event.type === 'scroll') { @@ -2458,41 +2497,181 @@ Object.defineProperties(exports, { }}, __esModule: {value: true} }); +var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47__46__46__47_helpers_47_number__; +var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}), + innerHeight = $__0.innerHeight, + innerWidth = $__0.innerWidth, + getScrollLeft = $__0.getScrollLeft, + getScrollTop = $__0.getScrollTop, + offset = $__0.offset; +var $__1 = ($___46__46__47__46__46__47__46__46__47_helpers_47_number__ = require("helpers/number"), $___46__46__47__46__46__47__46__46__47_helpers_47_number__ && $___46__46__47__46__46__47__46__46__47_helpers_47_number__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_number__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_number__}), + rangeEach = $__1.rangeEach, + rangeEachReverse = $__1.rangeEachReverse; var WalkontableScroll = function WalkontableScroll(wotInstance) { this.wot = wotInstance; this.instance = wotInstance; }; -($traceurRuntime.createClass)(WalkontableScroll, {scrollViewport: function(coords) { +($traceurRuntime.createClass)(WalkontableScroll, { + scrollViewport: function(coords) { if (!this.wot.drawn) { return; } - var totalRows = this.wot.getSetting('totalRows'); - var totalColumns = this.wot.getSetting('totalColumns'); - var fixedRowsTop = this.instance.getSetting('fixedRowsTop'); - var fixedRowsBottom = this.instance.getSetting('fixedRowsBottom'); - var fixedColumnsLeft = this.instance.getSetting('fixedColumnsLeft'); + var $__3 = this._getVariables(), + topOverlay = $__3.topOverlay, + leftOverlay = $__3.leftOverlay, + totalRows = $__3.totalRows, + totalColumns = $__3.totalColumns, + fixedRowsTop = $__3.fixedRowsTop, + fixedRowsBottom = $__3.fixedRowsBottom, + fixedColumnsLeft = $__3.fixedColumnsLeft; if (coords.row < 0 || coords.row > totalRows - 1) { - throw new Error('row ' + coords.row + ' does not exist'); + throw new Error(("row " + coords.row + " does not exist")); } if (coords.col < 0 || coords.col > totalColumns - 1) { - throw new Error('column ' + coords.col + ' does not exist'); + throw new Error(("column " + coords.col + " does not exist")); + } + if (coords.row >= fixedRowsTop && coords.row < this.getFirstVisibleRow()) { + topOverlay.scrollTo(coords.row); + } else if (coords.row > this.getLastVisibleRow() && coords.row < totalRows - fixedRowsBottom) { + topOverlay.scrollTo(coords.row, true); + } + if (coords.col >= fixedColumnsLeft && coords.col < this.getFirstVisibleColumn()) { + leftOverlay.scrollTo(coords.col); + } else if (coords.col > this.getLastVisibleColumn()) { + leftOverlay.scrollTo(coords.col, true); + } + }, + getFirstVisibleRow: function() { + var $__3 = this._getVariables(), + topOverlay = $__3.topOverlay, + wtTable = $__3.wtTable, + wtViewport = $__3.wtViewport, + totalRows = $__3.totalRows, + fixedRowsTop = $__3.fixedRowsTop; + var firstVisibleRow = wtTable.getFirstVisibleRow(); + if (topOverlay.mainTableScrollableElement === window) { + var rootElementOffset = offset(wtTable.wtRootElement); + var totalTableHeight = innerHeight(wtTable.hider); + var windowHeight = innerHeight(window); + var windowScrollTop = getScrollTop(window); + if (rootElementOffset.top + totalTableHeight - windowHeight <= windowScrollTop) { + var rowsHeight = wtViewport.getColumnHeaderHeight(); + rowsHeight += topOverlay.sumCellSizes(0, fixedRowsTop); + rangeEachReverse(totalRows, 1, (function(row) { + rowsHeight += topOverlay.sumCellSizes(row - 1, row); + if (rootElementOffset.top + totalTableHeight - rowsHeight <= windowScrollTop) { + firstVisibleRow = row; + return false; + } + })); + } } - if (coords.row > this.instance.wtTable.getLastVisibleRow() && coords.row < totalRows - fixedRowsBottom) { - this.wot.wtOverlays.topOverlay.scrollTo(coords.row, true); - } else if (coords.row >= fixedRowsTop && coords.row < this.instance.wtTable.getFirstVisibleRow()) { - this.wot.wtOverlays.topOverlay.scrollTo(coords.row); + return firstVisibleRow; + }, + getLastVisibleRow: function() { + var $__3 = this._getVariables(), + topOverlay = $__3.topOverlay, + wtTable = $__3.wtTable, + wtViewport = $__3.wtViewport, + totalRows = $__3.totalRows; + var lastVisibleRow = wtTable.getLastVisibleRow(); + if (topOverlay.mainTableScrollableElement === window) { + var rootElementOffset = offset(wtTable.wtRootElement); + var windowHeight = innerHeight(window); + var windowScrollTop = getScrollTop(window); + if (rootElementOffset.top > windowScrollTop) { + var rowsHeight = wtViewport.getColumnHeaderHeight(); + rangeEach(1, totalRows, (function(row) { + rowsHeight += topOverlay.sumCellSizes(row - 1, row); + if (rootElementOffset.top + rowsHeight - windowScrollTop >= windowHeight) { + lastVisibleRow = row - 2; + return false; + } + })); + } + } + return lastVisibleRow; + }, + getFirstVisibleColumn: function() { + var $__3 = this._getVariables(), + leftOverlay = $__3.leftOverlay, + wtTable = $__3.wtTable, + wtViewport = $__3.wtViewport, + totalColumns = $__3.totalColumns, + fixedColumnsLeft = $__3.fixedColumnsLeft; + var firstVisibleColumn = wtTable.getFirstVisibleColumn(); + if (leftOverlay.mainTableScrollableElement === window) { + var rootElementOffset = offset(wtTable.wtRootElement); + var totalTableWidth = innerWidth(wtTable.hider); + var windowWidth = innerWidth(window); + var windowScrollLeft = getScrollLeft(window); + if (rootElementOffset.left + totalTableWidth - windowWidth <= windowScrollLeft) { + var columnsWidth = wtViewport.getRowHeaderWidth(); + rangeEachReverse(totalColumns, 1, (function(column) { + columnsWidth += leftOverlay.sumCellSizes(column - 1, column); + if (rootElementOffset.left + totalTableWidth - columnsWidth <= windowScrollLeft) { + firstVisibleColumn = column; + return false; + } + })); + } } - if (coords.col > this.instance.wtTable.getLastVisibleColumn()) { - this.wot.wtOverlays.leftOverlay.scrollTo(coords.col, true); - } else if (coords.col >= fixedColumnsLeft && coords.col < this.instance.wtTable.getFirstVisibleColumn()) { - this.wot.wtOverlays.leftOverlay.scrollTo(coords.col); + return firstVisibleColumn; + }, + getLastVisibleColumn: function() { + var $__3 = this._getVariables(), + leftOverlay = $__3.leftOverlay, + wtTable = $__3.wtTable, + wtViewport = $__3.wtViewport, + totalColumns = $__3.totalColumns; + var lastVisibleColumn = wtTable.getLastVisibleColumn(); + if (leftOverlay.mainTableScrollableElement === window) { + var rootElementOffset = offset(wtTable.wtRootElement); + var windowWidth = innerWidth(window); + var windowScrollLeft = getScrollLeft(window); + if (rootElementOffset.left > windowScrollLeft) { + var columnsWidth = wtViewport.getRowHeaderWidth(); + rangeEach(1, totalColumns, (function(column) { + columnsWidth += leftOverlay.sumCellSizes(column - 1, column); + if (rootElementOffset.left + columnsWidth - windowScrollLeft >= windowWidth) { + lastVisibleColumn = column - 2; + return false; + } + })); + } } - }}, {}); + return lastVisibleColumn; + }, + _getVariables: function() { + var wot = this.wot; + var topOverlay = wot.wtOverlays.topOverlay; + var leftOverlay = wot.wtOverlays.leftOverlay; + var wtTable = wot.wtTable; + var wtViewport = wot.wtViewport; + var totalRows = wot.getSetting('totalRows'); + var totalColumns = wot.getSetting('totalColumns'); + var fixedRowsTop = wot.getSetting('fixedRowsTop'); + var fixedRowsBottom = wot.getSetting('fixedRowsBottom'); + var fixedColumnsLeft = wot.getSetting('fixedColumnsLeft'); + return { + topOverlay: topOverlay, + leftOverlay: leftOverlay, + wtTable: wtTable, + wtViewport: wtViewport, + totalRows: totalRows, + totalColumns: totalColumns, + fixedRowsTop: fixedRowsTop, + fixedRowsBottom: fixedRowsBottom, + fixedColumnsLeft: fixedColumnsLeft + }; + } +}, {}); ; window.WalkontableScroll = WalkontableScroll; //# -},{}],18:[function(require,module,exports){ +},{"helpers/dom/element":45,"helpers/number":49}],18:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { WalkontableSelection: {get: function() { @@ -2641,6 +2820,9 @@ var WalkontableSettings = function WalkontableSettings(wotInstance, settings) { stretchH: 'none', currentRowClassName: null, currentColumnClassName: null, + preventOverflow: function() { + return false; + }, data: void 0, fixedColumnsLeft: 0, fixedRowsTop: 0, @@ -2850,8 +3032,11 @@ var WalkontableTable = function WalkontableTable(wotInstance, table) { if (!this.isWorkingOnClone()) { this.holder.parentNode.style.position = 'relative'; if (trimmingElement === window) { - this.holder.style.overflow = 'visible'; - this.wtRootElement.style.overflow = 'visible'; + var preventOverflow = this.wot.getSetting('preventOverflow'); + if (!preventOverflow) { + this.holder.style.overflow = 'visible'; + this.wtRootElement.style.overflow = 'visible'; + } } else { this.holder.style.width = getStyle(trimmingElement, 'width'); this.holder.style.height = getStyle(trimmingElement, 'height'); @@ -3123,7 +3308,8 @@ var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = empty = $__0.empty, getScrollbarWidth = $__0.getScrollbarWidth, hasClass = $__0.hasClass, - innerHeight = $__0.innerHeight; + innerHeight = $__0.innerHeight, + outerWidth = $__0.outerWidth; var WalkontableTableRenderer = function WalkontableTableRenderer(wtTable) { this.wtTable = wtTable; this.wot = wtTable.instance; @@ -3183,6 +3369,11 @@ var WalkontableTableRenderer = function WalkontableTableRenderer(wtTable) { this.markOversizedRows(); this.wot.wtViewport.createVisibleCalculators(); this.wot.wtOverlays.refresh(false); + var hiderWidth = outerWidth(this.wtTable.hider); + var tableWidth = outerWidth(this.wtTable.TABLE); + if (hiderWidth !== 0 && (tableWidth !== hiderWidth)) { + this.adjustColumnWidths(columnsToRender); + } this.wot.wtOverlays.applyToDOM(); if (workspaceWidth !== this.wot.wtViewport.getWorkspaceWidth()) { this.wot.wtViewport.containerWidth = null; @@ -3565,11 +3756,15 @@ var WalkontableViewport = function WalkontableViewport(wotInstance) { }, getWorkspaceWidth: function() { var width; - var totalColumns = this.instance.getSetting('totalColumns'); + var totalColumns = this.wot.getSetting('totalColumns'); var trimmingContainer = this.instance.wtOverlays.leftOverlay.trimmingContainer; var overflow; - var stretchSetting = this.instance.getSetting('stretchH'); + var stretchSetting = this.wot.getSetting('stretchH'); var docOffsetWidth = document.documentElement.offsetWidth; + var preventOverflow = this.wot.getSetting('preventOverflow'); + if (preventOverflow) { + return outerWidth(this.instance.wtTable.wtRootElement); + } if (Handsontable.freezeOverlays) { width = Math.min(docOffsetWidth - this.getWorkspaceOffset().left, docOffsetWidth); } else { @@ -3699,7 +3894,7 @@ var WalkontableViewport = function WalkontableViewport(wotInstance) { } else { height = this.getViewportHeight(); } - pos = getScrollTop(this.wot.wtOverlays.mainTableScrollableElement) - this.wot.wtOverlays.topOverlay.getTableParentOffset(); + pos = this.wot.wtOverlays.topOverlay.getScrollPosition() - this.wot.wtOverlays.topOverlay.getTableParentOffset(); if (pos < 0) { pos = 0; } @@ -3848,9 +4043,9 @@ var domHelpers = ($__helpers_47_dom_47_element__ = require("helpers/dom/element" var domEventHelpers = ($__helpers_47_dom_47_event__ = require("helpers/dom/event"), $__helpers_47_dom_47_event__ && $__helpers_47_dom_47_event__.__esModule && $__helpers_47_dom_47_event__ || {default: $__helpers_47_dom_47_event__}); var HELPERS = [arrayHelpers, browserHelpers, dataHelpers, functionHelpers, mixedHelpers, numberHelpers, objectHelpers, settingHelpers, stringHelpers, unicodeHelpers]; var DOM = [domHelpers, domEventHelpers]; -Handsontable.buildDate = 'Fri Dec 04 2015 11:56:12 GMT+0100 (CET)'; +Handsontable.buildDate = 'Fri Jan 08 2016 13:02:33 GMT+0100 (CET)'; Handsontable.packageName = 'handsontable'; -Handsontable.version = '0.20.2'; +Handsontable.version = '0.20.3'; var baseVersion = '@@baseVersion'; if (!/^@@/.test(baseVersion)) { Handsontable.baseVersion = baseVersion; @@ -4105,8 +4300,8 @@ Handsontable.Core = function Core(rootElement, userSettings) { instance.getSettings().fixedRowsTop -= Math.min(amount, fixedRowsTop - index); } var fixedRowsBottom = instance.getSettings().fixedRowsBottom; - if (fixedRowsBottom && totalRows - fixedRowsBottom <= index + 1) { - instance.getSettings().fixedRowsBottom -= Math.min(amount, fixedRowsBottom - index); + if (fixedRowsBottom && index >= totalRows - fixedRowsBottom) { + instance.getSettings().fixedRowsBottom -= Math.min(amount, fixedRowsBottom); } grid.adjustRowsAndCols(); selection.refreshBorders(); @@ -5703,7 +5898,8 @@ DefaultSettings.prototype = { correctFormat: false, defaultDate: void 0, strict: void 0, - renderAllRows: void 0 + renderAllRows: void 0, + preventOverflow: false }; Handsontable.DefaultSettings = DefaultSettings; @@ -10753,6 +10949,11 @@ var $AutoColumnSize = AutoColumnSize; if (this.enabled) { return; } + var setting = this.hot.getSettings().autoColumnSize; + var samplingRatio = setting && setting.hasOwnProperty('samplingRatio') ? this.hot.getSettings().autoColumnSize.samplingRatio : void 0; + if (samplingRatio && !isNaN(samplingRatio)) { + this.samplesGenerator.customSampleCount = parseInt(samplingRatio, 10); + } this.addHook('afterLoadData', (function() { return $__10.onAfterLoadData(); })); @@ -11023,6 +11224,11 @@ var $AutoRowSize = AutoRowSize; if (this.enabled) { return; } + var setting = this.hot.getSettings().autoRowSize; + var samplingRatio = setting && setting.hasOwnProperty('samplingRatio') ? this.hot.getSettings().autoRowSize.samplingRatio : void 0; + if (samplingRatio && !isNaN(samplingRatio)) { + this.samplesGenerator.customSampleCount = parseInt(samplingRatio, 10); + } this.addHook('afterLoadData', (function() { return $__9.onAfterLoadData(); })); @@ -13305,7 +13511,7 @@ var _predefinedItems = ($__4 = {}, Object.defineProperty($__4, SEPARATOR, { }, disabled: function() { var selected = getValidSelection(this); - if (!selected) { + if (!selected || this.countRows() >= this.getSettings().maxRows) { return true; } var rowCount = this.countRows(); @@ -13328,7 +13534,7 @@ var _predefinedItems = ($__4 = {}, Object.defineProperty($__4, SEPARATOR, { }, disabled: function() { var selected = getValidSelection(this); - if (!selected) { + if (!selected || this.countRows() >= this.getSettings().maxRows) { return true; } var rowCount = this.countRows(); @@ -13828,9 +14034,6 @@ function getValidSelection(hot) { if (selected[0] < 0) { return null; } - if (hot.countRows() >= hot.getSettings().maxRows) { - return null; - } return selected; } function prepareVerticalAlignClass(className, alignment) { @@ -18253,6 +18456,7 @@ var WalkontableSelection = ($__3rdparty_47_walkontable_47_src_47_selection__ = r var Walkontable = ($__3rdparty_47_walkontable_47_src_47_core__ = require("3rdparty/walkontable/src/core"), $__3rdparty_47_walkontable_47_src_47_core__ && $__3rdparty_47_walkontable_47_src_47_core__.__esModule && $__3rdparty_47_walkontable_47_src_47_core__ || {default: $__3rdparty_47_walkontable_47_src_47_core__}).Walkontable; Handsontable.TableView = TableView; function TableView(instance) { + var $__6 = this; var that = this; this.eventManager = eventManagerObject(instance); this.instance = instance; @@ -18403,6 +18607,9 @@ function TableView(instance) { }, externalRowCalculator: this.instance.getPlugin('autoRowSize') && this.instance.getPlugin('autoRowSize').isEnabled(), table: table, + preventOverflow: (function() { + return $__6.settings.preventOverflow; + }), stretchH: this.settings.stretchH, data: instance.getDataAtCell, totalRows: (function() { @@ -18625,11 +18832,11 @@ TableView.prototype.isTextSelectionAllowed = function(el) { return false; }; TableView.prototype.isSelectedOnlyCell = function() { - var $__6 = this.instance.getSelected() || [], - row = $__6[0], - col = $__6[1], - rowEnd = $__6[2], - colEnd = $__6[3]; + var $__7 = this.instance.getSelected() || [], + row = $__7[0], + col = $__7[1], + rowEnd = $__7[2], + colEnd = $__7[3]; return row !== void 0 && row === rowEnd && col === colEnd; }; TableView.prototype.isCellEdited = function() { @@ -18980,9 +19187,20 @@ var stringify = ($___46__46__47_helpers_47_mixed__ = require("helpers/mixed"), $ var SamplesGenerator = function SamplesGenerator(dataFactory) { this.samples = null; this.dataFactory = dataFactory; + this.customSampleCount = null; }; var $SamplesGenerator = SamplesGenerator; -($traceurRuntime.createClass)(SamplesGenerator, ($__7 = {}, Object.defineProperty($__7, "generateRowSamples", { +($traceurRuntime.createClass)(SamplesGenerator, ($__7 = {}, Object.defineProperty($__7, "getSampleCount", { + value: function() { + if (this.customSampleCount) { + return this.customSampleCount; + } + return $SamplesGenerator.SAMPLE_COUNT; + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__7, "generateRowSamples", { value: function(rowRange, colRange) { return this.generateSamples('row', colRange, rowRange); }, @@ -19019,6 +19237,7 @@ var $SamplesGenerator = SamplesGenerator; value: function(type, range, specifierValue) { var $__5 = this; var samples = new Map(); + var sampledValues = []; rangeEach(range.from, range.to, (function(index) { var $__7; var value; @@ -19035,25 +19254,29 @@ var $SamplesGenerator = SamplesGenerator; var len = value.length; if (!samples.has(len)) { samples.set(len, { - needed: $SamplesGenerator.SAMPLE_COUNT, + needed: $__5.getSampleCount(), strings: [] }); } var sample = samples.get(len); if (sample.needed) { - var computedKey = type === 'row' ? 'col' : 'row'; - sample.strings.push(($__7 = {}, Object.defineProperty($__7, "value", { - value: value, - configurable: true, - enumerable: true, - writable: true - }), Object.defineProperty($__7, computedKey, { - value: index, - configurable: true, - enumerable: true, - writable: true - }), $__7)); - sample.needed--; + var duplicate = sampledValues.indexOf(value) > -1; + if (!duplicate) { + var computedKey = type === 'row' ? 'col' : 'row'; + sample.strings.push(($__7 = {}, Object.defineProperty($__7, "value", { + value: value, + configurable: true, + enumerable: true, + writable: true + }), Object.defineProperty($__7, computedKey, { + value: index, + configurable: true, + enumerable: true, + writable: true + }), $__7)); + sampledValues.push(value); + sample.needed--; + } } })); return samples; diff --git a/bower_components/handsontable/dist/handsontable.min.js b/bower_components/handsontable/dist/handsontable.min.js index 3a56d00..1ca8194 100644 --- a/bower_components/handsontable/dist/handsontable.min.js +++ b/bower_components/handsontable/dist/handsontable.min.js @@ -24,16 +24,16 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Handsontable=e()}}(function(){var e;return function(e,t,n){return function o(e,t,n){function r(l,a){if(!t[l]){if(!e[l]){var u="function"==typeof require&&require;if(!a&&u)return u(l,!0);if(i)return i(l,!0);if(s[l]&&"undefined"!=typeof window[s[l]])return window[s[l]];var c=new Error("Cannot find module '"+l+"'");throw c.code="MODULE_NOT_FOUND",c}var d=t[l]={exports:{}};e[l][0].call(d.exports,function(t){var n=e[l][1][t];return r(n?n:t)},d,d.exports,o,e,t,n)}return t[l].exports}for(var i="function"==typeof require&&require,s=JSON.parse('{"zeroclipboard":"ZeroClipboard","moment":"moment","pikaday":"Pikaday"}')||{},l=0;l1)for(t=1,o=arguments.length;o>t;t++)r.push(arguments[t]);if(a){if("undefined"==typeof a[e])throw new Error("Handsontable do not provide action: "+e);i=a[e].apply(a,r),"destroy"===e&&l.removeData()}return i}}(window,jQuery,Handsontable)},{}],2:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableBorder:{get:function(){return C}},__esModule:{value:!0}});var o,r,i,s,l,a=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),u=a.getComputedStyle,c=a.getTrimmingContainer,d=a.innerWidth,h=a.innerHeight,f=a.offset,g=a.outerHeight,p=a.outerWidth,m=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}).stopImmediatePropagation,w=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,v=(s=e("cell/coords"),s&&s.__esModule&&s||{"default":s}).WalkontableCellCoords,b=(l=e("overlay/_base.js"),l&&l.__esModule&&l||{"default":l}).WalkontableOverlay,C=function(e,t){t&&(this.eventManager=new w(e),this.instance=e,this.wot=e,this.settings=t,this.mouseDown=!1,this.main=null,this.top=null,this.left=null,this.bottom=null,this.right=null,this.topStyle=null,this.leftStyle=null,this.bottomStyle=null,this.rightStyle=null,this.cornerDefaultStyle={width:"5px",height:"5px",borderWidth:"2px",borderStyle:"solid",borderColor:"#FFF"},this.corner=null,this.cornerStyle=null,this.createBorders(t),this.registerListeners())};$traceurRuntime.createClass(C,{registerListeners:function(){var e=this;this.eventManager.addEventListener(document.body,"mousedown",function(){return e.onMouseDown()}),this.eventManager.addEventListener(document.body,"mouseup",function(){return e.onMouseUp()});for(var t=this,n=function(n,o){t.eventManager.addEventListener(t.main.childNodes[n],"mouseenter",function(t){return e.onMouseEnter(t,e.main.childNodes[n])})},o=0,r=this.main.childNodes.length;r>o;o++)n(o,r)},onMouseDown:function(){this.mouseDown=!0},onMouseUp:function(){this.mouseDown=!1},onMouseEnter:function(e,t){function n(e){return e.clientYMath.ceil(i.top+i.height)?!0:e.clientXMath.ceil(i.left+i.width)?!0:void 0}function o(e){n(e)&&(r.eventManager.removeEventListener(document.body,"mousemove",o),t.style.display="block")}if(this.mouseDown&&this.wot.getSetting("hideBorderOnMouseDownOver")){e.preventDefault(),m(e);var r=this,i=t.getBoundingClientRect();t.style.display="none",this.eventManager.addEventListener(document.body,"mousemove",o)}},createBorders:function(e){this.main=document.createElement("div");var t=["top","left","bottom","right","corner"],n=this.main.style;n.position="absolute",n.top=0,n.left=0;for(var o=0;5>o;o++){var r=t[o],i=document.createElement("div");i.className="wtBorder "+(this.settings.className||""),this.settings[r]&&this.settings[r].hide&&(i.className+=" hidden"),n=i.style,n.backgroundColor=this.settings[r]&&this.settings[r].color?this.settings[r].color:e.border.color,n.height=this.settings[r]&&this.settings[r].width?this.settings[r].width+"px":e.border.width+"px",n.width=this.settings[r]&&this.settings[r].width?this.settings[r].width+"px":e.border.width+"px",this.main.appendChild(i)}this.top=this.main.childNodes[0],this.left=this.main.childNodes[1],this.bottom=this.main.childNodes[2],this.right=this.main.childNodes[3],this.topStyle=this.top.style,this.leftStyle=this.left.style,this.bottomStyle=this.bottom.style,this.rightStyle=this.right.style,this.corner=this.main.childNodes[4],this.corner.className+=" corner",this.cornerStyle=this.corner.style,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.height=this.cornerDefaultStyle.height,this.cornerStyle.border=[this.cornerDefaultStyle.borderWidth,this.cornerDefaultStyle.borderStyle,this.cornerDefaultStyle.borderColor].join(" "),Handsontable.mobileBrowser&&this.createMultipleSelectorHandles(),this.disappear(),this.wot.wtTable.bordersHolder||(this.wot.wtTable.bordersHolder=document.createElement("div"),this.wot.wtTable.bordersHolder.className="htBorders",this.wot.wtTable.spreader.appendChild(this.wot.wtTable.bordersHolder)),this.wot.wtTable.bordersHolder.insertBefore(this.main,this.wot.wtTable.bordersHolder.firstChild)},createMultipleSelectorHandles:function(){this.selectionHandles={topLeft:document.createElement("DIV"),topLeftHitArea:document.createElement("DIV"),bottomRight:document.createElement("DIV"),bottomRightHitArea:document.createElement("DIV")};var e=10,t=40;this.selectionHandles.topLeft.className="topLeftSelectionHandle",this.selectionHandles.topLeftHitArea.className="topLeftSelectionHandle-HitArea",this.selectionHandles.bottomRight.className="bottomRightSelectionHandle",this.selectionHandles.bottomRightHitArea.className="bottomRightSelectionHandle-HitArea",this.selectionHandles.styles={topLeft:this.selectionHandles.topLeft.style,topLeftHitArea:this.selectionHandles.topLeftHitArea.style,bottomRight:this.selectionHandles.bottomRight.style,bottomRightHitArea:this.selectionHandles.bottomRightHitArea.style};var n={position:"absolute",height:t+"px",width:t+"px","border-radius":parseInt(t/1.5,10)+"px"};for(var o in n)n.hasOwnProperty(o)&&(this.selectionHandles.styles.bottomRightHitArea[o]=n[o],this.selectionHandles.styles.topLeftHitArea[o]=n[o]);var r={position:"absolute",height:e+"px",width:e+"px","border-radius":parseInt(e/1.5,10)+"px",background:"#F5F5FF",border:"1px solid #4285c8"};for(var i in r)r.hasOwnProperty(i)&&(this.selectionHandles.styles.bottomRight[i]=r[i],this.selectionHandles.styles.topLeft[i]=r[i]);this.main.appendChild(this.selectionHandles.topLeft),this.main.appendChild(this.selectionHandles.bottomRight),this.main.appendChild(this.selectionHandles.topLeftHitArea),this.main.appendChild(this.selectionHandles.bottomRightHitArea)},isPartRange:function(e,t){return!this.wot.selections.area.cellRange||e==this.wot.selections.area.cellRange.to.row&&t==this.wot.selections.area.cellRange.to.col?!1:!0},updateMultipleSelectionHandlesPosition:function(e,t,n,o,r,i){var s=parseInt(this.selectionHandles.styles.topLeft.width,10),l=parseInt(this.selectionHandles.styles.topLeftHitArea.width,10);this.selectionHandles.styles.topLeft.top=parseInt(n-s,10)+"px",this.selectionHandles.styles.topLeft.left=parseInt(o-s,10)+"px",this.selectionHandles.styles.topLeftHitArea.top=parseInt(n-l/4*3,10)+"px",this.selectionHandles.styles.topLeftHitArea.left=parseInt(o-l/4*3,10)+"px",this.selectionHandles.styles.bottomRight.top=parseInt(n+i,10)+"px",this.selectionHandles.styles.bottomRight.left=parseInt(o+r,10)+"px",this.selectionHandles.styles.bottomRightHitArea.top=parseInt(n+i-l/4,10)+"px",this.selectionHandles.styles.bottomRightHitArea.left=parseInt(o+r-l/4,10)+"px",this.settings.border.multipleSelectionHandlesVisible&&this.settings.border.multipleSelectionHandlesVisible()?(this.selectionHandles.styles.topLeft.display="block",this.selectionHandles.styles.topLeftHitArea.display="block",this.isPartRange(e,t)?(this.selectionHandles.styles.bottomRight.display="none",this.selectionHandles.styles.bottomRightHitArea.display="none"):(this.selectionHandles.styles.bottomRight.display="block",this.selectionHandles.styles.bottomRightHitArea.display="block")):(this.selectionHandles.styles.topLeft.display="none",this.selectionHandles.styles.bottomRight.display="none",this.selectionHandles.styles.topLeftHitArea.display="none",this.selectionHandles.styles.bottomRightHitArea.display="none"),e==this.wot.wtSettings.getSetting("fixedRowsTop")||t==this.wot.wtSettings.getSetting("fixedColumnsLeft")?(this.selectionHandles.styles.topLeft.zIndex="9999",this.selectionHandles.styles.topLeftHitArea.zIndex="9999"):(this.selectionHandles.styles.topLeft.zIndex="",this.selectionHandles.styles.topLeftHitArea.zIndex="")},appear:function(e){if(!this.disabled){var t,n,o,r,i,s,l,a,m,w,C,y,R,E,S,T,O,_,M;M=b.isOverlayTypeOf(this.wot.cloneOverlay,b.CLONE_TOP)||b.isOverlayTypeOf(this.wot.cloneOverlay,b.CLONE_TOP_LEFT_CORNER)?this.wot.getSetting("fixedRowsTop"):b.isOverlayTypeOf(this.wot.cloneOverlay,b.CLONE_BOTTOM)||b.isOverlayTypeOf(this.wot.cloneOverlay,b.CLONE_BOTTOM_LEFT_CORNER)?this.wot.getSetting("fixedRowsBottom"):this.wot.wtTable.getRenderedRowsCount();for(var H=0;M>H;H++){var k=this.wot.wtTable.rowFilter.renderedToSource(H);if(k>=e[0]&&k<=e[2]){R=k;break}}for(var A=M-1;A>=0;A--){var P=this.wot.wtTable.rowFilter.renderedToSource(A);if(P>=e[0]&&P<=e[2]){S=P;break}}M=this.wot.wtTable.getRenderedColumnsCount();for(var x=0;M>x;x++){var D=this.wot.wtTable.columnFilter.renderedToSource(x);if(D>=e[1]&&D<=e[3]){E=D;break}}for(var N=M-1;N>=0;N--){var L=this.wot.wtTable.columnFilter.renderedToSource(N);if(L>=e[1]&&L<=e[3]){T=L;break}}if(void 0===R||void 0===E)return void this.disappear();t=R!==S||E!==T,n=this.wot.wtTable.getCell(new v(R,E)),o=t?this.wot.wtTable.getCell(new v(S,T)):n,r=f(n),i=t?f(o):r,s=f(this.wot.wtTable.TABLE),a=r.top,C=i.top+g(o)-a,w=r.left,y=i.left+p(o)-w,l=a-s.top-1,m=w-s.left-1;var W=u(n);parseInt(W.borderTopWidth,10)>0&&(l+=1,C=C>0?C-1:0),parseInt(W.borderLeftWidth,10)>0&&(m+=1,y=y>0?y-1:0),this.topStyle.top=l+"px",this.topStyle.left=m+"px",this.topStyle.width=y+"px",this.topStyle.display="block",this.leftStyle.top=l+"px",this.leftStyle.left=m+"px",this.leftStyle.height=C+"px",this.leftStyle.display="block";var I=Math.floor(this.settings.border.width/2);this.bottomStyle.top=l+C-I+"px",this.bottomStyle.left=m+"px",this.bottomStyle.width=y+"px",this.bottomStyle.display="block",this.rightStyle.top=l+"px",this.rightStyle.left=m+y-I+"px",this.rightStyle.height=C+1+"px",this.rightStyle.display="block",Handsontable.mobileBrowser||!this.hasSetting(this.settings.border.cornerVisible)||this.isPartRange(S,T)?this.cornerStyle.display="none":(this.cornerStyle.top=l+C-4+"px",this.cornerStyle.left=m+y-4+"px",this.cornerStyle.borderRightWidth=this.cornerDefaultStyle.borderWidth,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.display="block",O=c(this.wot.wtTable.TABLE),T===this.wot.getSetting("totalColumns")-1&&(_=o.offsetLeft+p(o)>=d(O),_&&(this.cornerStyle.left=Math.floor(m+y-3-parseInt(this.cornerDefaultStyle.width)/2)+"px",this.cornerStyle.borderRightWidth=0)),S===this.wot.getSetting("totalRows")-1&&(_=o.offsetTop+g(o)>=h(O),_&&(this.cornerStyle.top=Math.floor(l+C-3-parseInt(this.cornerDefaultStyle.height)/2)+"px",this.cornerStyle.borderBottomWidth=0))),Handsontable.mobileBrowser&&this.updateMultipleSelectionHandlesPosition(R,E,l,m,y,C)}},disappear:function(){this.topStyle.display="none",this.leftStyle.display="none",this.bottomStyle.display="none",this.rightStyle.display="none",this.cornerStyle.display="none",Handsontable.mobileBrowser&&(this.selectionHandles.styles.topLeft.display="none",this.selectionHandles.styles.bottomRight.display="none")},hasSetting:function(e){return"function"==typeof e?e():!!e}},{}),window.WalkontableBorder=C},{"cell/coords":5,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"overlay/_base.js":11}],3:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableViewportColumnsCalculator:{get:function(){return r}},__esModule:{value:!0}});var o=new WeakMap,r=function(e,t,n,r,i,s,l){o.set(this,{viewportWidth:e,scrollOffset:t,totalColumns:n,columnWidthFn:r,overrideFn:i,onlyFullyVisible:s}),this.count=0,this.startColumn=null,this.endColumn=null,this.startPosition=null,this.stretchAllRatio=0,this.stretchLastWidth=0,this.stretch=l,this.totalTargetWidth=0,this.needVerifyLastColumnWidth=!0,this.stretchAllColumnsWidth=[],this.calculate()},i=r;$traceurRuntime.createClass(r,{calculate:function(){for(var e,t=0,n=!0,r=[],i=o.get(this),s=i.onlyFullyVisible,l=i.overrideFn,a=i.scrollOffset,u=i.totalColumns,c=i.viewportWidth,d=0;u>d;d++)if(e=this._getColumnWidth(d),a>=t&&!s&&(this.startColumn=d),t>=a&&a+c>=t+e&&(null==this.startColumn&&(this.startColumn=d),this.endColumn=d),r.push(t),t+=e,s||(this.endColumn=d),t>=a+c){n=!1;break}if(this.endColumn===u-1&&n)for(this.startColumn=this.endColumn;this.startColumn>0;){var h=r[this.endColumn]+e-r[this.startColumn-1];if((c>=h||!s)&&this.startColumn--,h>c)break}null!==this.startColumn&&l&&l(this),this.startPosition=r[this.startColumn],void 0==this.startPosition&&(this.startPosition=null),null!==this.startColumn&&(this.count=this.endColumn-this.startColumn+1)},refreshStretching:function(e){if("none"!==this.stretch){for(var t,n,r=0,i=o.get(this),s=i.totalColumns,l=0;s>l;l++)t=this._getColumnWidth(l),r+=t;this.totalTargetWidth=e,n=r-e,"all"===this.stretch&&0>n?(this.stretchAllRatio=e/r,this.stretchAllColumnsWidth=[],this.needVerifyLastColumnWidth=!0):"last"===this.stretch&&e!==1/0&&(this.stretchLastWidth=-n+this._getColumnWidth(s-1))}},getStretchedColumnWidth:function(e,t){var n=null;return"all"===this.stretch&&0!==this.stretchAllRatio?n=this._getStretchedAllColumnWidth(e,t):"last"===this.stretch&&0!==this.stretchLastWidth&&(n=this._getStretchedLastColumnWidth(e)),n},_getStretchedAllColumnWidth:function(e,t){var n=0,r=o.get(this),i=r.totalColumns;if(this.stretchAllColumnsWidth[e]||(this.stretchAllColumnsWidth[e]=Math.round(t*this.stretchAllRatio)),this.stretchAllColumnsWidth.length===i&&this.needVerifyLastColumnWidth){this.needVerifyLastColumnWidth=!1;for(var s=0;sf;f++){var g=a(f);if(void 0===g&&(g=i.DEFAULT_HEIGHT),u>=e&&!s&&(this.startRow=f),e>=u&&u+d-h>=e+g&&(null===this.startRow&&(this.startRow=f),this.endRow=f),n.push(e),e+=g,s||(this.endRow=f),e>=u+d-h){t=!1;break}}if(this.endRow===c-1&&t)for(this.startRow=this.endRow;this.startRow>0;){var p=n[this.endRow]+g-n[this.startRow-1];if((d-h>=p||!s)&&this.startRow--,p>=d-h)break}null!==this.startRow&&l&&l(this),this.startPosition=n[this.startRow],void 0==this.startPosition&&(this.startPosition=null),null!==this.startRow&&(this.count=this.endRow-this.startRow+1)}},{get DEFAULT_HEIGHT(){return 23}}),window.WalkontableViewportRowsCalculator=r},{}],5:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableCellCoords:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t){"undefined"!=typeof e&&"undefined"!=typeof t?(this.row=e,this.col=t):(this.row=null,this.col=null)};$traceurRuntime.createClass(o,{isValid:function(e){return this.row<0||this.col<0?!1:this.row>=e.getSetting("totalRows")||this.col>=e.getSetting("totalColumns")?!1:!0},isEqual:function(e){return e===this?!0:this.row===e.row&&this.col===e.col},isSouthEastOf:function(e){return this.row>=e.row&&this.col>=e.col},isNorthWestOf:function(e){return this.row<=e.row&&this.col<=e.col},isSouthWestOf:function(e){return this.row>=e.row&&this.col<=e.col},isNorthEastOf:function(e){return this.row<=e.row&&this.col>=e.col}},{}),window.WalkontableCellCoords=o},{}],6:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableCellRange:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("cell/coords"),o&&o.__esModule&&o||{"default":o}).WalkontableCellCoords,i=function(e,t,n){this.highlight=e,this.from=t,this.to=n},s=i;$traceurRuntime.createClass(i,{isValid:function(e){return this.from.isValid(e)&&this.to.isValid(e)},isSingle:function(){return this.from.row===this.to.row&&this.from.col===this.to.col},getHeight:function(){return Math.max(this.from.row,this.to.row)-Math.min(this.from.row,this.to.row)+1},getWidth:function(){return Math.max(this.from.col,this.to.col)-Math.min(this.from.col,this.to.col)+1},includes:function(e){var t=this.getTopLeftCorner(),n=this.getBottomRightCorner();return e.row<0&&(e.row=0),e.col<0&&(e.col=0),t.row<=e.row&&n.row>=e.row&&t.col<=e.col&&n.col>=e.col},includesRange:function(e){return this.includes(e.getTopLeftCorner())&&this.includes(e.getBottomRightCorner())},isEqual:function(e){return Math.min(this.from.row,this.to.row)==Math.min(e.from.row,e.to.row)&&Math.max(this.from.row,this.to.row)==Math.max(e.from.row,e.to.row)&&Math.min(this.from.col,this.to.col)==Math.min(e.from.col,e.to.col)&&Math.max(this.from.col,this.to.col)==Math.max(e.from.col,e.to.col)},overlaps:function(e){return e.isSouthEastOf(this.getTopLeftCorner())&&e.isNorthWestOf(this.getBottomRightCorner())},isSouthEastOf:function(e){return this.getTopLeftCorner().isSouthEastOf(e)||this.getBottomRightCorner().isSouthEastOf(e)},isNorthWestOf:function(e){return this.getTopLeftCorner().isNorthWestOf(e)||this.getBottomRightCorner().isNorthWestOf(e)},expand:function(e){var t=this.getTopLeftCorner(),n=this.getBottomRightCorner();return e.rown.row||e.col>n.col?(this.from=new r(Math.min(t.row,e.row),Math.min(t.col,e.col)),this.to=new r(Math.max(n.row,e.row),Math.max(n.col,e.col)),!0):!1},expandByRange:function(e){if(this.includesRange(e)||!this.overlaps(e))return!1;var t=this.getTopLeftCorner(),n=this.getBottomRightCorner(),o=(this.getTopRightCorner(),this.getBottomLeftCorner(),e.getTopLeftCorner()),i=e.getBottomRightCorner(),l=Math.min(t.row,o.row),a=Math.min(t.col,o.col),u=Math.max(n.row,i.row),c=Math.max(n.col,i.col),d=new r(l,a),h=new r(u,c),f=new s(d,d,h).isCorner(this.from,e),g=e.isEqual(new s(d,d,h));return f&&!g&&(this.from.col>d.col&&(d.col=c,h.col=a),this.from.row>d.row&&(d.row=u,h.row=l)),this.from=d,this.to=h,!0},getDirection:function(){return this.from.isNorthWestOf(this.to)?"NW-SE":this.from.isNorthEastOf(this.to)?"NE-SW":this.from.isSouthEastOf(this.to)?"SE-NW":this.from.isSouthWestOf(this.to)?"SW-NE":void 0},setDirection:function(e){switch(e){case"NW-SE":this.from=this.getTopLeftCorner(),this.to=this.getBottomRightCorner();break;case"NE-SW":this.from=this.getTopRightCorner(),this.to=this.getBottomLeftCorner();break;case"SE-NW":this.from=this.getBottomRightCorner(),this.to=this.getTopLeftCorner();break;case"SW-NE":this.from=this.getBottomLeftCorner(),this.to=this.getTopRightCorner()}},getTopLeftCorner:function(){return new r(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))},getBottomRightCorner:function(){return new r(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))},getTopRightCorner:function(){return new r(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))},getBottomLeftCorner:function(){return new r(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))},isCorner:function(e,t){return t&&t.includes(e)&&(this.getTopLeftCorner().isEqual(new r(t.from.row,t.from.col))||this.getTopRightCorner().isEqual(new r(t.from.row,t.to.col))||this.getBottomLeftCorner().isEqual(new r(t.to.row,t.from.col))||this.getBottomRightCorner().isEqual(new r(t.to.row,t.to.col)))?!0:e.isEqual(this.getTopLeftCorner())||e.isEqual(this.getTopRightCorner())||e.isEqual(this.getBottomLeftCorner())||e.isEqual(this.getBottomRightCorner())},getOppositeCorner:function(e,t){if(!(e instanceof r))return!1;if(t&&t.includes(e)){if(this.getTopLeftCorner().isEqual(new r(t.from.row,t.from.col)))return this.getBottomRightCorner();if(this.getTopRightCorner().isEqual(new r(t.from.row,t.to.col)))return this.getBottomLeftCorner();if(this.getBottomLeftCorner().isEqual(new r(t.to.row,t.from.col)))return this.getTopRightCorner();if(this.getBottomRightCorner().isEqual(new r(t.to.row,t.to.col)))return this.getTopLeftCorner()}return e.isEqual(this.getBottomRightCorner())?this.getTopLeftCorner():e.isEqual(this.getTopLeftCorner())?this.getBottomRightCorner():e.isEqual(this.getTopRightCorner())?this.getBottomLeftCorner():e.isEqual(this.getBottomLeftCorner())?this.getTopRightCorner():void 0},getBordersSharedWith:function(e){if(!this.includesRange(e))return[];var t={top:Math.min(this.from.row,this.to.row),bottom:Math.max(this.from.row,this.to.row),left:Math.min(this.from.col,this.to.col),right:Math.max(this.from.col,this.to.col)},n={top:Math.min(e.from.row,e.to.row),bottom:Math.max(e.from.row,e.to.row),left:Math.min(e.from.col,e.to.col),right:Math.max(e.from.col,e.to.col)},o=[];return t.top==n.top&&o.push("top"),t.right==n.right&&o.push("right"),t.bottom==n.bottom&&o.push("bottom"),t.left==n.left&&o.push("left"),o},getInner:function(){for(var e=this.getTopLeftCorner(),t=this.getBottomRightCorner(),n=[],o=e.row;o<=t.row;o++)for(var i=e.col;i<=t.col;i++)this.from.row===o&&this.from.col===i||this.to.row===o&&this.to.col===i||n.push(new r(o,i));return n},getAll:function(){for(var e=this.getTopLeftCorner(),t=this.getBottomRightCorner(),n=[],o=e.row;o<=t.row;o++)for(var i=e.col;i<=t.col;i++)e.row===o&&e.col===i?n.push(e):t.row===o&&t.col===i?n.push(t):n.push(new r(o,i));return n},forAll:function(e){for(var t=this.getTopLeftCorner(),n=this.getBottomRightCorner(),o=t.row;o<=n.row;o++)for(var r=t.col;r<=n.col;r++){var i=e(o,r);if(i===!1)return}}},{}),window.WalkontableCellRange=i},{"cell/coords":5}],7:[function(e,t,n){"use strict";Object.defineProperties(n,{Walkontable:{get:function(){return P}},__esModule:{value:!0}});var o,r,i,s,l,a,u,c,d,h,f,g,p,m,w=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),v=w.addClass,b=w.fastInnerText,C=w.isVisible,y=w.removeClass,R=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).objectEach,E=(i=e("helpers/string"),i&&i.__esModule&&i||{"default":i}),S=E.toUpperCaseFirst,T=E.randomString,O=(s=e("event"),s&&s.__esModule&&s||{"default":s}).WalkontableEvent,_=(l=e("overlays"),l&&l.__esModule&&l||{"default":l}).WalkontableOverlays,M=(a=e("scroll"),a&&a.__esModule&&a||{"default":a}).WalkontableScroll,H=(u=e("settings"),u&&u.__esModule&&u||{"default":u}).WalkontableSettings,k=(c=e("table"),c&&c.__esModule&&c||{"default":c}).WalkontableTable,A=(d=e("viewport"),d&&d.__esModule&&d||{"default":d}).WalkontableViewport,P=((h=e("overlay/_base.js"),h&&h.__esModule&&h||{"default":h}).WalkontableOverlay,(f=e("overlay/top.js"),f&&f.__esModule&&f||{"default":f}).WalkontableTopOverlay,(g=e("overlay/left.js"),g&&g.__esModule&&g||{"default":g}).WalkontableLeftOverlay,(p=e("overlay/debug.js"),p&&p.__esModule&&p||{"default":p}).WalkontableDebugOverlay,(m=e("overlay/topLeftCorner.js"),m&&m.__esModule&&m||{"default":m}).WalkontableTopLeftCornerOverlay,function(e){var t=[];if(this.guid="wt_"+T(),e.cloneSource?(this.cloneSource=e.cloneSource,this.cloneOverlay=e.cloneOverlay,this.wtSettings=e.cloneSource.wtSettings,this.wtTable=new k(this,e.table,e.wtRootElement),this.wtScroll=new M(this),this.wtViewport=e.cloneSource.wtViewport,this.wtEvent=new O(this),this.selections=this.cloneSource.selections):(this.wtSettings=new H(this,e),this.wtTable=new k(this,e.table),this.wtScroll=new M(this),this.wtViewport=new A(this),this.wtEvent=new O(this),this.selections=this.getSetting("selections"),this.wtOverlays=new _(this),this.exportSettingsAsClassNames()),this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(var n=0,o=this.wtTable.THEAD.childNodes[0].childNodes.length;o>n;n++)t.push(this.wtTable.THEAD.childNodes[0].childNodes[n].innerHTML);this.getSetting("columnHeaders").length||this.update("columnHeaders",[function(e,n){b(n,t[e])}])}this.drawn=!1,this.drawInterrupted=!1});$traceurRuntime.createClass(P,{draw:function(){var e=void 0!==arguments[0]?arguments[0]:!1;return this.drawInterrupted=!1,e||C(this.wtTable.TABLE)?this.wtTable.draw(e):this.drawInterrupted=!0,this},getCell:function(e){var t=void 0!==arguments[1]?arguments[1]:!1;if(!t)return this.wtTable.getCell(e);var n=this.wtSettings.getSetting("totalRows"),o=this.wtSettings.getSetting("fixedRowsTop"),r=this.wtSettings.getSetting("fixedRowsBottom"),i=this.wtSettings.getSetting("fixedColumnsLeft");if(e.row=n-r){if(this.wtOverlays.bottomLeftCornerOverlay.clone)return this.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell(e)}else{if(e.coln-r&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)},update:function(e,t){return this.wtSettings.update(e,t)},scrollVertical:function(e){return this.wtOverlays.topOverlay.scrollTo(e),this.getSetting("onScrollVertically"),this},scrollHorizontal:function(e){return this.wtOverlays.leftOverlay.scrollTo(e),this.getSetting("onScrollHorizontally"),this},scrollViewport:function(e){return this.wtScroll.scrollViewport(e),this},getViewport:function(){return[this.wtTable.getFirstVisibleRow(),this.wtTable.getFirstVisibleColumn(),this.wtTable.getLastVisibleRow(),this.wtTable.getLastVisibleColumn()]},getOverlayName:function(){return this.cloneOverlay?this.cloneOverlay.type:"master"},exportSettingsAsClassNames:function(){var e=this,t={rowHeaders:["array"],columnHeaders:["array"]},n=[],o=[];R(t,function(t,r){t.indexOf("array")>-1&&e.getSetting(r).length&&o.push("ht"+S(r)),n.push("ht"+S(r))}),y(this.wtTable.wtRootElement.parentNode,n),v(this.wtTable.wtRootElement.parentNode,o)},getSetting:function(e,t,n,o,r){return this.wtSettings.getSetting(e,t,n,o,r)},hasSetting:function(e){return this.wtSettings.has(e)},destroy:function(){this.wtOverlays.destroy(),this.wtEvent.destroy()}},{}),window.Walkontable=P},{event:8,"helpers/dom/element":45,"helpers/object":50,"helpers/string":52,"overlay/_base.js":11,"overlay/debug.js":12,"overlay/left.js":13,"overlay/top.js":14,"overlay/topLeftCorner.js":15,overlays:16,scroll:17,settings:19,table:20,viewport:22}],8:[function(e,t,n){"use strict";function o(e){var t=this,n=c(e);this.instance=e;var o=[null,null];this.dblClickTimeout=[null,null];var r,i,s=function(e){var n=t.parentCell(e.realTarget);a(e.realTarget,"corner")?t.instance.getSetting("onCellCornerMouseDown",e,e.realTarget):n.TD&&t.instance.hasSetting("onCellMouseDown")&&t.instance.getSetting("onCellMouseDown",e,n.coords,n.TD,t.instance),2!==e.button&&n.TD&&(o[0]=n.TD,clearTimeout(t.dblClickTimeout[0]),t.dblClickTimeout[0]=setTimeout(function(){o[0]=null},1e3))},d=function(e){t.instance.touchMoving=!0},h=function(e){n.addEventListener(this,"touchmove",d),t.checkIfTouchMove=setTimeout(function(){return t.instance.touchMoving===!0?(t.instance.touchMoving=void 0,void n.removeEventListener("touchmove",d,!1)):void s(e)},30)},f=function(e){var n,o;t.instance.hasSetting("onCellMouseOver")&&(n=t.instance.wtTable.TABLE,o=l(e.realTarget,["TD","TH"],n),o&&o!==i&&u(o,n)&&(i=o,t.instance.getSetting("onCellMouseOver",e,t.instance.wtTable.getCoords(o),o,t.instance)))},g=function(e){if(2!==e.button){var n=t.parentCell(e.realTarget);n.TD===o[0]&&n.TD===o[1]?(a(e.realTarget,"corner")?t.instance.getSetting("onCellCornerDblClick",e,n.coords,n.TD,t.instance):t.instance.getSetting("onCellDblClick",e,n.coords,n.TD,t.instance),o[0]=null,o[1]=null):n.TD===o[0]&&(o[1]=n.TD,clearTimeout(t.dblClickTimeout[1]),t.dblClickTimeout[1]=setTimeout(function(){o[1]=null},500))}},p=function(e){clearTimeout(r),e.preventDefault(),g(e)};if(n.addEventListener(this.instance.wtTable.holder,"mousedown",s),n.addEventListener(this.instance.wtTable.TABLE,"mouseover",f),n.addEventListener(this.instance.wtTable.holder,"mouseup",g),this.instance.wtTable.holder.parentNode.parentNode&&Handsontable.mobileBrowser&&!t.instance.wtTable.isWorkingOnClone()){var m="."+this.instance.wtTable.holder.parentNode.className.split(" ").join(".");n.addEventListener(this.instance.wtTable.holder,"touchstart",function(e){t.instance.touchApplied=!0,u(e.target,m)&&h.call(e.target,e)}),n.addEventListener(this.instance.wtTable.holder,"touchend",function(e){t.instance.touchApplied=!1,u(e.target,m)&&p.call(e.target,e)}),t.instance.momentumScrolling||(t.instance.momentumScrolling={}),n.addEventListener(this.instance.wtTable.holder,"scroll",function(e){clearTimeout(t.instance.momentumScrolling._timeout),t.instance.momentumScrolling.ongoing||t.instance.getSetting("onBeforeTouchScroll"),t.instance.momentumScrolling.ongoing=!0,t.instance.momentumScrolling._timeout=setTimeout(function(){t.instance.touchApplied||(t.instance.momentumScrolling.ongoing=!1,t.instance.getSetting("onAfterMomentumScroll"))},200)})}n.addEventListener(window,"resize",function(){"none"!==t.instance.getSetting("stretchH")&&t.instance.draw()}),this.destroy=function(){clearTimeout(this.dblClickTimeout[0]),clearTimeout(this.dblClickTimeout[1]),n.destroy()}}Object.defineProperties(n,{WalkontableEvent:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),l=s.closest,a=s.hasClass,u=s.isChildOf,c=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager;o.prototype.parentCell=function(e){var t={},n=this.instance.wtTable.TABLE,o=l(e,["TD","TH"],n);return o&&u(o,n)?(t.coords=this.instance.wtTable.getCoords(o),t.TD=o):a(e,"wtBorder")&&a(e,"current")?(t.coords=this.instance.selections.current.cellRange.highlight,t.TD=this.instance.wtTable.getCell(t.coords)):a(e,"wtBorder")&&a(e,"area")&&this.instance.selections.area.cellRange&&(t.coords=this.instance.selections.area.cellRange.to,t.TD=this.instance.wtTable.getCell(t.coords)),t},window.WalkontableEvent=o},{eventManager:41,"helpers/dom/element":45}],9:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableColumnFilter:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t,n){this.offset=e,this.total=t,this.countTH=n};$traceurRuntime.createClass(o,{offsetted:function(e){return e+this.offset},unOffsetted:function(e){return e-this.offset},renderedToSource:function(e){return this.offsetted(e)},sourceToRendered:function(e){return this.unOffsetted(e)},offsettedTH:function(e){return e-this.countTH},unOffsettedTH:function(e){return e+this.countTH},visibleRowHeadedColumnToSourceColumn:function(e){return this.renderedToSource(this.offsettedTH(e))},sourceColumnToVisibleRowHeadedColumn:function(e){return this.unOffsettedTH(this.sourceToRendered(e))}},{}),window.WalkontableColumnFilter=o; -},{}],10:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableRowFilter:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t,n){this.offset=e,this.total=t,this.countTH=n};$traceurRuntime.createClass(o,{offsetted:function(e){return e+this.offset},unOffsetted:function(e){return e-this.offset},renderedToSource:function(e){return this.offsetted(e)},sourceToRendered:function(e){return this.unOffsetted(e)},offsettedTH:function(e){return e-this.countTH},unOffsettedTH:function(e){return e+this.countTH},visibleColHeadedRowToSourceRow:function(e){return this.renderedToSource(this.offsettedTH(e))},sourceRowToVisibleColHeadedRow:function(e){return this.unOffsettedTH(this.sourceToRendered(e))}},{}),window.WalkontableRowFilter=o},{}],11:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableOverlay:{get:function(){return h}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),l=s.getScrollableElement,a=s.getTrimmingContainer,u=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).defineGetter,c=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,d={},h=function(e){u(this,"wot",e,{writable:!1}),this.instance=this.wot,this.type="",this.TABLE=this.wot.wtTable.TABLE,this.hider=this.wot.wtTable.hider,this.spreader=this.wot.wtTable.spreader,this.holder=this.wot.wtTable.holder,this.wtRootElement=this.wot.wtTable.wtRootElement,this.trimmingContainer=a(this.hider.parentNode.parentNode),this.mainTableScrollableElement=l(this.wot.wtTable.TABLE),this.needFullRender=this.shouldBeRendered(),this.areElementSizesAdjusted=!1},f=h;$traceurRuntime.createClass(h,{shouldBeRendered:function(){return!0},makeClone:function(e){if(-1===f.CLONE_TYPES.indexOf(e))throw new Error('Clone type "'+e+'" is not supported.');var t=document.createElement("DIV"),n=document.createElement("TABLE");return t.className="ht_clone_"+e+" handsontable",t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.overflow="hidden",n.className=this.wot.wtTable.TABLE.className,t.appendChild(n),this.type=e,this.wot.wtTable.wtRootElement.parentNode.appendChild(t),new Walkontable({cloneSource:this.wot,cloneOverlay:this,table:n})},refresh:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=this.shouldBeRendered();this.clone&&(this.needFullRender||t)&&this.clone.draw(e),this.needFullRender=t},destroy:function(){c(this.clone).destroy()}},{get CLONE_TOP(){return"top"},get CLONE_BOTTOM(){return"bottom"},get CLONE_LEFT(){return"left"},get CLONE_TOP_LEFT_CORNER(){return"top_left_corner"},get CLONE_BOTTOM_LEFT_CORNER(){return"bottom_left_corner"},get CLONE_DEBUG(){return"debug"},get CLONE_TYPES(){return[f.CLONE_TOP,f.CLONE_BOTTOM,f.CLONE_LEFT,f.CLONE_TOP_LEFT_CORNER,f.CLONE_BOTTOM_LEFT_CORNER,f.CLONE_DEBUG]},registerOverlay:function(e,t){if(-1===f.CLONE_TYPES.indexOf(e))throw new Error("Unsupported overlay ("+e+").");d[e]=t},createOverlay:function(e,t){return new d[e](t)},isOverlayTypeOf:function(e,t){return e&&d[t]?e instanceof d[t]:!1}}),window.WalkontableOverlay=h},{eventManager:41,"helpers/dom/element":45,"helpers/object":50}],12:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableDebugOverlay:{get:function(){return l}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).addClass,s=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,l=function(e){$traceurRuntime.superConstructor(a).call(this,e),this.clone=this.makeClone(s.CLONE_DEBUG),this.clone.wtTable.holder.style.opacity=.4,this.clone.wtTable.holder.style.textShadow="0 0 2px #ff0000",i(this.clone.wtTable.holder.parentNode,"wtDebugVisible")},a=l;$traceurRuntime.createClass(l,{},{},s),window.WalkontableDebugOverlay=l,s.registerOverlay(s.CLONE_DEBUG,l)},{_base:11,"helpers/dom/element":45}],13:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableLeftOverlay:{get:function(){return p}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.addClass,l=i.getScrollbarWidth,a=i.getScrollLeft,u=i.getWindowScrollTop,c=i.hasClass,d=i.outerWidth,h=i.removeClass,f=i.setOverlayPosition,g=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,p=function(e){$traceurRuntime.superConstructor(m).call(this,e),this.clone=this.makeClone(g.CLONE_LEFT)},m=p;$traceurRuntime.createClass(p,{shouldBeRendered:function(){return this.wot.getSetting("fixedColumnsLeft")||this.wot.getSetting("rowHeaders").length?!0:!1},resetFixedPosition:function(){if(this.needFullRender&&this.wot.wtTable.holder.parentNode){var e=this.clone.wtTable.holder.parentNode,t=0;if(this.trimmingContainer===window){var n,o,r=this.wot.wtTable.hider.getBoundingClientRect(),i=Math.ceil(r.left),s=Math.ceil(r.right);o=this.wot.wtTable.hider.style.top,o=""===o?0:o,n=0>i&&s-e.offsetWidth>0?-i:0,t=n,n+="px",f(e,n,o)}else t=this.getScrollPosition();this.adjustHeaderBordersPosition(t),this.adjustElementsSize()}},setScrollPosition:function(e){this.mainTableScrollableElement===window?window.scrollTo(e,u()):this.mainTableScrollableElement.scrollLeft=e},onScroll:function(){this.wot.getSetting("onScrollVertically")},sumCellSizes:function(e,t){for(var n=0,o=this.wot.wtSettings.defaultColumnWidth;t>e;)n+=this.wot.wtTable.getStretchedColumnWidth(e)||o,e++;return n},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1;(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize(),e||(this.areElementSizesAdjusted=!0))},adjustRootElementSize:function(){var e,t=this.wot.wtTable.holder,n=t.clientHeight===t.offsetHeight?0:l(),o=this.clone.wtTable.holder.parentNode,r=o.style;this.trimmingContainer!==window&&(r.height=this.wot.wtViewport.getWorkspaceHeight()-n+"px"),this.clone.wtTable.holder.style.height=r.height,e=d(this.clone.wtTable.TABLE),r.width=(0===e?e:e+4)+"px"},adjustRootChildrenSize:function(){var e=l();this.clone.wtTable.hider.style.height=this.hider.style.height,this.clone.wtTable.holder.style.height=this.clone.wtTable.holder.parentNode.style.height,0===e&&(e=30),this.clone.wtTable.holder.style.width=parseInt(this.clone.wtTable.holder.parentNode.style.width,10)+e+"px"},applyToDOM:function(){var e=this.wot.getSetting("totalColumns");if(this.areElementSizesAdjusted||this.adjustElementsSize(),"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition)this.spreader.style.left=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the columnsRenderCalculator");this.spreader.style.left="0"}this.spreader.style.right="",this.needFullRender&&this.syncOverlayOffset()},syncOverlayOffset:function(){"number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px":this.clone.wtTable.spreader.style.top=""},scrollTo:function(e,t){var n=this.getTableParentOffset(),o=this.wot.cloneSource?this.wot.cloneSource:this.wot,r=o.wtTable.holder,i=0;t&&r.offsetWidth!==r.clientWidth&&(i=l()),t?(n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportWidth()):n+=this.sumCellSizes(this.wot.getSetting("fixedColumnsLeft"),e),n+=i,this.setScrollPosition(n)},getTableParentOffset:function(){return this.trimmingContainer===window?this.wot.wtTable.holderOffset.left:0},getScrollPosition:function(){return a(this.mainTableScrollableElement)},adjustHeaderBordersPosition:function(e){var t=this.wot.wtTable.holder.parentNode,n=this.wot.getSetting("rowHeaders"),o=this.wot.getSetting("fixedColumnsLeft");if(o&&!n.length)s(t,"innerBorderLeft");else if(!o&&n.length){var r=c(t,"innerBorderLeft");e?s(t,"innerBorderLeft"):h(t,"innerBorderLeft"),(!r&&e||r&&!e)&&this.wot.wtOverlays.adjustElementsSize()}}},{},g),window.WalkontableLeftOverlay=p,g.registerOverlay(g.CLONE_LEFT,p)},{_base:11,"helpers/dom/element":45}],14:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableTopOverlay:{get:function(){return p}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.addClass,l=i.getScrollbarWidth,a=i.getScrollTop,u=i.getWindowScrollLeft,c=i.hasClass,d=i.outerHeight,h=i.removeClass,f=i.setOverlayPosition,g=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,p=function(e){$traceurRuntime.superConstructor(m).call(this,e),this.clone=this.makeClone(g.CLONE_TOP)},m=p;$traceurRuntime.createClass(p,{shouldBeRendered:function(){return this.wot.getSetting("fixedRowsTop")||this.wot.getSetting("columnHeaders").length?!0:!1},resetFixedPosition:function(){if(this.needFullRender&&this.wot.wtTable.holder.parentNode){var e=this.clone.wtTable.holder.parentNode,t=0;if(this.wot.wtOverlays.leftOverlay.trimmingContainer===window){var n,o,r=this.wot.wtTable.hider.getBoundingClientRect(),i=Math.ceil(r.top),s=Math.ceil(r.bottom);n=this.wot.wtTable.hider.style.left,n=""===n?0:n,o=0>i&&s-e.offsetHeight>0?-i:0,t=o,o+="px",f(e,n,o)}else t=this.getScrollPosition();this.adjustHeaderBordersPosition(t),this.adjustElementsSize()}},setScrollPosition:function(e){this.mainTableScrollableElement===window?window.scrollTo(u(),e):this.mainTableScrollableElement.scrollTop=e},onScroll:function(){this.wot.getSetting("onScrollHorizontally")},sumCellSizes:function(e,t){for(var n=0,o=this.wot.wtSettings.settings.defaultRowHeight;t>e;){var r=this.wot.wtTable.getRowHeight(e);n+=void 0===r?o:r,e++}return n},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1;(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize(),e||(this.areElementSizesAdjusted=!0))},adjustRootElementSize:function(){var e,t=this.wot.wtTable.holder,n=t.clientWidth===t.offsetWidth?0:l(),o=this.clone.wtTable.holder.parentNode,r=o.style;this.trimmingContainer!==window&&(r.width=this.wot.wtViewport.getWorkspaceWidth()-n+"px"),this.clone.wtTable.holder.style.width=r.width,e=d(this.clone.wtTable.TABLE),r.height=(0===e?e:e+4)+"px"},adjustRootChildrenSize:function(){var e=l();this.clone.wtTable.hider.style.width=this.hider.style.width,this.clone.wtTable.holder.style.width=this.clone.wtTable.holder.parentNode.style.width,0===e&&(e=30),this.clone.wtTable.holder.style.height=parseInt(this.clone.wtTable.holder.parentNode.style.height,10)+e+"px"},applyToDOM:function(){var e=this.wot.getSetting("totalRows");if(this.areElementSizesAdjusted||this.adjustElementsSize(),"number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition)this.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.top="0"}this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()},syncOverlayOffset:function(){"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.left=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px":this.clone.wtTable.spreader.style.left=""},scrollTo:function(e,t){var n=this.getTableParentOffset(),o=this.wot.cloneSource?this.wot.cloneSource:this.wot,r=o.wtTable.holder,i=0;if(t&&r.offsetHeight!==r.clientHeight&&(i=l()),t){var s=this.wot.getSetting("fixedRowsBottom"),a=(this.wot.getSetting("fixedRowsTop"),this.wot.getSetting("totalRows"));n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportHeight()-this.sumCellSizes(a-s,a),n+=1}else n+=this.sumCellSizes(this.wot.getSetting("fixedRowsTop"),e);n+=i,this.setScrollPosition(n)},getTableParentOffset:function(){return this.mainTableScrollableElement===window?this.wot.wtTable.holderOffset.top:0},getScrollPosition:function(){return a(this.mainTableScrollableElement)},adjustHeaderBordersPosition:function(e){if(0===this.wot.getSetting("fixedRowsTop")&&this.wot.getSetting("columnHeaders").length>0){var t=this.wot.wtTable.holder.parentNode,n=c(t,"innerBorderTop");e?s(t,"innerBorderTop"):h(t,"innerBorderTop"),(!n&&e||n&&!e)&&this.wot.wtOverlays.adjustElementsSize()}if(0===this.wot.getSetting("rowHeaders").length){var o=this.clone.wtTable.THEAD.querySelectorAll("th:nth-of-type(2)");if(o)for(var r=0;rc&&h-e.offsetWidth>0?-c+"px":"0",r=0>u&&d-e.offsetHeight>0?-u+"px":"0",a(e,o,r)}e.style.height=(0===t?t:t+4)+"px",e.style.width=(0===n?n:n+4)+"px"}}},{},u),window.WalkontableTopLeftCornerOverlay=c,u.registerOverlay(u.CLONE_TOP_LEFT_CORNER,c)},{_base:11,"helpers/dom/element":45}],16:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableOverlays:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),l=s.getScrollableElement,a=s.getScrollbarWidth,u=s.getScrollLeft,c=s.getScrollTop,d=(r=e("helpers/unicode"),r&&r.__esModule&&r||{"default":r}).isKey,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,f=function(e){this.wot=e,this.instance=this.wot,this.eventManager=new h(this.wot),this.wot.update("scrollbarWidth",a()),this.wot.update("scrollbarHeight",a()),this.mainTableScrollableElement=l(this.wot.wtTable.TABLE),this.topOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP,this.wot),"undefined"==typeof WalkontableBottomOverlay?this.bottomOverlay={needFullRender:!1}:this.bottomOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM,this.wot),this.leftOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_LEFT,this.wot),this.topOverlay.needFullRender&&this.leftOverlay.needFullRender&&(this.topLeftCornerOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP_LEFT_CORNER,this.wot)),this.bottomOverlay.needFullRender&&this.leftOverlay.needFullRender&&"undefined"!=typeof WalkontableBottomLeftCornerOverlay?this.bottomLeftCornerOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER,this.wot):this.bottomLeftCornerOverlay={needFullRender:!1},this.wot.getSetting("debug")&&(this.debug=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_DEBUG,this.wot)),this.destroyed=!1,this.keyPressed=!1,this.spreaderLastSize={width:null,height:null},this.overlayScrollPositions={master:{top:0,left:0},top:{top:null,left:0},bottom:{top:null,left:0},left:{top:0,left:null}},this.verticalScrolling=!1,this.horizontalScrolling=!1,this.delegatedScrollCallback=!1,this.registerListeners()};$traceurRuntime.createClass(f,{refreshAll:function(){if(this.wot.drawn){if(!this.wot.wtTable.holder.parentNode)return void this.destroy();this.wot.draw(!0),this.verticalScrolling&&this.leftOverlay.onScroll(),this.horizontalScrolling&&this.topOverlay.onScroll(),this.verticalScrolling=!1,this.horizontalScrolling=!1}},registerListeners:function(){var e=this;this.eventManager.addEventListener(document.documentElement,"keydown",function(t){return e.onKeyDown(t)}),this.eventManager.addEventListener(document.documentElement,"keyup",function(){return e.onKeyUp()}),this.eventManager.addEventListener(document,"visibilitychange",function(){return e.onKeyUp()}),this.eventManager.addEventListener(this.mainTableScrollableElement,"scroll",function(t){return e.onTableScroll(t)}),this.topOverlay.needFullRender&&(this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.bottomOverlay.needFullRender&&(this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.leftOverlay.needFullRender&&(this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.topOverlay.trimmingContainer!==window&&this.leftOverlay.trimmingContainer!==window&&this.eventManager.addEventListener(window,"wheel",function(t){var n,o=t.wheelDeltaY||t.deltaY,r=t.wheelDeltaX||t.deltaX;e.topOverlay.clone.wtTable.holder.contains(t.realTarget)?n="top":e.bottomOverlay.clone&&e.bottomOverlay.clone.wtTable.holder.contains(t.realTarget)?n="bottom":e.leftOverlay.clone.wtTable.holder.contains(t.realTarget)&&(n="left"),"top"==n&&0!==o?t.preventDefault():"left"==n&&0!==r?t.preventDefault():"bottom"==n&&0!==o&&t.preventDefault()})},onTableScroll:function(e){Handsontable.mobileBrowser||(!this.keyPressed||this.mainTableScrollableElement===window||e.target.contains(this.mainTableScrollableElement))&&("scroll"===e.type?this.syncScrollPositions(e):this.translateMouseWheelToScroll(e))},onKeyDown:function(e){this.keyPressed=d(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")},onKeyUp:function(){this.keyPressed=!1},translateMouseWheelToScroll:function(e){for(var t,n=this.topOverlay.clone.wtTable.holder,o=this.bottomOverlay.clone?this.bottomOverlay.clone.wtTable.holder:null,r=this.leftOverlay.clone.wtTable.holder,i={type:"wheel"},s=e.target,l=e.wheelDeltaY||-1*e.deltaY,a=e.wheelDeltaX||-1*e.deltaX;s!=document&&null!=s;){if(s.className.indexOf("wtHolder")>-1){t=s;break}s=s.parentNode}return i.target=t,t==n?this.syncScrollPositions(i,-.2*l):t==o?this.syncScrollPositions(i,-.2*l):t==r&&this.syncScrollPositions(i,-.2*a),!1},syncScrollPositions:function(e){var t=void 0!==arguments[1]?arguments[1]:null;if(!this.destroyed){if(0===arguments.length)return void this.syncScrollWithMaster();var n,o,r,i=this.mainTableScrollableElement,s=e.target,l=0,a=!1,d=!1;this.topOverlay.needFullRender&&(n=this.topOverlay.clone.wtTable.holder),this.bottomOverlay.needFullRender&&(r=this.bottomOverlay.clone.wtTable.holder),this.leftOverlay.needFullRender&&(o=this.leftOverlay.clone.wtTable.holder),s===document&&(s=window),s===i?(l=u(s),this.overlayScrollPositions.master.left!==l&&(this.horizontalScrolling=!0,this.overlayScrollPositions.master.left=l,a=!0,n&&(n.scrollLeft=l,d=this.mainTableScrollableElement!==window),r&&(r.scrollLeft=l,d=this.mainTableScrollableElement!==window)),l=c(s),this.overlayScrollPositions.master.top!==l&&(this.verticalScrolling=!0,this.overlayScrollPositions.master.top=l,a=!0,o&&(o.scrollTop=l,d=this.mainTableScrollableElement!==window))):s===r?(l=u(s),this.overlayScrollPositions.bottom.left!==l&&(this.horizontalScrolling=!0,this.overlayScrollPositions.bottom.left=l,a=!0,i.scrollLeft=l),null!==t&&(a=!0,i.scrollTop+=t)):s===n?(l=u(s),this.overlayScrollPositions.top.left!==l&&(this.horizontalScrolling=!0,this.overlayScrollPositions.top.left=l,a=!0,i.scrollLeft=l),null!==t&&(a=!0,i.scrollTop+=t)):s===o&&(l=c(s),this.overlayScrollPositions.left.top!==l&&(this.verticalScrolling=!0,this.overlayScrollPositions.left.top=l,a=!0,i.scrollTop=l),null!==t&&(a=!0,i.scrollLeft+=t)),!this.keyPressed&&a&&"scroll"===e.type&&(this.delegatedScrollCallback?this.delegatedScrollCallback=!1:this.refreshAll(),d&&(this.delegatedScrollCallback=!0))}},syncScrollWithMaster:function(){var e=this.topOverlay.mainTableScrollableElement;this.topOverlay.needFullRender&&(this.topOverlay.clone.wtTable.holder.scrollLeft=e.scrollLeft),this.leftOverlay.needFullRender&&(this.leftOverlay.clone.wtTable.holder.scrollTop=e.scrollTop)},destroy:function(){this.eventManager.destroy(),this.topOverlay.destroy(),this.bottomOverlay.clone&&this.bottomOverlay.destroy(),this.leftOverlay.destroy(),this.topLeftCornerOverlay&&this.topLeftCornerOverlay.destroy(),this.bottomLeftCornerOverlay&&this.bottomLeftCornerOverlay.clone&&this.bottomLeftCornerOverlay.destroy(),this.debug&&this.debug.destroy(),this.destroyed=!0},refresh:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(this.topOverlay.areElementSizesAdjusted&&this.leftOverlay.areElementSizesAdjusted){var t=this.wot.wtTable.wtRootElement.parentNode||this.wot.wtTable.wtRootElement,n=t.clientWidth,o=t.clientHeight;(n!==this.spreaderLastSize.width||o!==this.spreaderLastSize.height)&&(this.spreaderLastSize.width=n,this.spreaderLastSize.height=o,this.adjustElementsSize())}this.bottomOverlay.clone&&this.bottomOverlay.refresh(e),this.leftOverlay.refresh(e),this.topOverlay.refresh(e),this.topLeftCornerOverlay&&this.topLeftCornerOverlay.refresh(e),this.bottomLeftCornerOverlay&&this.bottomLeftCornerOverlay.clone&&this.bottomLeftCornerOverlay.refresh(e),this.debug&&this.debug.refresh(e)},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=this.wot.getSetting("totalColumns"),n=this.wot.getSetting("totalRows"),o=this.wot.wtViewport.getRowHeaderWidth(),r=this.wot.wtViewport.getColumnHeaderHeight(),i=this.wot.wtTable.hider.style;i.width=o+this.leftOverlay.sumCellSizes(0,t)+"px",i.height=r+this.topOverlay.sumCellSizes(0,n)+1+"px",this.topOverlay.adjustElementsSize(e),this.leftOverlay.adjustElementsSize(e),this.bottomOverlay.clone&&this.bottomOverlay.adjustElementsSize(e)},applyToDOM:function(){this.topOverlay.areElementSizesAdjusted&&this.leftOverlay.areElementSizesAdjusted||this.adjustElementsSize(),this.topOverlay.applyToDOM(),this.bottomOverlay.clone&&this.bottomOverlay.applyToDOM(),this.leftOverlay.applyToDOM()}},{}),window.WalkontableOverlays=f},{eventManager:41,"helpers/dom/element":45,"helpers/unicode":53}],17:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableScroll:{get:function(){return o}},__esModule:{value:!0}});var o=function(e){this.wot=e,this.instance=e};$traceurRuntime.createClass(o,{scrollViewport:function(e){if(this.wot.drawn){var t=this.wot.getSetting("totalRows"),n=this.wot.getSetting("totalColumns"),o=this.instance.getSetting("fixedRowsTop"),r=this.instance.getSetting("fixedRowsBottom"),i=this.instance.getSetting("fixedColumnsLeft");if(e.row<0||e.row>t-1)throw new Error("row "+e.row+" does not exist");if(e.col<0||e.col>n-1)throw new Error("column "+e.col+" does not exist");e.row>this.instance.wtTable.getLastVisibleRow()&&e.row=o&&e.rowthis.instance.wtTable.getLastVisibleColumn()?this.wot.wtOverlays.leftOverlay.scrollTo(e.col,!0):e.col>=i&&e.colu;u++)o=e.wtTable.columnFilter.renderedToSource(u),o>=a[1]&&o<=a[3]&&(r=e.wtTable.getColumnHeader(o),r&&this.settings.highlightColumnClassName&&l(r,this.settings.highlightColumnClassName));for(var c=0;i>c;c++){n=e.wtTable.rowFilter.renderedToSource(c),n>=a[0]&&n<=a[2]&&(r=e.wtTable.getRowHeader(n),r&&this.settings.highlightRowClassName&&l(r,this.settings.highlightRowClassName));for(var d=0;s>d;d++)o=e.wtTable.columnFilter.renderedToSource(d),n>=a[0]&&n<=a[2]&&o>=a[1]&&o<=a[3]?this.settings.className&&this.addClassAtCoords(e,n,o,this.settings.className):n>=a[0]&&n<=a[2]?this.settings.highlightRowClassName&&this.addClassAtCoords(e,n,o,this.settings.highlightRowClassName):o>=a[1]&&o<=a[3]&&this.settings.highlightColumnClassName&&this.addClassAtCoords(e,n,o,this.settings.highlightColumnClassName)}if(e.getSetting("onBeforeDrawBorders",a,this.settings.className),this.settings.border){var h=this.getBorder(e);h&&h.appear(a)}}}},{}),window.WalkontableSelection=d},{border:2,"cell/coords":5,"cell/range":6,"helpers/dom/element":45}],19:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableSettings:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).fastInnerText,i=function(e,t){var n=this;this.wot=e,this.instance=e,this.defaults={table:void 0,debug:!1,externalRowCalculator:!1,stretchH:"none",currentRowClassName:null,currentColumnClassName:null,data:void 0,fixedColumnsLeft:0,fixedRowsTop:0,fixedRowsBottom:0,minSpareRows:0,rowHeaders:function(){return[]},columnHeaders:function(){return[]},totalRows:void 0,totalColumns:void 0,cellRenderer:function(e,t,o){var i=n.getSetting("data",e,t);r(o,void 0===i||null===i?"":i)},columnWidth:function(e){},rowHeight:function(e){},defaultRowHeight:23,defaultColumnWidth:50,selections:null,hideBorderOnMouseDownOver:!1,viewportRowCalculatorOverride:null,viewportColumnCalculatorOverride:null,onCellMouseDown:null,onCellMouseOver:null,onCellDblClick:null,onCellCornerMouseDown:null,onCellCornerDblClick:null,beforeDraw:null,onDraw:null,onBeforeDrawBorders:null,onScrollVertically:null,onScrollHorizontally:null,onBeforeTouchScroll:null,onAfterMomentumScroll:null,scrollbarWidth:10,scrollbarHeight:10,renderAllRows:!1,groups:!1},this.settings={};for(var o in this.defaults)if(this.defaults.hasOwnProperty(o))if(void 0!==t[o])this.settings[o]=t[o];else{if(void 0===this.defaults[o])throw new Error('A required setting "'+o+'" was not provided');this.settings[o]=this.defaults[o]}};$traceurRuntime.createClass(i,{update:function(e,t){if(void 0===t)for(var n in e)e.hasOwnProperty(n)&&(this.settings[n]=e[n]);else this.settings[e]=t;return this.wot},getSetting:function(e,t,n,o,r){return"function"==typeof this.settings[e]?this.settings[e](t,n,o,r):void 0!==t&&Array.isArray(this.settings[e])?this.settings[e][t]:this.settings[e]},has:function(e){return!!this.settings[e]}},{}),window.WalkontableSettings=i},{"helpers/dom/element":45}],20:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableTable:{get:function(){return y}},__esModule:{value:!0}});var o,r,i,s,l,a,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),c=u.getStyle,d=u.getTrimmingContainer,h=u.hasClass,f=u.index,g=u.offset,p=u.removeClass,m=u.removeTextNodes,w=(u.overlayContainsElement,(r=e("cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords),v=((i=e("cell/range"),i&&i.__esModule&&i||{"default":i}).WalkontableCellRange,(s=e("filter/column"),s&&s.__esModule&&s||{"default":s}).WalkontableColumnFilter),b=(l=e("filter/row"),l&&l.__esModule&&l||{"default":l}).WalkontableRowFilter,C=(a=e("tableRenderer"),a&&a.__esModule&&a||{"default":a}).WalkontableTableRenderer,y=function(e,t){this.wot=e,this.instance=this.wot,this.TABLE=t,this.TBODY=null,this.THEAD=null,this.COLGROUP=null,this.tableOffset=0,this.holderOffset=0,m(this.TABLE),this.spreader=this.createSpreader(this.TABLE),this.hider=this.createHider(this.spreader),this.holder=this.createHolder(this.hider),this.wtRootElement=this.holder.parentNode,this.alignOverlaysWithTrimmingContainer(),this.fixTableDomTree(),this.colgroupChildrenLength=this.COLGROUP.childNodes.length,this.theadChildrenLength=this.THEAD.firstChild?this.THEAD.firstChild.childNodes.length:0,this.tbodyChildrenLength=this.TBODY.childNodes.length,this.rowFilter=null,this.columnFilter=null};$traceurRuntime.createClass(y,{fixTableDomTree:function(){this.TBODY=this.TABLE.querySelector("tbody"),this.TBODY||(this.TBODY=document.createElement("tbody"),this.TABLE.appendChild(this.TBODY)),this.THEAD=this.TABLE.querySelector("thead"),this.THEAD||(this.THEAD=document.createElement("thead"),this.TABLE.insertBefore(this.THEAD,this.TBODY)),this.COLGROUP=this.TABLE.querySelector("colgroup"),this.COLGROUP||(this.COLGROUP=document.createElement("colgroup"),this.TABLE.insertBefore(this.COLGROUP,this.THEAD)),this.wot.getSetting("columnHeaders").length&&!this.THEAD.childNodes.length&&this.THEAD.appendChild(document.createElement("TR"))},createSpreader:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.className="wtSpreader",n&&n.insertBefore(t,e),t.appendChild(e)),t.style.position="relative",t},createHider:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.className="wtHider",n&&n.insertBefore(t,e),t.appendChild(e)),t},createHolder:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.style.position="relative",t.className="wtHolder",n&&n.insertBefore(t,e),this.isWorkingOnClone()||(t.parentNode.className+="ht_master handsontable"),t.appendChild(e)),t},alignOverlaysWithTrimmingContainer:function(){var e=d(this.wtRootElement);this.isWorkingOnClone()||(this.holder.parentNode.style.position="relative",e===window?(this.holder.style.overflow="visible",this.wtRootElement.style.overflow="visible"):(this.holder.style.width=c(e,"width"),this.holder.style.height=c(e,"height"),this.holder.style.overflow=""))},isWorkingOnClone:function(){return!!this.wot.cloneSource},draw:function(e){var t=this.instance.getSetting("totalRows");if(this.isWorkingOnClone()||(this.holderOffset=g(this.holder),e=this.wot.wtViewport.createRenderCalculators(e)),e)this.isWorkingOnClone()||this.wot.wtViewport.createVisibleCalculators(),this.wot.wtOverlays&&this.wot.wtOverlays.refresh(!0);else{this.isWorkingOnClone()?this.tableOffset=this.wot.cloneSource.wtTable.tableOffset:this.tableOffset=g(this.TABLE);var n;n=WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)?0:WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?t-this.wot.getSetting("fixedRowsBottom"):this.wot.wtViewport.rowsRenderCalculator.startRow; -var o;o=WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_LEFT)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?0:this.wot.wtViewport.columnsRenderCalculator.startColumn,this.rowFilter=new b(n,t,this.wot.getSetting("columnHeaders").length),this.columnFilter=new v(o,this.wot.getSetting("totalColumns"),this.wot.getSetting("rowHeaders").length),this._doDraw(),this.alignOverlaysWithTrimmingContainer()}return this.refreshSelections(e),this.isWorkingOnClone()||(this.wot.wtOverlays.topOverlay.resetFixedPosition(),this.wot.wtOverlays.bottomOverlay.clone&&this.wot.wtOverlays.bottomOverlay.resetFixedPosition(),this.wot.wtOverlays.leftOverlay.resetFixedPosition(),this.wot.wtOverlays.topLeftCornerOverlay&&this.wot.wtOverlays.topLeftCornerOverlay.resetFixedPosition(),this.instance.wtOverlays.bottomLeftCornerOverlay&&this.instance.wtOverlays.bottomLeftCornerOverlay.clone&&this.wot.wtOverlays.bottomLeftCornerOverlay.resetFixedPosition()),this.wot.drawn=!0,this},_doDraw:function(){var e=new C(this);e.render()},removeClassFromCells:function(e){for(var t=this.TABLE.querySelectorAll("."+e),n=0,o=t.length;o>n;n++)p(t[n],e)},refreshSelections:function(e){if(this.wot.selections){var t=this.wot.selections.length;if(e)for(var n=0;t>n;n++)this.wot.selections[n].settings.className&&this.removeClassFromCells(this.wot.selections[n].settings.className),this.wot.selections[n].settings.highlightRowClassName&&this.removeClassFromCells(this.wot.selections[n].settings.highlightRowClassName),this.wot.selections[n].settings.highlightColumnClassName&&this.removeClassFromCells(this.wot.selections[n].settings.highlightColumnClassName);for(var o=0;t>o;o++)this.wot.selections[o].draw(this.wot,e)}},getCell:function(e){if(this.isRowBeforeRenderedRows(e.row))return-1;if(this.isRowAfterRenderedRows(e.row))return-2;var t=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e.row)];return t?t.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e.col)]:void 0},getColumnHeader:function(e){var t=void 0!==arguments[1]?arguments[1]:0,n=this.THEAD.childNodes[t];return n?n.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]:void 0},getRowHeader:function(e){if(0===this.columnFilter.sourceColumnToVisibleRowHeadedColumn(0))return null;var t=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)];return t?t.childNodes[0]:void 0},getCoords:function(e){var t=e.parentNode,n=f(t);n=t.parentNode===this.THEAD?this.rowFilter.visibleColHeadedRowToSourceRow(n):this.rowFilter.renderedToSource(n);var o=this.columnFilter.visibleRowHeadedColumnToSourceColumn(e.cellIndex);return new w(n,o)},getTrForRow:function(e){return this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)]},getFirstRenderedRow:function(){return this.wot.wtViewport.rowsRenderCalculator.startRow},getFirstVisibleRow:function(){return this.wot.wtViewport.rowsVisibleCalculator.startRow},getFirstRenderedColumn:function(){return this.wot.wtViewport.columnsRenderCalculator.startColumn},getFirstVisibleColumn:function(){return this.wot.wtViewport.columnsVisibleCalculator.startColumn},getLastRenderedRow:function(){return this.wot.wtViewport.rowsRenderCalculator.endRow},getLastVisibleRow:function(){return this.wot.wtViewport.rowsVisibleCalculator.endRow},getLastRenderedColumn:function(){return this.wot.wtViewport.columnsRenderCalculator.endColumn},getLastVisibleColumn:function(){return this.wot.wtViewport.columnsVisibleCalculator.endColumn},isRowBeforeRenderedRows:function(e){return this.rowFilter.sourceToRendered(e)<0&&e>=0},isRowAfterViewport:function(e){return this.rowFilter.sourceToRendered(e)>this.getLastVisibleRow()},isRowAfterRenderedRows:function(e){return this.rowFilter.sourceToRendered(e)>this.getLastRenderedRow()},isColumnBeforeViewport:function(e){return this.columnFilter.sourceToRendered(e)<0&&e>=0},isColumnAfterViewport:function(e){return this.columnFilter.sourceToRendered(e)>this.getLastVisibleColumn()},isLastRowFullyVisible:function(){return this.getLastVisibleRow()===this.getLastRenderedRow()},isLastColumnFullyVisible:function(){return this.getLastVisibleColumn()===this.getLastRenderedColumn()},getRenderedColumnsCount:function(){return WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)?this.wot.getSetting("totalColumns"):WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_LEFT)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?this.wot.getSetting("fixedColumnsLeft"):this.wot.wtViewport.columnsRenderCalculator.count},getRenderedRowsCount:function(){return WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)?this.wot.getSetting("totalRows"):WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)?this.wot.getSetting("fixedRowsTop"):WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?this.instance.getSetting("fixedRowsBottom"):this.wot.wtViewport.rowsRenderCalculator.count},getVisibleRowsCount:function(){return this.wot.wtViewport.rowsVisibleCalculator.count},allRowsInViewport:function(){return this.wot.getSetting("totalRows")==this.getVisibleRowsCount()},getRowHeight:function(e){var t=this.wot.wtSettings.settings.rowHeight(e),n=this.wot.wtViewport.oversizedRows[e];return void 0!==n&&(t=void 0===t?n:Math.max(t,n)),t},getColumnHeaderHeight:function(e){var t=this.wot.wtSettings.settings.defaultRowHeight,n=this.wot.wtViewport.oversizedColumnHeaders[e];return void 0!==n&&(t=t?Math.max(t,n):n),t},getVisibleColumnsCount:function(){return this.wot.wtViewport.columnsVisibleCalculator.count},allColumnsInViewport:function(){return this.wot.getSetting("totalColumns")==this.getVisibleColumnsCount()},getColumnWidth:function(e){var t=this.wot.wtSettings.settings.columnWidth;return"function"==typeof t?t=t(e):"object"==typeof t&&(t=t[e]),t||this.wot.wtSettings.settings.defaultColumnWidth},getStretchedColumnWidth:function(e){var t=this.getColumnWidth(e),n=-1===[void 0,null].indexOf(t)?t:this.instance.wtSettings.settings.defaultColumnWidth,o=this.wot.wtViewport.columnsRenderCalculator;if(o){var r=o.getStretchedColumnWidth(e,n);r&&(n=r)}return n}},{}),window.WalkontableTable=y},{"cell/coords":5,"cell/range":6,"filter/column":9,"filter/row":10,"helpers/dom/element":45,tableRenderer:21}],21:[function(e,t,n){"use strict";function o(e,t){var n=document.createElement("TH");return t.insertBefore(n,e),t.removeChild(e),n}function r(e,t){var n=document.createElement("TD");return t.insertBefore(n,e),t.removeChild(e),n}Object.defineProperties(n,{WalkontableTableRenderer:{get:function(){return h}},__esModule:{value:!0}});var i,s=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),l=s.addClass,a=s.empty,u=s.getScrollbarWidth,c=s.hasClass,d=s.innerHeight,h=function(e){this.wtTable=e,this.wot=e.instance,this.instance=e.instance,this.rowFilter=e.rowFilter,this.columnFilter=e.columnFilter,this.TABLE=e.TABLE,this.THEAD=e.THEAD,this.TBODY=e.TBODY,this.COLGROUP=e.COLGROUP,this.rowHeaders=[],this.rowHeaderCount=0,this.columnHeaders=[],this.columnHeaderCount=0,this.fixedRowsTop=0,this.fixedRowsBottom=0};$traceurRuntime.createClass(h,{render:function(){this.wtTable.isWorkingOnClone()||this.wot.getSetting("beforeDraw",!0),this.rowHeaders=this.wot.getSetting("rowHeaders"),this.rowHeaderCount=this.rowHeaders.length,this.fixedRowsTop=this.wot.getSetting("fixedRowsTop"),this.fixedRowsBottom=this.wot.getSetting("fixedRowsBottom"),this.columnHeaders=this.wot.getSetting("columnHeaders"),this.columnHeaderCount=this.columnHeaders.length;var e,t=this.wtTable.getRenderedColumnsCount(),n=this.wtTable.getRenderedRowsCount(),o=this.wot.getSetting("totalColumns"),r=this.wot.getSetting("totalRows"),i=!1;if((WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER))&&(this.columnHeaders=[],this.columnHeaderCount=0),o>0&&(this.adjustAvailableNodes(),i=!0,this.renderColumnHeaders(),this.renderRows(r,n,t),this.wtTable.isWorkingOnClone()||(e=this.wot.wtViewport.getWorkspaceWidth(),this.wot.wtViewport.containerWidth=null),this.adjustColumnHeaderHeights(),this.adjustColumnWidths(t),this.markOversizedColumns()),i||this.adjustAvailableNodes(),this.removeRedundantRows(n),this.wtTable.isWorkingOnClone()){if(WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)){var s=this.wot.cloneOverlay.instance;this.wot.cloneOverlay.markOversizedFixedBottomRows(),s.wtOverlays.adjustElementsSize()}}else{if(this.markOversizedRows(),this.wot.wtViewport.createVisibleCalculators(),this.wot.wtOverlays.refresh(!1),this.wot.wtOverlays.applyToDOM(),e!==this.wot.wtViewport.getWorkspaceWidth()){this.wot.wtViewport.containerWidth=null;for(var l=this.wtTable.getFirstRenderedColumn(),a=this.wtTable.getLastRenderedColumn(),u=l;a>u;u++){var c=this.wtTable.getStretchedColumnWidth(u),d=this.columnFilter.sourceToRendered(u);this.COLGROUP.childNodes[d+this.rowHeaderCount].style.width=c+"px"}}this.wot.getSetting("onDraw",!0)}},removeRedundantRows:function(e){for(;this.wtTable.tbodyChildrenLength>e;)this.TBODY.removeChild(this.TBODY.lastChild),this.wtTable.tbodyChildrenLength--},renderRows:function(e,t,n){for(var o,r,i=0,s=this.rowFilter.renderedToSource(i),l=this.wtTable.isWorkingOnClone();e>s&&s>=0&&(i>1e3&&console.error("Security brake: Too much TRs. Please define height for your table, which will enforce scrollbars."),void 0===t||i!==t);){if(r=this.getOrCreateTrForRow(i,r),this.renderRowHeaders(s,r),this.adjustColumns(r,n+this.rowHeaderCount),o=this.renderCells(s,r,n),(!l||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM))&&this.resetOversizedRow(s),r.firstChild){var a=this.wot.wtTable.getRowHeight(s);a?(a--,r.firstChild.style.height=a+"px"):r.firstChild.style.height=""}i++,s=this.rowFilter.renderedToSource(i)}},resetOversizedRow:function(e){this.wot.getSetting("externalRowCalculator")||this.wot.wtViewport.oversizedRows&&this.wot.wtViewport.oversizedRows[e]&&(this.wot.wtViewport.oversizedRows[e]=void 0)},markOversizedRows:function(){if(!this.wot.getSetting("externalRowCalculator")){var e,t,n,o,r,i=this.instance.wtTable.TBODY.childNodes.length,s=i*this.instance.wtSettings.settings.defaultRowHeight,l=d(this.instance.wtTable.TBODY)-1;this.instance.getSetting("totalRows");if(s!==l||this.instance.getSetting("fixedRowsBottom"))for(;i;)i--,n=this.instance.wtTable.rowFilter.renderedToSource(i),e=this.instance.wtTable.getRowHeight(n),o=this.instance.wtTable.getTrForRow(n),r=o.querySelector("th"),t=r?d(r):d(o)-1,(!e&&this.instance.wtSettings.settings.defaultRowHeighte)&&(this.instance.wtViewport.oversizedRows[n]=++t)}},markOversizedColumns:function(){var e=this.wot.getOverlayName();if(this.columnHeaderCount&&!this.wot.wtViewport.isMarkedOversizedColumn[e]&&!this.wtTable.isWorkingOnClone()){for(var t=this.wtTable.getRenderedColumnsCount(),n=0;no;o++)this.markIfOversizedColumnHeader(o);this.wot.wtViewport.isMarkedOversizedColumn[e]=!0}},adjustColumnHeaderHeights:function(){for(var e=this.wot.getSetting("columnHeaders"),t=this.wot.wtTable.THEAD.childNodes,n=this.wot.wtViewport.oversizedColumnHeaders,o=0,r=e.length;r>o;o++)if(n[o]){if(0===t[o].childNodes.length)return;t[o].childNodes[0].style.height=n[o]+"px"}},markIfOversizedColumnHeader:function(e){for(var t,n,o,r=this.wot.wtTable.columnFilter.renderedToSource(e),i=this.columnHeaderCount,s=this.wot.wtSettings.settings.defaultRowHeight;i;)i--,t=this.wot.wtTable.getColumnHeaderHeight(i),n=this.wot.wtTable.getColumnHeader(r,i),n&&(o=d(n),(!t&&o>s||o>t)&&(this.wot.wtViewport.oversizedColumnHeaders[i]=o))},renderCells:function(e,t,n){for(var o,i,s=0;n>s;s++)i=this.columnFilter.renderedToSource(s),o=0===s?t.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(i)]:o.nextSibling,"TH"==o.nodeName&&(o=r(o,t)),c(o,"hide")||(o.className=""),o.removeAttribute("style"),this.wot.wtSettings.settings.cellRenderer(e,i,o);return o},adjustColumnWidths:function(e){var t=0,n=this.wot.cloneSource?this.wot.cloneSource:this.wot,o=n.wtTable.holder;o.offsetHeightr;r++){var i=this.wtTable.getStretchedColumnWidth(this.columnFilter.renderedToSource(r));this.COLGROUP.childNodes[r+this.rowHeaderCount].style.width=i+"px"}},appendToTbody:function(e){this.TBODY.appendChild(e),this.wtTable.tbodyChildrenLength++},getOrCreateTrForRow:function(e,t){var n;return e>=this.wtTable.tbodyChildrenLength?(n=this.createRow(),this.appendToTbody(n)):n=0===e?this.TBODY.firstChild:t.nextSibling,n.className&&n.removeAttribute("class"),n},createRow:function(){for(var e=document.createElement("TR"),t=0;to;o++){var r=this.columnFilter.renderedToSource(o);this.renderColumnHeader(t,r,n.childNodes[o+this.rowHeaderCount])}},adjustColGroups:function(){for(var e=this.wtTable.getRenderedColumnsCount();this.wtTable.colgroupChildrenLengthe+this.rowHeaderCount;)this.COLGROUP.removeChild(this.COLGROUP.lastChild),this.wtTable.colgroupChildrenLength--;this.rowHeaderCount&&l(this.COLGROUP.childNodes[0],"rowHeader")},adjustThead:function(){var e=this.wtTable.getRenderedColumnsCount(),t=this.THEAD.firstChild;if(this.columnHeaders.length){for(var n=0,o=this.columnHeaders.length;o>n;n++){for(t=this.THEAD.childNodes[n],t||(t=document.createElement("TR"),this.THEAD.appendChild(t)),this.theadChildrenLength=t.childNodes.length;this.theadChildrenLengthe+this.rowHeaderCount;)t.removeChild(t.lastChild),this.theadChildrenLength--}var r=this.THEAD.childNodes.length;if(r>this.columnHeaders.length)for(var i=this.columnHeaders.length;r>i;i++)this.THEAD.removeChild(this.THEAD.lastChild)}else t&&a(t)},getTrForColumnHeaders:function(e){return this.THEAD.childNodes[e]},renderColumnHeader:function(e,t,n){return n.className="",n.removeAttribute("style"),this.columnHeaders[e](t,n,e)},adjustColumns:function(e,t){for(var n=e.childNodes.length;t>n;){var o=document.createElement("TD");e.appendChild(o),n++}for(;n>t;)e.removeChild(e.lastChild),n--},removeRedundantColumns:function(e){for(;this.wtTable.tbodyChildrenLength>e;)this.TBODY.removeChild(this.TBODY.lastChild),this.wtTable.tbodyChildrenLength--}},{}),window.WalkontableTableRenderer=h},{"helpers/dom/element":45}],22:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableViewport:{get:function(){return w}},__esModule:{value:!0}});var o,r,i,s,l=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=l.getScrollbarWidth,u=l.getScrollTop,c=l.getStyle,d=l.offset,h=l.outerHeight,f=l.outerWidth,g=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,p=(i=e("calculator/viewportColumns"),i&&i.__esModule&&i||{"default":i}).WalkontableViewportColumnsCalculator,m=(s=e("calculator/viewportRows"),s&&s.__esModule&&s||{"default":s}).WalkontableViewportRowsCalculator,w=function(e){var t=this;this.wot=e,this.instance=this.wot,this.oversizedRows=[],this.oversizedColumnHeaders=[],this.isMarkedOversizedColumn={},this.clientHeight=0,this.containerWidth=NaN,this.rowHeaderWidth=NaN,this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,this.eventManager=new g(this.wot),this.eventManager.addEventListener(window,"resize",function(){t.clientHeight=t.getWorkspaceHeight()})};$traceurRuntime.createClass(w,{getWorkspaceHeight:function(){var e,t=this.instance.wtOverlays.topOverlay.trimmingContainer,n=0;return t===window?n=document.documentElement.clientHeight:(e=h(t),n=e>0&&t.clientHeight>0?t.clientHeight:1/0),n},getWorkspaceWidth:function(){var e,t,n=this.instance.getSetting("totalColumns"),o=this.instance.wtOverlays.leftOverlay.trimmingContainer,r=this.instance.getSetting("stretchH"),i=document.documentElement.offsetWidth;return e=Handsontable.freezeOverlays?Math.min(i-this.getWorkspaceOffset().left,i):Math.min(this.getContainerFillWidth(),i-this.getWorkspaceOffset().left,i),o===window&&n>0&&this.sumColumnWidths(0,n-1)>e?document.documentElement.clientWidth:o!==window&&(t=c(this.instance.wtOverlays.leftOverlay.trimmingContainer,"overflow"),"scroll"==t||"hidden"==t||"auto"==t)?Math.max(e,o.clientWidth):"none"!==r&&r?e:Math.max(e,f(this.instance.wtTable.TABLE))},hasVerticalScroll:function(){return this.getWorkspaceActualHeight()>this.getWorkspaceHeight()},hasHorizontalScroll:function(){return this.getWorkspaceActualWidth()>this.getWorkspaceWidth()},sumColumnWidths:function(e,t){for(var n=0;t>e;)n+=this.wot.wtTable.getColumnWidth(e),e++;return n},getContainerFillWidth:function(){if(this.containerWidth)return this.containerWidth;var e,t,n=this.instance.wtTable.holder;return t=document.createElement("div"),t.style.width="100%",t.style.height="1px",n.appendChild(t),e=t.offsetWidth,this.containerWidth=e,n.removeChild(t),e},getWorkspaceOffset:function(){return d(this.wot.wtTable.TABLE)},getWorkspaceActualHeight:function(){return h(this.wot.wtTable.TABLE)},getWorkspaceActualWidth:function(){return f(this.wot.wtTable.TABLE)||f(this.wot.wtTable.TBODY)||f(this.wot.wtTable.THEAD)},getColumnHeaderHeight:function(){return isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=h(this.wot.wtTable.THEAD)),this.columnHeaderHeight},getViewportHeight:function(){var e,t=this.getWorkspaceHeight();return t===1/0?t:(e=this.getColumnHeaderHeight(),e>0&&(t-=e),t)},getRowHeaderWidth:function(){if(this.wot.cloneSource)return this.wot.cloneSource.wtViewport.getRowHeaderWidth();if(isNaN(this.rowHeaderWidth)){var e=this.instance.getSetting("rowHeaders");if(e.length){var t=this.instance.wtTable.TABLE.querySelector("TH");this.rowHeaderWidth=0;for(var n=0,o=e.length;o>n;n++)t?(this.rowHeaderWidth+=f(t),t=t.nextSibling):this.rowHeaderWidth+=50}else this.rowHeaderWidth=0}return this.rowHeaderWidth},getViewportWidth:function(){var e,t=this.getWorkspaceWidth();return t===1/0?t:(e=this.getRowHeaderWidth(),e>0?t-e:t)},createRowsCalculator:function(){var e,t,n,o,r,i,s,l=void 0!==arguments[0]?arguments[0]:!1,c=this;return this.rowHeaderWidth=NaN,e=this.wot.wtSettings.settings.renderAllRows?1/0:this.getViewportHeight(),t=u(this.wot.wtOverlays.mainTableScrollableElement)-this.wot.wtOverlays.topOverlay.getTableParentOffset(),0>t&&(t=0),n=this.wot.getSetting("fixedRowsTop"),r=this.wot.getSetting("fixedRowsBottom"),s=this.wot.getSetting("totalRows"),n&&(i=this.wot.wtOverlays.topOverlay.sumCellSizes(0,n),t+=i,e-=i),r&&this.wot.wtOverlays.bottomOverlay.clone&&(i=this.wot.wtOverlays.bottomOverlay.sumCellSizes(s-r,s),e-=i),o=this.wot.wtTable.holder.clientHeight===this.wot.wtTable.holder.offsetHeight?0:a(),new m(e,t,this.wot.getSetting("totalRows"),function(e){return c.wot.wtTable.getRowHeight(e)},l?null:this.wot.wtSettings.settings.viewportRowCalculatorOverride,l,o)},createColumnsCalculator:function(){var e,t,n=void 0!==arguments[0]?arguments[0]:!1,o=this,r=this.getViewportWidth();if(this.columnHeaderHeight=NaN,e=this.wot.wtOverlays.leftOverlay.getScrollPosition()-this.wot.wtOverlays.leftOverlay.getTableParentOffset(),0>e&&(e=0),t=this.wot.getSetting("fixedColumnsLeft")){var i=this.wot.wtOverlays.leftOverlay.sumCellSizes(0,t);e+=i,r-=i}return this.wot.wtTable.holder.clientWidth!==this.wot.wtTable.holder.offsetWidth&&(r-=a()),new p(r,e,this.wot.getSetting("totalColumns"),function(e){return o.wot.wtTable.getColumnWidth(e)},n?null:this.wot.wtSettings.settings.viewportColumnCalculatorOverride,n,this.wot.getSetting("stretchH"))},createRenderCalculators:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(e){var t=this.createRowsCalculator(!0),n=this.createColumnsCalculator(!0);this.areAllProposedVisibleRowsAlreadyRendered(t)&&this.areAllProposedVisibleColumnsAlreadyRendered(n)||(e=!1)}return e||(this.rowsRenderCalculator=this.createRowsCalculator(),this.columnsRenderCalculator=this.createColumnsCalculator()),this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,e},createVisibleCalculators:function(){this.rowsVisibleCalculator=this.createRowsCalculator(!0),this.columnsVisibleCalculator=this.createColumnsCalculator(!0)},areAllProposedVisibleRowsAlreadyRendered:function(e){return this.rowsVisibleCalculator?e.startRow0?!1:e.endRow>this.rowsRenderCalculator.endRow||e.endRow===this.rowsRenderCalculator.endRow&&e.endRow0?!1:e.endColumn>this.columnsRenderCalculator.endColumn||e.endColumn===this.columnsRenderCalculator.endColumn&&e.endColumn=0;s--)if(null===e[s])e.splice(s,1);else{var l=e[s][0],a=d.propToCol(e[s][1]),u=m.runHooks("modifyCol",a),c=m.getCellMeta(l,u);if("numeric"===c.type&&"string"==typeof e[s][3]&&e[s][3].length>0&&(/^-?[\d\s]*(\.|\,)?\d*$/.test(e[s][3])||c.format)){var h=e[s][3].length;"undefined"==typeof c.language?R.language("en"):e[s][3].indexOf(".")===h-3&&-1===e[s][3].indexOf(",")?R.language("en"):R.language(c.language),R.validate(e[s][3])&&(e[s][3]=R().unformat(e[s][3]))}m.getCellValidator(c)&&(i.addValidatorToQueue(),m.validateCell(e[s][3],c,function(t,n){return function(o){if("boolean"!=typeof o)throw new Error("Validation error: result is not boolean");o===!1&&n.allowInvalid===!1&&(e.splice(t,1),n.valid=!0,--t),i.removeValidatorFormQueue(); -}}(s,c),t))}i.checkIfQueueIsEmpty()}function r(e,t){var n=e.length-1;if(!(0>n)){for(;n>=0;n--)if(null!==e[n]){if(null!=e[n][2]||null!=e[n][3]){if(c.settings.allowInsertRow)for(;e[n][0]>m.countRows()-1;)d.createRow();if("array"===m.dataType&&c.settings.allowInsertColumn)for(;d.propToCol(e[n][1])>m.countCols()-1;)d.createCol();d.set(e[n][0],e[n][1],e[n][3])}}else e.splice(n,1);m.forceFullRender=!0,f.adjustRowsAndCols(),Handsontable.hooks.run(m,"beforeChangeRender",e,t),g.refreshBorders(null,!0),m.view.wt.wtOverlays.adjustElementsSize(),Handsontable.hooks.run(m,"afterChange",e,t||"edit")}}function i(e,t,n){return"object"==typeof e?e:[[e,t,n]]}function s(e){if(e.hasOwnProperty("type")){var t,n={};if("object"==typeof e.type)t=e.type;else if("string"==typeof e.type&&(t=Handsontable.cellTypes[e.type],void 0===t))throw new Error('You declared cell type "'+e.type+'" as a string that is not mapped to a known object. Cell type must be an object or a string mapped to an object in Handsontable.cellTypes');for(var o in t)t.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&(n[o]=t[o]);return n}}function l(e){return Handsontable.hooks.run(m,"modifyRow",e)}function a(e){return Handsontable.hooks.run(m,"modifyCol",e)}function u(){throw new Error("This method cannot be called because this Handsontable instance has been destroyed")}var c,d,h,f,g,p,m=this,w=function(){},v=A(m);x(w.prototype,Q.prototype),x(w.prototype,t),x(w.prototype,s(t)),this.rootElement=e,this.isHotTableEnv=O(this.rootElement),Handsontable.eventManager.isHotTableEnv=this.isHotTableEnv,this.container=document.createElement("DIV"),this.renderCall=!1,e.insertBefore(this.container,e.firstChild),this.guid="ht_"+B(),this.rootElement.id&&"ht_"!==this.rootElement.id.substring(0,3)||(this.rootElement.id=this.guid),c={cellSettings:[],columnSettings:[],columnsSettingConflicts:["data","width"],settings:new w,selRange:null,isPopulated:null,scrollable:null,firstRun:!0},f={alter:function(e,t,n,o,r){var i;switch(n=n||1,e){case"insert_row":if(m.getSettings().maxRows===m.countSourceRows())return;i=d.createRow(t,n),i&&(g.isSelected()&&c.selRange.from.row>=t?(c.selRange.from.row=c.selRange.from.row+i,g.transformEnd(i,0)):g.refreshBorders());break;case"insert_col":if(i=d.createCol(t,n)){if(Array.isArray(m.getSettings().colHeaders)){var s=[t,0];s.length+=i,Array.prototype.splice.apply(m.getSettings().colHeaders,s)}g.isSelected()&&c.selRange.from.col>=t?(c.selRange.from.col=c.selRange.from.col+i,g.transformEnd(0,i)):g.refreshBorders()}break;case"remove_row":d.removeRow(t,n),c.cellSettings.splice(t,n);var l=m.countRows(),a=m.getSettings().fixedRowsTop;a>=t+1&&(m.getSettings().fixedRowsTop-=Math.min(n,a-t));var u=m.getSettings().fixedRowsBottom;u&&t+1>=l-u&&(m.getSettings().fixedRowsBottom-=Math.min(n,u-t)),f.adjustRowsAndCols(),g.refreshBorders();break;case"remove_col":d.removeCol(t,n);for(var h=0,p=d.getAll().length;p>h;h++)h in c.cellSettings&&c.cellSettings[h].splice(t,n);var w=m.getSettings().fixedColumnsLeft;w>=t+1&&(m.getSettings().fixedColumnsLeft-=Math.min(n,w-t)),Array.isArray(m.getSettings().colHeaders)&&("undefined"==typeof t&&(t=-1),m.getSettings().colHeaders.splice(t,n)),f.adjustRowsAndCols(),g.refreshBorders();break;default:throw new Error('There is no such action "'+e+'"')}r||f.adjustRowsAndCols()},adjustRowsAndCols:function(){if(c.settings.minRows){var e=m.countRows();if(et;t++)d.createRow(m.countRows(),1,!0)}if(c.settings.minSpareRows){var o=m.countEmptyRows(!0);if(oi-1?(a=i-1,l=!0,h>a&&(h=a)):h>i-1&&(h=i-1,l=!0,a>h&&(a=h)),u>s-1?(u=s-1,l=!0,f>u&&(f=u)):f>s-1&&(f=s-1,l=!0,u>f&&(u=f)),l&&m.selectCell(a,u,h,f)}m.view&&m.view.wt.wtOverlays.adjustElementsSize()},populateFromArray:function(e,t,n,o,r,i,s){var l,a,u,d,h=[],f={};if(a=t.length,0===a)return!1;var g,p,w,v;({row:null===n?null:n.row,col:null===n?null:n.col});switch(r){case"shift_down":for(g=n?n.col-e.col+1:0,p=n?n.row-e.row+1:0,t=G(t),u=0,d=t.length,w=Math.max(d,g);w>u;u++)if(d>u){for(l=0,a=t[u].length;p-a>l;l++)t[u].push(t[u][l%a]);t[u].unshift(e.col+u,e.row,0),m.spliceCol.apply(m,t[u])}else t[u%d][0]=e.col+u,m.spliceCol.apply(m,t[u%d]);break;case"shift_right":for(g=n?n.col-e.col+1:0,p=n?n.row-e.row+1:0,l=0,a=t.length,v=Math.max(a,p);v>l;l++)if(a>l){for(u=0,d=t[l].length;g-d>u;u++)t[l].push(t[l][u%d]);t[l].unshift(e.row+l,e.col,0),m.spliceRow.apply(m,t[l])}else t[l%a][0]=e.row+l,m.spliceRow.apply(m,t[l%a]);break;case"overwrite":default:f.row=e.row,f.col=e.col;var b,C={row:n&&e?n.row-e.row+1:1,col:n&&e?n.col-e.col+1:1},y=0,R=0,E=!0,S=function(e){var n=void 0!==arguments[1]?arguments[1]:null,o=t[e%t.length];return null!==n?o[n%o.length]:o},T=t.length,O=n?n.row-e.row+1:0;for(a=n?O:Math.max(T,O),l=0;a>l&&!(n&&f.row>n.row&&O>T||!c.settings.allowInsertRow&&f.row>m.countRows()-1||f.row>=c.settings.maxRows);l++){var _=l-y,M=S(_).length,H=n?n.col-e.col+1:0;if(d=n?H:Math.max(M,H),f.col=e.col,b=m.getCellMeta(f.row,f.col),"paste"!==o&&"autofill"!==o||!b.skipRowOnPaste){for(R=0,u=0;d>u&&!(n&&f.col>n.col&&H>M||!c.settings.allowInsertColumn&&f.col>m.countCols()-1||f.col>=c.settings.maxCols);u++)if(b=m.getCellMeta(f.row,f.col),"paste"!==o&&"autofill"!==o||!b.skipColumnOnPaste)if(b.readOnly)f.col++;else{var k=u-R,A=S(_,k),P=m.getDataAtCell(f.row,f.col),x={row:_,col:k};if("autofill"===o){var W=m.runHooks("beforeAutofillInsidePopulate",x,i,t,s,{},C);W&&(A="undefined"==typeof W.value?A:W.value)}if(null!==A&&"object"==typeof A)if(null===P||"object"!=typeof P)E=!1;else{var I=D(P[0]||P),j=D(A[0]||A);N(I,j)?A=L(A):E=!1}else null!==P&&"object"==typeof P&&(E=!1);E&&h.push([f.row,f.col,A]),E=!0,f.col++}else R++,f.col++,d++;f.row++}else y++,f.row++,a++}m.setDataAtCell(h,null,null,o||"populateFromArray")}}},this.selection=g={inProgress:!1,selectedHeader:{cols:!1,rows:!1},setSelectedHeaders:function(e,t){m.selection.selectedHeader.rows=e,m.selection.selectedHeader.cols=t},begin:function(){m.selection.inProgress=!0},finish:function(){var e=m.getSelected();Handsontable.hooks.run(m,"afterSelectionEnd",e[0],e[1],e[2],e[3]),Handsontable.hooks.run(m,"afterSelectionEndByProp",e[0],m.colToProp(e[1]),e[2],m.colToProp(e[3])),m.selection.inProgress=!1},isInProgress:function(){return m.selection.inProgress},setRangeStart:function(e,t){Handsontable.hooks.run(m,"beforeSetRangeStart",e),c.selRange=new X(e,e,e),g.setRangeEnd(e,null,t)},setRangeEnd:function(e,t,n){if(null!==c.selRange){var o,r=!1,i=!0,s=m.view.wt.wtTable.getFirstVisibleRow(),l=m.view.wt.wtTable.getFirstVisibleColumn(),a={row:null,col:null};Handsontable.hooks.run(m,"beforeSetRangeEnd",e),m.selection.begin(),a.row=e.row<0?s:e.row,a.col=e.col<0?l:e.col,c.selRange.to=new Y(a.row,a.col),c.settings.multiSelect||(c.selRange.from=e),m.view.wt.selections.current.clear(),o=m.getCellMeta(c.selRange.highlight.row,c.selRange.highlight.col).disableVisualSelection,"string"==typeof o&&(o=[o]),(o===!1||Array.isArray(o)&&-1===o.indexOf("current"))&&m.view.wt.selections.current.add(c.selRange.highlight),m.view.wt.selections.area.clear(),(o===!1||Array.isArray(o)&&-1===o.indexOf("area"))&&g.isMultiple()&&(m.view.wt.selections.area.add(c.selRange.from),m.view.wt.selections.area.add(c.selRange.to)),(c.settings.currentRowClassName||c.settings.currentColClassName)&&(m.view.wt.selections.highlight.clear(),m.view.wt.selections.highlight.add(c.selRange.from),m.view.wt.selections.highlight.add(c.selRange.to)),Handsontable.hooks.run(m,"afterSelection",c.selRange.from.row,c.selRange.from.col,c.selRange.to.row,c.selRange.to.col),Handsontable.hooks.run(m,"afterSelectionByProp",c.selRange.from.row,d.colToProp(c.selRange.from.col),c.selRange.to.row,d.colToProp(c.selRange.to.col)),(0===c.selRange.from.row&&c.selRange.to.row===m.countRows()-1&&m.countRows()>1||0===c.selRange.from.col&&c.selRange.to.col===m.countCols()-1&&m.countCols()>1)&&(r=!0),(e.row<0||e.col<0)&&(i=!1),t!==!1&&!r&&i&&(c.selRange.from&&!g.isMultiple()?m.view.scrollViewport(c.selRange.from):m.view.scrollViewport(e)),g.refreshBorders(null,n)}},refreshBorders:function(e,t){t||p.destroyEditor(e),m.view.render(),g.isSelected()&&!t&&p.prepareEditor()},isMultiple:function(){var e=!(c.selRange.to.col===c.selRange.from.col&&c.selRange.to.row===c.selRange.from.row),t=Handsontable.hooks.run(m,"afterIsMultipleSelection",e);return e?t:void 0},transformStart:function(e,t,n,o){var r,i,s,l,a=new Y(e,t),u=0,d=0;m.runHooks("modifyTransformStart",a),r=m.countRows(),i=m.countCols(),l=m.getSettings().fixedRowsBottom,c.selRange.highlight.row+e>r-1?n&&c.settings.minSpareRows>0&&!(l&&c.selRange.highlight.row>=r-l-1)?(m.alter("insert_row",r),r=m.countRows()):c.settings.autoWrapCol&&(a.row=1-r,a.col=c.selRange.highlight.col+a.col==i-1?1-i:1):c.settings.autoWrapCol&&c.selRange.highlight.row+a.row<0&&c.selRange.highlight.col+a.col>=0&&(a.row=r-1,a.col=c.selRange.highlight.col+a.col==0?i-1:-1),c.selRange.highlight.col+a.col>i-1?n&&c.settings.minSpareCols>0?(m.alter("insert_col",i),i=m.countCols()):c.settings.autoWrapRow&&(a.row=c.selRange.highlight.row+a.row==r-1?1-r:1,a.col=1-i):c.settings.autoWrapRow&&c.selRange.highlight.col+a.col<0&&c.selRange.highlight.row+a.row>=0&&(a.row=c.selRange.highlight.row+a.row==0?r-1:-1,a.col=i-1),s=new Y(c.selRange.highlight.row+a.row,c.selRange.highlight.col+a.col),s.row<0?(u=-1,s.row=0):s.row>0&&s.row>=r&&(u=1,s.row=r-1),s.col<0?(d=-1,s.col=0):s.col>0&&s.col>=i&&(d=1,s.col=i-1),m.runHooks("afterModifyTransformStart",s,u,d),g.setRangeStart(s,o)},transformEnd:function(e,t){var n,o,r,i=new Y(e,t),s=0,l=0;m.runHooks("modifyTransformEnd",i),n=m.countRows(),o=m.countCols(),r=new Y(c.selRange.to.row+i.row,c.selRange.to.col+i.col),r.row<0?(s=-1,r.row=0):r.row>0&&r.row>=n&&(s=1,r.row=n-1),r.col<0?(l=-1,r.col=0):r.col>0&&r.col>=o&&(l=1,r.col=o-1),m.runHooks("afterModifyTransformEnd",r,s,l),g.setRangeEnd(r,!0)},isSelected:function(){return null!==c.selRange},inInSelection:function(e){return g.isSelected()?c.selRange.includes(e):!1},deselect:function(){g.isSelected()&&(m.selection.inProgress=!1,c.selRange=null,m.view.wt.selections.current.clear(),m.view.wt.selections.area.clear(),(c.settings.currentRowClassName||c.settings.currentColClassName)&&m.view.wt.selections.highlight.clear(),p.destroyEditor(),g.refreshBorders(),Handsontable.hooks.run(m,"afterDeselect"))},selectAll:function(){c.settings.multiSelect&&(g.setRangeStart(new Y(0,0)),g.setRangeEnd(new Y(m.countRows()-1,m.countCols()-1),!1))},empty:function(){if(g.isSelected()){var e,t,n=c.selRange.getTopLeftCorner(),o=c.selRange.getBottomRightCorner(),r=[];for(e=n.row;e<=o.row;e++)for(t=n.col;t<=o.col;t++)m.getCellMeta(e,t).readOnly||r.push([e,t,""]);m.setDataAtCell(r)}}},this.init=function(){h=new z(m,c.settings.data),Handsontable.hooks.run(m,"beforeInit"),Handsontable.mobileBrowser&&S(m.rootElement,"mobile"),this.updateSettings(c.settings,!0),this.view=new F(this),p=new k(m,c,g,d),this.forceFullRender=!0,Handsontable.hooks.run(m,"init"),this.view.render(),"object"==typeof c.firstRun&&(Handsontable.hooks.run(m,"afterChange",c.firstRun[0],c.firstRun[1]),c.firstRun=!1),Handsontable.hooks.run(m,"afterInit")},this.validateCell=function(e,t,n,o){function r(e){var o=t.physicalCol,r=t.physicalRow,i=m.getCell(r,o,!0);i&&m.view.wt.wtSettings.settings.cellRenderer(r,o,i),n(e)}var i=m.getCellValidator(t);"[object RegExp]"===Object.prototype.toString.call(i)&&(i=function(e){return function(t,n){n(e.test(t))}}(i)),"function"==typeof i?(e=Handsontable.hooks.run(m,"beforeValidate",e,t.row,t.prop,o),m._registerTimeout(setTimeout(function(){i.call(t,e,function(n){n=Handsontable.hooks.run(m,"afterValidate",n,e,t.row,t.prop,o),t.valid=n,r(n),Handsontable.hooks.run(m,"postAfterValidate",n,e,t.row,t.prop,o)})},0))):(t.valid=!0,r(t.valid))},this.setDataAtCell=function(e,t,n,s){var l,a,u,c=i(e,t,n),h=[];for(l=0,a=c.length;a>l;l++){if("object"!=typeof c[l])throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if("number"!=typeof c[l][1])throw new Error("Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`");u=d.colToProp(c[l][1]),h.push([c[l][0],u,d.get(c[l][0],u),c[l][2]])}s||"object"!=typeof e||(s=t),o(h,s,function(){r(h,s)})},this.setDataAtRowProp=function(e,t,n,s){var l,a,u=i(e,t,n),c=[];for(l=0,a=u.length;a>l;l++)c.push([u[l][0],u[l][1],d.get(u[l][0],u[l][1]),u[l][2]]);s||"object"!=typeof e||(s=t),o(c,s,function(){r(c,s)})},this.listen=function(){Handsontable.activeGuid=m.guid},this.unlisten=function(){Handsontable.activeGuid=null},this.isListening=function(){return Handsontable.activeGuid===m.guid},this.destroyEditor=function(e){g.refreshBorders(e)},this.populateFromArray=function(e,t,n,o,r,i,s,l,a){var u;if("object"!=typeof n||"object"!=typeof n[0])throw new Error("populateFromArray parameter `input` must be an array of arrays");return u="number"==typeof o?new Y(o,r):null,f.populateFromArray(new Y(e,t),n,u,i,s,l,a)},this.spliceCol=function(e,t,n){return d.spliceCol.apply(d,arguments)},this.spliceRow=function(e,t,n){return d.spliceRow.apply(d,arguments)},this.getSelected=function(){return g.isSelected()?[c.selRange.from.row,c.selRange.from.col,c.selRange.to.row,c.selRange.to.col]:void 0},this.getSelectedRange=function(){return g.isSelected()?c.selRange:void 0},this.render=function(){m.view&&(m.renderCall=!0,m.forceFullRender=!0,g.refreshBorders(null,!0))},this.loadData=function(e){function t(){c.cellSettings.length=0}if("object"==typeof e&&null!==e)e.push&&e.splice||(e=[e]);else{if(null!==e)throw new Error("loadData only accepts array of objects or array of arrays ("+typeof e+" given)");e=[];for(var n,o=0,r=c.settings.startRows;r>o;o++){n=[];for(var i=0,s=c.settings.startCols;s>i;i++)n.push(null);e.push(n)}}c.isPopulated=!1,w.prototype.data=e,Array.isArray(c.settings.dataSchema)||Array.isArray(e[0])?m.dataType="array":"function"==typeof c.settings.dataSchema?m.dataType="function":m.dataType="object",d=new H(m,c,w),h.data=e,h.dataType=m.dataType,h.colToProp=d.colToProp.bind(d),h.propToCol=d.propToCol.bind(d),t(),f.adjustRowsAndCols(),Handsontable.hooks.run(m,"afterLoadData",c.firstRun),c.firstRun?c.firstRun=[null,"loadData"]:(Handsontable.hooks.run(m,"afterChange",null,"loadData"),m.render()),c.isPopulated=!0},this.getData=function(e,t,n,o){return"undefined"==typeof e?d.getAll():d.getRange(new Y(e,t),new Y(n,o),d.DESTINATION_RENDERER)},this.getCopyableText=function(e,t,n,o){return d.getCopyableText(new Y(e,t),new Y(n,o))},this.getCopyableData=function(e,t){return d.getCopyable(e,d.colToProp(t))},this.getSchema=function(){return d.getSchema()},this.updateSettings=function(e,t){var n,o;if("undefined"!=typeof e.rows)throw new Error('"rows" setting is no longer supported. do you mean startRows, minRows or maxRows?');if("undefined"!=typeof e.cols)throw new Error('"cols" setting is no longer supported. do you mean startCols, minCols or maxCols?');for(n in e)"data"!==n&&(Handsontable.hooks.getRegistered().indexOf(n)>-1?("function"==typeof e[n]||Array.isArray(e[n]))&&m.addHook(n,e[n]):!t&&e.hasOwnProperty(n)&&(w.prototype[n]=e[n]));if(void 0===e.data&&void 0===c.settings.data?m.loadData(null):void 0!==e.data?m.loadData(e.data):void 0!==e.columns&&d.createMap(),o=m.countCols(),c.cellSettings.length=0,o>0){var r,i;for(n=0;o>n;n++)c.columnSettings[n]=M(w,c.columnsSettingConflicts),r=c.columnSettings[n].prototype,w.prototype.columns&&(i=w.prototype.columns[n],x(r,i),x(r,s(i)))}if("undefined"!=typeof e.cell)for(n in e.cell)if(e.cell.hasOwnProperty(n)){var l=e.cell[n];m.setCellMetaObject(l.row,l.col,l)}if(Handsontable.hooks.run(m,"afterCellMetaReset"),"undefined"!=typeof e.className&&(w.prototype.className&&_(m.rootElement,w.prototype.className),e.className&&S(m.rootElement,e.className)),"undefined"!=typeof e.height){var a=e.height;"function"==typeof a&&(a=a()),m.rootElement.style.height=a+"px"}if("undefined"!=typeof e.width){var u=e.width;"function"==typeof u&&(u=u()),m.rootElement.style.width=u+"px"}a&&(m.rootElement.style.overflow="hidden"),t||Handsontable.hooks.run(m,"afterUpdateSettings"),f.adjustRowsAndCols(),m.view&&!c.firstRun&&(m.forceFullRender=!0,g.refreshBorders(null,!0))},this.getValue=function(){var e=m.getSelected();if(w.prototype.getValue){if("function"==typeof w.prototype.getValue)return w.prototype.getValue.call(m);if(e)return m.getData()[e[0]][w.prototype.getValue]}else if(e)return m.getDataAtCell(e[0],e[1])},this.getSettings=function(){return c.settings},this.clear=function(){g.selectAll(),g.empty()},this.alter=function(e,t,n,o,r){f.alter(e,t,n,o,r)},this.getCell=function(e,t,n){return m.view.getCellAtCoords(new Y(e,t),n)},this.getCoords=function(e){return this.view.wt.wtTable.getCoords.call(this.view.wt.wtTable,e)},this.colToProp=function(e){return d.colToProp(e)},this.propToCol=function(e){return d.propToCol(e)},this.getDataAtCell=function(e,t){return d.get(e,d.colToProp(t))},this.getDataAtRowProp=function(e,t){return d.get(e,t)},this.getDataAtCol=function(e){var t=[];return t.concat.apply(t,d.getRange(new Y(0,e),new Y(c.settings.data.length-1,e),d.DESTINATION_RENDERER))},this.getDataAtProp=function(e){var t,n=[];return t=d.getRange(new Y(0,d.propToCol(e)),new Y(c.settings.data.length-1,d.propToCol(e)),d.DESTINATION_RENDERER),n.concat.apply(n,t)},this.getSourceData=function(e,t,n,o){var r;return r=void 0===e?h.getData():h.getByRange(new Y(e,t),new Y(n,o))},this.getSourceDataAtCol=function(e){return h.getAtColumn(e)},this.getSourceDataAtRow=function(e){return h.getAtRow(e)},this.getSourceDataAtCell=function(e,t){return h.getAtCell(e,t)},this.getDataAtRow=function(e){var t=d.getRange(new Y(e,0),new Y(e,this.countCols()-1),d.DESTINATION_RENDERER);return t[0]},this.getDataType=function(e,t,n,o){var r=this,i=null,s=null;void 0===e&&(e=0,n=this.countRows(),t=0,o=this.countCols()),void 0===n&&(n=e),void 0===o&&(o=t);var l="mixed";return V(Math.min(e,n),Math.max(e,n),function(e){var n=!0;return V(Math.min(t,o),Math.max(t,o),function(t){var o=r.getCellMeta(e,t);return s=o.type,i?n=i===s:i=s,n}),l=n?s:"mixed",n}),l},this.removeCellMeta=function(e,t,n){var o=m.getCellMeta(e,t);void 0!=o[n]&&delete c.cellSettings[e][t][n]},this.setCellMetaObject=function(e,t,n){if("object"==typeof n)for(var o in n)if(n.hasOwnProperty(o)){var r=n[o];this.setCellMeta(e,t,o,r)}},this.setCellMeta=function(e,t,n,o){c.cellSettings[e]||(c.cellSettings[e]=[]),c.cellSettings[e][t]||(c.cellSettings[e][t]=new c.columnSettings[t]),c.cellSettings[e][t][n]=o,Handsontable.hooks.run(m,"afterSetCellMeta",e,t,n,o)},this.getCellsMeta=function(){return W(c.cellSettings)},this.getCellMeta=function(e,t){var n,o=d.colToProp(t),r=e,i=t;if(e=l(e),t=a(t),c.columnSettings[t]||(c.columnSettings[t]=M(w,c.columnsSettingConflicts)),c.cellSettings[e]||(c.cellSettings[e]=[]),c.cellSettings[e][t]||(c.cellSettings[e][t]=new c.columnSettings[t]),n=c.cellSettings[e][t],n.row=e,n.col=t,n.physicalRow=r,n.physicalCol=i,n.prop=o,n.instance=m,Handsontable.hooks.run(m,"beforeGetCellMeta",e,t,n),x(n,s(n)),n.cells){var u=n.cells.call(n,e,t,o);u&&(x(n,u),x(n,s(u)))}return Handsontable.hooks.run(m,"afterGetCellMeta",e,t,n),n},this.isColumnModificationAllowed=function(){return!("object"===m.dataType||m.getSettings().columns)};var b=$("renderer");this.getCellRenderer=function(e,t){var n=b.call(this,e,t);return j(n)},this.getCellEditor=$("editor"),this.getCellValidator=$("validator"),this.validateCells=function(e){var t=new n;t.onQueueEmpty=e;for(var o=m.countRows()-1;o>=0;){for(var r=m.countCols()-1;r>=0;)t.addValidatorToQueue(),m.validateCell(m.getDataAtCell(o,r),m.getCellMeta(o,r),function(e){if("boolean"!=typeof e)throw new Error("Validation error: result is not boolean");e===!1&&(t.valid=!1),t.removeValidatorFormQueue()},"validateCells"),r--;o--}t.checkIfQueueIsEmpty()},this.getRowHeader=function(e){var t=c.settings.rowHeaders;return void 0!==e&&(e=Handsontable.hooks.run(m,"modifyRowHeader",e)),void 0===e?(t=[],V(m.countRows()-1,function(e){t.push(m.getRowHeader(e))})):Array.isArray(t)&&void 0!==t[e]?t=t[e]:"function"==typeof t?t=t(e):t&&"string"!=typeof t&&"number"!=typeof t&&(t=e+1),t},this.hasRowHeaders=function(){return!!c.settings.rowHeaders},this.hasColHeaders=function(){if(void 0!==c.settings.colHeaders&&null!==c.settings.colHeaders)return!!c.settings.colHeaders;for(var e=0,t=m.countCols();t>e;e++)if(m.getColHeader(e))return!0;return!1},this.getColHeader=function(e){if(e=Handsontable.hooks.run(m,"modifyColHeader",e),void 0===e){for(var t=[],n=0,o=m.countCols();o>n;n++)t.push(m.getColHeader(n));return t}var r=e;return e=Handsontable.hooks.run(m,"modifyCol",e),c.settings.columns&&c.settings.columns[e]&&c.settings.columns[e].title?c.settings.columns[e].title:Array.isArray(c.settings.colHeaders)&&void 0!==c.settings.colHeaders[e]?c.settings.colHeaders[e]:"function"==typeof c.settings.colHeaders?c.settings.colHeaders(e):c.settings.colHeaders&&"string"!=typeof c.settings.colHeaders&&"number"!=typeof c.settings.colHeaders?K(r):c.settings.colHeaders},this._getColWidthFromSettings=function(e){var t=m.getCellMeta(0,e),n=t.width;if((void 0===n||n===c.settings.width)&&(n=t.colWidths),void 0!==n&&null!==n){switch(typeof n){case"object":n=n[e];break;case"function":n=n(e)}"string"==typeof n&&(n=parseInt(n,10))}return n},this.getColWidth=function(e){var t=m._getColWidthFromSettings(e);return t=Handsontable.hooks.run(m,"modifyColWidth",t,e),void 0===t&&(t=q.DEFAULT_WIDTH),t},this._getRowHeightFromSettings=function(e){var t=c.settings.rowHeights;if(void 0!==t&&null!==t){switch(typeof t){case"object":t=t[e];break;case"function":t=t(e)}"string"==typeof t&&(t=parseInt(t,10))}return t},this.getRowHeight=function(e){var t=m._getRowHeightFromSettings(e);return t=Handsontable.hooks.run(m,"modifyRowHeight",t,e)},this.countSourceRows=function(){return m.getSourceData()?m.getSourceData().length:0},this.countRows=function(){return d.getLength()},this.countCols=function(){return"object"===m.dataType||"function"===m.dataType?c.settings.columns&&c.settings.columns.length?c.settings.columns.length:d.colToPropCache.length:"array"===m.dataType?c.settings.columns&&c.settings.columns.length?c.settings.columns.length:c.settings.data&&c.settings.data[0]&&c.settings.data[0].length?c.settings.data[0].length:0:void 0},this.getColspanOffset=function(e,t){var n=0;if(m.colspanArray){for(var o=0;e>o;o++)n+=m.colspanArray[t][o]-1||0;return n}for(var n=0,r=m.view.wt.wtTable.THEAD.childNodes.length-t-1,i=m.view.wt.wtTable.THEAD.querySelector("tr:nth-child("+parseInt(r+1,10)+")"),s=m.view.wt.wtSettings.settings.rowHeaders().length,o=s;s+e>o;o++)i.childNodes[o].hasAttribute("colspan")&&(n+=parseInt(i.childNodes[o].getAttribute("colspan"),10)-1);return n},this.getHeaderColspan=function(e,t){var n=m.view.wt.wtTable.THEAD.childNodes.length-t-1,o=m.view.wt.wtSettings.settings.rowHeaders().length,r=m.view.wt.wtTable.THEAD.querySelector("tr:nth-child("+parseInt(n+1,10)+")"),i=o+e-m.view.wt.wtViewport.columnsRenderCalculator.startColumn;return r.childNodes[i].hasAttribute("colspan")?parseInt(r.childNodes[i].getAttribute("colspan"),10):0},this.rowOffset=function(){return m.view.wt.wtTable.getFirstRenderedRow()},this.colOffset=function(){return m.view.wt.wtTable.getFirstRenderedColumn()},this.countRenderedRows=function(){return m.view.wt.drawn?m.view.wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return m.view.wt.drawn?m.view.wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return m.view.wt.drawn?m.view.wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return m.view.wt.drawn?m.view.wt.wtTable.getVisibleColumnsCount():-1},this.countEmptyRows=function(e){for(var t,n=m.countRows()-1,o=0;n>=0;){if(t=Handsontable.hooks.run(this,"modifyRow",n),m.isEmptyRow(t))o++;else if(e)break;n--}return o},this.countEmptyCols=function(e){if(m.countRows()<1)return 0;for(var t=m.countCols()-1,n=0;t>=0;){if(m.isEmptyCol(t))n++;else if(e)break;t--}return n},this.isEmptyRow=function(e){return c.settings.isEmptyRow.call(m,e)},this.isEmptyCol=function(e){return c.settings.isEmptyCol.call(m,e)},this.selectCell=function(e,t,n,o,r,i){var s;if(i="undefined"==typeof i||i===!0,"number"!=typeof e||0>e||e>=m.countRows())return!1;if("number"!=typeof t||0>t||t>=m.countCols())return!1;if("undefined"!=typeof n){if("number"!=typeof n||0>n||n>=m.countRows())return!1;if("number"!=typeof o||0>o||o>=m.countCols())return!1}return s=new Y(e,t),c.selRange=new X(s,s,s),i&&m.listen(),"undefined"==typeof n?g.setRangeEnd(c.selRange.from,r):g.setRangeEnd(new Y(n,o),r),m.selection.finish(),!0},this.selectCellByProp=function(e,t,n,o,r){return arguments[1]=d.propToCol(arguments[1]),"undefined"!=typeof arguments[3]&&(arguments[3]=d.propToCol(arguments[3])),m.selectCell.apply(m,arguments)},this.deselectCell=function(){g.deselect()},this.destroy=function(){m._clearTimeouts(),m.view&&m.view.destroy(),h&&h.destroy(),h=null,T(m.rootElement),v.destroy(),Handsontable.hooks.run(m,"afterDestroy"),Handsontable.hooks.destroy(m);for(var e in m)m.hasOwnProperty(e)&&("function"==typeof m[e]?m[e]=u:"guid"!==e&&(m[e]=null));c=null,d=null,f=null,g=null,p=null,m=null,w=null},this.getActiveEditor=function(){return p.getActiveEditor()},this.getPlugin=function(e){return I(this,e)},this.getInstance=function(){return m},this.addHook=function(e,t){Handsontable.hooks.add(e,t,m)},this.hasHook=function(e){return Handsontable.hooks.has(e,m)},this.addHookOnce=function(e,t){Handsontable.hooks.once(e,t,m)},this.removeHook=function(e,t){Handsontable.hooks.remove(e,t,m)},this.runHooks=function(e,t,n,o,r,i,s){return Handsontable.hooks.run(m,e,t,n,o,r,i,s)},this.timeouts=[],this._registerTimeout=function(e){this.timeouts.push(e)},this._clearTimeouts=function(){for(var e=0,t=this.timeouts.length;t>e;e++)clearTimeout(this.timeouts[e])},this.version=Handsontable.version,Handsontable.hooks.run(m,"construct")};var Q=function(){};Q.prototype={data:void 0,dataSchema:void 0,width:void 0,height:void 0,startRows:5,startCols:5,rowHeaders:null,colHeaders:null,colWidths:void 0,rowHeights:void 0,columns:void 0,cells:void 0,cell:[],comments:!1,customBorders:!1,minRows:0,minCols:0,maxRows:1/0,maxCols:1/0,minSpareRows:0,minSpareCols:0,allowInsertRow:!0,allowInsertColumn:!0,allowRemoveRow:!0,allowRemoveColumn:!0,multiSelect:!0,fillHandle:!0,fixedRowsTop:0,fixedRowsBottom:0,fixedColumnsLeft:0,outsideClickDeselects:!0,enterBeginsEditing:!0,enterMoves:{row:1,col:0},tabMoves:{row:0,col:1},autoWrapRow:!1,autoWrapCol:!1,copyRowsLimit:1e3,copyColsLimit:1e3,pasteMode:"overwrite",persistentState:!1,currentRowClassName:void 0,currentColClassName:void 0,className:void 0,tableClassName:void 0,stretchH:"none",isEmptyRow:function(e){var t,n,o,r;for(t=0,n=this.countCols();n>t;t++)if(o=this.getDataAtCell(e,t),""!==o&&null!==o&&"undefined"!=typeof o)return"object"==typeof o?(r=this.getCellMeta(e,t),N(this.getSchema()[r.prop],o)):!1;return!0},isEmptyCol:function(e){var t,n,o;for(t=0,n=this.countRows();n>t;t++)if(o=this.getDataAtCell(t,e),""!==o&&null!==o&&"undefined"!=typeof o)return!1;return!0},observeDOMVisibility:!0,allowInvalid:!0,invalidCellClassName:"htInvalid",placeholder:!1,placeholderCellClassName:"htPlaceholder",readOnlyCellClassName:"htDimmed",renderer:void 0,commentedCellClassName:"htCommentCell",fragmentSelection:!1,readOnly:!1,skipColumnOnPaste:!1,search:!1,type:"text",copyable:!0,editor:void 0,autoComplete:void 0,visibleRows:10,trimDropdown:!0,debug:!1,wordWrap:!0,noWordWrapClassName:"htNoWrap",contextMenu:void 0,contextMenuCopyPaste:void 0,copyPaste:void 0,undo:void 0,columnSorting:void 0,manualColumnMove:void 0,manualColumnResize:void 0,manualRowMove:void 0,manualRowResize:void 0,mergeCells:!1,viewportRowRenderingOffset:"auto",viewportColumnRenderingOffset:"auto",validator:void 0,disableVisualSelection:!1,sortIndicator:!1,manualColumnFreeze:void 0,trimWhitespace:!0,settings:void 0,source:void 0,title:void 0,checkedTemplate:void 0,uncheckedTemplate:void 0,label:void 0,format:void 0,language:void 0,selectOptions:void 0,autoColumnSize:void 0,autoRowSize:void 0,dateFormat:void 0,correctFormat:!1,defaultDate:void 0,strict:void 0,renderAllRows:void 0},Handsontable.DefaultSettings=Q},{"3rdparty/walkontable/src/calculator/viewportColumns":3,"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/selection":18,dataMap:26,dataSource:27,editorManager:28,eventManager:41,"helpers/array":42,"helpers/data":44,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/setting":51,"helpers/string":52,numeral:"numeral",plugins:57,renderers:88,tableView:97}],26:[function(e,t,n){"use strict";function o(e,t,n){this.instance=e,this.priv=t,this.GridSettings=n,this.dataSource=this.instance.getSettings().data,this.dataSource[0]?this.duckSchema=this.recursiveDuckSchema(this.dataSource[0]):this.duckSchema={},this.createMap()}Object.defineProperties(n,{DataMap:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a,u,c,d=(r=e("SheetClip"),r&&r.__esModule&&r||{"default":r})["default"],h=(i=e("helpers/data"),i&&i.__esModule&&i||{"default":i}).cellMethodLookupFactory,f=(s=e("helpers/setting"),s&&s.__esModule&&s||{"default":s}).columnFactory,g=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),p=g.duckSchema,m=g.deepExtend,w=(a=e("helpers/array"),a&&a.__esModule&&a||{"default":a}),v=w.extendArray,b=w.to2dArray,C=(u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}).rangeEach,y=(c=e("multiMap"),c&&c.__esModule&&c||{"default":c}).MultiMap;o.prototype.DESTINATION_RENDERER=1,o.prototype.DESTINATION_CLIPBOARD_GENERATOR=2,o.prototype.recursiveDuckSchema=function(e){return p(e)},o.prototype.recursiveDuckColumns=function(e,t,n){var o,r;if("undefined"==typeof t&&(t=0,n=""),"object"==typeof e&&!Array.isArray(e))for(r in e)e.hasOwnProperty(r)&&(null===e[r]?(o=n+r,this.colToPropCache.push(o),this.propToColCache.set(o,t),t++):t=this.recursiveDuckColumns(e[r],t,r+"."));return t},o.prototype.createMap=function(){var e,t,n=this.getSchema();if("undefined"==typeof n)throw new Error("trying to create `columns` definition but you didnt' provide `schema` nor `data`");this.colToPropCache=[],this.propToColCache=new y;var o=this.instance.getSettings().columns;if(o)for(e=0,t=o.length;t>e;e++)"undefined"!=typeof o[e].data&&(this.colToPropCache[e]=o[e].data,this.propToColCache.set(o[e].data,e));else this.recursiveDuckColumns(n)},o.prototype.colToProp=function(e){return e=Handsontable.hooks.run(this.instance,"modifyCol",e),this.colToPropCache&&"undefined"!=typeof this.colToPropCache[e]?this.colToPropCache[e]:e},o.prototype.propToCol=function(e){var t;return t="undefined"==typeof this.propToColCache.get(e)?e:this.propToColCache.get(e),t=Handsontable.hooks.run(this.instance,"modifyCol",t)},o.prototype.getSchema=function(){var e=this.instance.getSettings().dataSchema;return e?"function"==typeof e?e():e:this.duckSchema},o.prototype.createRow=function(e,t,n){var o,r,i=this.instance.countCols(),s=0;t||(t=1),("number"!=typeof e||e>=this.instance.countSourceRows())&&(e=this.instance.countSourceRows()),r=e;for(var l=this.instance.getSettings().maxRows;t>s&&this.instance.countSourceRows()a;a++)o.push(null)}else"function"===this.instance.dataType?o=this.instance.getSettings().dataSchema(e):(o={}, -m(o,this.getSchema()));e===this.instance.countSourceRows()?this.dataSource.push(o):this.dataSource.splice(e,0,o),s++,r++}return Handsontable.hooks.run(this.instance,"afterCreateRow",e,s,n),this.instance.forceFullRender=!0,s},o.prototype.createCol=function(e,t,n){if(!this.instance.isColumnModificationAllowed())throw new Error("Cannot create new column. When data source in an object, you can only have as much columns as defined in first data row, data schema or in the 'columns' setting.If you want to be able to add new columns, you have to use array datasource.");var o,r,i=this.instance.countSourceRows(),s=this.dataSource,l=0;t||(t=1),r=e;for(var a=this.instance.getSettings().maxCols;t>l&&this.instance.countCols()=this.instance.countCols()){for(var u=0;i>u;u++)"undefined"==typeof s[u]&&(s[u]=[]),s[u].push(null);this.priv.columnSettings.push(o)}else{for(var u=0;i>u;u++)s[u].splice(r,0,null);this.priv.columnSettings.splice(r,0,o)}l++,r++}return Handsontable.hooks.run(this.instance,"afterCreateCol",e,l,n),this.instance.forceFullRender=!0,l},o.prototype.removeRow=function(e,t){t||(t=1),"number"!=typeof e&&(e=-t),e=(this.instance.countSourceRows()+e)%this.instance.countSourceRows();var n=this.physicalRowsToLogical(e,t),o=Handsontable.hooks.run(this.instance,"beforeRemoveRow",e,t,n);if(o!==!1){var r=this.dataSource,i=r.filter(function(e,t){return-1==n.indexOf(t)});r.length=0,Array.prototype.push.apply(r,i),Handsontable.hooks.run(this.instance,"afterRemoveRow",e,t,n),this.instance.forceFullRender=!0}},o.prototype.removeCol=function(e,t){if("object"===this.instance.dataType||this.instance.getSettings().columns)throw new Error("cannot remove column with object data source or columns option specified");t||(t=1),"number"!=typeof e&&(e=-t),e=(this.instance.countCols()+e)%this.instance.countCols();var n=Handsontable.hooks.run(this.instance,"beforeRemoveCol",e,t);if(n!==!1){for(var o=this.dataSource,r=0,i=this.instance.countSourceRows();i>r;r++)o[r].splice(e,t);this.priv.columnSettings.splice(e,t),Handsontable.hooks.run(this.instance,"afterRemoveCol",e,t),this.instance.forceFullRender=!0}},o.prototype.spliceCol=function(e,t,n){var o=4<=arguments.length?[].slice.call(arguments,3):[],r=this.instance.getDataAtCol(e),i=r.slice(t,t+n),s=r.slice(t+n);v(o,s);for(var l=0;n>l;)o.push(null),l++;return b(o),this.instance.populateFromArray(t,e,o,null,null,"spliceCol"),i},o.prototype.spliceRow=function(e,t,n){var o=4<=arguments.length?[].slice.call(arguments,3):[],r=this.instance.getSourceDataAtRow(e),i=r.slice(t,t+n),s=r.slice(t+n);v(o,s);for(var l=0;n>l;)o.push(null),l++;return this.instance.populateFromArray(e,t,[o],null,null,"spliceRow"),i},o.prototype.get=function(e,t){if(e=Handsontable.hooks.run(this.instance,"modifyRow",e),"string"==typeof t&&t.indexOf(".")>-1){var n=t.split("."),o=this.dataSource[e];if(!o)return null;for(var r=0,i=n.length;i>r;r++)if(o=o[n[r]],"undefined"==typeof o)return null;return o}return"function"==typeof t?t(this.dataSource.slice(e,e+1)[0]):this.dataSource[e]&&this.dataSource[e].hasOwnProperty&&this.dataSource[e].hasOwnProperty(t)?this.dataSource[e][t]:null};var R=h("copyable",!1);o.prototype.getCopyable=function(e,t){return R.call(this.instance,e,this.propToCol(t))?this.get(e,t):""},o.prototype.set=function(e,t,n,o){if(e=Handsontable.hooks.run(this.instance,"modifyRow",e,o||"datamapGet"),"string"==typeof t&&t.indexOf(".")>-1){for(var r=t.split("."),i=this.dataSource[e],s=0,l=r.length-1;l>s;s++)"undefined"==typeof i[r[s]]&&(i[r[s]]={}),i=i[r[s]];i[r[s]]=n}else"function"==typeof t?t(this.dataSource.slice(e,e+1)[0],n):this.dataSource[e][t]=n},o.prototype.physicalRowsToLogical=function(e,t){for(var n,o=this.instance.countSourceRows(),r=(o+e)%o,i=[],s=t;o>r&&s;)n=Handsontable.hooks.run(this.instance,"modifyRow",r),i.push(n),s--,r++;return i},o.prototype.clear=function(){for(var e=0;e=o;o++){l=[];var c=Handsontable.hooks.run(this.instance,"modifyRow",o);for(i=Math.min(e.col,t.col);s>=i;i++){if(null===c)break;l.push(u.call(this,o,this.colToProp(i)))}null!==c&&a.push(l)}return a},o.prototype.getText=function(e,t){return d.stringify(this.getRange(e,t,this.DESTINATION_RENDERER))},o.prototype.getCopyableText=function(e,t){return d.stringify(this.getRange(e,t,this.DESTINATION_CLIPBOARD_GENERATOR))},Handsontable.DataMap=o},{SheetClip:"SheetClip","helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51,multiMap:55}],27:[function(e,t,n){"use strict";Object.defineProperties(n,{DataSource:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s,l,a=((o=e("helpers/data"),o&&o.__esModule&&o||{"default":o}).cellMethodLookupFactory,(r=e("helpers/setting"),r&&r.__esModule&&r||{"default":r}).columnFactory,i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}),u=(a.duckSchema,a.deepExtend,a.getProperty),c=(s=e("helpers/array"),s&&s.__esModule&&s||{"default":s}),d=(c.extendArray,c.arrayEach),h=(l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}).rangeEach,f=function(e,t){this.hot=e,this.data=t,this.dataType="array",this.colToProp=function(){},this.propToCol=function(){}};$traceurRuntime.createClass(f,{getData:function(){return this.data},getAtColumn:function(e){var t=this,n=[];return d(this.data,function(o){var r=t.colToProp(e);o="string"==typeof r?u(o,r):o[r],n.push(o)}),n},getAtRow:function(e){return this.data[e]},getAtCell:function(e,t){return this.data[e][this.colToProp(t)]},getByRange:function(e,t){var n=this,o=Math.min(e.row,t.row),r=Math.min(e.col,t.col),i=Math.max(e.row,t.row),s=Math.max(e.col,t.col),l=[];return h(o,i,function(e){var t,o=n.getAtRow(e);"array"===n.dataType?t=o.slice(r,s):"object"===n.dataType&&(t={},h(r,s,function(e){var r=n.colToProp(e);t[r]=o[r]})),l.push(t)}),l},destroy:function(){this.data=null,this.hot=null}},{})},{"helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51}],28:[function(e,t,n){"use strict";function o(e,t,n){function o(e){var o="function"==typeof t.settings.enterMoves?t.settings.enterMoves(event):t.settings.enterMoves;e?n.transformStart(-o.row,-o.col):n.transformStart(o.row,o.col,!0)}function r(e){e?n.transformEnd(-1,0):n.transformStart(-1,0)}function i(e){e?n.transformEnd(1,0):n.transformStart(1,0)}function s(e){e?n.transformEnd(0,1):n.transformStart(0,1)}function l(e){e?n.transformEnd(0,-1):n.transformStart(0,-1)}function a(a){var c,g;if(e.isListening()&&(Handsontable.hooks.run(e,"beforeKeyDown",a),!y&&!w(a)&&(t.lastKeyCode=a.keyCode,n.isSelected()))){if(c=(a.ctrlKey||a.metaKey)&&!a.altKey,b&&!b.isWaiting()&&!(h(a.keyCode)||f(a.keyCode)||c||C.isEditorOpened()))return void C.openEditor("",a);switch(g=a.shiftKey?n.setRangeEnd:n.setRangeStart,a.keyCode){case d.A:!C.isEditorOpened()&&c&&(n.selectAll(),a.preventDefault(),p(a));break;case d.ARROW_UP:C.isEditorOpened()&&!b.isWaiting()&&C.closeEditorAndSaveChanges(c),r(a.shiftKey),a.preventDefault(),p(a);break;case d.ARROW_DOWN:C.isEditorOpened()&&!b.isWaiting()&&C.closeEditorAndSaveChanges(c),i(a.shiftKey),a.preventDefault(),p(a);break;case d.ARROW_RIGHT:C.isEditorOpened()&&!b.isWaiting()&&C.closeEditorAndSaveChanges(c),s(a.shiftKey),a.preventDefault(),p(a);break;case d.ARROW_LEFT:C.isEditorOpened()&&!b.isWaiting()&&C.closeEditorAndSaveChanges(c),l(a.shiftKey),a.preventDefault(),p(a);break;case d.TAB:var v="function"==typeof t.settings.tabMoves?t.settings.tabMoves(a):t.settings.tabMoves;a.shiftKey?n.transformStart(-v.row,-v.col):n.transformStart(v.row,v.col,!0),a.preventDefault(),p(a);break;case d.BACKSPACE:case d.DELETE:n.empty(a),C.prepareEditor(),a.preventDefault();break;case d.F2:C.openEditor(null,a),b&&b.enableFullEditMode(),a.preventDefault();break;case d.ENTER:C.isEditorOpened()?(b&&b.state!==Handsontable.EditorState.WAITING&&C.closeEditorAndSaveChanges(c),o(a.shiftKey)):e.getSettings().enterBeginsEditing?(C.openEditor(null,a),b&&b.enableFullEditMode()):o(a.shiftKey),a.preventDefault(),m(a);break;case d.ESCAPE:C.isEditorOpened()&&C.closeEditorAndRestoreOriginalValue(c),a.preventDefault();break;case d.HOME:g(a.ctrlKey||a.metaKey?new u(0,t.selRange.from.col):new u(t.selRange.from.row,0)),a.preventDefault(),p(a);break;case d.END:g(a.ctrlKey||a.metaKey?new u(e.countRows()-1,t.selRange.from.col):new u(t.selRange.from.row,e.countCols()-1)),a.preventDefault(),p(a);break;case d.PAGE_UP:n.transformStart(-e.countVisibleRows(),0),a.preventDefault(),p(a);break;case d.PAGE_DOWN:n.transformStart(e.countVisibleRows(),0),a.preventDefault(),p(a)}}}function c(){function t(e,t,n){"TD"==n.nodeName&&(C.openEditor(),b&&b.enableFullEditMode())}e.addHook("afterDocumentKeyDown",a),g.addEventListener(document.documentElement,"keydown",function(t){e.runHooks("afterDocumentKeyDown",t)}),e.view.wt.update("onCellDblClick",t),e.addHook("afterDestroy",function(){y=!0})}var g,b,C=this,y=!1;g=v(e),this.destroyEditor=function(e){this.closeEditor(e)},this.getActiveEditor=function(){return b},this.prepareEditor=function(){var n,o,r,i,s,l,a;return b&&b.isWaiting()?void this.closeEditor(!1,!1,function(e){e&&C.prepareEditor()}):(n=t.selRange.highlight.row,o=t.selRange.highlight.col,r=e.colToProp(o),i=e.getCell(n,o),s=e.getDataAtCell(n,o),l=e.getCellMeta(n,o),a=e.getCellEditor(l),void(a?(b=Handsontable.editors.getEditor(a,e),b.prepare(n,o,r,i,s,l)):b=void 0))},this.isEditorOpened=function(){return b&&b.isOpened()},this.openEditor=function(e,t){b&&!b.cellProperties.readOnly?b.beginEditing(e,t):b&&b.cellProperties.readOnly&&t&&t.keyCode===d.ENTER&&o()},this.closeEditor=function(e,t,n){b?b.finishEditing(e,t,n):n&&n(!1)},this.closeEditorAndSaveChanges=function(e){return this.closeEditor(!1,e)},this.closeEditorAndRestoreOriginalValue=function(e){return this.closeEditor(!0,e)},c()}Object.defineProperties(n,{EditorManager:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a,u=(r=e("3rdparty/walkontable/src/cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords,c=(i=e("helpers/unicode"),i&&i.__esModule&&i||{"default":i}),d=c.KEY_CODES,h=c.isMetaKey,f=c.isCtrlKey,g=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=g.stopPropagation,m=g.stopImmediatePropagation,w=g.isImmediatePropagationStopped,v=((l=e("editors"),l&&l.__esModule&&l||{"default":l}).getEditor,(a=e("eventManager"),a&&a.__esModule&&a||{"default":a}).eventManager);Handsontable.EditorManager=o},{"3rdparty/walkontable/src/cell/coords":5,editors:29,eventManager:41,"helpers/dom/event":46,"helpers/unicode":53}],29:[function(e,t,n){"use strict";function o(e){var t,n;n={},t=e,this.getConstructor=function(){return e},this.getInstance=function(e){return e.guid in n||(n[e.guid]=new t(e)),n[e.guid]}}function r(e,t){var n=new o(t);"string"==typeof e&&(c[e]=n,Handsontable.editors[u(e)+"Editor"]=t),d.set(t,n)}function i(e,t){var n;if("function"==typeof e)d.get(e)||r(null,e),n=d.get(e);else{if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter ');n=c[e]}if(!n)throw Error('No editor registered under name "'+e+'"');return n.getInstance(t)}function s(e){var t;if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter ');if(t=c[e],!t)throw Error('No editor registered under name "'+e+'"');return t.getConstructor()}function l(e){return c[e]?!0:!1}Object.defineProperties(n,{registerEditor:{get:function(){return r}},getEditor:{get:function(){return i}},hasEditor:{get:function(){return l}},getEditorConstructor:{get:function(){return s}},__esModule:{value:!0}});var a,u=(a=e("helpers/string"),a&&a.__esModule&&a||{"default":a}).toUpperCaseFirst,c={},d=new WeakMap;Handsontable.editors=Handsontable.editors||{},Handsontable.editors.registerEditor=r,Handsontable.editors.getEditor=i},{"helpers/string":52}],30:[function(e,t,n){"use strict";function o(e){this.instance=e,this.state=Handsontable.EditorState.VIRGIN,this._opened=!1,this._fullEditMode=!1,this._closeCallback=null,this.init()}Object.defineProperties(n,{BaseEditor:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/mixed"),r&&r.__esModule&&r||{"default":r}).stringify,l=(i=e("3rdparty/walkontable/src/cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords;Handsontable.editors=Handsontable.editors||{},Handsontable.editors.BaseEditor=o,Handsontable.EditorState={VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"},o.prototype._fireCallbacks=function(e){this._closeCallback&&(this._closeCallback(e),this._closeCallback=null)},o.prototype.init=function(){},o.prototype.getValue=function(){throw Error("Editor getValue() method unimplemented")},o.prototype.setValue=function(e){throw Error("Editor setValue() method unimplemented")},o.prototype.open=function(){throw Error("Editor open() method unimplemented")},o.prototype.close=function(){throw Error("Editor close() method unimplemented")},o.prototype.prepare=function(e,t,n,o,r,i){this.TD=o,this.row=e,this.col=t,this.prop=n,this.originalValue=r,this.cellProperties=i,this.instance.view.isMouseDown()&&document.activeElement&&document.activeElement!==document.body?document.activeElement.blur():document.activeElement||document.body.focus(),this.state=Handsontable.EditorState.VIRGIN},o.prototype.extend=function(){function e(){n.apply(this,arguments)}function t(e,t){function n(){}return n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e}var n=this.constructor;return t(e,n)},o.prototype.saveValue=function(e,t){var n,o;t?(n=this.instance.getSelected(),n[0]>n[2]&&(o=n[0],n[0]=n[2],n[2]=o),n[1]>n[3]&&(o=n[1],n[1]=n[3],n[3]=o),this.instance.populateFromArray(n[0],n[1],e,n[2],n[3],"edit")):this.instance.populateFromArray(this.row,this.col,e,null,null,"edit")},o.prototype.beginEditing=function(e,t){this.state==Handsontable.EditorState.VIRGIN&&(this.instance.view.scrollViewport(new l(this.row,this.col)),this.instance.view.render(),this.state=Handsontable.EditorState.EDITING,e="string"==typeof e?e:this.originalValue,this.setValue(s(e)),this.open(t),this._opened=!0,this.focus(),this.instance.view.render())},o.prototype.finishEditing=function(e,t,n){var o,r=this;if(n){var i=this._closeCallback;this._closeCallback=function(e){i&&i(e),n(e)}}if(!this.isWaiting()){if(this.state==Handsontable.EditorState.VIRGIN)return void this.instance._registerTimeout(setTimeout(function(){r._fireCallbacks(!0)},0));if(this.state==Handsontable.EditorState.EDITING){if(e)return this.cancelChanges(),void this.instance.view.render();o=this.instance.getSettings().trimWhitespace?[["string"==typeof this.getValue()?String.prototype.trim.call(this.getValue()||""):this.getValue()]]:[[this.getValue()]],this.state=Handsontable.EditorState.WAITING,this.saveValue(o,t),this.instance.getCellValidator(this.cellProperties)?this.instance.addHookOnce("postAfterValidate",function(e){r.state=Handsontable.EditorState.FINISHED,r.discardEditor(e)}):(this.state=Handsontable.EditorState.FINISHED,this.discardEditor(!0))}}},o.prototype.cancelChanges=function(){this.state=Handsontable.EditorState.FINISHED,this.discardEditor()},o.prototype.discardEditor=function(e){this.state===Handsontable.EditorState.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.instance.selectCell(this.row,this.col),this.focus(),this.state=Handsontable.EditorState.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=Handsontable.EditorState.VIRGIN,this._fireCallbacks(!0)))},o.prototype.enableFullEditMode=function(){this._fullEditMode=!0},o.prototype.isInFullEditMode=function(){return this._fullEditMode},o.prototype.isOpened=function(){return this._opened},o.prototype.isWaiting=function(){return this.state===Handsontable.EditorState.WAITING},o.prototype.checkEditorSection=function(){var e=this.instance.countRows(),t="";return this.row=e-this.instance.getSettings().fixedRowsBottom?t=this.col"+l+"")))},autoColumnSize:!0,modifyColWidth:function(e,t){var o=this.getPlugin("autoColumnSize").widths;return o[t]&&(e=o[t]),n?e:e+15}}),this.htEditor.view.wt.wtTable.holder.parentNode.style["padding-right"]=v()+2+"px",O&&(O=!1),t.instance._registerTimeout(setTimeout(function(){t.queryChoices(t.TEXTAREA.value)},0))},T.prototype.close=function(){S.prototype.close.apply(this,arguments)},T.prototype.queryChoices=function(e){if(this.query=e,"function"==typeof this.cellProperties.source){var t=this;this.cellProperties.source(e,function(e){t.updateChoicesList(e)})}else if(Array.isArray(this.cellProperties.source)){var n;if(e&&this.cellProperties.filter!==!1){var o=this.cellProperties.filteringCaseSensitive===!0,r=e.toLowerCase();n=this.cellProperties.source.filter(function(t){return o?-1!=t.indexOf(e):-1!=t.toLowerCase().indexOf(r)})}else n=this.cellProperties.source;this.updateChoicesList(n)}else this.updateChoicesList([])},T.prototype.updateChoicesList=function(e){var t,n=w(this.TEXTAREA),o=b(this.TEXTAREA),r=T.sortByRelevance(this.getValue(),e,this.cellProperties.filteringCaseSensitive);if(0==this.cellProperties.filter)t=r[0];else{for(var i=[],s=0,l=r.length;l>s;s++)i.push(e[r[s]]);t=0,e=i}this.choices=e,this.htEditor.loadData(g([e])),this.updateDropdownHeight(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(t),this.instance.listen(),this.TEXTAREA.focus(),y(this.TEXTAREA,n,n==o?void 0:o)},T.prototype.updateDropdownHeight=function(){var e=this.htEditor.getColWidth(0)+v()+2,t=void 0===this.cellProperties.trimDropdown?!0:this.cellProperties.trimDropdown;this.htEditor.updateSettings({height:this.getDropdownHeight(),width:t?void 0:e}),this.htEditor.view.wt.wtTable.alignOverlaysWithTrimmingContainer()},T.prototype.finishEditing=function(e){e||this.instance.removeHook("beforeKeyDown",o),S.prototype.finishEditing.apply(this,arguments)},T.prototype.highlightBestMatchingChoice=function(e){"number"==typeof e?this.htEditor.selectCell(e,0):this.htEditor.deselectCell()},T.sortByRelevance=function(e,t,n){var o,r,i,s,l,a=[],u=e.length,c=[];if(0===u){for(s=0,l=t.length;l>s;s++)c.push(s);return c}for(s=0,l=t.length;l>s;s++)o=f(t[s]),r=n?o.indexOf(e):o.toLowerCase().indexOf(e.toLowerCase()),-1!=r&&(i=o.length-r-u,a.push({baseIndex:s,index:r,charsLeft:i,value:o}));for(a.sort(function(e,t){return-1===t.index?-1:-1===e.index?1:e.indext.charsLeft?1:0:void 0}),s=0,l=a.length;l>s;s++)c.push(a[s].baseIndex);return c},T.prototype.getDropdownHeight=function(){var e=this.htEditor.getInstance().getRowHeight(0)||23,t=this.cellProperties.visibleRows;return this.choices.length>=t?t*e:this.choices.length*e+8},T.prototype.allowKeyEventPropagation=function(e){var t={row:this.htEditor.getSelectedRange()?this.htEditor.getSelectedRange().from.row:-1},n=!1;return e===d.ARROW_DOWN&&t.row-1&&(n=!0),n},E("autocomplete",T)},{editors:29,handsontableEditor:35,"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/unicode":53}],32:[function(e,t,n){"use strict";Object.defineProperties(n,{CheckboxEditor:{get:function(){return u}},__esModule:{value:!0}});var o,r,i,s=(o=e("editors"),o&&o.__esModule&&o||{"default":o}).registerEditor,l=(r=e("_baseEditor"),r&&r.__esModule&&r||{"default":r}).BaseEditor,a=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).hasClass,u=function(){$traceurRuntime.superConstructor(c).apply(this,arguments)},c=u;$traceurRuntime.createClass(u,{beginEditing:function(){var e=this.TD.querySelector('input[type="checkbox"]');a(e,"htBadValue")||e.click()},finishEditing:function(){},init:function(){},open:function(){},close:function(){},getValue:function(){},setValue:function(){},focus:function(){}},{},l),s("checkbox",u)},{_baseEditor:30,editors:29,"helpers/dom/element":45}],33:[function(e,t,n){"use strict";Object.defineProperties(n,{DateEditor:{get:function(){return S}},__esModule:{value:!0}});var o,r,i,s,l,a,u,c,d,h=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),f=h.addClass,g=h.outerHeight,p=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).deepExtend,m=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,w=(s=e("editors"),s&&s.__esModule&&s||{"default":s}),v=(w.getEditor,w.registerEditor),b=(l=e("helpers/unicode"),l&&l.__esModule&&l||{"default":l}).isMetaKey,C=(a=e("helpers/dom/event"),a&&a.__esModule&&a||{"default":a}).stopPropagation,y=(u=e("textEditor"),u&&u.__esModule&&u||{"default":u}).TextEditor,R=(c=e("moment"),c&&c.__esModule&&c||{"default":c})["default"],E=(d=e("pikaday"),d&&d.__esModule&&d||{"default":d})["default"];Handsontable.editors=Handsontable.editors||{},Handsontable.editors.DateEditor=S;var S=function(e){this.$datePicker=null,this.datePicker=null,this.datePickerStyle=null,this.defaultDateFormat="DD/MM/YYYY",this.isCellEdited=!1,this.parentDestroyed=!1,$traceurRuntime.superConstructor(T).call(this,e)},T=S;$traceurRuntime.createClass(S,{init:function(){var e=this;if("function"!=typeof R)throw new Error("You need to include moment.js to your project.");if("function"!=typeof E)throw new Error("You need to include Pikaday to your project.");$traceurRuntime.superGet(this,T.prototype,"init").call(this),this.instance.addHook("afterDestroy",function(){e.parentDestroyed=!0,e.destroyElements()})},createElements:function(){$traceurRuntime.superGet(this,T.prototype,"createElements").call(this),this.datePicker=document.createElement("DIV"),this.datePickerStyle=this.datePicker.style,this.datePickerStyle.position="absolute",this.datePickerStyle.top=0,this.datePickerStyle.left=0,this.datePickerStyle.zIndex=9999,f(this.datePicker,"htDatepickerHolder"),document.body.appendChild(this.datePicker),this.$datePicker=new E(this.getDatePickerConfig());var e=new m(this);e.addEventListener(this.datePicker,"mousedown",function(e){return C(e)}),this.hideDatepicker()},destroyElements:function(){this.$datePicker.destroy()},prepare:function(e,t,n,o,r,i){this._opened=!1,$traceurRuntime.superGet(this,T.prototype,"prepare").call(this,e,t,n,o,r,i)},open:function(){var e=void 0!==arguments[0]?arguments[0]:null;$traceurRuntime.superGet(this,T.prototype,"open").call(this),this.showDatepicker(e)},close:function(){var e=this;this._opened=!1,this.instance._registerTimeout(setTimeout(function(){e.instance.selection.refreshBorders()},0)),$traceurRuntime.superGet(this,T.prototype,"close").call(this)},finishEditing:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=void 0!==arguments[1]?arguments[1]:!1;if(e){var n=this.originalValue;void 0!==n&&this.setValue(n)}this.hideDatepicker(),$traceurRuntime.superGet(this,T.prototype,"finishEditing").call(this,e,t)},showDatepicker:function(e){this.$datePicker.config(this.getDatePickerConfig());var t,n=this.TD.getBoundingClientRect(),o=this.cellProperties.dateFormat||this.defaultDateFormat,r=this.$datePicker.config(),i=this.instance.view.isMouseDown(),s=e?b(e.keyCode):!1;this.datePickerStyle.top=window.pageYOffset+n.top+g(this.TD)+"px",this.datePickerStyle.left=window.pageXOffset+n.left+"px",this.$datePicker._onInputFocus=function(){},r.format=o,this.originalValue?(t=this.originalValue,R(t,o,!0).isValid()&&this.$datePicker.setMoment(R(t,o),!0),s||i||this.setValue("")):this.cellProperties.defaultDate?(t=this.cellProperties.defaultDate,r.defaultDate=t,R(t,o,!0).isValid()&&this.$datePicker.setMoment(R(t,o),!0),s||i||this.setValue("")):this.$datePicker.gotoToday(),this.datePickerStyle.display="block",this.$datePicker.show()},hideDatepicker:function(){this.datePickerStyle.display="none",this.$datePicker.hide()},getDatePickerConfig:function(){var e=this,t=this.TEXTAREA,n={};this.cellProperties&&this.cellProperties.datePickerConfig&&p(n,this.cellProperties.datePickerConfig);var o=n.onSelect,r=n.onClose;return n.field=t,n.trigger=t,n.container=this.datePicker,n.bound=!1,n.format=n.format||this.defaultDateFormat,n.reposition=n.reposition||!1,n.onSelect=function(t){isNaN(t.getTime())||(t=R(t).format(e.cellProperties.dateFormat||e.defaultDateFormat)),e.setValue(t),e.hideDatepicker(),o&&o()},n.onClose=function(){e.parentDestroyed||e.finishEditing(!1),r&&r()},n}},{},y),v("date",S)},{editors:29,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,moment:void 0,pikaday:void 0,textEditor:40}],34:[function(e,t,n){"use strict";Object.defineProperties(n,{DropdownEditor:{get:function(){return a}},__esModule:{value:!0}});var o,r,i=(o=e("editors"),o&&o.__esModule&&o||{"default":o}),s=(i.getEditor,i.registerEditor),l=(r=e("autocompleteEditor"),r&&r.__esModule&&r||{"default":r}).AutocompleteEditor,a=function(){$traceurRuntime.superConstructor(u).apply(this,arguments)},u=a;$traceurRuntime.createClass(a,{prepare:function(e,t,n,o,r,i){$traceurRuntime.superGet(this,u.prototype,"prepare").call(this,e,t,n,o,r,i),this.cellProperties.filter=!1,this.cellProperties.strict=!0}},{},l),Handsontable.hooks.add("beforeValidate",function(e,t,n,o){var r=this.getCellMeta(t,n);r.editor===Handsontable.editors.DropdownEditor&&void 0===r.strict&&(r.filter=!1,r.strict=!0)}),s("dropdown",a)},{autocompleteEditor:31,editors:29}],35:[function(e,t,n){"use strict";Object.defineProperties(n,{HandsontableEditor:{get:function(){return v}},__esModule:{value:!0}});var o,r,i,s,l,a,u=(o=e("helpers/unicode"),o&&o.__esModule&&o||{"default":o}).KEY_CODES,c=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).extend,d=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).setCaretPosition,h=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),f=h.stopImmediatePropagation,g=h.isImmediatePropagationStopped,p=(l=e("editors"),l&&l.__esModule&&l||{"default":l}),m=(p.getEditor,p.registerEditor),w=(a=e("textEditor"),a&&a.__esModule&&a||{"default":a}).TextEditor,v=w.prototype.extend();v.prototype.createElements=function(){w.prototype.createElements.apply(this,arguments);var e=document.createElement("DIV");e.className="handsontableEditor",this.TEXTAREA_PARENT.appendChild(e),this.htContainer=e,this.assignHooks()},v.prototype.prepare=function(e,t,n,o,r,i){w.prototype.prepare.apply(this,arguments);var s=this,l={startRows:0,startCols:0,minRows:0,minCols:0,className:"listbox",copyPaste:!1,autoColumnSize:!1,autoRowSize:!1,readOnly:!0,fillHandle:!1,afterOnCellMouseDown:function(){var e=this.getValue();void 0!==e&&s.setValue(e),s.instance.destroyEditor()}};this.cellProperties.handsontable&&c(l,i.handsontable),this.htOptions=l};var b=function(e){if(!g(e)){var t,n=this.getActiveEditor(),o=n.htEditor.getInstance();if(e.keyCode==u.ARROW_DOWN)if(o.getSelected()){var r=o.getSelected()[0],i=o.countRows()-1;t=Math.min(i,r+1)}else t=0;else if(e.keyCode==u.ARROW_UP&&o.getSelected()){var r=o.getSelected()[0];t=r-1}void 0!==t&&(0>t?o.deselectCell():o.selectCell(t,0),o.getData().length&&(e.preventDefault(),f(e),n.instance.listen(),n.TEXTAREA.focus()))}};v.prototype.open=function(){this.instance.addHook("beforeKeyDown",b),w.prototype.open.apply(this,arguments),this.htEditor&&this.htEditor.destroy(),this.htEditor=new Handsontable(this.htContainer,this.htOptions),this.cellProperties.strict?(this.htEditor.selectCell(0,0),this.TEXTAREA.style.visibility="hidden"):(this.htEditor.deselectCell(),this.TEXTAREA.style.visibility="visible"),d(this.TEXTAREA,0,this.TEXTAREA.value.length)},v.prototype.close=function(){this.instance.removeHook("beforeKeyDown",b),this.instance.listen(),w.prototype.close.apply(this,arguments)},v.prototype.focus=function(){this.instance.listen(),w.prototype.focus.apply(this,arguments)},v.prototype.beginEditing=function(e){var t=this.instance.getSettings().onBeginEditing;t&&t()===!1||w.prototype.beginEditing.apply(this,arguments)},v.prototype.finishEditing=function(e,t){if(this.htEditor&&this.htEditor.isListening()&&this.instance.listen(),this.htEditor&&this.htEditor.getSelected()){var n=this.htEditor.getInstance().getValue();void 0!==n&&this.setValue(n)}return w.prototype.finishEditing.apply(this,arguments)},v.prototype.assignHooks=function(){var e=this;this.instance.addHook("afterDestroy",function(){e.htEditor&&e.htEditor.destroy()})},m("handsontable",v)},{editors:29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,textEditor:40}],36:[function(e,t,n){"use strict";Object.defineProperties(n,{MobileTextEditor:{get:function(){return M}},__esModule:{value:!0}});var o,r,i,s,l,a,u=(o=e("helpers/unicode"),o&&o.__esModule&&o||{"default":o}).KEY_CODES,c=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}),d=c.stopImmediatePropagation,h=c.isImmediatePropagationStopped,f=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{ -"default":i}),g=f.addClass,p=f.getScrollLeft,m=f.getScrollTop,w=f.hasClass,v=f.isChildOf,b=f.offset,C=f.outerHeight,y=f.outerWidth,R=f.removeClass,E=f.setCaretPosition,S=(s=e("editors"),s&&s.__esModule&&s||{"default":s}),T=(S.getEditor,S.registerEditor),O=(l=e("_baseEditor"),l&&l.__esModule&&l||{"default":l}).BaseEditor,_=(a=e("eventManager"),a&&a.__esModule&&a||{"default":a}).eventManager,M=O.prototype.extend(),H={},k=function(){this.controls={},this.controls.leftButton=document.createElement("DIV"),this.controls.leftButton.className="leftButton",this.controls.rightButton=document.createElement("DIV"),this.controls.rightButton.className="rightButton",this.controls.upButton=document.createElement("DIV"),this.controls.upButton.className="upButton",this.controls.downButton=document.createElement("DIV"),this.controls.downButton.className="downButton";for(var e in this.controls)this.controls.hasOwnProperty(e)&&this.positionControls.appendChild(this.controls[e])};M.prototype.valueChanged=function(){return this.initValue!=this.getValue()},M.prototype.init=function(){var e=this;this.eventManager=_(this.instance),this.createElements(),this.bindEvents(),this.instance.addHook("afterDestroy",function(){e.destroy()})},M.prototype.getValue=function(){return this.TEXTAREA.value},M.prototype.setValue=function(e){this.initValue=e,this.TEXTAREA.value=e},M.prototype.createElements=function(){this.editorContainer=document.createElement("DIV"),this.editorContainer.className="htMobileEditorContainer",this.cellPointer=document.createElement("DIV"),this.cellPointer.className="cellPointer",this.moveHandle=document.createElement("DIV"),this.moveHandle.className="moveHandle",this.inputPane=document.createElement("DIV"),this.inputPane.className="inputs",this.positionControls=document.createElement("DIV"),this.positionControls.className="positionControls",this.TEXTAREA=document.createElement("TEXTAREA"),g(this.TEXTAREA,"handsontableInput"),this.inputPane.appendChild(this.TEXTAREA),this.editorContainer.appendChild(this.cellPointer),this.editorContainer.appendChild(this.moveHandle),this.editorContainer.appendChild(this.inputPane),this.editorContainer.appendChild(this.positionControls),k.call(this),document.body.appendChild(this.editorContainer)},M.prototype.onBeforeKeyDown=function(e){var t=this,n=t.getActiveEditor();if(e.target===n.TEXTAREA&&!h(e))switch(e.keyCode){case u.ENTER:n.close(),e.preventDefault();break;case u.BACKSPACE:d(e)}},M.prototype.open=function(){this.instance.addHook("beforeKeyDown",this.onBeforeKeyDown),g(this.editorContainer,"active"),R(this.cellPointer,"hidden"),this.updateEditorPosition()},M.prototype.focus=function(){this.TEXTAREA.focus(),E(this.TEXTAREA,this.TEXTAREA.value.length)},M.prototype.close=function(){this.TEXTAREA.blur(),this.instance.removeHook("beforeKeyDown",this.onBeforeKeyDown),R(this.editorContainer,"active")},M.prototype.scrollToView=function(){var e=this.instance.getSelectedRange().highlight;this.instance.view.scrollViewport(e)},M.prototype.hideCellPointer=function(){w(this.cellPointer,"hidden")||g(this.cellPointer,"hidden")},M.prototype.updateEditorPosition=function(e,t){if(e&&t)e=parseInt(e,10),t=parseInt(t,10),this.editorContainer.style.top=t+"px",this.editorContainer.style.left=e+"px";else{var n=this.instance.getSelected(),o=this.instance.getCell(n[0],n[1]);if(H.cellPointer||(H.cellPointer={height:C(this.cellPointer),width:y(this.cellPointer)}),H.editorContainer||(H.editorContainer={width:y(this.editorContainer)}),void 0!==o){var r=this.instance.view.wt.wtOverlays.leftOverlay.trimmingContainer==window?0:p(this.instance.view.wt.wtOverlays.leftOverlay.holder),i=this.instance.view.wt.wtOverlays.topOverlay.trimmingContainer==window?0:m(this.instance.view.wt.wtOverlays.topOverlay.holder),s=b(o),l=y(o),a={x:r,y:i};this.editorContainer.style.top=parseInt(s.top+C(o)-a.y+H.cellPointer.height,10)+"px",this.editorContainer.style.left=parseInt(window.innerWidth/2-H.editorContainer.width/2,10)+"px",s.left+l/2>parseInt(this.editorContainer.style.left,10)+H.editorContainer.width?this.editorContainer.style.left=window.innerWidth-H.editorContainer.width+"px":s.left+l/2n;n++)t[e[n]]=e[n];else"object"==typeof e&&(t=e);return t},S.prototype.getValue=function(){return this.select.value},S.prototype.setValue=function(e){this.select.value=e};var T=function(e){var t=this,n=t.getActiveEditor();switch(e.keyCode){case C.ARROW_UP:var o=n.select.selectedIndex-1;o>=0&&(n.select[o].selected=!0),b(e),e.preventDefault();break;case C.ARROW_DOWN:var r=n.select.selectedIndex+1;r<=n.select.length-1&&(n.select[r].selected=!0),b(e),e.preventDefault()}};S.prototype.open=function(){this._opened=!0,this.refreshDimensions(),this.select.style.display="",this.instance.addHook("beforeKeyDown",T)},S.prototype.close=function(){this._opened=!1,this.select.style.display="none",this.instance.removeHook("beforeKeyDown",T)},S.prototype.focus=function(){this.select.focus()},S.prototype.refreshDimensions=function(){if(this.state===Handsontable.EditorState.EDITING){if(this.TD=this.getEditedCell(),!this.TD)return void this.close();var e,t=w(this.TD)+1,n=m(this.TD)+1,o=p(this.TD),r=p(this.instance.rootElement),i=g(this.TD),s=o.top-r.top-1-(i.scrollTop||0),l=o.left-r.left-1-(i.scrollLeft||0),a=this.checkEditorSection(),u=this.instance.getSettings();u.rowHeaders?1:0,u.colHeaders?1:0;switch(a){case"top":e=f(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":e=f(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":e=f(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":e=f(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":e=f(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}0===this.instance.getSelected()[0]&&(s+=1),0===this.instance.getSelected()[1]&&(l+=1);var c=this.select.style;e&&-1!=e?c[e[0]]=e[1]:v(this.select);var d=h(this.TD);parseInt(d.borderTopWidth,10)>0&&(n-=1),parseInt(d.borderLeftWidth,10)>0&&(t-=1),c.height=n+"px",c.minWidth=t+"px",c.top=s+"px",c.left=l+"px",c.margin="0px"}},S.prototype.getEditedCell=function(){var e,t=this.checkEditorSection();switch(t){case"top":e=this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=101;break;case"corner":e=this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=103;break;case"left":e=this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=102;break;default:e=this.instance.getCell(this.row,this.col),this.select.style.zIndex=""}return-1!=e&&-2!=e?e:void 0},R("select",S)},{_baseEditor:30,editors:29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],40:[function(e,t,n){"use strict";Object.defineProperties(n,{TextEditor:{get:function(){return k}},__esModule:{value:!0}});var o,r,i,s,l,a,u,c=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),d=c.addClass,h=c.getCaretPosition,f=c.getComputedStyle,g=c.getCssTransform,p=c.getScrollableElement,m=c.innerWidth,w=c.offset,v=c.resetCssTransform,b=c.setCaretPosition,C=(r=e("autoResize"),r&&r.__esModule&&r||{"default":r})["default"],y=(i=e("_baseEditor"),i&&i.__esModule&&i||{"default":i}).BaseEditor,R=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).eventManager,E=(l=e("editors"),l&&l.__esModule&&l||{"default":l}),S=(E.getEditor,E.registerEditor),T=(a=e("helpers/unicode"),a&&a.__esModule&&a||{"default":a}).KEY_CODES,O=(u=e("helpers/dom/event"),u&&u.__esModule&&u||{"default":u}),_=O.stopPropagation,M=O.stopImmediatePropagation,H=O.isImmediatePropagationStopped,k=y.prototype.extend();k.prototype.init=function(){var e=this;this.createElements(),this.eventManager=R(this),this.bindEvents(),this.autoResize=C(),this.instance.addHook("afterDestroy",function(){e.destroy()})},k.prototype.getValue=function(){return this.TEXTAREA.value},k.prototype.setValue=function(e){this.TEXTAREA.value=e};var A=function(e){var t,n=this,o=n.getActiveEditor();if(t=(e.ctrlKey||e.metaKey)&&!e.altKey,e.target===o.TEXTAREA&&!H(e)){if(17===e.keyCode||224===e.keyCode||91===e.keyCode||93===e.keyCode)return void M(e);switch(e.keyCode){case T.ARROW_RIGHT:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&M(e);break;case T.ARROW_LEFT:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&M(e);break;case T.ARROW_UP:case T.ARROW_DOWN:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&M(e);break;case T.ENTER:var r=o.instance.getSelected(),i=!(r[0]===r[2]&&r[1]===r[3]);if(t&&!i||e.altKey){if(o.isOpened()){var s=h(o.TEXTAREA),l=o.getValue(),a=l.slice(0,s)+"\n"+l.slice(s);o.setValue(a),b(o.TEXTAREA,s+1)}else o.beginEditing(o.originalValue+"\n");M(e)}e.preventDefault();break;case T.A:case T.X:case T.C:case T.V:t&&M(e);break;case T.BACKSPACE:case T.DELETE:case T.HOME:case T.END:M(e)}-1===[T.ARROW_UP,T.ARROW_RIGHT,T.ARROW_DOWN,T.ARROW_LEFT].indexOf(e.keyCode)&&o.autoResize.resize(String.fromCharCode(e.keyCode))}};k.prototype.open=function(){this.refreshDimensions(),this.instance.addHook("beforeKeyDown",A)},k.prototype.close=function(e){this.textareaParentStyle.display="none",this.autoResize.unObserve(),document.activeElement===this.TEXTAREA&&this.instance.listen(),this.instance.removeHook("beforeKeyDown",A)},k.prototype.focus=function(){this.TEXTAREA.focus(),b(this.TEXTAREA,this.TEXTAREA.value.length)},k.prototype.createElements=function(){this.TEXTAREA=document.createElement("TEXTAREA"),d(this.TEXTAREA,"handsontableInput"),this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,this.TEXTAREA_PARENT=document.createElement("DIV"),d(this.TEXTAREA_PARENT,"handsontableInputHolder"),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.textareaParentStyle.top=0,this.textareaParentStyle.left=0,this.textareaParentStyle.display="none",this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.instance.rootElement.appendChild(this.TEXTAREA_PARENT);var e=this;this.instance._registerTimeout(setTimeout(function(){e.refreshDimensions()},0))},k.prototype.getEditedCell=function(){var e,t=this.checkEditorSection();switch(t){case"top":e=this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=101;break;case"top-left-corner":e=this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=103;break;case"bottom-left-corner":e=this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=103;break;case"left":e=this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=102;break;case"bottom":e=this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=102;break;default:e=this.instance.getCell(this.row,this.col),this.textareaParentStyle.zIndex=""}return-1!=e&&-2!=e?e:void 0},k.prototype.refreshDimensions=function(){if(this.state===Handsontable.EditorState.EDITING){if(this.TD=this.getEditedCell(),!this.TD)return void this.close(!0);var e,t=w(this.TD),n=w(this.instance.rootElement),o=p(this.TD),r=this.instance.countRows(),i=t.top-n.top-1-(o.scrollTop||0),s=t.left-n.left-1-(o.scrollLeft||0),l=this.instance.getSettings(),a=(l.rowHeaders?1:0,l.colHeaders?1:0),u=this.checkEditorSection(),c=this.TD.style.backgroundColor;switch(u){case"top":e=g(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":e=g(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":e=g(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":e=g(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":e=g(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}(a&&0===this.instance.getSelected()[0]||l.fixedRowsBottom&&this.instance.getSelected()[0]===r-l.fixedRowsBottom)&&(i+=1),0===this.instance.getSelected()[1]&&(s+=1),e&&-1!=e?this.textareaParentStyle[e[0]]=e[1]:v(this.textareaParentStyle),this.textareaParentStyle.top=i+"px",this.textareaParentStyle.left=s+"px";var d=this.TD.offsetTop-this.instance.view.wt.wtOverlays.topOverlay.getScrollPosition(),h=this.TD.offsetLeft-this.instance.view.wt.wtOverlays.leftOverlay.getScrollPosition(),b=m(this.TD)-8,C=this.instance.view.maximumVisibleElementWidth(h)-9,y=this.TD.scrollHeight+1,R=Math.max(this.instance.view.maximumVisibleElementHeight(d)-2,23),E=f(this.TD);this.TEXTAREA.style.fontSize=E.fontSize,this.TEXTAREA.style.fontFamily=E.fontFamily,this.TEXTAREA.style.backgroundColor="",this.TEXTAREA.style.backgroundColor=c?c:f(this.TEXTAREA).backgroundColor,this.autoResize.init(this.TEXTAREA,{minHeight:Math.min(y,R),maxHeight:R,minWidth:Math.min(b,C),maxWidth:C},!0),this.textareaParentStyle.display="block"}},k.prototype.bindEvents=function(){var e=this;this.eventManager.addEventListener(this.TEXTAREA,"cut",function(e){_(e)}),this.eventManager.addEventListener(this.TEXTAREA,"paste",function(e){_(e)}),this.instance.addHook("afterScrollHorizontally",function(){e.refreshDimensions()}),this.instance.addHook("afterScrollVertically",function(){e.refreshDimensions()}),this.instance.addHook("afterColumnResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterRowResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterDestroy",function(){e.eventManager.destroy()})},k.prototype.destroy=function(){this.eventManager.destroy()},S("text",k)},{_baseEditor:30,autoResize:"autoResize",editors:29,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],41:[function(e,t,n){"use strict";function o(e,t){var n,o,r,i,s,l="HOT-TABLE";if(t.isTargetWebComponent=!1,t.realTarget=t.target,!Handsontable.eventManager.isHotTableEnv)return t;for(t=a(t),s=t.path?t.path.length:0;s--;){if(t.path[s].nodeName===l)n=!0;else if(n&&t.path[s].shadowRoot){i=t.path[s];break}0!==s||i||(i=t.path[s])}return i||(i=t.target),t.isTargetWebComponent=!0,c()?t.realTarget=t.srcElement||t.toElement:(e instanceof Handsontable.Core||e instanceof Walkontable)&&(e instanceof Handsontable.Core?o=e.view?e.view.wt.wtTable.TABLE:null:e instanceof Walkontable&&(o=e.wtTable.TABLE.parentNode.parentNode),r=u(t.target,[l],o),r?t.realTarget=o.querySelector(l)||t.target:t.realTarget=t.target),Object.defineProperty(t,"target",{get:function(){return a(i)},enumerable:!0,configurable:!0}),t}function r(e){return new d(e)}Object.defineProperties(n,{EventManager:{get:function(){return d}},eventManager:{get:function(){return r}},__esModule:{value:!0}});var i,s,l=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),a=l.polymerWrap,u=l.closest,c=(s=e("helpers/browser"),s&&s.__esModule&&s||{"default":s}).isWebComponentSupportedNatively,d=function(){var e=void 0!==arguments[0]?arguments[0]:null;this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])};$traceurRuntime.createClass(d,{addEventListener:function(e,t,n){function r(e){void 0==e.target&&void 0!=e.srcElement&&(e.definePoperty?e.definePoperty("target",{value:e.srcElement}):e.target=e.srcElement),void 0==e.preventDefault&&(e.definePoperty?e.definePoperty("preventDefault",{value:function(){this.returnValue=!1}}):e.preventDefault=function(){this.returnValue=!1}),e=o(s,e),n.call(this,e)}var i=this,s=this.context;return this.context.eventListeners.push({element:e,event:t,callback:n,callbackProxy:r}),window.addEventListener?e.addEventListener(t,r,!1):e.attachEvent("on"+t,r),Handsontable.countEventManagerListeners++,function(){i.removeEventListener(e,t,n)}},removeEventListener:function(e,t,n){for(var o,r=this.context.eventListeners.length;r--;)if(o=this.context.eventListeners[r],o.event==t&&o.element==e){if(n&&n!=o.callback)continue;this.context.eventListeners.splice(r,1),o.element.removeEventListener?o.element.removeEventListener(o.event,o.callbackProxy,!1):o.element.detachEvent("on"+o.event,o.callbackProxy),Handsontable.countEventManagerListeners--}},clearEvents:function(){if(this.context)for(var e=this.context.eventListeners.length;e--;){var t=this.context.eventListeners[e];t&&this.removeEventListener(t.element,t.event,t.callback)}},clear:function(){this.clearEvents()},destroy:function(){this.clearEvents(),this.context=null},fireEvent:function(e,t){var n,o={bubbles:!0,cancelable:"mousemove"!==t,view:window,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:void 0};document.createEvent?(n=document.createEvent("MouseEvents"),n.initMouseEvent(t,o.bubbles,o.cancelable,o.view,o.detail,o.screenX,o.screenY,o.clientX,o.clientY,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,o.button,o.relatedTarget||document.body.parentNode)):n=document.createEventObject(),e.dispatchEvent?e.dispatchEvent(n):e.fireEvent("on"+t,n)}},{}),window.Handsontable=window.Handsontable||{},Handsontable.countEventManagerListeners=0,Handsontable.eventManager=r},{"helpers/browser":43,"helpers/dom/element":45}],42:[function(e,t,n){"use strict";function o(e){for(var t=0,n=e.length;n>t;)e[t]=[e[t]],t++}function r(e,t){for(var n=0,o=t.length;o>n;)e.push(t[n]),n++}function i(e){var t=[];if(!e||0===e.length||!e[0]||0===e[0].length)return t;for(var n=e.length,o=e[0].length,r=0;n>r;r++)for(var i=0;o>i;i++)t[i]||(t[i]=[]),t[i][r]=e[r][i];return t}function s(e,t,n,o){var r=-1,i=e.length;for(o&&i&&(n=e[++r]);++rt?e:t},Array.isArray(e)?e[0]:void 0)}function h(e){return s(e,function(e,t){return t>e?e:t},Array.isArray(e)?e[0]:void 0)}function f(e){return e.length?c(e)/e.length:0}function g(e){return s(e,function(e,t){return e.concat(Array.isArray(t)?g(t):t)},[])}function p(e){var t=[];return u(e,function(e){-1===t.indexOf(e)&&t.push(e)}),t}Object.defineProperties(n,{to2dArray:{get:function(){return o}},extendArray:{get:function(){return r}},pivot:{get:function(){return i}},arrayReduce:{get:function(){return s}},arrayFilter:{get:function(){return l}},arrayMap:{get:function(){return a}},arrayEach:{get:function(){return u}},arraySum:{get:function(){return c}},arrayMax:{get:function(){return d}},arrayMin:{get:function(){return h}},arrayAvg:{get:function(){return f}},arrayFlatten:{get:function(){return g}},arrayUnique:{get:function(){return p}},__esModule:{value:!0}})},{}],43:[function(e,t,n){"use strict";function o(){return f}function r(){return g}function i(){return p}function s(){return m}function l(e){return e||(e=navigator.userAgent),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e)}function a(){return"ontouchstart"in window}function u(){var e=document.createElement("div");return e.createShadowRoot&&e.createShadowRoot.toString().match(/\[native code\]/)?!0:!1}function c(){var e=document.createElement("TABLE");e.style.borderSpacing=0,e.style.borderWidth=0,e.style.padding=0;var t=document.createElement("TBODY");e.appendChild(t),t.appendChild(document.createElement("TR")),t.firstChild.appendChild(document.createElement("TD")),t.firstChild.firstChild.innerHTML="t
t";var n=document.createElement("CAPTION");n.innerHTML="c
c
c
c",n.style.padding=0,n.style.margin=0,e.insertBefore(n,t),document.body.appendChild(e),h=e.offsetHeight<2*e.lastChild.offsetHeight,document.body.removeChild(e)}function d(){return void 0===h&&c(),h}Object.defineProperties(n,{isIE8:{get:function(){return o}},isIE9:{get:function(){return r}},isSafari:{get:function(){return i}},isChrome:{get:function(){return s}},isMobileBrowser:{get:function(){return l}},isTouchSupported:{get:function(){return a}},isWebComponentSupportedNatively:{get:function(){return u}},hasCaptionProblem:{get:function(){return d}},__esModule:{value:!0}});var h,f=!document.createTextNode("test").textContent,g=!!document.documentMode,p=/Safari/.test(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor),m=/Chrome/.test(navigator.userAgent)&&/Google/.test(navigator.vendor)},{}],44:[function(e,t,n){"use strict";function o(e){for(var t,n=e+1,o="";n>0;)t=(n-1)%26,o=String.fromCharCode(65+t)+o,n=parseInt((n-t)/26,10);return o}function r(e,t){e="number"==typeof e?e:100,t="number"==typeof t?t:4;var n,r,i=[];for(n=0;e>n;n++){var s=[];for(r=0;t>r;r++)s.push(o(r)+(n+1));i.push(s)}return i}function i(e,t){e="number"==typeof e?e:100,t="number"==typeof t?t:4;var n,r,i=[];for(n=0;e>n;n++){var s={};for(r=0;t>r;r++)s["prop"+r]=o(r)+(n+1);i.push(s)}return i}function s(e,t){for(var n,o=[],r=0;e>r;r++){n=[];for(var i=0;t>i;i++)n.push("");o.push(n)}return o}function l(e){var t,n,o,r,i=[],s=0;for(t=0,n=e.length;n>t;t++)for(o=0,r=e[t].length;r>o;o++)o==s&&(i.push([]),s++),i[o].push(e[t][o]);return i}function a(e,t){function n(e){var t=Handsontable.cellTypes[e];if("undefined"==typeof t)throw new Error('You declared cell type "'+e+'" as a string that is not mapped to a known object. Cell type must be an object or a string mapped to an object in Handsontable.cellTypes');return t}return t="undefined"==typeof t?!0:t,function(o,r){return function i(o){if(o){if(o.hasOwnProperty(e)&&void 0!==o[e])return o[e];if(o.hasOwnProperty("type")&&o.type){var r;if("string"!=typeof o.type)throw new Error("Cell type must be a string ");if(r=n(o.type),r.hasOwnProperty(e))return r[e];if(t)return}return i(c(o))}}("number"==typeof o?this.getCellMeta(o,r):o)}}Object.defineProperties(n,{spreadsheetColumnLabel:{get:function(){return o}},createSpreadsheetData:{get:function(){return r}},createSpreadsheetObjectData:{get:function(){return i}},createEmptySpreadsheetData:{get:function(){return s}},translateRowsToColumns:{get:function(){return l}},cellMethodLookupFactory:{get:function(){return a}},__esModule:{value:!0}});var u,c=(u=e("object"),u&&u.__esModule&&u||{"default":u}).getPrototypeOf},{object:50}],45:[function(e,t,n){"use strict";function o(e,t,n){for(;null!=e&&e!==n;){if(e.nodeType===Node.ELEMENT_NODE&&(t.indexOf(e.nodeName)>-1||t.indexOf(e)>-1))return e;e=e.host&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.host:e.parentNode}return null}function r(e,t){var n=e.parentNode,o=[];for("string"==typeof t?o=Array.prototype.slice.call(document.querySelectorAll(t),0):o.push(t);null!=n;){if(o.indexOf(n)>-1)return!0;n=n.parentNode}return!1}function i(e){function t(e){return e.nodeType===Node.ELEMENT_NODE&&e.nodeName===o.toUpperCase()}var n,o="hot-table",r=!1;for(n=s(e);null!=n;){if(t(n)){r=!0;break}if(n.host&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(r=t(n.host))break;n=n.host}n=n.parentNode}return r}function s(e){return"undefined"!=typeof Polymer&&"function"==typeof wrap?wrap(e):e}function l(e){return"undefined"!=typeof Polymer&&"function"==typeof unwrap?unwrap(e):e}function a(e){var t=0;if(e.previousSibling)for(;e=e.previousSibling;)++t;return t}function u(e,t){var n=document.querySelector(".ht_clone_"+e);return n?n.contains(t):null}function c(e){var t=0,n=[];if(!e||!e.length)return n;for(;e[t];)n.push(e[t]),t++;return n}function d(e,t){return Y(e,t)}function h(e,t){return X(e,t)}function f(e,t){return q(e,t)}function g(e,t){if(3===e.nodeType)t.removeChild(e);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(e.nodeName)>-1)for(var n=e.childNodes,o=n.length-1;o>=0;o--)g(n[o],e)}function p(e){for(var t;t=e.lastChild;)e.removeChild(t)}function m(e,t){se.test(t)?e.innerHTML=t:w(e,t)}function w(e,t){var n=e.firstChild;n&&3===n.nodeType&&null===n.nextSibling?le?n.textContent=t:n.data=t:(p(e),e.appendChild(document.createTextNode(t)))}function v(e){for(var t=e;l(t)!==document.documentElement;){if(null===t)return!1;if(t.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(t.host){if(t.host.impl)return v(t.host.impl);if(t.host)return v(t.host);throw new Error("Lost in Web Components world")}return!1}if("none"===t.style.display)return!1;t=t.parentNode}return!0}function b(e){var t,n,o,r,i;if(r=document.documentElement,te()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName)return i=e.getBoundingClientRect(),{top:i.top+(window.pageYOffset||r.scrollTop)-(r.clientTop||0),left:i.left+(window.pageXOffset||r.scrollLeft)-(r.clientLeft||0)};for(t=e.offsetLeft,n=e.offsetTop,o=e;(e=e.offsetParent)&&e!==document.body;)t+=e.offsetLeft,n+=e.offsetTop,o=e;return o&&"fixed"===o.style.position&&(t+=window.pageXOffset||r.scrollLeft,n+=window.pageYOffset||r.scrollTop),{left:t,top:n}}function C(){var e=window.scrollY;return void 0===e&&(e=document.documentElement.scrollTop),e}function y(){var e=window.scrollX;return void 0===e&&(e=document.documentElement.scrollLeft),e}function R(e){return e===window?C():e.scrollTop}function E(e){return e===window?y():e.scrollLeft}function S(e){for(var t,n,o,r=e.parentNode,i=["auto","scroll"],s="",l="",a="",u="";r&&r.style&&document.body!==r;){if(t=r.style.overflow,n=r.style.overflowX,o=r.style.overflowY,"scroll"==t||"scroll"==n||"scroll"==o)return r;if(window.getComputedStyle&&(s=window.getComputedStyle(r), -l=s.getPropertyValue("overflow"),a=s.getPropertyValue("overflow-y"),u=s.getPropertyValue("overflow-x"),"scroll"===l||"scroll"===u||"scroll"===a))return r;if(r.clientHeight<=r.scrollHeight&&(-1!==i.indexOf(o)||-1!==i.indexOf(t)||-1!==i.indexOf(l)||-1!==i.indexOf(a)))return r;if(r.clientWidth<=r.scrollWidth&&(-1!==i.indexOf(n)||-1!==i.indexOf(t)||-1!==i.indexOf(l)||-1!==i.indexOf(u)))return r;r=r.parentNode}return window}function T(e){for(var t=e.parentNode;t&&t.style&&document.body!==t;){if("visible"!==t.style.overflow&&""!==t.style.overflow)return t;if(window.getComputedStyle){var n=window.getComputedStyle(t);if("visible"!==n.getPropertyValue("overflow")&&""!==n.getPropertyValue("overflow"))return t}t=t.parentNode}return window}function O(e,t){if(e){if(e!==window){var n,o=e.style[t];return""!==o&&void 0!==o?o:(n=_(e),""!==n[t]&&void 0!==n[t]?n[t]:void 0)}if("width"===t)return window.innerWidth+"px";if("height"===t)return window.innerHeight+"px"}}function _(e){return e.currentStyle||document.defaultView.getComputedStyle(e)}function M(e){return e.offsetWidth}function H(e){return te()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName?e.offsetHeight+e.firstChild.offsetHeight:e.offsetHeight}function k(e){return e.clientHeight||e.innerHeight}function A(e){return e.clientWidth||e.innerWidth}function P(e,t,n){window.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function x(e,t,n){window.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)}function D(e){if(e.selectionStart)return e.selectionStart;if(document.selection){e.focus();var t=document.selection.createRange();if(null==t)return 0;var n=e.createTextRange(),o=n.duplicate();return n.moveToBookmark(t.getBookmark()),o.setEndPoint("EndToStart",n),o.text.length}return 0}function N(e){if(e.selectionEnd)return e.selectionEnd;if(document.selection){var t=document.selection.createRange();if(null==t)return 0;var n=e.createTextRange();return n.text.indexOf(t.text)+t.text.length}}function L(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e}function W(e,t,n){if(void 0===n&&(n=t),e.setSelectionRange){e.focus();try{e.setSelectionRange(t,n)}catch(o){var r=e.parentNode,i=r.style.display;r.style.display="block",e.setSelectionRange(t,n),r.style.display=i}}else if(e.createTextRange){var s=e.createTextRange();s.collapse(!0),s.moveEnd("character",n),s.moveStart("character",t),s.select()}}function I(){var e=document.createElement("p");e.style.width="100%",e.style.height="200px";var t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),(document.body||document.documentElement).appendChild(t);var n=e.offsetWidth;t.style.overflow="scroll";var o=e.offsetWidth;return n==o&&(o=t.clientWidth),(document.body||document.documentElement).removeChild(t),n-o}function j(){return void 0===ie&&(ie=I()),ie}function B(e,t,n){J()||Z()?(e.style.top=n,e.style.left=t):ee()?e.style["-webkit-transform"]="translate3d("+t+","+n+",0)":e.style.transform="translate3d("+t+","+n+",0)"}function V(e){var t;return e.style.transform&&""!==(t=e.style.transform)?["transform",t]:e.style["-webkit-transform"]&&""!==(t=e.style["-webkit-transform"])?["-webkit-transform",t]:-1}function F(e){e.transform&&""!==e.transform?e.transform="":e["-webkit-transform"]&&""!==e["-webkit-transform"]&&(e["-webkit-transform"]="")}function z(e){var t=["INPUT","SELECT","TEXTAREA"];return t.indexOf(e.nodeName)>-1||"true"===e.contentEditable}function U(e){return z(e)&&-1==e.className.indexOf("handsontableInput")&&-1==e.className.indexOf("copyPaste")}function G(e){return ce.call(window,e)}function $(e){de.call(window,e)}Object.defineProperties(n,{closest:{get:function(){return o}},isChildOf:{get:function(){return r}},isChildOfWebComponentTable:{get:function(){return i}},polymerWrap:{get:function(){return s}},polymerUnwrap:{get:function(){return l}},index:{get:function(){return a}},overlayContainsElement:{get:function(){return u}},hasClass:{get:function(){return d}},addClass:{get:function(){return h}},removeClass:{get:function(){return f}},removeTextNodes:{get:function(){return g}},empty:{get:function(){return p}},HTML_CHARACTERS:{get:function(){return se}},fastInnerHTML:{get:function(){return m}},fastInnerText:{get:function(){return w}},isVisible:{get:function(){return v}},offset:{get:function(){return b}},getWindowScrollTop:{get:function(){return C}},getWindowScrollLeft:{get:function(){return y}},getScrollTop:{get:function(){return R}},getScrollLeft:{get:function(){return E}},getScrollableElement:{get:function(){return S}},getTrimmingContainer:{get:function(){return T}},getStyle:{get:function(){return O}},getComputedStyle:{get:function(){return _}},outerWidth:{get:function(){return M}},outerHeight:{get:function(){return H}},innerHeight:{get:function(){return k}},innerWidth:{get:function(){return A}},addEvent:{get:function(){return P}},removeEvent:{get:function(){return x}},getCaretPosition:{get:function(){return D}},getSelectionEndPosition:{get:function(){return N}},getSelectionText:{get:function(){return L}},setCaretPosition:{get:function(){return W}},getScrollbarWidth:{get:function(){return j}},setOverlayPosition:{get:function(){return B}},getCssTransform:{get:function(){return V}},resetCssTransform:{get:function(){return F}},isInput:{get:function(){return z}},isOutsideInput:{get:function(){return U}},requestAnimationFrame:{get:function(){return G}},cancelAnimationFrame:{get:function(){return $}},__esModule:{value:!0}});var K,Y,X,q,Q=(K=e("../browser"),K&&K.__esModule&&K||{"default":K}),J=Q.isIE8,Z=Q.isIE9,ee=Q.isSafari,te=Q.hasCaptionProblem,ne=document.documentElement.classList?!0:!1;if(ne){var oe=function(){var e=document.createElement("div");return e.classList.add("test","test2"),e.classList.contains("test2")}();Y=function(e,t){return""===t?!1:e.classList.contains(t)},X=function(e,t){var n=0;if("string"==typeof t&&(t=t.split(" ")),t=c(t),oe)e.classList.add.apply(e.classList,t);else for(;t&&t[n];)e.classList.add(t[n]),n++},q=function(e,t){var n=0;if("string"==typeof t&&(t=t.split(" ")),t=c(t),oe)e.classList.remove.apply(e.classList,t);else for(;t&&t[n];)e.classList.remove(t[n]),n++}}else{var re=function(e){return new RegExp("(\\s|^)"+e+"(\\s|$)")};Y=function(e,t){return e.className.match(re(t))?!0:!1},X=function(e,t){var n=0,o=e.className;if("string"==typeof t&&(t=t.split(" ")),""===o)o=t.join(" ");else for(;t&&t[n];)re(t[n]).test(o)||(o+=" "+t[n]),n++;e.className=o},q=function(e,t){var n=0,o=e.className;for("string"==typeof t&&(t=t.split(" "));t&&t[n];)o=o.replace(re(t[n])," ").trim(),n++;e.className!==o&&(e.className=o)}}for(var ie,se=/(<(.*)>|&(.*);)/,le=document.createTextNode("test").textContent?!0:!1,ae=0,ue=["ms","moz","webkit","o"],ce=window.requestAnimationFrame,de=window.cancelAnimationFrame,he=0;he=t&&n(o)!==!1;);}function s(e,t){return t=parseInt(t.toString().replace("%",""),10),t=parseInt(e*t/100)}Object.defineProperties(n,{isNumeric:{get:function(){return o}},rangeEach:{get:function(){return r}},rangeEachReverse:{get:function(){return i}},valueAccordingPercent:{get:function(){return s}},__esModule:{value:!0}})},{}],50:[function(e,t,n){"use strict";function o(e){var t;return Array.isArray(e)?t=[]:(t={},g(e,function(e,n){e&&"object"==typeof e&&!Array.isArray(e)?t[n]=o(e):Array.isArray(e)?e.length&&"object"==typeof e[0]&&!Array.isArray(e[0])?t[n]=[o(e[0])]:t[n]=[]:t[n]=null})),t}function r(e,t){return t.prototype.constructor=t,e.prototype=new t,e.prototype.constructor=e,e}function i(e,t){return g(t,function(t,n){e[n]=t}),e}function s(e,t){g(t,function(n,o){t[o]&&"object"==typeof t[o]?(e[o]||(Array.isArray(t[o])?e[o]=[]:e[o]={}),s(e[o],t[o])):e[o]=t[o]})}function l(e){return"object"==typeof e?JSON.parse(JSON.stringify(e)):e}function a(e){var t={};return g(e,function(e,n){t[n]=e}),t}function u(e){for(var t=[],n=1;no;o++)n.prototype[t[o]]=void 0;return n}Object.defineProperties(n,{columnFactory:{get:function(){return o}},__esModule:{value:!0}});var r,i=(r=e("object"),r&&r.__esModule&&r||{"default":r}).inherit},{object:50}],52:[function(e,t,n){"use strict";function o(e){return e[0].toUpperCase()+e.substr(1)}function r(e,t){var n=!0;return g(t.length-1,function(o){return e.charAt(o)!==t.charAt(o)?(n=!1,!1):void 0}),n}function i(e,t){var n=!0,o=t.length-1,r=e.length-1;return g(o,function(i){var s=r-i,l=o-i;return e.charAt(s)!==t.charAt(l)?(n=!1,!1):void 0}),n}function s(){for(var e=[],t=0;t=t)return e;n=String(n);var o=n.length;o||(n=" ");var r=t-e.length,i=Math.ceil(r/n.length),s="";return g(i,function(e){s+=n}),s=s.slice(0,r),s+e}Object.defineProperties(n,{toUpperCaseFirst:{get:function(){return o}},startsWith:{get:function(){return r}},endsWith:{get:function(){return i}},equalsIgnoreCase:{get:function(){return s}},randomString:{get:function(){return l}},isPercentValue:{get:function(){return a}},substitute:{get:function(){return u}},padStart:{get:function(){return c}},__esModule:{value:!0}});var d,h,f=(d=e("mixed"),d&&d.__esModule&&d||{"default":d}).stringify,g=(h=e("number"),h&&h.__esModule&&h||{"default":h}).rangeEach},{mixed:48,number:49}],53:[function(e,t,n){"use strict";function o(e){return 32==e||e>=48&&57>=e||e>=96&&111>=e||e>=186&&192>=e||e>=219&&222>=e||e>=226||e>=65&&90>=e}function r(e){var t=[u.ARROW_DOWN,u.ARROW_UP,u.ARROW_LEFT,u.ARROW_RIGHT,u.HOME,u.END,u.DELETE,u.BACKSPACE,u.F1,u.F2,u.F3,u.F4,u.F5,u.F6,u.F7,u.F8,u.F9,u.F10,u.F11,u.F12,u.TAB,u.PAGE_DOWN,u.PAGE_UP,u.ENTER,u.ESCAPE,u.SHIFT,u.CAPS_LOCK,u.ALT];return-1!==t.indexOf(e)}function i(e){return-1!==[u.CONTROL_LEFT,224,u.COMMAND_LEFT,u.COMMAND_RIGHT].indexOf(e)}function s(e,t){var n=t.split("|"),o=!1;return a(n,function(t){return e===u[t]?(o=!0,!1):void 0}),o}Object.defineProperties(n,{KEY_CODES:{get:function(){return u}},isPrintableChar:{get:function(){return o}},isMetaKey:{get:function(){return r}},isCtrlKey:{get:function(){return i}},isKey:{get:function(){return s}},__esModule:{value:!0}});var l,a=(l=e("array"),l&&l.__esModule&&l||{"default":l}).arrayEach,u={MOUSE_LEFT:1,MOUSE_RIGHT:3,MOUSE_MIDDLE:2,BACKSPACE:8,COMMA:188,INSERT:45,DELETE:46,END:35,ENTER:13,ESCAPE:27,CONTROL_LEFT:91,COMMAND_LEFT:17,COMMAND_RIGHT:93,ALT:18,HOME:36,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,SPACE:32,SHIFT:16,CAPS_LOCK:20,TAB:9,ARROW_RIGHT:39,ARROW_LEFT:37,ARROW_UP:38,ARROW_DOWN:40,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,A:65,X:88,C:67,V:86}},{array:42}],54:[function(e,t,n){"use strict";Object.defineProperties(n,{localHooks:{get:function(){return a}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/array"),o&&o.__esModule&&o||{"default":o}).arrayEach,s=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).defineGetter,l="localHooks",a={_localHooks:Object.create(null),addLocalHook:function(e,t){this._localHooks[e]||(this._localHooks[e]=[]),this._localHooks[e].push(t)},runLocalHooks:function(e){for(var t=[],n=1;n=0?(t.skip=!0,!0):!1},has:function(e){var t=void 0!==arguments[1]?arguments[1]:null,n=this.getBucket(t);return void 0!==n[e]&&n[e].length?!0:!1},run:function(e,t,n,o,r,i,s,l){var a=this.globalBucket[t],u=-1,c=a?a.length:0;if(c)for(;++u=0},getRegistered:function(){return i}},{}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.Hooks=a},{"helpers/array":42,"helpers/object":50}],57:[function(e,t,n){"use strict";function o(e,t){e=c(e),Handsontable.plugins[e]=t,Handsontable.hooks.add("construct",function(){var n;d.has(this)||d.set(this,{}),n=d.get(this),n[e]||(n[e]=new t(this))}),Handsontable.hooks.add("afterDestroy",function(){if(d.has(this)){var e=d.get(this);u(e,function(e){return e.destroy()}),d["delete"](this)}})}function r(e,t){if("string"!=typeof t)throw Error('Only strings can be passed as "plugin" parameter');var n=c(t);if(d.has(e)&&d.get(e)[n])return d.get(e)[n]}function i(e){return d.has(e)?Object.keys(d.get(e)):[]}function s(e,t){var n=null;return d.has(e)&&u(d.get(e),function(e,o){e===t&&(n=o)}),n}Object.defineProperties(n,{registerPlugin:{get:function(){return o}},getPlugin:{get:function(){return r}},getRegistredPluginNames:{get:function(){return i}},getPluginName:{get:function(){return s}},__esModule:{value:!0}});var l,a,u=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}).objectEach,c=(a=e("helpers/string"),a&&a.__esModule&&a||{"default":a}).toUpperCaseFirst,d=new WeakMap;Handsontable.plugins=Handsontable.plugins||{},Handsontable.plugins.utils=Handsontable.plugins.utils||{},Handsontable.plugins.registerPlugin=o},{"helpers/object":50,"helpers/string":52}],58:[function(e,t,n){"use strict";Object.defineProperties(n,{"default":{get:function(){return m}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/object"),o&&o.__esModule&&o||{"default":o}),l=s.defineGetter,a=s.objectEach,u=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,c=(i=e("plugins"),i&&i.__esModule&&i||{"default":i}),d=c.getRegistredPluginNames,h=c.getPluginName,f=new WeakMap,g=null,p=function(e){var t=this;l(this,"hot",e,{writable:!1}),f.set(this,{hooks:{}}),g=null,this.pluginName=null,this.pluginsInitializedCallbacks=[],this.isPluginsReady=!1,this.enabled=!1,this.initialized=!1,this.hot.addHook("afterPluginsInitialized",function(){return t.onAfterPluginsInitialized()}),this.hot.addHook("afterUpdateSettings",function(){return t.onUpdateSettings()}),this.hot.addHook("beforeInit",function(){return t.init()})};$traceurRuntime.createClass(p,{init:function(){this.pluginName=h(this.hot,this),this.isEnabled&&this.isEnabled()&&this.enablePlugin(),g||(g=d(this.hot)),g.indexOf(this.pluginName)>=0&&g.splice(g.indexOf(this.pluginName),1),g.length||this.hot.runHooks("afterPluginsInitialized"),this.initialized=!0},enablePlugin:function(){this.enabled=!0},disablePlugin:function(){this.eventManager&&this.eventManager.clear(),this.clearHooks(),this.enabled=!1},addHook:function(e,t){var n=f.get(this).hooks[e]=f.get(this).hooks[e]||[];this.hot.addHook(e,t),n.push(t),f.get(this).hooks[e]=n},removeHooks:function(e){var t=this;u(f.get(this).hooks[e]||[],function(n){t.hot.removeHook(e,n)})},clearHooks:function(){var e=this,t=f.get(this).hooks;a(t,function(t,n){return e.removeHooks(n)}),t.length=0},callOnPluginsReady:function(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)},onAfterPluginsInitialized:function(){u(this.pluginsInitializedCallbacks,function(e){return e()}),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0},onUpdateSettings:function(){this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&this.updatePlugin())},updatePlugin:function(){},destroy:function(){var e=this;this.eventManager&&this.eventManager.destroy(),this.clearHooks(),a(this,function(t,n){"hot"!==n&&(e[n]=null)}),delete this.hot}},{});var m=p;Handsontable.plugins.BasePlugin=p},{"helpers/array":42,"helpers/object":50,plugins:57}],59:[function(e,t,n){"use strict";Object.defineProperties(n,{AutoColumnSize:{get:function(){return A}},__esModule:{value:!0}});var o,r,i,s,l,a,u,c,d,h,f=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],g=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),p=g.arrayEach,m=g.arrayFilter,w=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),v=w.cancelAnimationFrame,b=w.requestAnimationFrame,C=w.isVisible,y=(s=e("utils/ghostTable"),s&&s.__esModule&&s||{"default":s}).GhostTable,R=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),E=R.isObject,S=(R.objectEach,a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}),T=S.valueAccordingPercent,O=S.rangeEach,_=(u=e("plugins"),u&&u.__esModule&&u||{"default":u}).registerPlugin,M=(c=e("utils/samplesGenerator"),c&&c.__esModule&&c||{"default":c}).SamplesGenerator,H=(d=e("helpers/string"),d&&d.__esModule&&d||{"default":d}).isPercentValue,k=(h=e("3rdparty/walkontable/src/calculator/viewportColumns"),h&&h.__esModule&&h||{"default":h}).WalkontableViewportColumnsCalculator,A=function(e){var t=this;$traceurRuntime.superConstructor(P).call(this,e),this.widths=[],this.ghostTable=new y(this.hot),this.samplesGenerator=new M(function(e,n){return t.hot.getDataAtCell(e,n)}),this.firstCalculation=!0,this.inProgress=!1,this.addHook("beforeColumnResize",function(e,n,o){return t.onBeforeColumnResize(e,n,o)})},P=A;$traceurRuntime.createClass(A,{isEnabled:function(){return this.hot.getSettings().autoColumnSize!==!1&&!this.hot.getSettings().colWidths},enablePlugin:function(){var e=this;this.enabled||(this.addHook("afterLoadData",function(){return e.onAfterLoadData()}),this.addHook("beforeChange",function(t){return e.onBeforeChange(t)}),this.addHook("beforeRender",function(t){return e.onBeforeRender(t)}),this.addHook("modifyColWidth",function(t,n){return e.getColumnWidth(n,t)}),$traceurRuntime.superGet(this,P.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,P.prototype,"disablePlugin").call(this)},calculateColumnsWidth:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countRows()-1},n=void 0!==arguments[2]?arguments[2]:!1,o=this;"number"==typeof e&&(e={from:e,to:e}),"number"==typeof t&&(t={from:t,to:t}),O(e.from,e.to,function(e){if(n||void 0===o.widths[e]&&!o.hot._getColWidthFromSettings(e)){var r=o.samplesGenerator.generateColumnSamples(e,t);r.forEach(function(e,t){return o.ghostTable.addColumn(t,e)})}}),this.ghostTable.columns.length&&(this.ghostTable.getWidths(function(e,t){return o.widths[e]=t}),this.ghostTable.clean())},calculateAllColumnsWidth:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=this,n=0,o=this.hot.countCols()-1,r=null;this.inProgress=!0;var i=function(){return t.hot?(t.calculateColumnsWidth({from:n,to:Math.min(n+P.CALCULATION_STEP,o)},e),n=n+P.CALCULATION_STEP+1,void(o>n?r=b(i):(v(r),t.inProgress=!1,t.hot.view.wt.wtOverlays.adjustElementsSize(!0),t.hot.view.wt.wtOverlays.leftOverlay.needFullRender&&t.hot.view.wt.wtOverlays.leftOverlay.clone.draw()))):(v(r),void(t.inProgress=!1))};this.firstCalculation&&this.getSyncCalculationLimit()&&(this.calculateColumnsWidth({from:0,to:this.getSyncCalculationLimit()},e),this.firstCalculation=!1,n=this.getSyncCalculationLimit()+1),o>n?i():this.inProgress=!1},recalculateAllColumnsWidth:function(){this.hot.view&&C(this.hot.view.wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllColumnsWidth())},getSyncCalculationLimit:function(){var e=P.SYNC_CALCULATION_LIMIT,t=this.hot.countCols()-1;return E(this.hot.getSettings().autoColumnSize)&&(e=this.hot.getSettings().autoColumnSize.syncLimit,H(e)?e=T(t,e):e>>=0),Math.min(e,t)},getColumnWidth:function(e){var t=arguments[1],n=void 0!==arguments[2]?arguments[2]:!0,o=t;return void 0===o&&(o=this.widths[e],n&&"number"==typeof o&&(o=Math.max(o,k.DEFAULT_WIDTH))),o},getFirstVisibleColumn:function(){var e=this.hot.view.wt;return e.wtViewport.columnsVisibleCalculator?e.wtTable.getFirstVisibleColumn():e.wtViewport.columnsRenderCalculator?e.wtTable.getFirstRenderedColumn():-1},getLastVisibleColumn:function(){var e=this.hot.view.wt;return e.wtViewport.columnsVisibleCalculator?e.wtTable.getLastVisibleColumn():e.wtViewport.columnsRenderCalculator?e.wtTable.getLastRenderedColumn():-1},clearCache:function(){this.widths.length=0},isNeedRecalculate:function(){return m(this.widths,function(e){return void 0===e}).length?!0:!1},onBeforeRender:function(){var e=this.hot.renderCall;this.calculateColumnsWidth({from:this.getFirstVisibleColumn(),to:this.getLastVisibleColumn()},void 0,e),this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllColumnsWidth()},onAfterLoadData:function(){var e=this;this.hot.view?this.recalculateAllColumnsWidth():setTimeout(function(){e.hot&&e.recalculateAllColumnsWidth()},0)},onBeforeChange:function(e){var t=this;p(e,function(e){return t.widths[e[1]]=void 0})},onBeforeColumnResize:function(e,t,n){return n&&(this.calculateColumnsWidth(e,void 0,!0),t=this.getColumnWidth(e,void 0,!1)),t},destroy:function(){this.ghostTable.clean(),$traceurRuntime.superGet(this,P.prototype,"destroy").call(this)}},{get CALCULATION_STEP(){return 50},get SYNC_CALCULATION_LIMIT(){return 50}},f),_("autoColumnSize",A)},{"3rdparty/walkontable/src/calculator/viewportColumns":3,_base:58,"helpers/array":42,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/string":52,plugins:57,"utils/ghostTable":98,"utils/samplesGenerator":99}],60:[function(e,t,n){"use strict";Object.defineProperties(n,{AutoRowSize:{get:function(){return M}},__esModule:{value:!0}});var o,r,i,s,l,a,u,c,d,h=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],f=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),g=(f.arrayEach,f.arrayFilter),p=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),m=p.cancelAnimationFrame,w=p.requestAnimationFrame,v=p.isVisible,b=(s=e("utils/ghostTable"),s&&s.__esModule&&s||{"default":s}).GhostTable,C=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),y=C.isObject,R=(C.objectEach,a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}),E=R.valueAccordingPercent,S=R.rangeEach,T=(u=e("plugins"),u&&u.__esModule&&u||{"default":u}).registerPlugin,O=(c=e("utils/samplesGenerator"),c&&c.__esModule&&c||{"default":c}).SamplesGenerator,_=(d=e("helpers/string"),d&&d.__esModule&&d||{"default":d}).isPercentValue,M=function(e){var t=this;$traceurRuntime.superConstructor(H).call(this,e),this.heights=[],this.ghostTable=new b(this.hot),this.samplesGenerator=new O(function(e,n){return t.hot.getDataAtCell(e,n)}),this.firstCalculation=!0,this.inProgress=!1,this.addHook("beforeRowResize",function(e,n,o){return t.onBeforeRowResize(e,n,o)})},H=M;$traceurRuntime.createClass(M,{isEnabled:function(){return this.hot.getSettings().autoRowSize===!0||y(this.hot.getSettings().autoRowSize)},enablePlugin:function(){var e=this;this.enabled||(this.addHook("afterLoadData",function(){return e.onAfterLoadData()}),this.addHook("beforeChange",function(t){return e.onBeforeChange(t)}),this.addHook("beforeColumnMove",function(){return e.recalculateAllRowsHeight()}),this.addHook("beforeColumnResize",function(){return e.recalculateAllRowsHeight()}),this.addHook("beforeColumnSort",function(){return e.clearCache()}),this.addHook("beforeRender",function(t){return e.onBeforeRender(t)}),this.addHook("beforeRowMove",function(t,n){ -return e.onBeforeRowMove(t,n)}),this.addHook("modifyRowHeight",function(t,n){return e.getRowHeight(n,t)}),$traceurRuntime.superGet(this,H.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,H.prototype,"disablePlugin").call(this)},calculateRowsHeight:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countCols()-1},n=void 0!==arguments[2]?arguments[2]:!1,o=this;"number"==typeof e&&(e={from:e,to:e}),"number"==typeof t&&(t={from:t,to:t}),S(e.from,e.to,function(e){if(n||void 0===o.heights[e]){var r=o.samplesGenerator.generateRowSamples(e,t);r.forEach(function(e,t){return o.ghostTable.addRow(t,e)})}}),this.ghostTable.rows.length&&(this.ghostTable.getHeights(function(e,t){return o.heights[e]=t}),this.ghostTable.clean())},calculateAllRowsHeight:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=this,n=0,o=this.hot.countRows()-1,r=null;this.inProgress=!0;var i=function(){return t.hot?(t.calculateRowsHeight({from:n,to:Math.min(n+H.CALCULATION_STEP,o)},e),n=n+H.CALCULATION_STEP+1,void(o>n?r=w(i):(m(r),t.inProgress=!1,t.hot.view.wt.wtOverlays.adjustElementsSize(!0),t.hot.view.wt.wtOverlays.leftOverlay.needFullRender&&t.hot.view.wt.wtOverlays.leftOverlay.clone.draw()))):(m(r),void(t.inProgress=!1))};this.firstCalculation&&this.getSyncCalculationLimit()&&(this.calculateRowsHeight({from:0,to:this.getSyncCalculationLimit()},e),this.firstCalculation=!1,n=this.getSyncCalculationLimit()+1),o>n?i():this.inProgress=!1},recalculateAllRowsHeight:function(){v(this.hot.view.wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllRowsHeight())},getSyncCalculationLimit:function(){var e=H.SYNC_CALCULATION_LIMIT,t=this.hot.countRows()-1;return y(this.hot.getSettings().autoRowSize)&&(e=this.hot.getSettings().autoRowSize.syncLimit,_(e)?e=E(t,e):e>>=0),Math.min(e,t)},getRowHeight:function(e){var t=arguments[1],n=t;return void 0!==this.heights[e]&&this.heights[e]>(t||0)&&(n=this.heights[e]),n},getFirstVisibleRow:function(){var e=this.hot.view.wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getFirstVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getFirstRenderedRow():-1},getLastVisibleRow:function(){var e=this.hot.view.wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getLastVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getLastRenderedRow():-1},clearCache:function(){this.heights.length=0},clearCacheByRange:function(e){var t=this;"number"==typeof e&&(e={from:e,to:e}),S(Math.min(e.from,e.to),Math.max(e.from,e.to),function(e){return t.heights[e]=void 0})},isNeedRecalculate:function(){return g(this.heights,function(e){return void 0===e}).length?!0:!1},onBeforeRender:function(){var e=this.hot.renderCall;this.calculateRowsHeight({from:this.getFirstVisibleRow(),to:this.getLastVisibleRow()},void 0,e),this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllRowsHeight()},onBeforeRowMove:function(e,t){this.clearCacheByRange({from:e,to:t}),this.calculateAllRowsHeight()},onBeforeRowResize:function(e,t,n){return n&&(this.calculateRowsHeight(e,void 0,!0),t=this.getRowHeight(e)),t},onAfterLoadData:function(){var e=this;this.hot.view?this.recalculateAllRowsHeight():setTimeout(function(){e.hot&&e.recalculateAllRowsHeight()},0)},onBeforeChange:function(e){var t=null;1===e.length?t=e[0][0]:e.length>1&&(t={from:e[0][0],to:e[e.length-1][0]}),null!==t&&this.clearCacheByRange(t)},destroy:function(){this.ghostTable.clean(),$traceurRuntime.superGet(this,H.prototype,"destroy").call(this)}},{get CALCULATION_STEP(){return 50},get SYNC_CALCULATION_LIMIT(){return 500}},h),T("autoRowSize",M)},{_base:58,"helpers/array":42,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/string":52,plugins:57,"utils/ghostTable":98,"utils/samplesGenerator":99}],61:[function(e,t,n){"use strict";function o(e,t,n,o){var r,i,s,l,a,u=n.length,c=n?n[0].length:0,d=[],h=[];if(r=t.row-e.row,i=t.col-e.col,-1!==["down","up"].indexOf(o)){for(var f=0;i>=f;f++)s=parseInt(n[0][f],10),l=parseInt(n[u-1][f],10),a=("down"===o?l-s:s-l)/(u-1)||0,h.push(a);d.push(h)}if(-1!==["right","left"].indexOf(o))for(var g=0;r>=g;g++)s=parseInt(n[g][0],10),l=parseInt(n[g][c-1],10),a=("right"===o?l-s:s-l)/(c-1)||0,h=[],h.push(a),d.push(h);return d}function r(e){function t(t){return e.autofill?void(e.autofill.handle&&e.autofill.handle.isDragged&&(e.autofill.handle.isDragged>1&&e.autofill.apply(),e.autofill.handle.isDragged=0,l=!1)):!0}function n(e){var t,n;return s.instance.autofill?(t=c(s.instance.table).top-(window.pageYOffset||document.documentElement.scrollTop)+d(s.instance.table),n=c(s.instance.table).left-(window.pageXOffset||document.documentElement.scrollLeft)+h(s.instance.table),s.addingStarted===!1&&s.instance.autofill.handle.isDragged>0&&e.clientY>t&&e.clientX<=n?(s.instance.mouseDragOutside=!0,s.addingStarted=!0):s.instance.mouseDragOutside=!1,void(s.instance.mouseDragOutside&&setTimeout(function(){s.addingStarted=!1,s.instance.alter("insert_row")},200))):!1}var o,r,i,s=this,l=!1;this.instance=e,this.addingStarted=!1,i=f(e),i.addEventListener(document,"mouseup",t),i.addEventListener(document,"mousemove",n),o=this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown,this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown=function(t){e.autofill.handle.isDragged=1,l=!0,o(t)},r=this.instance.view.wt.wtSettings.settings.onCellMouseOver,this.instance.view.wt.wtSettings.settings.onCellMouseOver=function(t,n,o,i){e.autofill&&l&&!e.view.isMouseDown()&&e.autofill.handle&&e.autofill.handle.isDragged&&(e.autofill.handle.isDragged++,e.autofill.showBorder(n),e.autofill.checkIfNewRowNeeded()),r(t,n,o,i)},this.instance.view.wt.wtSettings.settings.onCellCornerDblClick=function(){e.autofill.selectAdjacent()}}Object.defineProperties(n,{Autofill:{get:function(){return r}},__esModule:{value:!0}});var i,s,l,a,u=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),c=u.offset,d=u.outerHeight,h=u.outerWidth,f=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).eventManager,g=((l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin,(a=e("3rdparty/walkontable/src/cell/coords"),a&&a.__esModule&&a||{"default":a}).WalkontableCellCoords);r.prototype.init=function(){this.handle={}},r.prototype.disable=function(){this.handle.disabled=!0},r.prototype.selectAdjacent=function(){var e,t,n,o,r;e=this.instance.selection.isMultiple()?this.instance.view.wt.selections.area.getCorners():this.instance.view.wt.selections.current.getCorners(),t=this.instance.getData();e:for(n=e[2]+1;nt[3]?(s="right",n=new g(e[0],t[3]+1),r=new g(e[2],e[3])):e[0]t[2]&&e[1]===t[1]&&(s="down",n=new g(t[2]+1,e[1]),r=new g(e[2],e[3])),n&&n.row>-1&&n.col>-1?(a={from:this.instance.getSelectedRange().from,to:this.instance.getSelectedRange().to},i=this.instance.getData(a.from.row,a.from.col,a.to.row,a.to.col),l=o(n,r,i,s),Handsontable.hooks.run(this.instance,"beforeAutofill",n,r,i),this.instance.populateFromArray(n.row,n.col,i,r.row,r.col,"autofill",null,s,l),this.instance.selection.setRangeStart(new g(e[0],e[1])),this.instance.selection.setRangeEnd(new g(e[2],e[3]))):this.instance.selection.refreshBorders())},r.prototype.showBorder=function(e){var t=this.instance.getSelectedRange().getTopLeftCorner(),n=this.instance.getSelectedRange().getBottomRightCorner();if("horizontal"!==this.instance.getSettings().fillHandle&&(n.rowe.row))e=new g(e.row,n.col);else{if("vertical"===this.instance.getSettings().fillHandle)return;e=new g(n.row,e.col)}this.instance.view.wt.selections.fill.clear(),this.instance.view.wt.selections.fill.add(this.instance.getSelectedRange().from),this.instance.view.wt.selections.fill.add(this.instance.getSelectedRange().to),this.instance.view.wt.selections.fill.add(e),this.instance.view.render()},r.prototype.checkIfNewRowNeeded=function(){var e,t,n=this.instance.countRows(),o=this;this.instance.view.wt.selections.fill.cellRange&&this.addingStarted===!1&&(t=this.instance.getSelected(),e=this.instance.view.wt.selections.fill.getCorners(),t[2]n[1]?e?1:-1:0}},dateSort:function(e){return function(t,n){if(t[1]===n[1])return 0;if(null===t[1]||""===t[1])return 1;if(null===n[1]||""===n[1])return-1;var o=new Date(t[1]),r=new Date(n[1]);return r>o?e?-1:1:o>r?e?1:-1:0}},sort:function(){if("undefined"==typeof this.hot.sortOrder)return void(this.hot.sortIndex.length=0);var e,t;this.hot.sortingEnabled=!1,this.hot.sortIndex.length=0;for(var n=this.hot.colOffset(),o=0,r=this.hot.countRows()-this.hot.getSettings().minSpareRows;r>o;o++)this.hot.sortIndex.push([o,this.hot.getDataAtCell(o,this.hot.sortColumn+n)]);switch(e=this.hot.getCellMeta(0,this.hot.sortColumn),this.sortIndicators[this.hot.sortColumn]=e.sortIndicator,e.type){case"date":t=this.dateSort;break;default:t=this.defaultSort}this.hot.sortIndex.sort(t(this.hot.sortOrder));for(var o=this.hot.sortIndex.length;o=0&&-1===r&&u(n,"columnSorting"),f(n,"descending"),f(n,"ascending"),this.sortIndicators[e]&&e===this.hot.sortColumn&&("ascending"===this.sortOrderClass?u(n,"ascending"):"descending"===this.sortOrderClass&&u(n,"descending")))},isSorted:function(){return"undefined"!=typeof this.hot.sortColumn},afterCreateRow:function(e,t){if(this.isSorted()){for(var n=0;n=e&&(this.hot.sortIndex[n][0]+=t);for(var n=0;t>n;n++)this.hot.sortIndex.splice(e+n,0,[e+n,this.hot.getSourceData()[e+n][this.hot.sortColumn+this.hot.colOffset()]]);this.saveSortingState()}},afterRemoveRow:function(e,t){function n(e){return m(o,function(t,n){return e>n&&t++,t},0)}if(this.isSorted()){var o=this.hot.sortIndex.splice(e,t);o=p(o,function(e){return e[0]}),this.hot.sortIndex=p(this.hot.sortIndex,function(e,t){var o=n(e[0]);return o&&(e[0]-=o),e}),this.saveSortingState()}}},{},v),b("columnSorting",C)},{_base:58,eventManager:41,"helpers/array":42,"helpers/dom/element":45,plugins:57}],63:[function(e,t,n){"use strict";Object.defineProperties(n,{CommentEditor:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).addClass,i=function(){this.editor=this.createEditor(),this.editorStyle=this.editor.style,this.editorStyle.position="absolute",this.editorStyle.zIndex=100,this.hide()},s=i;$traceurRuntime.createClass(i,{setPosition:function(e,t){this.editorStyle.left=e+"px",this.editorStyle.top=t+"px"},show:function(){this.editorStyle.display="block"},hide:function(){this.editorStyle.display="none"},isVisible:function(){return"block"===this.editorStyle.display},setValue:function(){var e=void 0!==arguments[0]?arguments[0]:"";e=e||"",this.getInputElement().value=e},getValue:function(){return this.getInputElement().value},isFocused:function(){return document.activeElement===this.getInputElement()},focus:function(){this.getInputElement().focus()},createEditor:function(){var e,t,n=document.querySelector("."+s.CLASS_EDITOR_CONTAINER);return n||(n=document.createElement("div"),r(n,s.CLASS_EDITOR_CONTAINER),document.body.appendChild(n)),e=document.createElement("div"),r(e,s.CLASS_EDITOR),t=document.createElement("textarea"),r(t,s.CLASS_INPUT),e.appendChild(t),n.appendChild(e),e},getInputElement:function(){return this.editor.querySelector("."+s.CLASS_INPUT)},destroy:function(){this.editor.parentNode.removeChild(this.editor),this.editor=null,this.editorStyle=null}},{get CLASS_EDITOR_CONTAINER(){return"htCommentsContainer"},get CLASS_EDITOR(){return"htComments"},get CLASS_INPUT(){return"htCommentTextArea"},get CLASS_CELL(){return"htCommentCell"}})},{"helpers/dom/element":45}],64:[function(e,t,n){"use strict";Object.defineProperties(n,{Comments:{get:function(){return R}},__esModule:{value:!0}});var o,r,i,s,l,a,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),c=u.addClass,d=u.closest,h=u.getWindowScrollLeft,f=u.getWindowScrollTop,g=u.hasClass,p=u.offset,m=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,w=(i=e("3rdparty/walkontable/src/cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords,v=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}),b=v.registerPlugin,C=(v.getPlugin,(l=e("_base"),l&&l.__esModule&&l||{"default":l})["default"]),y=(a=e("commentEditor"),a&&a.__esModule&&a||{"default":a}).CommentEditor,R=function(e){$traceurRuntime.superConstructor(E).call(this,e),this.editor=null,this.eventManager=null,this.range={},this.mouseDown=!1,this.contextMenuEvent=!1,this.timer=null},E=R;$traceurRuntime.createClass(R,{isEnabled:function(){return this.hot.getSettings().comments},enablePlugin:function(){var e=this;this.enabled||(this.editor||(this.editor=new y),this.eventManager||(this.eventManager=new m(this)),this.addHook("afterContextMenuDefaultOptions",function(t){return e.addToContextMenu(t)}),this.addHook("afterRenderer",function(t,n,o,r,i,s){return e.onAfterRenderer(t,s)}),this.addHook("afterScrollHorizontally",function(){return e.refreshEditorPosition()}),this.addHook("afterScrollVertically",function(){return e.refreshEditorPosition()}),this.addHook("afterColumnResize",function(){return e.refreshEditorPosition()}),this.addHook("afterRowResize",function(){return e.refreshEditorPosition()}),this.registerListeners(),$traceurRuntime.superGet(this,E.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,E.prototype,"disablePlugin").call(this)},registerListeners:function(){var e=this;this.eventManager.addEventListener(document,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(document,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(document,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(document,"mouseup",function(t){return e.onMouseUp(t)}),this.eventManager.addEventListener(this.editor.getInputElement(),"blur",function(t){return e.onEditorBlur(t)})},setRange:function(e){this.range=e},clearRange:function(){this.range={}},targetIsCellWithComment:function(e){return g(e.target,"htCommentCell")&&d(e.target,[this.hot.rootElement])?!0:!1},targetIsCommentTextArea:function(e){return this.editor.getInputElement()===e.target},saveComment:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');var e=this.editor.getValue(),t=this.range.from.row,n=this.range.from.col;this.hot.setCellMeta(t,n,"comment",e),this.hot.render()},saveCommentAtCell:function(e,t){this.setRange({from:new w(e,t)}),this.saveComment()},removeComment:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');this.hot.removeCellMeta(this.range.from.row,this.range.from.col,"comment"),this.hot.render(),this.hide()},removeCommentAtCell:function(e,t){this.setRange({from:new w(e,t)}),this.removeComment()},show:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');var e=this.hot.getCellMeta(this.range.from.row,this.range.from.col);return this.refreshEditorPosition(!0),this.editor.setValue(e.comment||""),this.editor.show(),!0},showAtCell:function(e,t){return this.setRange({from:new w(e,t)}),this.show()},hide:function(){this.editor.hide()},refreshEditorPosition:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(e||this.range.from&&this.editor.isVisible()){var t=this.hot.view.wt.wtTable.getCell(this.range.from),n=p(t),o=this.hot.getColWidth(this.range.from.col),r=n.top,i=n.left,s=0,l=0;this.hot.view.wt.wtViewport.hasVerticalScroll()&&(r-=this.hot.view.wt.wtOverlays.topOverlay.getScrollPosition(),s=20),this.hot.view.wt.wtViewport.hasHorizontalScroll()&&(i-=this.hot.view.wt.wtOverlays.leftOverlay.getScrollPosition(),l=20);var a=i+o,u=r,c=this.hot.view.wt.wtTable.holder.getBoundingClientRect(),d={left:c.left+h()+l,right:c.right+h()-15,top:c.top+f()+s,bottom:c.bottom+f()};a<=d.left||a>d.right||u<=d.top||u>d.bottom?this.hide():this.editor.setPosition(a,u)}},onMouseDown:function(e){this.mouseDown=!0,this.hot.view&&this.hot.view.wt&&(this.contextMenuEvent||this.targetIsCommentTextArea(e)||this.targetIsCellWithComment(e)||this.hide(),this.contextMenuEvent=!1)},onMouseOver:function(e){if(!this.mouseDown&&!this.editor.isFocused())if(this.targetIsCellWithComment(e)){var t=this.hot.view.wt.wtTable.getCoords(e.target),n={from:new w(t.row,t.col)};this.setRange(n),this.show()}else this.targetIsCommentTextArea(e)||this.editor.isFocused()||this.hide()},onMouseMove:function(e){var t=this;this.targetIsCommentTextArea(e)&&(this.mouseDown=!0,clearTimeout(this.timer),this.timer=setTimeout(function(){t.mouseDown=!1},200))},onMouseUp:function(e){this.mouseDown=!1},onAfterRenderer:function(e,t){t.comment&&c(e,t.commentedCellClassName)},onEditorBlur:function(e){this.saveComment()},checkSelectionCommentsConsistency:function(){var e=this.hot.getSelectedRange();if(!e)return!1;var t=!1,n=e.from;return this.hot.getCellMeta(n.row,n.col).comment&&(t=!0),t},onContextMenuAddComment:function(){var e=this,t=this.hot.getSelectedRange();this.contextMenuEvent=!0,this.setRange({from:t.from}),this.show(),setTimeout(function(){e.hot&&(e.hot.deselectCell(),e.editor.focus())},10)},onContextMenuRemoveComment:function(e,t){this.contextMenuEvent=!0,this.removeCommentAtCell(t.start.row,t.start.col)},addToContextMenu:function(e){var t=this;e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR,{key:"commentsAddEdit",name:function(){return t.checkSelectionCommentsConsistency()?"Edit Comment":"Add Comment"},callback:function(){return t.onContextMenuAddComment()},disabled:function(){return this.getSelected()?!1:!0}},{key:"commentsRemove",name:function(){return"Delete Comment"},callback:function(e,n){return t.onContextMenuRemoveComment(e,n)},disabled:function(){return!t.checkSelectionCommentsConsistency()}})},destroy:function(){this.editor&&this.editor.destroy(),$traceurRuntime.superGet(this,E.prototype,"destroy").call(this)}},{},C),b("comments",R)},{"3rdparty/walkontable/src/cell/coords":5,_base:58,commentEditor:63,eventManager:41,"helpers/dom/element":45,plugins:57}],65:[function(e,t,n){"use strict";function o(e,t){var n;return i(t,function(t){var o=t.key?t.key.split(":"):null;return Array.isArray(o)&&o[1]===e?(n=t,!1):void 0}),n}Object.defineProperties(n,{CommandExecutor:{get:function(){return s}},__esModule:{value:!0}});var r,i=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,s=function(e){this.hot=e,this.commands={},this.commonCallback=null};$traceurRuntime.createClass(s,{registerCommand:function(e,t){this.commands[e]=t},setCommonCallback:function(e){this.commonCallback=e},execute:function(e){for(var t=[],n=1;n0;if(s)return}}else if(!(t(i)||v(i,"current")&&v(i,"wtBorder")))return;this.open(e)},onMenuAfterOpen:function(){this.hot.runHooks("afterContextMenuShow",this)},onMenuAfterClose:function(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)},destroy:function(){this.close(),this.menu&&this.menu.destroy(),$traceurRuntime.superGet(this,W.prototype,"destroy").call(this)}},{get DEFAULT_ITEMS(){return[T,O,N,_,M,N,H,k,N,A,P,N,x,N,D]}},g),L.SEPARATOR={name:N},Handsontable.hooks.register("afterContextMenuDefaultOptions"),Handsontable.hooks.register("afterContextMenuShow"),Handsontable.hooks.register("afterContextMenuHide"),Handsontable.hooks.register("afterContextMenuExecute"),R("contextMenu",L)},{_base:58,commandExecutor:65,eventManager:41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,itemsFactory:68,menu:69,plugins:57,predefinedItems:70}],67:[function(e,t,n){"use strict";Object.defineProperties(n,{Cursor:{get:function(){return d}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.getWindowScrollLeft,l=i.getWindowScrollTop,a=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}),u=a.pageX,c=a.pageY,d=function(e){var t,n,o,r,i,a,d,h,f=l(),g=s();this.type=this.getSourceType(e),"literal"===this.type?(t=parseInt(e.top,10),o=parseInt(e.left,10),d=e.height,h=e.width):"event"===this.type&&(t=parseInt(c(e),10),o=parseInt(u(e),10),d=e.target.clientHeight,h=e.target.clientWidth),n=t-f,r=o-g,i=f,a=g,this.top=t,this.topRelative=n,this.left=o,this.leftRelative=r,this.scrollTop=i,this.scrollLeft=a,this.cellHeight=d,this.cellWidth=h};$traceurRuntime.createClass(d,{getSourceType:function(e){var t="literal";return e instanceof Event&&(t="event"),t},fitsAbove:function(e){return this.topRelative>=e.offsetHeight},fitsBelow:function(e){var t=void 0!==arguments[1]?arguments[1]:window.innerHeight;return this.topRelative+e.offsetHeight<=t},fitsOnRight:function(e){var t=void 0!==arguments[1]?arguments[1]:window.innerWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=t},fitsOnLeft:function(e){return this.leftRelative>=e.offsetWidth}},{}),Handsontable.plugins.utils=Handsontable.plugins.utils||{},Handsontable.plugins.utils.Cursor=d},{"helpers/dom/element":45,"helpers/dom/event":46}],68:[function(e,t,n){"use strict";function o(){var e=void 0!==arguments[0]?arguments[0]:null,t=void 0!==arguments[1]?arguments[1]:[],n=void 0!==arguments[2]?arguments[2]:{},o=[];return e&&e.items?e=e.items:Array.isArray(e)||(e=t),u(e)?a(e,function(e,t){var r=n["string"==typeof e?e:t];r||(r=e),u(e)?c(r,e):"string"==typeof r&&(r={name:r}),void 0===r.key&&(r.key=t), -o.push(r)}):d(e,function(e,t){var r=n[e];!r&&g.indexOf(e)>=0||(r||(r={name:e,key:t+""}),u(e)&&c(r,e),void 0===r.key&&(r.key=t),o.push(r))}),o[0].name===f&&o.shift(),o}Object.defineProperties(n,{ItemsFactory:{get:function(){return m}},__esModule:{value:!0}});var r,i,s,l=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}),a=l.objectEach,u=l.isObject,c=l.extend,d=(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,h=(s=e("predefinedItems"),s&&s.__esModule&&s||{"default":s}),f=h.SEPARATOR,g=h.ITEMS,p=h.predefinedItems,m=function(e){var t=void 0!==arguments[1]?arguments[1]:null;this.hot=e,this.predefinedItems=p(),this.defaultOrderPattern=t};$traceurRuntime.createClass(m,{setPredefinedItems:function(e){var t=this,n={};this.defaultOrderPattern.length=0,a(e,function(e,o){var r="";e.name===f?(n[f]=e,r=f):isNaN(parseInt(o,10))?(e.key=void 0===e.key?o:e.key,n[o]=e,r=e.key):(n[e.key]=e,r=e.key),t.defaultOrderPattern.push(r)}),this.predefinedItems=n},getVisibleItems:function(){var e=void 0!==arguments[0]?arguments[0]:null,t=this,n={};return a(this.predefinedItems,function(e,o){(!e.hidden||e.hidden&&!e.hidden.apply(t.hot))&&(n[o]=e)}),o(e,this.defaultOrderPattern,n)},getItems:function(){var e=void 0!==arguments[0]?arguments[0]:null;return o(e,this.defaultOrderPattern,this.predefinedItems)}},{})},{"helpers/array":42,"helpers/object":50,predefinedItems:70}],69:[function(e,t,n){"use strict";Object.defineProperties(n,{Menu:{get:function(){return W}},__esModule:{value:!0}});var o,r,i,s,l,a,u,c,d,h,f=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),g=f.addClass,p=f.empty,m=f.fastInnerHTML,w=(f.getComputedStyle,f.getScrollbarWidth),v=(f.getWindowScrollLeft,f.getWindowScrollTop,f.hasClass,f.isChildOf),b=f.removeClass,C=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,y=(i=e("cursor"),i&&i.__esModule&&i||{"default":i}).Cursor,R=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).EventManager,E=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),S=(E.extend,E.isObject,E.objectEach,E.mixin),T=(a=e("utils"),a&&a.__esModule&&a||{"default":a}),O=T.isSeparator,_=T.isDisabled,M=T.isSelectionDisabled,H=T.hasSubMenu,k=T.normalizeSelection,A=(u=e("helpers/unicode"),u&&u.__esModule&&u||{"default":u}).KEY_CODES,P=(c=e("mixins/localHooks"),c&&c.__esModule&&c||{"default":c}).localHooks,x=(d=e("predefinedItems"),d&&d.__esModule&&d||{"default":d}),D=x.SEPARATOR,N=(x.predefinedItems,h=e("helpers/dom/event"),h&&h.__esModule&&h||{"default":h}),L=(N.stopPropagation,N.stopImmediatePropagation),W=(N.pageX,N.pageY,function(e){var t=void 0!==arguments[1]?arguments[1]:{parent:null,name:null,className:"",keepInViewport:!0};this.hot=e,this.options=t,this.eventManager=new R(this),this.container=this.createContainer(this.options.name),this.hotMenu=null,this.hotSubMenus={},this.parentMenu=this.options.parent||null,this.menuItems=null,this.origOutsideClickDeselects=null,this._afterScrollCallback=null,this.registerEvents()}),I=W;$traceurRuntime.createClass(W,{registerEvents:function(){var e=this;this.eventManager.addEventListener(document.documentElement,"mousedown",function(t){return e.onDocumentMouseDown(t)})},setMenuItems:function(e){this.menuItems=e},isSubMenu:function(){return null!==this.parentMenu},open:function(){var e=this;this.container.removeAttribute("style"),this.container.style.display="block";var t={data:this.menuItems,colHeaders:!1,colWidths:[200],autoRowSize:!1,readOnly:!0,copyPaste:!1,columns:[{data:"name",renderer:function(t,n,o,r,i,s){return e.menuItemRenderer(t,n,o,r,i,s)}}],renderAllRows:!0,fragmentSelection:"cell",beforeKeyDown:function(t){return e.onBeforeKeyDown(t)},afterOnCellMouseOver:function(t,n,o){return e.openSubMenu(n.row)}};this.origOutsideClickDeselects=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1,this.hotMenu=new Handsontable.Core(this.container,t),this.hotMenu.addHook("afterInit",function(){return e.onAfterInit()}),this.hotMenu.init(),this.hotMenu.listen(),this.blockMainTableCallbacks(),this.runLocalHooks("afterOpen")},close:function(){var e=void 0!==arguments[0]?arguments[0]:!1;this.isOpened()&&(e&&this.parentMenu?this.parentMenu.close():(this.closeAllSubMenus(),this.container.style.display="none",this.releaseMainTableCallbacks(),this.hotMenu.destroy(),this.hotMenu=null,this.hot.getSettings().outsideClickDeselects=this.origOutsideClickDeselects,this.runLocalHooks("afterClose")))},openSubMenu:function(e){var t=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!t||!H(t))return!1;var n=this.hotMenu.getSourceDataAtRow(e),o=new I(this.hot,{parent:this,name:n.name,className:this.options.className});return o.setMenuItems(n.submenu.items),o.open(),o.setPosition(t.getBoundingClientRect()),this.hotSubMenus[n.key]=o,o},closeSubMenu:function(e){var t=this.hotMenu.getSourceDataAtRow(e),n=this.hotSubMenus[t.key];n&&(n.destroy(),delete this.hotSubMenus[t.key])},closeAllSubMenus:function(){var e=this;C(this.hotMenu.getData(),function(t,n){return e.closeSubMenu(n)})},isAllSubMenusClosed:function(){return 0===Object.keys(this.hotSubMenus).length},destroy:function(){this.clearLocalHooks(),this.close(),this.parentMenu=null,this.eventManager.destroy()},isOpened:function(){return null!==this.hotMenu},executeCommand:function(e){if(this.isOpened()&&this.hotMenu.getSelected()){var t=this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelected()[0]);if(this.runLocalHooks("select",t,e),t.isCommand!==!1){var n=this.hot.getSelectedRange(),o=n?k(n):{};this.runLocalHooks("executeCommand",t.key,o,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",t.key,o,e),this.close(!0)}}},setPosition:function(e){var t=new y(e);this.options.keepInViewport?(t.fitsBelow(this.container)?this.setPositionBelowCursor(t):t.fitsAbove(this.container)?this.setPositionAboveCursor(t):this.setPositionBelowCursor(t),t.fitsOnRight(this.container)?this.setPositionOnRightOfCursor(t):this.setPositionOnLeftOfCursor(t)):(this.setPositionBelowCursor(t),this.setPositionOnRightOfCursor(t))},setPositionAboveCursor:function(e){var t=e.top-this.container.offsetHeight;this.isSubMenu()&&(t=window.scrollY+e.top+e.cellHeight-this.container.offsetHeight+3),this.container.style.top=t+"px"},setPositionBelowCursor:function(e){var t=e.top-1;this.isSubMenu()&&(t=e.top+window.scrollY-1),this.container.style.top=t+"px"},setPositionOnRightOfCursor:function(e){var t;t=this.isSubMenu()?window.scrollX+1+e.left+e.cellWidth:1+e.left,this.container.style.left=t+"px"},setPositionOnLeftOfCursor:function(e){this.container.style.left=e.left-this.container.offsetWidth+w()+4+"px"},selectFirstCell:function(){var e=this.hotMenu.getCell(0,0);O(e)||_(e)||M(e)?this.selectNextCell(0,0):this.hotMenu.selectCell(0,0)},selectLastCell:function(){var e=this.hotMenu.countRows()-1,t=this.hotMenu.getCell(e,0);O(t)||_(t)||M(t)?this.selectPrevCell(e,0):this.hotMenu.selectCell(e,0)},selectNextCell:function(e,t){var n=e+1,o=n=0?this.hotMenu.getCell(n,t):null;o&&(O(o)||_(o)||M(o)?this.selectPrevCell(n,t):this.hotMenu.selectCell(n,t))},menuItemRenderer:function(e,t,n,o,r,i){var s=this,l=e.getSourceDataAtRow(n),a=document.createElement("div"),u=function(e){return e.hasOwnProperty("submenu")},c=function(e){return new RegExp(D,"i").test(e.name)},d=function(e){return e.disabled===!0||"function"==typeof e.disabled&&e.disabled.call(s.hot)===!0},h=function(e){return"function"==typeof e.hidden&&e.hidden.call(s.hot)===!0},f=function(e){return e.disableSelection},w=h(l);"function"==typeof i&&(i=i.call(this.hot)),p(t),g(a,"htItemWrapper"),t.appendChild(a),c(l)?g(t,"htSeparator"):w||"function"!=typeof l.renderer?m(a,i):(g(t,"htCustomMenuRenderer"),t.appendChild(l.renderer(e,a,n,o,r,i))),w?t.parentNode&&g(t.parentNode,"htHidden"):d(l)?(g(t,"htDisabled"),this.eventManager.addEventListener(a,"mouseenter",function(){return e.deselectCell()})):f(l)?(g(t,"htSelectionDisabled"),this.eventManager.addEventListener(a,"mouseenter",function(){return e.deselectCell()})):u(l)?(g(t,"htSubmenu"),f(l)?this.eventManager.addEventListener(a,"mouseenter",function(){return e.deselectCell()}):this.eventManager.addEventListener(a,"mouseenter",function(){return e.selectCell(n,o,void 0,void 0,void 0,!1)})):(b(t,"htSubmenu"),b(t,"htDisabled"),f(l)?this.eventManager.addEventListener(a,"mouseenter",function(){return e.deselectCell()}):this.eventManager.addEventListener(a,"mouseenter",function(){return e.selectCell(n,o,void 0,void 0,void 0,!1)}))},createContainer:function(){var e=void 0!==arguments[0]?arguments[0]:null;e&&(e=e.replace(/ /g,"_"),e=this.options.className+"Sub_"+e);var t;return t=e?document.querySelector("."+this.options.className+"."+e):document.querySelector("."+this.options.className),t||(t=document.createElement("div"),g(t,"htMenu "+this.options.className),e&&g(t,e),document.getElementsByTagName("body")[0].appendChild(t)),t},blockMainTableCallbacks:function(){this._afterScrollCallback=function(){},this.hot.addHook("afterScrollVertically",this._afterScrollCallback),this.hot.addHook("afterScrollHorizontally",this._afterScrollCallback)},releaseMainTableCallbacks:function(){this._afterScrollCallback&&(this.hot.removeHook("afterScrollVertically",this._afterScrollCallback),this.hot.removeHook("afterScrollHorizontally",this._afterScrollCallback),this._afterScrollCallback=null)},onBeforeKeyDown:function(e){var t=this.hotMenu.getSelected(),n=!1;switch(e.keyCode){case A.ESCAPE:this.close(),n=!0;break;case A.ENTER:t&&(this.hotMenu.getSourceDataAtRow(t[0]).submenu?n=!0:(this.executeCommand(e),this.close(!0)));break;case A.ARROW_DOWN:t?this.selectNextCell(t[0],t[1]):this.selectFirstCell(),n=!0;break;case A.ARROW_UP:t?this.selectPrevCell(t[0],t[1]):this.selectLastCell(),n=!0;break;case A.ARROW_RIGHT:if(t){var o=this.openSubMenu(t[0]);o&&o.selectFirstCell()}n=!0;break;case A.ARROW_LEFT:t&&this.isSubMenu()&&(this.close(),this.parentMenu&&this.parentMenu.hotMenu.listen(),n=!0)}n&&(e.preventDefault(),L(e))},onAfterInit:function(){var e=this.hotMenu.getSettings().data,t=this.hotMenu.view.wt.wtTable.hider.style,n=this.hotMenu.view.wt.wtTable.holder.style,o=parseInt(t.width,10),r=0;C(e,function(e){return r+=e.name===D?1:26}),n.width=o+22+"px",n.height=r+4+"px"},onDocumentMouseDown:function(e){this.isOpened()&&(this.container&&v(e.target,this.container)&&this.executeCommand(e),(this.isAllSubMenusClosed()||this.isSubMenu())&&!v(e.target,".htMenu")&&v(e.target,document)&&this.close(!0))}},{}),S(W,P)},{cursor:67,eventManager:41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,"mixins/localHooks":54,predefinedItems:70,utils:71}],70:[function(e,t,n){"use strict";function o(){var e={};return c(A,function(t,n){return e[n]=d(t)}),e}function r(e,t){-1===k.indexOf(e)&&(A[e]=t)}var i;Object.defineProperties(n,{ROW_ABOVE:{get:function(){return v}},ROW_BELOW:{get:function(){return b}},COLUMN_LEFT:{get:function(){return C}},COLUMN_RIGHT:{get:function(){return y}},CLEAR_COLUMN:{get:function(){return R}},REMOVE_ROW:{get:function(){return E}},REMOVE_COLUMN:{get:function(){return S}},UNDO:{get:function(){return T}},REDO:{get:function(){return O}},READ_ONLY:{get:function(){return _}},ALIGNMENT:{get:function(){return M}},SEPARATOR:{get:function(){return H}},ITEMS:{get:function(){return k}},predefinedItems:{get:function(){return o}},addItem:{get:function(){return r}},__esModule:{value:!0}});var s,l,a,u=(s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}),c=u.objectEach,d=u.clone,h=((l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}).rangeEach,a=e("utils"),a&&a.__esModule&&a||{"default":a}),f=h.align,g=h.getAlignmentClasses,p=h.getValidSelection,m=h.checkSelectionConsistency,w=h.markLabelAsSelected,v="row_above",b="row_below",C="col_left",y="col_right",R="clear_column",E="remove_row",S="remove_col",T="undo",O="redo",_="make_read_only",M="alignment",H="---------",k=[v,b,C,y,R,E,S,T,O,_,M,H],A=(i={},Object.defineProperty(i,H,{value:{name:H},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,v,{value:{key:v,name:"Insert row above",callback:function(e,t){this.alter("insert_row",t.start.row)},disabled:function(){var e=p(this);if(!e)return!0;var t=this.countRows(),n=[0,e[1],t-1,e[1]];return n.join(",")===e.join(",")&&t>1},hidden:function(){return!this.getSettings().allowInsertRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,b,{value:{key:b,name:"Insert row below",callback:function(e,t){this.alter("insert_row",t.end.row+1)},disabled:function(){var e=p(this);if(!e)return!0;var t=this.countRows(),n=[0,e[1],t-1,e[1]];return n.join(",")===e.join(",")&&t>1},hidden:function(){return!this.getSettings().allowInsertRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,C,{value:{key:C,name:"Insert column on the left",callback:function(e,t){this.alter("insert_col",t.start.col)},disabled:function(){var e=p(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n},hidden:function(){return!this.getSettings().allowInsertColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,y,{value:{key:y,name:"Insert column on the right",callback:function(e,t){this.alter("insert_col",t.end.col+1)},disabled:function(){var e=p(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n},hidden:function(){return!this.getSettings().allowInsertColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,R,{value:{key:R,name:"Clear column",callback:function(e,t){var n=t.start.col;this.countRows()&&this.populateFromArray(0,n,[[null]],Math.max(t.start.row,t.end.row),n)},disabled:function(){var e=p(this);if(!e)return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,E,{value:{key:E,name:"Remove row",callback:function(e,t){var n=t.end.row-t.start.row+1;this.alter("remove_row",t.start.row,n)},disabled:function(){var e=p(this);if(!e)return!0;var t=[0,e[1],this.countRows()-1,e[1]];return t.join(",")===e.join(",")},hidden:function(){return!this.getSettings().allowRemoveRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,S,{value:{key:S,name:"Remove column",callback:function(e,t){var n=t.end.col-t.start.col+1;this.alter("remove_col",t.start.col,n)},disabled:function(){var e=p(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||n},hidden:function(){return!this.getSettings().allowRemoveColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,T,{value:{key:T,name:"Undo",callback:function(){this.undo()},disabled:function(){return this.undoRedo&&!this.undoRedo.isUndoAvailable()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,O,{value:{key:O,name:"Redo",callback:function(){this.redo()},disabled:function(){return this.undoRedo&&!this.undoRedo.isRedoAvailable()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,_,{value:{key:_,name:function(){var e=this,t="Read only",n=m(this.getSelectedRange(),function(t,n){return e.getCellMeta(t,n).readOnly});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=m(t,function(t,n){return e.getCellMeta(t,n).readOnly});t.forAll(function(t,o){e.getCellMeta(t,o).readOnly=n?!1:!0}),this.render()},disabled:function(){return this.getSelectedRange()?!1:!0}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,M,{value:{key:M,name:"Alignment",disabled:function(){return this.getSelectedRange()?!1:!0},submenu:{items:[{key:M+":left",name:function(){var e=this,t="Left",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htLeft")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htLeft";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":center",name:function(){var e=this,t="Center",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htCenter")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htCenter";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":right",name:function(){var e=this,t="Right",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htRight")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htRight";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":justify",name:function(){var e=this,t="Justify",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htJustify")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htJustify";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{name:H},{key:M+":top",name:function(){var e=this,t="Top",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htTop")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htTop";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":middle",name:function(){var e=this,t="Middle",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htMiddle")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htMiddle";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":bottom",name:function(){var e=this,t="Bottom",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htBottom")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htBottom";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1}]}},configurable:!0,enumerable:!0,writable:!0}),i)},{"helpers/number":49,"helpers/object":50,utils:71}],71:[function(e,t,n){"use strict";function o(e){return{start:e.getTopLeftCorner(),end:e.getBottomRightCorner()}}function r(e){return w(e,"htSeparator")}function i(e){return w(e,"htSubmenu")}function s(e){return w(e,"htDisabled")}function l(e){return w(e,"htSelectionDisabled")}function a(e){var t=e.getSelected();return t?t[0]<0?null:e.countRows()>=e.getSettings().maxRows?null:t:null}function u(e,t){return-1!=e.indexOf(t)?e:(e=e.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ",""),e+=" "+t)}function c(e,t){return-1!=e.indexOf(t)?e:(e=e.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ",""),e+=" "+t)}function d(e,t){for(var n={},o=e.from.row;o<=e.to.row;o++)for(var r=e.from.col;r<=e.to.col;r++)n[o]||(n[o]=[]),n[o][r]=t(o,r);return n}function h(e,t,n,o){if(e.from.row==e.to.row&&e.from.col==e.to.col)f(e.from.row,e.from.col,t,n,o);else for(var r=e.from.row;r<=e.to.row;r++)for(var i=e.from.col;i<=e.to.col;i++)f(r,i,t,n,o)}function f(e,t,n,o,r){var i=r(e,t),s=o;i.className&&(s="vertical"===n?u(i.className,o):c(i.className,o)),i.className=s}function g(e,t){var n=!1;return e&&e.forAll(function(e,o){return t(e,o)?(n=!0,!1):void 0}),n}function p(e){return''+String.fromCharCode(10003)+""+e}Object.defineProperties(n,{normalizeSelection:{get:function(){return o}},isSeparator:{get:function(){return r}},hasSubMenu:{get:function(){return i}},isDisabled:{get:function(){return s}},isSelectionDisabled:{get:function(){return l}},getValidSelection:{get:function(){return a}},prepareVerticalAlignClass:{get:function(){return u}},prepareHorizontalAlignClass:{get:function(){return c}},getAlignmentClasses:{get:function(){return d}},align:{get:function(){return h}},checkSelectionConsistency:{get:function(){return g}},markLabelAsSelected:{get:function(){return p}},__esModule:{value:!0}});var m,w=(m=e("helpers/dom/element"),m&&m.__esModule&&m||{"default":m}).hasClass},{"helpers/dom/element":45}],72:[function(e,t,n){"use strict";Object.defineProperties(n,{ContextMenuCopyPaste:{get:function(){return p}},__esModule:{value:!0}});var o,r,i,s,l,a,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).removeClass,c=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,d=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,h=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}).registerPlugin,f=(l=e("_base"),l&&l.__esModule&&l||{"default":l})["default"],g=(a=e("zeroclipboard"),a&&a.__esModule&&a||{"default":a})["default"],p=function(e){$traceurRuntime.superConstructor(m).call(this,e),this.eventManager=new d(this),this.swfPath=null,this.outsideClickDeselectsCache=null},m=p;$traceurRuntime.createClass(p,{isEnabled:function(){return this.hot.getSettings().contextMenuCopyPaste},enablePlugin:function(){var e=this;if(!this.enabled){"object"==typeof this.hot.getSettings().contextMenuCopyPaste&&(this.swfPath=this.hot.getSettings().contextMenuCopyPaste.swfPath),"undefined"==typeof g&&console.error("To be able to use the Copy/Paste feature from the context menu, you need to manually include ZeroClipboard.js file to your website.");try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(t){"undefined"==typeof navigator.mimeTypes["application/x-shockwave-flash"]&&console.error("To be able to use the Copy/Paste feature from the context menu, your browser needs to have Flash Plugin installed.")}this.swfPath&&g.config({swfPath:this.swfPath}),this.hot.addHook("afterContextMenuShow",function(){return e.onAfterContextMenuShow()}),this.hot.addHook("afterContextMenuDefaultOptions",function(t){return e.onAfterContextMenuDefaultOptions(t)}),this.registerEvents(),$traceurRuntime.superGet(this,m.prototype,"enablePlugin").call(this)}},disablePlugin:function(){$traceurRuntime.superGet(this,m.prototype,"disablePlugin").call(this)},registerEvents:function(){var e=this;this.eventManager.addEventListener(document,"mouseenter",function(){return e.removeCurrentClass()}),this.eventManager.addEventListener(document,"mouseleave",function(){return e.removeZeroClipboardClass()})},getCopyValue:function(){return this.hot.copyPaste.setCopyableText(),this.hot.copyPaste.copyPasteInstance.elTextarea.value},onAfterContextMenuDefaultOptions:function(e){e.items.unshift({key:"copy",name:"Copy"},{key:"paste",name:"Paste",callback:function(){this.copyPaste.triggerPaste()}},Handsontable.plugins.ContextMenu.SEPARATOR)},onAfterContextMenuShow:function(){var e=this,t=this.hot.getPlugin("contextMenu"),n=t.menu.hotMenu.getSourceData();c(n,function(n,o){if("copy"===n.key){var r=new g(t.menu.hotMenu.getCell(o,0));return r.off(),r.on("copy",function(t){var n=t.clipboardData;n.setData("text/plain",e.getCopyValue()),e.hot.getSettings().outsideClickDeselects=e.outsideClickDeselectsCache}),!1}})},removeCurrentClass:function(){var e=this.hot.getPlugin("contextMenu");if(e.menu.isOpened()){var t=e.menu.hotMenu.rootElement.querySelector("td.current");t&&u(t,"current")}this.outsideClickDeselectsCache=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1},removeZeroClipboardClass:function(){var e=this.hot.getPlugin("contextMenu");if(e.menu.isOpened()){var t=e.menu.hotMenu.rootElement.querySelector("td.zeroclipboard-is-hover");t&&u(t,"zeroclipboard-is-hover")}this.hot.getSettings().outsideClickDeselects=this.outsideClickDeselectsCache}},{},f),h("contextMenuCopyPaste",p)},{_base:58,eventManager:41,"helpers/array":42,"helpers/dom/element":45,plugins:57,zeroclipboard:void 0}],73:[function(e,t,n){"use strict";function o(e){function t(){e.isListening()&&e.selection.empty()}function n(t){var n,o,r,i,s,l,a,u,c,d;if(e.isListening()&&e.selection.isSelected()){n=t,o=w.parse(n),r=e.getSelected(),i=new M(r[0],r[1]),s=new M(r[2],r[3]),l=new H(i,i,s),a=l.getTopLeftCorner(),u=l.getBottomRightCorner(),c=a,d=new M(Math.max(u.row,o.length-1+a.row),Math.max(u.col,o[0].length-1+a.col));var h=s.row-i.row>=o.length-1,f=s.col-i.col>=o[0].length-1;e.addHookOnce("afterChange",function(t,n){var o=t?t.length:0;if(o){var r={row:0,col:0},i=-1;y(t,function(e,n){var s=o>n+1?t[n+1]:null;s&&(h||(r.row=r.row+Math.max(s[0]-e[0]-1,0)),!f&&e[1]>i&&(i=e[1],r.col=r.col+Math.max(s[1]-e[1]-1,0)))}),e.selectCell(c.row,c.col,d.row+r.row,d.col+r.col)}}),e.populateFromArray(c.row,c.col,o,d.row,d.col,"paste",e.getSettings().pasteMode)}}function o(t){if(e.getSelected()&&!(e.getActiveEditor()&&e.getActiveEditor().isOpened()||T(t))){if(C(t.keyCode)){if(e.getSettings().fragmentSelection&&O())return;return r.setCopyableText(),void S(t)}var n=(t.ctrlKey||t.metaKey)&&!t.altKey;t.keyCode==b.A&&n&&e._registerTimeout(setTimeout(_(r.setCopyableText,r),0))}}var r=this;this.copyPasteInstance=m(),this.copyPasteInstance.onCut(t),this.copyPasteInstance.onPaste(n),this.onPaste=n,e.addHook("beforeKeyDown",o),this.destroy=function(){this.copyPasteInstance&&(this.copyPasteInstance.removeCallback(t),this.copyPasteInstance.removeCallback(n),this.copyPasteInstance.destroy(),this.copyPasteInstance=null),e.removeHook("beforeKeyDown",o)},e.addHook("afterDestroy",_(this.destroy,this)),this.triggerPaste=_(this.copyPasteInstance.triggerPaste,this.copyPasteInstance),this.triggerCut=_(this.copyPasteInstance.triggerCut,this.copyPasteInstance),this.setCopyableText=function(){var t=e.getSettings(),n=t.copyRowsLimit,o=t.copyColsLimit,r=e.getSelectedRange(),i=r.getTopLeftCorner(),s=r.getBottomRightCorner(),l=i.row,a=i.col,u=s.row,c=s.col,d=Math.min(u,l+n-1),h=Math.min(c,a+o-1),f=[];f.push({startRow:l,startCol:a,endRow:d,endCol:h}),f=Handsontable.hooks.run(e,"modifyCopyableRange",f);var g=this.getRangedCopyableData(f);e.copyPaste.copyPasteInstance.copyable(g),(u!==d||c!==h)&&Handsontable.hooks.run(e,"afterCopyLimit",u-l+1,c-a+1,n,o)},this.getRangedCopyableData=function(t){var n=[],o=[],r=[];return y(t,function(e){R(e.startRow,e.endRow,function(e){-1===o.indexOf(e)&&o.push(e)}),R(e.startCol,e.endCol,function(e){-1===r.indexOf(e)&&r.push(e)})}),y(o,function(t){var o=[];y(r,function(n){o.push(e.getCopyableData(t,n))}),n.push(o)}),w.stringify(n)}}function r(){var e=this,t=e.getSettings().copyPaste!==!1;t&&!e.copyPaste?e.copyPaste=new o(e):!t&&e.copyPaste&&(e.copyPaste.destroy(),e.copyPaste=null)}Object.defineProperties(n,{CopyPastePlugin:{get:function(){return o}},__esModule:{value:!0}});var i,s,l,a,u,c,d,h,f,g,p,m=(i=e("copyPaste"),i&&i.__esModule&&i||{"default":i})["default"],w=(s=e("SheetClip"),s&&s.__esModule&&s||{"default":s})["default"],v=(l=e("helpers/unicode"),l&&l.__esModule&&l||{"default":l}),b=v.KEY_CODES,C=v.isCtrlKey,y=(a=e("helpers/array"),a&&a.__esModule&&a||{"default":a}).arrayEach,R=(u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}).rangeEach,E=(c=e("helpers/dom/event"),c&&c.__esModule&&c||{"default":c}),S=E.stopImmediatePropagation,T=E.isImmediatePropagationStopped,O=(d=e("helpers/dom/element"),d&&d.__esModule&&d||{"default":d}).getSelectionText,_=(h=e("helpers/function"),h&&h.__esModule&&h||{"default":h}).proxy,M=((f=e("plugins"),f&&f.__esModule&&f||{"default":f}).registerPlugin,(g=e("3rdparty/walkontable/src/cell/coords"),g&&g.__esModule&&g||{"default":g}).WalkontableCellCoords),H=(p=e("3rdparty/walkontable/src/cell/range"),p&&p.__esModule&&p||{"default":p}).WalkontableCellRange;Handsontable.hooks.add("afterInit",r),Handsontable.hooks.add("afterUpdateSettings",r),Handsontable.hooks.register("afterCopyLimit"),Handsontable.hooks.register("modifyCopyableRange")},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,SheetClip:"SheetClip",copyPaste:"copyPaste","helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/function":47,"helpers/number":49,"helpers/unicode":53,plugins:57}],74:[function(e,t,n){"use strict";function o(){}var r,i,s,l,a=((r=e("plugins"),r&&r.__esModule&&r||{"default":r}).registerPlugin,(i=e("3rdparty/walkontable/src/cell/range"),i&&i.__esModule&&i||{"default":i}).WalkontableCellRange),u=(s=e("3rdparty/walkontable/src/selection"),s&&s.__esModule&&s||{"default":s}).WalkontableSelection,c=function(e){return"boolean"==typeof e&&e===!0?!0:"object"==typeof e&&e.length>0?!0:!1},d=function(){c(this.getSettings().customBorders)&&(this.customBorders||(l=this,this.customBorders=new o))},h=function(e){for(var t=0;t=0?l.view.wt.selections[o]=n:l.view.wt.selections.push(n)},g=function(e,t,n){var o=C(e,t);o=y(o,n),this.setCellMeta(e,t,"borders",o),f(o)},p=function(e){for(var t=e.range,n=t.from.row;n<=t.to.row;n++)for(var o=t.from.col;o<=t.to.col;o++){var r=C(n,o),i=0;n==t.from.row&&(i++,e.hasOwnProperty("top")&&(r.top=e.top)),n==t.to.row&&(i++,e.hasOwnProperty("bottom")&&(r.bottom=e.bottom)),o==t.from.col&&(i++,e.hasOwnProperty("left")&&(r.left=e.left)),o==t.to.col&&(i++,e.hasOwnProperty("right")&&(r.right=e.right)),i>0&&(this.setCellMeta(n,o,"borders",r),f(r))}},m=function(e,t){return"border_row"+e+"col"+t},w=function(){return{width:1,color:"#000"}},v=function(){return{hide:!0}},b=function(){return{width:1,color:"#000",cornerVisible:!1}},C=function(e,t){return{className:m(e,t),border:b(),row:e,col:t,top:v(),right:v(),bottom:v(),left:v()}},y=function(e,t){return t.hasOwnProperty("border")&&(e.border=t.border),t.hasOwnProperty("top")&&(e.top=t.top),t.hasOwnProperty("right")&&(e.right=t.right),t.hasOwnProperty("bottom")&&(e.bottom=t.bottom),t.hasOwnProperty("left")&&(e.left=t.left),e},R=function(e){for(var t=document.querySelectorAll("."+e),n=0;n'+String.fromCharCode(10003)+""+e},M=function(e){this.getSettings().customBorders&&(e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR),e.items.push({key:"borders",name:"Borders",submenu:{items:[{key:"borders:top",name:function(){var e="Top",t=O(this,"top");return t&&(e=_(e)),e},callback:function(){var e=O(this,"top");T.call(this,this.getSelectedRange(),"top",e)},disabled:!1},{key:"borders:right",name:function(){var e="Right",t=O(this,"right");return t&&(e=_(e)),e},callback:function(){var e=O(this,"right");T.call(this,this.getSelectedRange(),"right",e)},disabled:!1},{key:"borders:bottom",name:function(){var e="Bottom",t=O(this,"bottom");return t&&(e=_(e)),e},callback:function(){var e=O(this,"bottom");T.call(this,this.getSelectedRange(),"bottom",e)},disabled:!1},{key:"borders:left",name:function(){var e="Left",t=O(this,"left");return t&&(e=_(e)),e},callback:function(){var e=O(this,"left");T.call(this,this.getSelectedRange(),"left",e)},disabled:!1},{key:"borders:no_borders",name:"Remove border(s)",callback:function(){T.call(this,this.getSelectedRange(),"noBorders")},disabled:function(){return!O(this)}}]}}))};Handsontable.hooks.add("beforeInit",d),Handsontable.hooks.add("afterContextMenuDefaultOptions",M),Handsontable.hooks.add("afterInit",function(){var e=this.getSettings().customBorders;if(e){for(var t=0;tthis.boundaries.bottom&&(o=t-this.boundaries.bottom),ethis.boundaries.right&&(n=e-this.boundaries.right),this.callback(n,o)};var l,a=function(e){e.dragToScrollListening=!1;var t=e.view.wt.wtTable.holder;l=new o,t!==window&&(l.setBoundaries(t.getBoundingClientRect()),l.setCallback(function(e,n){0>e?t.scrollLeft-=50:e>0&&(t.scrollLeft+=50),0>n?t.scrollTop-=20:n>0&&(t.scrollTop+=20)}),e.dragToScrollListening=!0)};Handsontable.hooks.add("afterInit",function(){var e=this,t=s(this);t.addEventListener(document,"mouseup",function(){e.dragToScrollListening=!1}),t.addEventListener(document,"mousemove",function(t){e.dragToScrollListening&&l.check(t.clientX,t.clientY)})}),Handsontable.hooks.add("afterDestroy",function(){s(this).clear()}),Handsontable.hooks.add("afterOnCellMouseDown",function(){a(this)}),Handsontable.hooks.add("afterOnCellCornerMouseDown",function(){a(this)}),Handsontable.plugins.DragToScroll=o},{eventManager:41,plugins:57}],76:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualColumnFreeze:{get:function(){return l}},__esModule:{value:!0}});var o,r,i=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],s=(r=e("plugins"),r&&r.__esModule&&r||{"default":r}).registerPlugin,l=function(e){$traceurRuntime.superConstructor(a).call(this,e)},a=l;$traceurRuntime.createClass(l,{isEnabled:function(){return!!this.hot.getSettings().manualColumnFreeze},enablePlugin:function(){var e=this;this.enabled||(this.addHook("modifyCol",function(t){return e.onModifyCol(t)}),this.addHook("afterContextMenuDefaultOptions",function(t){return e.addContextMenuEntry(t)}),$traceurRuntime.superGet(this,a.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,a.prototype,"disablePlugin").call(this)},init:function(){$traceurRuntime.superGet(this,a.prototype,"init").call(this),"undefined"==typeof this.hot.manualColumnPositionsPluginUsages?this.hot.manualColumnPositionsPluginUsages=["manualColumnFreeze"]:this.hot.manualColumnPositionsPluginUsages.push("manualColumnFreeze"),this.fixedColumnsCount=this.hot.getSettings().fixedColumnsLeft},onModifyCol:function(e){return this.hot.manualColumnPositionsPluginUsages.length>1?e:this.getModifiedColumnIndex(e)},getModifiedColumnIndex:function(e){return this.hot.manualColumnPositions[e]},addContextMenuEntry:function(e){var t=this;e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR,{key:"freeze_column",name:function(){var e=t.hot.getSelected()[1];return e>t.fixedColumnsCount-1?"Freeze this column":"Unfreeze this column"},disabled:function(){var e=t.hot.getSelected();return e[1]!==e[3]},callback:function(){var e=t.hot.getSelected()[1];e>t.fixedColumnsCount-1?t.freezeColumn(e):t.unfreezeColumn(e)}})},freezeColumn:function(e){if(!(e<=this.fixedColumnsCount-1)){var t=this.getModifiedColumnIndex(e)||e;this.checkPositionData(t),this.modifyColumnOrder(t,e,null,"freeze"),this.addFixedColumn(),this.hot.view.wt.wtOverlays.leftOverlay.refresh(),this.hot.view.wt.wtOverlays.adjustElementsSize()}},unfreezeColumn:function(e){if(!(e>this.fixedColumnsCount-1)){var t=this.getBestColumnReturnPosition(e),n=this.getModifiedColumnIndex(e)||e;this.checkPositionData(n),this.modifyColumnOrder(n,e,t,"unfreeze"),this.removeFixedColumn(),this.hot.view.wt.wtOverlays.leftOverlay.refresh(),this.hot.view.wt.wtOverlays.adjustElementsSize()}},addFixedColumn:function(){this.hot.updateSettings({fixedColumnsLeft:this.fixedColumnsCount+1}),this.fixedColumnsCount++},removeFixedColumn:function(){this.hot.updateSettings({fixedColumnsLeft:this.fixedColumnsCount-1}),this.fixedColumnsCount--},checkPositionData:function(e){this.hot.manualColumnPositions&&0!==this.hot.manualColumnPositions.length||this.hot.manualColumnPositions||(this.hot.manualColumnPositions=[]),e?this.hot.manualColumnPositions[e]||this.createPositionData(e+1):this.createPositionData(this.hot.countCols())},createPositionData:function(e){if(this.hot.manualColumnPositions.lengtht;t++)this.hot.manualColumnPositions[t]=t},modifyColumnOrder:function(e,t,n,o){null==n&&(n=e),"freeze"===o?this.hot.manualColumnPositions.splice(this.fixedColumnsCount,0,this.hot.manualColumnPositions.splice(t,1)[0]):"unfreeze"===o&&this.hot.manualColumnPositions.splice(n,0,this.hot.manualColumnPositions.splice(t,1)[0])},getBestColumnReturnPosition:function(e){for(var t=this.fixedColumnsCount,n=this.getModifiedColumnIndex(t),o=this.getModifiedColumnIndex(e);o>n;)t++,n=this.getModifiedColumnIndex(t);return t-1}},{},i),s("manualColumnFreeze",l)},{_base:58,plugins:57}],77:[function(e,t,n){"use strict";function o(){function e(e){p=this,m=e;var t=this.view.wt.wtTable.getCoords(e).col;if(t>=0){f=t;var n=m.getBoundingClientRect();a=n.left,w.style.top=n.top+"px",w.style.left=a+"px",p.rootElement.appendChild(w)}}function t(e,t){var n=e.getBoundingClientRect(),o=6;t>0?w.style.left=n.left+n.width-o+"px":w.style.left=n.left+"px"}function n(){var e=this;u(w,"active"),u(v,"active");var t=m.getBoundingClientRect();v.style.width=t.width+"px",v.style.height=e.view.maximumVisibleElementHeight(0)+"px",v.style.top=w.style.top,v.style.left=a+"px",e.rootElement.appendChild(v)}function o(e){v.style.left=a+e+"px"}function r(){d(w,"active"),d(v,"active")}var i,s,l,a,f,p,m,w=document.createElement("DIV"),v=document.createElement("DIV"),b=h(this);w.className="manualColumnMover",v.className="manualColumnMoverGuide";var C=function(){var e=this;Handsontable.hooks.run(e,"persistentStateSave","manualColumnPositions",e.manualColumnPositions)},y=function(){var e=this,t={};return Handsontable.hooks.run(e,"persistentStateLoad","manualColumnPositions",t),t.value},R=function(e){return"BODY"!=e.tagName?"THEAD"==e.parentNode.tagName?!0:(e=e.parentNode,R(e)):!1},E=function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:E(e.parentNode):null},S=function(){var a,u=this;b.addEventListener(u.rootElement,"mouseover",function(n){if(R(n.target)){var o=E(n.target);if(o)if(a){var r=u.view.wt.wtTable.getCoords(o).col;r>=0&&(s=r,t(n.target,s-i))}else e.call(u,o)}}),b.addEventListener(u.rootElement,"mousedown",function(e){c(e.target,"manualColumnMover")&&(l=g(e),n.call(u),a=u,i=f,s=f)}),b.addEventListener(window,"mousemove",function(e){a&&o(g(e)-l)}),b.addEventListener(window,"mouseup",function(t){a&&(r(),a=!1,O(u.manualColumnPositions,u.countCols()),u.manualColumnPositions.splice(s,0,u.manualColumnPositions.splice(i,1)[0]),Handsontable.hooks.run(u,"beforeColumnMove",i,s),u.forceFullRender=!0,u.view.render(),C.call(u),Handsontable.hooks.run(u,"afterColumnMove",i,s),e.call(u,m))}),u.addHook("afterDestroy",T)},T=function(){b.clear()},O=function(e,t){if(e.lengthn;n++)e[n]=n};this.beforeInit=function(){this.manualColumnPositions=[]},this.init=function(e){var t=this,n=!!this.getSettings().manualColumnMove;if(n){var o=this.getSettings().manualColumnMove,r=y.call(t);"undefined"!=typeof r?this.manualColumnPositions=r:Array.isArray(o)?this.manualColumnPositions=o:this.manualColumnPositions=[],("afterInit"===e||"afterUpdateSettings"===e&&0===b.context.eventListeners.length)&&("undefined"==typeof t.manualColumnPositionsPluginUsages?t.manualColumnPositionsPluginUsages=["manualColumnMove"]:t.manualColumnPositionsPluginUsages.push("manualColumnMove"),S.call(this),this.manualColumnPositions.length>0&&(this.forceFullRender=!0,this.render()))}else{var i=t.manualColumnPositionsPluginUsages?t.manualColumnPositionsPluginUsages.indexOf("manualColumnMove"):-1;i>-1&&(T.call(this),this.manualColumnPositions=[],t.manualColumnPositionsPluginUsages[i]=void 0)}},this.modifyCol=function(e){return this.getSettings().manualColumnMove?("undefined"==typeof this.manualColumnPositions[e]&&O(this.manualColumnPositions,e+1),this.manualColumnPositions[e]):e},this.afterRemoveCol=function(e,t){if(this.getSettings().manualColumnMove){var n,o=this.manualColumnPositions;n=o.splice(e,t),o=o.map(function(e){var t,o=e;for(t=0;tn[t]&&o--;return o}),this.manualColumnPositions=o}},this.afterCreateCol=function(e,t){if(this.getSettings().manualColumnMove){var n=this.manualColumnPositions;if(n.length){for(var o=[],r=0;t>r;r++)o.push(e+r);e>=n.length?n.concat(o):(n=n.map(function(n){return n>=e?n+t:n}),n.splice.apply(n,[e,0].concat(o))),this.manualColumnPositions=n}}}}Object.defineProperties(n,{ManualColumnMove:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=a.addClass,c=a.hasClass,d=a.removeClass,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,f=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=f.pageX,p=(f.pageY,(l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin,new o);Handsontable.hooks.add("beforeInit",p.beforeInit),Handsontable.hooks.add("afterInit",function(){p.init.call(this,"afterInit")}),Handsontable.hooks.add("afterUpdateSettings",function(){p.init.call(this,"afterUpdateSettings")}),Handsontable.hooks.add("modifyCol",p.modifyCol),Handsontable.hooks.add("afterRemoveCol",p.afterRemoveCol),Handsontable.hooks.add("afterCreateCol",p.afterCreateCol),Handsontable.hooks.register("beforeColumnMove"),Handsontable.hooks.register("afterColumnMove")},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],78:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualColumnResize:{get:function(){return w}},__esModule:{value:!0}});var o,r,i,s,l,a=(o=e("_base.js"),o&&o.__esModule&&o||{"default":o})["default"],u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=u.addClass,d=u.hasClass,h=u.removeClass,f=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,g=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=g.pageX,m=(g.pageY,(l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin),w=function(e){$traceurRuntime.superConstructor(v).call(this,e),this.currentTH=null,this.currentCol=null,this.currentWidth=null,this.newSize=null,this.startY=null,this.startWidth=null,this.startOffset=null,this.handle=document.createElement("DIV"),this.guide=document.createElement("DIV"),this.eventManager=f(this),this.pressed=null,this.dblclick=0,this.autoresizeTimeout=null,this.manualColumnWidths=[],c(this.handle,"manualColumnResizer"),c(this.guide,"manualColumnResizerGuide")},v=w;$traceurRuntime.createClass(w,{isEnabled:function(){return this.hot.getSettings().manualColumnResize},enablePlugin:function(){var e=this;if(!this.enabled){this.manualColumnWidths=[];var t=this.hot.getSettings().manualColumnResize,n=this.loadManualColumnWidths();this.addHook("modifyColWidth",function(t,n){return e.onModifyColWidth(t,n)}),"undefined"!=typeof n?this.manualColumnWidths=n:Array.isArray(t)?this.manualColumnWidths=t:this.manualColumnWidths=[],Handsontable.hooks.register("beforeColumnResize"),Handsontable.hooks.register("afterColumnResize"),this.bindEvents(),$traceurRuntime.superGet(this,v.prototype,"enablePlugin").call(this)}},updatePlugin:function(){var e=this.hot.getSettings().manualColumnResize;Array.isArray(e)?this.manualColumnWidths=e:this.manualColumnWidths=[]},disablePlugin:function(){$traceurRuntime.superGet(this,v.prototype,"disablePlugin").call(this)},saveManualColumnWidths:function(){this.hot.runHooks("persistentStateSave","manualColumnWidths",this.manualColumnWidths)},loadManualColumnWidths:function(){var e={};return this.hot.runHooks("persistentStateLoad","manualColumnWidths",e),e.value},setupHandlePosition:function(e){this.currentTH=e;var t=this.hot.view.wt.wtTable.getCoords(e).col;if(t>=0){var n=this.currentTH.getBoundingClientRect();this.currentCol=t,this.startOffset=n.left-6,this.startWidth=parseInt(n.width,10),this.handle.style.top=n.top+"px",this.handle.style.left=this.startOffset+this.startWidth+"px",this.hot.rootElement.appendChild(this.handle)}},refreshHandlePosition:function(){this.handle.style.left=this.startOffset+this.currentWidth+"px"},setupGuidePosition:function(){c(this.handle,"active"),c(this.guide,"active"),this.guide.style.top=this.handle.style.top,this.guide.style.left=this.handle.style.left,this.guide.style.height=this.hot.view.maximumVisibleElementHeight(0)+"px",this.hot.rootElement.appendChild(this.guide)},refreshGuidePosition:function(){this.guide.style.left=this.handle.style.left},hideHandleAndGuide:function(){h(this.handle,"active"),h(this.guide,"active")},checkIfColumnHeader:function(e){return"BODY"!=e.tagName?"THEAD"==e.parentNode.tagName?!0:(e=e.parentNode,this.checkIfColumnHeader(e)):!1},getTHFromTargetElement:function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:this.getTHFromTargetElement(e.parentNode):null},onMouseOver:function(e){if(this.checkIfColumnHeader(e.target)){var t=this.getTHFromTargetElement(e.target);if(!t)return;var n=t.getAttribute("colspan");!t||null!==n&&1!==n||this.pressed||this.setupHandlePosition(t)}},afterMouseDownTimeout:function(){if(this.dblclick>=2){var e=this.hot.runHooks("beforeColumnResize",this.currentCol,this.newSize,!0);void 0!==e&&(this.newSize=e),this.setManualSize(this.currentCol,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.hot.runHooks("afterColumnResize",this.currentCol,this.newSize,!0)}this.dblclick=0,this.autoresizeTimeout=null},onMouseDown:function(e){var t=this;d(e.target,"manualColumnResizer")&&(this.setupGuidePosition(),this.pressed=this.hot,null===this.autoresizeTimeout&&(this.autoresizeTimeout=setTimeout(function(){return t.afterMouseDownTimeout()},500),this.hot._registerTimeout(this.autoresizeTimeout)),this.dblclick++,this.startX=p(e),this.newSize=this.startWidth)},onMouseMove:function(e){this.pressed&&(this.currentWidth=this.startWidth+(p(e)-this.startX),this.newSize=this.setManualSize(this.currentCol,this.currentWidth),this.refreshHandlePosition(),this.refreshGuidePosition())},onMouseUp:function(e){this.pressed&&(this.hideHandleAndGuide(),this.pressed=!1,this.newSize!=this.startWidth&&(this.hot.runHooks("beforeColumnResize",this.currentCol,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",this.currentCol,this.newSize)),this.setupHandlePosition(this.currentTH))},bindEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},setManualSize:function(e,t){return t=Math.max(t,20),e=this.hot.runHooks("modifyCol",e),this.manualColumnWidths[e]=t,t},onModifyColWidth:function(e,t){return this.enabled&&(t=this.hot.runHooks("modifyCol",t),this.hot.getSettings().manualColumnResize&&this.manualColumnWidths[t])?this.manualColumnWidths[t]:e}},{},a),m("manualColumnResize",w)},{"_base.js":58,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],79:[function(e,t,n){"use strict";function o(){function e(e){var t=this;p=e;var n=this.view.wt.wtTable.getCoords(e).row;if(n>=0){f=n;var o=p.getBoundingClientRect();a=o.top,m.style.top=a+"px",m.style.left=o.left+"px",t.rootElement.appendChild(m)}}function t(e,t){var n=e.getBoundingClientRect(),o=6;t>0?m.style.top=n.top+n.height-o+"px":m.style.top=n.top+"px"}function n(){var e=this;u(m,"active"),u(w,"active");var t=p.getBoundingClientRect();w.style.width=e.view.maximumVisibleElementWidth(0)+"px",w.style.height=t.height+"px",w.style.top=a+"px",w.style.left=m.style.left,e.rootElement.appendChild(w)}function o(e){w.style.top=a+e+"px"}function r(){d(m,"active"),d(w,"active")}var i,s,l,a,f,p,m=document.createElement("DIV"),w=document.createElement("DIV"),v=h(this);m.className="manualRowMover",w.className="manualRowMoverGuide";var b=function(){var e=this;Handsontable.hooks.run(e,"persistentStateSave","manualRowPositions",e.manualRowPositions)},C=function(){var e=this,t={};return Handsontable.hooks.run(e,"persistentStateLoad","manualRowPositions",t),t.value},y=function(e){return"BODY"!=e.tagName?"TBODY"==e.parentNode.tagName?!0:(e=e.parentNode,y(e)):!1},R=function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:R(e.parentNode):null},E=function(){var a,u=this;v.addEventListener(u.rootElement,"mouseover",function(n){if(y(n.target)){var o=R(n.target);o&&(a?(s=u.view.wt.wtTable.getCoords(o).row,t(o,s-i)):e.call(u,o))}}),v.addEventListener(u.rootElement,"mousedown",function(e){c(e.target,"manualRowMover")&&(l=g(e),n.call(u),a=u,i=f,s=f)}),v.addEventListener(window,"mousemove",function(e){a&&o(g(e)-l)}),v.addEventListener(window,"mouseup",function(t){a&&(r(),a=!1,T(u.manualRowPositions,u.countRows()),u.manualRowPositions.splice(s,0,u.manualRowPositions.splice(i,1)[0]),Handsontable.hooks.run(u,"beforeRowMove",i,s),u.forceFullRender=!0,u.view.render(),b.call(u),Handsontable.hooks.run(u,"afterRowMove",i,s),e.call(u,p))}),u.addHook("afterDestroy",S)},S=function(){v.clear()},T=function(e,t){if(e.lengthn;n++)e[n]=n};this.beforeInit=function(){this.manualRowPositions=[]},this.init=function(e){var t=this,n=!!t.getSettings().manualRowMove;if(n){var o=t.getSettings().manualRowMove,r=C.call(t);"undefined"==typeof t.manualRowPositionsPluginUsages?t.manualRowPositionsPluginUsages=["manualColumnMove"]:t.manualRowPositionsPluginUsages.push("manualColumnMove"),"undefined"!=typeof r?this.manualRowPositions=r:Array.isArray(o)?this.manualRowPositions=o:this.manualRowPositions=[],("afterInit"===e||"afterUpdateSettings"===e&&0===v.context.eventListeners.length)&&(E.call(this),this.manualRowPositions.length>0&&(t.forceFullRender=!0,t.render()))}else{var i=t.manualRowPositionsPluginUsages?t.manualRowPositionsPluginUsages.indexOf("manualColumnMove"):-1;i>-1&&(S.call(this),t.manualRowPositions=[],t.manualRowPositionsPluginUsages[i]=void 0)}},this.modifyRow=function(e){var t=this;return t.getSettings().manualRowMove?("undefined"==typeof t.manualRowPositions[e]&&T(this.manualRowPositions,e+1),t.manualRowPositions[e]):e}}Object.defineProperties(n,{ManualRowMove:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=a.addClass,c=a.hasClass,d=a.removeClass,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,f=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=(f.pageX,f.pageY),p=((l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin,new o);Handsontable.hooks.add("beforeInit",p.beforeInit),Handsontable.hooks.add("afterInit",function(){p.init.call(this,"afterInit")}),Handsontable.hooks.add("afterUpdateSettings",function(){p.init.call(this,"afterUpdateSettings")}),Handsontable.hooks.add("modifyRow",p.modifyRow),Handsontable.hooks.register("beforeRowMove"),Handsontable.hooks.register("afterRowMove")},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],80:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualRowResize:{get:function(){return w}},__esModule:{value:!0}});var o,r,i,s,l,a=(o=e("_base.js"),o&&o.__esModule&&o||{"default":o})["default"],u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=u.addClass,d=u.hasClass,h=u.removeClass,f=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,g=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=(g.pageX,g.pageY),m=(l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin,w=function(e){$traceurRuntime.superConstructor(v).call(this,e),this.currentTH=null,this.currentRow=null,this.currentHeight=null,this.newSize=null,this.startY=null,this.startHeight=null,this.startOffset=null,this.handle=document.createElement("DIV"),this.guide=document.createElement("DIV"),this.eventManager=f(this),this.pressed=null,this.dblclick=0,this.autoresizeTimeout=null,this.manualRowHeights=[],c(this.handle,"manualRowResizer"),c(this.guide,"manualRowResizerGuide")},v=w;$traceurRuntime.createClass(w,{isEnabled:function(){return this.hot.getSettings().manualRowResize},enablePlugin:function(){var e=this;if(!this.enabled){this.manualRowHeights=[];var t=this.hot.getSettings().manualRowResize,n=this.loadManualRowHeights();"undefined"!=typeof n?this.manualRowHeights=n:Array.isArray(t)?this.manualRowHeights=t:this.manualRowHeights=[],this.addHook("modifyRowHeight",function(t,n){return e.onModifyRowHeight(t,n)}),Handsontable.hooks.register("beforeRowResize"),Handsontable.hooks.register("afterRowResize"),this.bindEvents(),$traceurRuntime.superGet(this,v.prototype,"enablePlugin").call(this)}},updatePlugin:function(){var e=this.hot.getSettings().manualRowResize;Array.isArray(e)?this.manualRowHeights=e:this.manualRowHeights=[]},disablePlugin:function(){$traceurRuntime.superGet(this,v.prototype,"disablePlugin").call(this)},saveManualRowHeights:function(){this.hot.runHooks("persistentStateSave","manualRowHeights",this.manualRowHeights)},loadManualRowHeights:function(){var e={};return this.hot.runHooks("persistentStateLoad","manualRowHeights",e),e.value},setupHandlePosition:function(e){this.currentTH=e;var t=this.hot.view.wt.wtTable.getCoords(e).row;if(t>=0){var n=this.currentTH.getBoundingClientRect();this.currentRow=t,this.startOffset=n.top-6,this.startHeight=parseInt(n.height,10),this.handle.style.left=n.left+"px",this.handle.style.top=this.startOffset+this.startHeight+"px",this.hot.rootElement.appendChild(this.handle)}},refreshHandlePosition:function(){this.handle.style.top=this.startOffset+this.currentHeight+"px"},setupGuidePosition:function(){c(this.handle,"active"),c(this.guide,"active"),this.guide.style.top=this.handle.style.top,this.guide.style.left=this.handle.style.left,this.guide.style.width=this.hot.view.maximumVisibleElementWidth(0)+"px",this.hot.rootElement.appendChild(this.guide)},refreshGuidePosition:function(){this.guide.style.top=this.handle.style.top},hideHandleAndGuide:function(){h(this.handle,"active"),h(this.guide,"active")},checkIfRowHeader:function(e){return"BODY"!=e.tagName?"TBODY"==e.parentNode.tagName?!0:(e=e.parentNode,this.checkIfRowHeader(e)):!1},getTHFromTargetElement:function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:this.getTHFromTargetElement(e.parentNode):null},onMouseOver:function(e){if(this.checkIfRowHeader(e.target)){var t=this.getTHFromTargetElement(e.target);t&&(this.pressed||this.setupHandlePosition(t))}},afterMouseDownTimeout:function(){if(this.dblclick>=2){var e=this.hot.runHooks("beforeRowResize",this.currentRow,this.newSize,!0);void 0!==e&&(this.newSize=e),this.setManualSize(this.currentRow,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.hot.runHooks("afterRowResize",this.currentRow,this.newSize,!0)}this.dblclick=0,this.autoresizeTimeout=null},onMouseDown:function(e){var t=this;d(e.target,"manualRowResizer")&&(this.setupGuidePosition(),this.pressed=this.hot,null==this.autoresizeTimeout&&(this.autoresizeTimeout=setTimeout(function(){return t.afterMouseDownTimeout()},500),this.hot._registerTimeout(this.autoresizeTimeout)),this.dblclick++,this.startY=p(e),this.newSize=this.startHeight)},onMouseMove:function(e){this.pressed&&(this.currentHeight=this.startHeight+(p(e)-this.startY),this.newSize=this.setManualSize(this.currentRow,this.currentHeight),this.refreshHandlePosition(),this.refreshGuidePosition())},onMouseUp:function(e){this.pressed&&(this.hideHandleAndGuide(),this.pressed=!1,this.newSize!=this.startHeight&&(this.hot.runHooks("beforeRowResize",this.currentRow,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.currentRow,this.newSize)),this.setupHandlePosition(this.currentTH))},bindEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},setManualSize:function(e,t){return e=this.hot.runHooks("modifyRow",e),this.manualRowHeights[e]=t,t},onModifyRowHeight:function(e,t){if(this.enabled){var n=this.hot.getPlugin("autoRowSize"),o=n?n.heights[t]:null;t=this.hot.runHooks("modifyRow",t);var r=this.manualRowHeights[t];if(void 0!==r&&(r===o||r>(e||0)))return r}return e}},{},a),m("manualRowResize",w)},{"_base.js":58,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],81:[function(e,t,n){"use strict";function o(){var e=[];return e.getInfo=function(e,t){for(var n=0,o=this.length;o>n;n++)if(this[n].row<=e&&this[n].row+this[n].rowspan-1>=e&&this[n].col<=t&&this[n].col+this[n].colspan-1>=t)return this[n]},e.setInfo=function(e){for(var t=0,n=this.length;n>t;t++)if(this[t].row===e.row&&this[t].col===e.col)return void(this[t]=e);this.push(e)},e.removeInfo=function(e,t){for(var n=0,o=this.length;o>n;n++)if(this[n].row===e&&this[n].col===t){this.splice(n,1);break}},e}function r(e){if(this.mergedCellInfoCollection=new o,Array.isArray(e))for(var t=0,n=e.length;n>t;t++)this.mergedCellInfoCollection.setInfo(e[t])}function i(e,t){var n=this.getSettings().mergeCells;if(n&&!this.selection.isMultiple()){var o=this.mergeCells.mergedCellInfoCollection.getInfo(e[0],e[1]);o&&(e[0]=o.row,e[1]=o.col,e[2]=o.row+o.rowspan-1,e[3]=o.col+o.colspan-1)}}function s(e,t){this.mergeCells&&this.mergeCells.shiftCollection("right",e,t)}function l(e,t){this.mergeCells&&this.mergeCells.shiftCollection("left",e,t)}function a(e,t){this.mergeCells&&this.mergeCells.shiftCollection("down",e,t)}function u(e,t){this.mergeCells&&this.mergeCells.shiftCollection("up",e,t)}Object.defineProperties(n,{MergeCells:{get:function(){return r}},__esModule:{value:!0}});var c,d,h,f,g,p=((c=e("plugins"),c&&c.__esModule&&c||{"default":c}).registerPlugin,(d=e("helpers/dom/event"),d&&d.__esModule&&d||{"default":d}).stopImmediatePropagation),m=(h=e("3rdparty/walkontable/src/cell/coords"),h&&h.__esModule&&h||{"default":h}).WalkontableCellCoords,w=(f=e("3rdparty/walkontable/src/cell/range"),f&&f.__esModule&&f||{"default":f}).WalkontableCellRange,v=(g=e("3rdparty/walkontable/src/table"),g&&g.__esModule&&g||{"default":g}).WalkontableTable;r.prototype.canMergeRange=function(e){return!e.isSingle()},r.prototype.mergeRange=function(e){if(this.canMergeRange(e)){var t=e.getTopLeftCorner(),n=e.getBottomRightCorner(),o={};o.row=t.row,o.col=t.col,o.rowspan=n.row-t.row+1,o.colspan=n.col-t.col+1,this.mergedCellInfoCollection.setInfo(o)}},r.prototype.mergeOrUnmergeSelection=function(e){var t=this.mergedCellInfoCollection.getInfo(e.from.row,e.from.col);t?this.unmergeSelection(e.from):this.mergeSelection(e)},r.prototype.mergeSelection=function(e){this.mergeRange(e)},r.prototype.unmergeSelection=function(e){var t=this.mergedCellInfoCollection.getInfo(e.row,e.col);this.mergedCellInfoCollection.removeInfo(t.row,t.col)},r.prototype.applySpanProperties=function(e,t,n){var o=this.mergedCellInfoCollection.getInfo(t,n);o?o.row===t&&o.col===n?(e.setAttribute("rowspan",o.rowspan),e.setAttribute("colspan",o.colspan)):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"),e.style.display="none"):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"))},r.prototype.modifyTransform=function(e,t,n){var o=function(e,t){return t.row>=e.row&&t.row<=e.row+e.rowspan-1?!0:!1},r=function(e,t){return t.col>=e.col&&t.col<=e.col+e.colspan-1?!0:!1},i=function(e){return new m(t.to.row+e.row,t.to.col+e.col)},s={row:n.row,col:n.col};if("modifyTransformStart"==e){this.lastDesiredCoords||(this.lastDesiredCoords=new m(null,null));for(var l,a=new m(t.highlight.row,t.highlight.col),u=this.mergedCellInfoCollection.getInfo(a.row,a.col),c=0,d=this.mergedCellInfoCollection.length;d>c;c++){var h=this.mergedCellInfoCollection[c];if(h=new m(h.row+h.rowspan-1,h.col+h.colspan-1),t.includes(h)){l=!0;break}}if(u){var f=new m(u.row,u.col),g=new m(u.row+u.rowspan-1,u.col+u.colspan-1),p=new w(f,f,g);p.includes(this.lastDesiredCoords)||(this.lastDesiredCoords=new m(null,null)),s.row=this.lastDesiredCoords.row?this.lastDesiredCoords.row-a.row:s.row,s.col=this.lastDesiredCoords.col?this.lastDesiredCoords.col-a.col:s.col,n.row>0?s.row=u.row+u.rowspan-1-a.row+n.row:n.row<0&&(s.row=a.row-u.row+n.row),n.col>0?s.col=u.col+u.colspan-1-a.col+n.col:n.col<0&&(s.col=a.col-u.col+n.col)}var v=new m(t.highlight.row+s.row,t.highlight.col+s.col),b=this.mergedCellInfoCollection.getInfo(v.row,v.col);b&&(this.lastDesiredCoords=v,s={row:b.row-a.row,col:b.col-a.col})}else if("modifyTransformEnd"==e)for(var c=0,d=this.mergedCellInfoCollection.length;d>c;c++){var C=this.mergedCellInfoCollection[c],f=new m(C.row,C.col),g=new m(C.row+C.rowspan-1,C.col+C.colspan-1),y=new w(f,f,g),R=t.getBordersSharedWith(y);if(y.isEqual(t))t.setDirection("NW-SE");else if(R.length>0){var E=t.highlight.isEqual(y.from);R.indexOf("top")>-1?t.to.isSouthEastOf(y.from)&&E?t.setDirection("NW-SE"):t.to.isSouthWestOf(y.from)&&E&&t.setDirection("NE-SW"):R.indexOf("bottom")>-1&&(t.to.isNorthEastOf(y.from)&&E?t.setDirection("SW-NE"):t.to.isNorthWestOf(y.from)&&E&&t.setDirection("SE-NW"))}var v=i(s),S=o(C,v),T=r(C,v);t.includesRange(y)&&(y.includes(v)||S||T)&&(S&&(s.row<0?s.row-=C.rowspan-1:s.row>0&&(s.row+=C.rowspan-1)),T&&(s.col<0?s.col-=C.colspan-1:s.col>0&&(s.col+=C.colspan-1))); -}0!==s.row&&(n.row=s.row),0!==s.col&&(n.col=s.col)},r.prototype.shiftCollection=function(e,t,n){var o=[0,0];switch(e){case"right":o[0]+=1;break;case"left":o[0]-=1;break;case"down":o[1]+=1;break;case"up":o[1]-=1}for(var r=0;rn;n++)e.mergeCells.mergedCellInfoCollection.setInfo(t[n])}else e.mergeCells=new r(t);else e.mergeCells&&(e.mergeCells.mergedCellInfoCollection=new o)},R=function(e){if(this.mergeCells){var t=(e.ctrlKey||e.metaKey)&&!e.altKey;t&&77===e.keyCode&&(this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()),this.render(),p(e))}},E=function(e){this.getSettings().mergeCells&&(e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR),e.items.push({key:"mergeCells",name:function(){var e=this.getSelected(),t=this.mergeCells.mergedCellInfoCollection.getInfo(e[0],e[1]);return t?"Unmerge cells":"Merge cells"},callback:function(){this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()),this.render()},disabled:function(){return!1}}))},S=function(e,t,n,o,r,i){this.mergeCells&&this.mergeCells.applySpanProperties(e,t,n)},T=function(e){return function(t){var n=this.getSettings().mergeCells;if(n){var o=this.getSelectedRange();if(this.mergeCells.modifyTransform(e,o,t),"modifyTransformEnd"===e){var r=this.countRows(),i=this.countCols();o.from.row<0?o.from.row=0:o.from.row>0&&o.from.row>=r&&(o.from.row=o.from-1),o.from.col<0?o.from.col=0:o.from.col>0&&o.from.col>=i&&(o.from.col=i-1)}}}},O=function(e){this.lastDesiredCoords=null;var t=this.getSettings().mergeCells;if(t){var n=this.getSelectedRange();n.highlight=new m(n.highlight.row,n.highlight.col),n.to=e;var o=!1;do{o=!1;for(var r=0,i=this.mergeCells.mergedCellInfoCollection.length;i>r;r++){var s=this.mergeCells.mergedCellInfoCollection[r],l=new m(s.row,s.col),a=new m(s.row+s.rowspan-1,s.col+s.colspan-1),u=new w(l,l,a);n.expandByRange(u)&&(e.row=n.to.row,e.col=n.to.col,o=!0)}}while(o)}},_=function(e,t){if(t&&"area"==t){var n=this.getSettings().mergeCells;if(n)for(var o=this.getSelectedRange(),r=new w(o.from,o.from,o.from),i=new w(o.to,o.to,o.to),s=0,l=this.mergeCells.mergedCellInfoCollection.length;l>s;s++){var a=this.mergeCells.mergedCellInfoCollection[s],u=new m(a.row,a.col),c=new m(a.row+a.rowspan-1,a.col+a.colspan-1),d=new w(u,u,c);r.expandByRange(d)&&(e[0]=r.from.row,e[1]=r.from.col),i.expandByRange(d)&&(e[2]=i.from.row,e[3]=i.from.col)}}},M=function(e,t,n){var o=this.getSettings().mergeCells;if(o){var r=this.mergeCells.mergedCellInfoCollection.getInfo(e,t);!r||r.row==e&&r.col==t||(n.copyable=!1)}},H=function(e){var t=this.getSettings().mergeCells;if(t)for(var n,o=this.countCols(),r=0;o>r;r++){if(n=this.mergeCells.mergedCellInfoCollection.getInfo(e.startRow,r),n&&n.rowe.endRow)return e.endRow=i,H.call(this,e)}}},k=function(e){var t=this.getSettings().mergeCells;if(t)for(var n,o=this.countRows(),r=0;o>r;r++){if(n=this.mergeCells.mergedCellInfoCollection.getInfo(r,e.startColumn),n&&n.cole.endColumn)return e.endColumn=i,k.call(this,e)}}},A=function(e){if(e&&this.mergeCells){var t=this.mergeCells.mergedCellInfoCollection,n=this.getSelectedRange();for(var o in t)if(n.highlight.row==t[o].row&&n.highlight.col==t[o].col&&n.to.row==t[o].row+t[o].rowspan-1&&n.to.col==t[o].col+t[o].colspan-1)return!1}return e};Handsontable.hooks.add("beforeInit",b),Handsontable.hooks.add("afterInit",C),Handsontable.hooks.add("afterUpdateSettings",y),Handsontable.hooks.add("beforeKeyDown",R),Handsontable.hooks.add("modifyTransformStart",T("modifyTransformStart")),Handsontable.hooks.add("modifyTransformEnd",T("modifyTransformEnd")),Handsontable.hooks.add("beforeSetRangeEnd",O),Handsontable.hooks.add("beforeDrawBorders",_),Handsontable.hooks.add("afterIsMultipleSelection",A),Handsontable.hooks.add("afterRenderer",S),Handsontable.hooks.add("afterContextMenuDefaultOptions",E),Handsontable.hooks.add("afterGetCellMeta",M),Handsontable.hooks.add("afterViewportRowCalculatorOverride",H),Handsontable.hooks.add("afterViewportColumnCalculatorOverride",k),Handsontable.hooks.add("afterAutofillApplyValues",i),Handsontable.hooks.add("afterCreateCol",s),Handsontable.hooks.add("afterRemoveCol",l),Handsontable.hooks.add("afterCreateRow",a),Handsontable.hooks.add("afterRemoveRow",u),Handsontable.MergeCells=r},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/table":20,"helpers/dom/event":46,plugins:57}],82:[function(e,t,n){"use strict";Object.defineProperties(n,{MultipleSelectionHandles:{get:function(){return g}},__esModule:{value:!0}});var o,r,i,s,l=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=l.getWindowScrollTop,u=l.hasClass,c=l.getWindowScrollLeft,d=(r=e("_base"),r&&r.__esModule&&r||{"default":r})["default"],h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,f=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}).registerPlugin,g=function(e){$traceurRuntime.superConstructor(p).call(this,e),this.dragged=[],this.eventManager=null,this.lastSetCell=null},p=g;$traceurRuntime.createClass(g,{isEnabled:function(){return Handsontable.mobileBrowser},enablePlugin:function(){this.enabled||(this.eventManager||(this.eventManager=new h(this)),this.registerListeners(),$traceurRuntime.superGet(this,p.prototype,"enablePlugin").call(this))},registerListeners:function(){function e(e){if(1===t.dragged.length)return t.dragged.splice(0,t.dragged.length),!0;var n=t.dragged.indexOf(e);return-1==n?!1:void(0===n?t.dragged=t.dragged.slice(0,1):1==n&&(t.dragged=t.dragged.slice(-1)))}var t=this;this.eventManager.addEventListener(this.hot.rootElement,"touchstart",function(e){var n;return u(e.target,"topLeftSelectionHandle-HitArea")?(n=t.hot.getSelectedRange(),t.dragged.push("topLeft"),t.touchStartRange={width:n.getWidth(),height:n.getHeight(),direction:n.getDirection()},e.preventDefault(),!1):u(e.target,"bottomRightSelectionHandle-HitArea")?(n=t.hot.getSelectedRange(),t.dragged.push("bottomRight"),t.touchStartRange={width:n.getWidth(),height:n.getHeight(),direction:n.getDirection()},e.preventDefault(),!1):void 0}),this.eventManager.addEventListener(this.hot.rootElement,"touchend",function(n){return u(n.target,"topLeftSelectionHandle-HitArea")?(e.call(t,"topLeft"),t.touchStartRange=void 0,n.preventDefault(),!1):u(n.target,"bottomRightSelectionHandle-HitArea")?(e.call(t,"bottomRight"),t.touchStartRange=void 0,n.preventDefault(),!1):void 0}),this.eventManager.addEventListener(this.hot.rootElement,"touchmove",function(e){var n,o,r,i,s,l,u,d=a(),h=c();0!==t.dragged.length&&(n=document.elementFromPoint(e.touches[0].screenX-h,e.touches[0].screenY-d),n&&n!==t.lastSetCell&&(("TD"==n.nodeName||"TH"==n.nodeName)&&(o=t.hot.getCoords(n),-1==o.col&&(o.col=0),r=t.hot.getSelectedRange(),i=r.getWidth(),s=r.getHeight(),l=r.getDirection(),1==i&&1==s&&t.hot.selection.setRangeEnd(o),u=t.getCurrentRangeCoords(r,o,t.touchStartRange.direction,l,t.dragged[0]),null!==u.start&&t.hot.selection.setRangeStart(u.start),t.hot.selection.setRangeEnd(u.end),t.lastSetCell=n),e.preventDefault()))})},getCurrentRangeCoords:function(e,t,n,o,r){var i=e.getTopLeftCorner(),s=e.getBottomRightCorner(),l=e.getBottomLeftCorner(),a=e.getTopRightCorner(),u={start:null,end:null};switch(n){case"NE-SW":switch(o){case"NE-SW":case"NW-SE":u="topLeft"==r?{start:new WalkontableCellCoords(t.row,e.highlight.col),end:new WalkontableCellCoords(l.row,t.col)}:{start:new WalkontableCellCoords(e.highlight.row,t.col),end:new WalkontableCellCoords(t.row,i.col)};break;case"SE-NW":"bottomRight"==r&&(u={start:new WalkontableCellCoords(s.row,t.col),end:new WalkontableCellCoords(t.row,i.col)})}break;case"NW-SE":switch(o){case"NE-SW":"topLeft"==r?u={start:t,end:l}:u.end=t;break;case"NW-SE":"topLeft"==r?u={start:t,end:s}:u.end=t;break;case"SE-NW":"topLeft"==r?u={start:t,end:i}:u.end=t;break;case"SW-NE":"topLeft"==r?u={start:t,end:a}:u.end=t}break;case"SW-NE":switch(o){case"NW-SE":u="bottomRight"==r?{start:new WalkontableCellCoords(t.row,i.col),end:new WalkontableCellCoords(l.row,t.col)}:{start:new WalkontableCellCoords(i.row,t.col),end:new WalkontableCellCoords(t.row,s.col)};break;case"SW-NE":u="topLeft"==r?{start:new WalkontableCellCoords(e.highlight.row,t.col),end:new WalkontableCellCoords(t.row,s.col)}:{start:new WalkontableCellCoords(t.row,i.col),end:new WalkontableCellCoords(i.row,t.col)};break;case"SE-NW":"bottomRight"==r?u={start:new WalkontableCellCoords(t.row,a.col),end:new WalkontableCellCoords(i.row,t.col)}:"topLeft"==r&&(u={start:l,end:t})}break;case"SE-NW":switch(o){case"NW-SE":case"NE-SW":case"SW-NE":"topLeft"==r&&(u.end=t);break;case"SE-NW":"topLeft"==r?u.end=t:u={start:t,end:i}}}return u},isDragged:function(){return this.dragged.length>0}},{},d),f("multipleSelectionHandles",g)},{_base:58,eventManager:41,"helpers/dom/element":45,plugins:57}],83:[function(e,t,n){"use strict";function o(){}function r(){var e=this,t=e.getSettings().observeChanges;t?(e.observer&&l.call(e),i.call(e),u.call(e)):t||l.call(e)}function i(){var e=this;e.observeChangesActive=!0,e.pauseObservingChanges=function(){e.observeChangesActive=!1},e.resumeObservingChanges=function(){e.observeChangesActive=!0},e.observedData=e.getSourceData(),e.observer=g.observe(e.observedData,function(t){e.observeChangesActive&&(s.call(e,t),e.render()),e.runHooks("afterChangesObserved")})}function s(e){function t(e){var t;return t=o(e),t=n(t)}function n(e){var t=[];return e.filter(function(e){var n=r(e.path);if(-1!=["add","remove"].indexOf(e.op)&&!isNaN(n.col)){if(-1!=t.indexOf(n.col))return!1;t.push(n.col)}return!0})}function o(e){return e.filter(function(e){return!/[\/]length/gi.test(e.path)})}function r(e){var t=e.match(/^\/(\d+)\/?(.*)?$/);return{row:parseInt(t[1],10),col:/^\d*$/.test(t[2])?parseInt(t[2],10):t[2]}}for(var i=this,s=t(e),l=0,a=s.length;a>l;l++){var u=s[l],c=r(u.path);switch(u.op){case"add":isNaN(c.col)?i.runHooks("afterCreateRow",c.row):i.runHooks("afterCreateCol",c.col);break;case"remove":isNaN(c.col)?i.runHooks("afterRemoveRow",c.row,1):i.runHooks("afterRemoveCol",c.col,1);break;case"replace":i.runHooks("afterChange",[c.row,c.col,null,u.value],"external")}}}function l(){var e=this;e.observer&&(a.call(e),c.call(e))}function a(){var e=this;g.unobserve(e.observedData,e.observer),delete e.observedData,delete e.observeChangesActive,delete e.pauseObservingChanges,delete e.resumeObservingChanges}function u(){var e=this;e.addHook("afterDestroy",l),e.addHook("afterCreateRow",d),e.addHook("afterRemoveRow",d),e.addHook("afterCreateCol",d),e.addHook("afterRemoveCol",d),e.addHook("afterChange",function(e,t){"loadData"!=t&&d.call(this)})}function c(){var e=this;e.removeHook("afterDestroy",l),e.removeHook("afterCreateRow",d),e.removeHook("afterRemoveRow",d),e.removeHook("afterCreateCol",d),e.removeHook("afterRemoveCol",d),e.removeHook("afterChange",d)}function d(){var e=this;e.pauseObservingChanges(),e.addHookOnce("afterChangesObserved",function(){e.resumeObservingChanges()})}Object.defineProperties(n,{ObserveChanges:{get:function(){return o}},__esModule:{value:!0}});var h,f,g=((h=e("plugins"),h&&h.__esModule&&h||{"default":h}).registerPlugin,(f=e("jsonpatch"),f&&f.__esModule&&f||{"default":f})["default"]);Handsontable.hooks.add("afterLoadData",r),Handsontable.hooks.add("afterUpdateSettings",r),Handsontable.hooks.register("afterChangesObserved")},{jsonpatch:"jsonpatch",plugins:57}],84:[function(e,t,n){"use strict";function o(e){var t,n=function(){window.localStorage[e+"__persistentStateKeys"]=JSON.stringify(t)},o=function(){var n=window.localStorage[e+"__persistentStateKeys"],o="string"==typeof n?JSON.parse(n):void 0;t=o?o:[]},r=function(){t=[],n()};o(),this.saveValue=function(o,r){window.localStorage[e+"_"+o]=JSON.stringify(r),-1==t.indexOf(o)&&(t.push(o),n())},this.loadValue=function(t,n){t="undefined"==typeof t?n:t;var o=window.localStorage[e+"_"+t];return"undefined"==typeof o?void 0:JSON.parse(o)},this.reset=function(t){window.localStorage.removeItem(e+"_"+t)},this.resetAll=function(){for(var n=0;nl;l++)for(var a=0;i>a;a++){var u=e.getDataAtCell(l,a),c=e.getCellMeta(l,a),d=c.search.callback||n,h=c.search.queryMethod||o,f=h(t,u);if(f){var g={row:l,col:a,data:u};s.push(g)}d&&d(e,l,a,u,f)}return s}},Handsontable.Search.DEFAULT_CALLBACK=function(e,t,n,o,r){e.getCellMeta(t,n).isSearchResult=r},Handsontable.Search.DEFAULT_QUERY_METHOD=function(e,t){return"undefined"!=typeof e&&null!=e&&e.toLowerCase&&0!==e.length?"undefined"==typeof t||null==t?!1:-1!=t.toString().toLowerCase().indexOf(e.toLowerCase()):!1},Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS="htSearchResult",Handsontable.Search.global=function(){var e=Handsontable.Search.DEFAULT_CALLBACK,t=Handsontable.Search.DEFAULT_QUERY_METHOD,n=Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS;return{getDefaultCallback:function(){return e},setDefaultCallback:function(t){e=t},getDefaultQueryMethod:function(){return t},setDefaultQueryMethod:function(e){t=e},getDefaultSearchResultClass:function(){return n},setDefaultSearchResultClass:function(e){n=e}}}(),Handsontable.SearchCellDecorator=function(e,t,n,o,r,i,s){var u=null!==s.search&&"object"==typeof s.search&&s.search.searchResultClass||Handsontable.Search.global.getDefaultSearchResultClass();s.isSearchResult?l(t,u):a(t,u)};var h=d("base");c("base",function(e,t,n,o,r,i,s){h.apply(this,arguments),Handsontable.SearchCellDecorator.apply(this,arguments)}),Handsontable.hooks.add("afterInit",o),Handsontable.hooks.add("afterUpdateSettings",o)},{"helpers/dom/element":45,renderers:88}],86:[function(e,t,n){"use strict";Object.defineProperties(n,{TouchScroll:{get:function(){return d}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),l=s.addClass,a=s.removeClass,u=(r=e("_base"),r&&r.__esModule&&r||{"default":r})["default"],c=(i=e("plugins"),i&&i.__esModule&&i||{"default":i}).registerPlugin,d=function(e){var t=this;$traceurRuntime.superConstructor(h).call(this,e),this.hot.addHook("afterInit",function(){return t.afterInit()}),this.hot.addHook("afterUpdateSettings",function(){return t.onAfterUpdateSettings()}),this.scrollbars=[],this.clones=[]},h=d;$traceurRuntime.createClass(d,{afterInit:function(){this.registerEvents(),this.onAfterUpdateSettings()},onAfterUpdateSettings:function(){var e=this;this.hot.addHookOnce("afterRender",function(){var t=e.hot.view.wt.wtOverlays;e.scrollbars=[],e.scrollbars.push(t.topOverlay),t.bottomOverlay.clone&&e.scrollbars.push(t.bottomOverlay),e.scrollbars.push(t.leftOverlay),t.topLeftCornerOverlay&&e.scrollbars.push(t.topLeftCornerOverlay),t.bottomLeftCornerOverlay&&t.bottomLeftCornerOverlay.clone&&e.scrollbars.push(t.bottomLeftCornerOverlay),e.clones=[],t.topOverlay.needFullRender&&e.clones.push(t.topOverlay.clone.wtTable.holder.parentNode),t.bottomOverlay.needFullRender&&e.clones.push(t.bottomOverlay.clone.wtTable.holder.parentNode),t.leftOverlay.needFullRender&&e.clones.push(t.leftOverlay.clone.wtTable.holder.parentNode),t.topLeftCornerOverlay&&e.clones.push(t.topLeftCornerOverlay.clone.wtTable.holder.parentNode),t.bottomLeftCornerOverlay&&t.bottomLeftCornerOverlay.clone&&e.clones.push(t.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode)})},registerEvents:function(){var e=this;this.hot.addHook("beforeTouchScroll",function(){return e.onBeforeTouchScroll()}),this.hot.addHook("afterMomentumScroll",function(){return e.onAfterMomentumScroll()})},onBeforeTouchScroll:function(){Handsontable.freezeOverlays=!0;for(var e=0,t=this.clones.length;t>e;e++)l(this.clones[e],"hide-tween")},onAfterMomentumScroll:function(){Handsontable.freezeOverlays=!1;for(var e=this,t=0,n=this.clones.length;n>t;t++)a(this.clones[t],"hide-tween");for(var o=0,r=this.clones.length;r>o;o++)l(this.clones[o],"show-tween");setTimeout(function(){for(var t=0,n=e.clones.length;n>t;t++)a(e.clones[t],"show-tween")},400);for(var i=0,s=this.scrollbars.length;s>i;i++)this.scrollbars[i].refresh(),this.scrollbars[i].resetFixedPosition();this.hot.view.wt.wtOverlays.syncScrollWithMaster()}},{},u),c("touchScroll",d)},{_base:58,"helpers/dom/element":45,plugins:57}],87:[function(e,t,n){"use strict";function o(){var e=this,t="undefined"==typeof e.getSettings().undo||e.getSettings().undo;t?e.undoRedo||(e.undoRedo=new Handsontable.UndoRedo(e),s(e),e.addHook("beforeKeyDown",r),e.addHook("afterChange",i)):e.undoRedo&&(delete e.undoRedo,l(e),e.removeHook("beforeKeyDown",r),e.removeHook("afterChange",i))}function r(e){var t=this,n=(e.ctrlKey||e.metaKey)&&!e.altKey;n&&(89===e.keyCode||e.shiftKey&&90===e.keyCode?(t.undoRedo.redo(),f(e)):90===e.keyCode&&(t.undoRedo.undo(),f(e)))}function i(e,t){var n=this;return"loadData"==t?n.undoRedo.clear():void 0}function s(e){e.undo=function(){return e.undoRedo.undo()},e.redo=function(){return e.undoRedo.redo()},e.isUndoAvailable=function(){return e.undoRedo.isUndoAvailable()},e.isRedoAvailable=function(){return e.undoRedo.isRedoAvailable()},e.clearUndo=function(){return e.undoRedo.clear()}}function l(e){delete e.undo,delete e.redo,delete e.isUndoAvailable,delete e.isRedoAvailable,delete e.clearUndo}var a,u,c=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),d=c.inherit,h=c.deepClone,f=(u=e("helpers/dom/event"),u&&u.__esModule&&u||{"default":u}).stopImmediatePropagation;Handsontable.UndoRedo=function(e){var t=this;this.instance=e,this.doneActions=[],this.undoneActions=[],this.ignoreNewActions=!1,e.addHook("afterChange",function(e,n){if(e){var o=new Handsontable.UndoRedo.ChangeAction(e);t.done(o)}}),e.addHook("afterCreateRow",function(e,n,o){if(!o){var r=new Handsontable.UndoRedo.CreateRowAction(e,n);t.done(r)}}),e.addHook("beforeRemoveRow",function(e,n){var o=t.instance.getSourceData();e=(o.length+e)%o.length;var r=o.slice(e,e+n),i=new Handsontable.UndoRedo.RemoveRowAction(e,r);t.done(i)}),e.addHook("afterCreateCol",function(e,n,o){if(!o){var r=new Handsontable.UndoRedo.CreateColumnAction(e,n);t.done(r)}}),e.addHook("beforeRemoveCol",function(n,o){var r=t.instance.getSourceData();n=(t.instance.countCols()+n)%t.instance.countCols();for(var i=[],s=0,l=r.length;l>s;s++)i[s]=r[s].slice(n,n+o);var a;Array.isArray(e.getSettings().colHeaders)&&(a=e.getSettings().colHeaders.slice(n,n+i.length));var u=new Handsontable.UndoRedo.RemoveColumnAction(n,i,a);t.done(u)}),e.addHook("beforeCellAlignment",function(e,n,o,r){var i=new Handsontable.UndoRedo.CellAlignmentAction(e,n,o,r);t.done(i)})},Handsontable.UndoRedo.prototype.done=function(e){this.ignoreNewActions||(this.doneActions.push(e),this.undoneActions.length=0)},Handsontable.UndoRedo.prototype.undo=function(){if(this.isUndoAvailable()){var e=this.doneActions.pop();this.ignoreNewActions=!0;var t=this;e.undo(this.instance,function(){t.ignoreNewActions=!1,t.undoneActions.push(e)})}},Handsontable.UndoRedo.prototype.redo=function(){if(this.isRedoAvailable()){var e=this.undoneActions.pop();this.ignoreNewActions=!0;var t=this;e.redo(this.instance,function(){t.ignoreNewActions=!1,t.doneActions.push(e)})}},Handsontable.UndoRedo.prototype.isUndoAvailable=function(){return this.doneActions.length>0},Handsontable.UndoRedo.prototype.isRedoAvailable=function(){return this.undoneActions.length>0},Handsontable.UndoRedo.prototype.clear=function(){this.doneActions.length=0,this.undoneActions.length=0},Handsontable.UndoRedo.Action=function(){},Handsontable.UndoRedo.Action.prototype.undo=function(){},Handsontable.UndoRedo.Action.prototype.redo=function(){},Handsontable.UndoRedo.ChangeAction=function(e){this.changes=e},d(Handsontable.UndoRedo.ChangeAction,Handsontable.UndoRedo.Action),Handsontable.UndoRedo.ChangeAction.prototype.undo=function(e,t){for(var n=h(this.changes),o=e.countEmptyRows(!0),r=e.countEmptyCols(!0),i=0,s=n.length;s>i;i++)n[i].splice(3,1);e.addHookOnce("afterChange",t),e.setDataAtRowProp(n,null,null,"undo");for(var i=0,s=n.length;s>i;i++)e.getSettings().minSpareRows&&n[i][0]+1+e.getSettings().minSpareRows===e.countRows()&&o==e.getSettings().minSpareRows&&(e.alter("remove_row",parseInt(n[i][0]+1,10),e.getSettings().minSpareRows),e.undoRedo.doneActions.pop()),e.getSettings().minSpareCols&&n[i][1]+1+e.getSettings().minSpareCols===e.countCols()&&r==e.getSettings().minSpareCols&&(e.alter("remove_col",parseInt(n[i][1]+1,10),e.getSettings().minSpareCols),e.undoRedo.doneActions.pop())},Handsontable.UndoRedo.ChangeAction.prototype.redo=function(e,t){for(var n=h(this.changes),o=0,r=n.length;r>o;o++)n[o].splice(2,1);e.addHookOnce("afterChange",t),e.setDataAtRowProp(n,null,null,"redo")},Handsontable.UndoRedo.CreateRowAction=function(e,t){this.index=e,this.amount=t},d(Handsontable.UndoRedo.CreateRowAction,Handsontable.UndoRedo.Action),Handsontable.UndoRedo.CreateRowAction.prototype.undo=function(e,t){var n=e.countRows(),o=e.getSettings().minSpareRows;this.index>=n&&this.index-or;r++)n=e.getSourceDataAtRow(r),o=[this.index,0],Array.prototype.push.apply(o,this.data[r]),Array.prototype.splice.apply(n,o);"undefined"!=typeof this.headers&&(o=[this.index,0],Array.prototype.push.apply(o,this.headers),Array.prototype.splice.apply(e.getSettings().colHeaders,o)),e.addHookOnce("afterRender",t),e.render()},Handsontable.UndoRedo.RemoveColumnAction.prototype.redo=function(e,t){e.addHookOnce("afterRemoveCol",t),e.alter("remove_col",this.index,this.amount)},Handsontable.hooks.add("afterInit",o),Handsontable.hooks.add("afterUpdateSettings",o)},{"helpers/dom/event":46,"helpers/object":50}],88:[function(e,t,n){"use strict";function o(e,t){var n;a[e]=t,n=l(e)+"Renderer",Handsontable.renderers[n]=t,Handsontable[n]=t}function r(e){if("function"==typeof e)return e;if("string"!=typeof e)throw Error('Only strings and functions can be passed as "renderer" parameter');if(!(e in a))throw Error('No editor registered under name "'+e+'"');return a[e]}function i(e){return e in a}Object.defineProperties(n,{registerRenderer:{get:function(){return o}},getRenderer:{get:function(){return r}},hasRenderer:{get:function(){return i}},__esModule:{value:!0}});var s,l=(s=e("helpers/string"),s&&s.__esModule&&s||{"default":s}).toUpperCaseFirst,a={};Handsontable.renderers=Handsontable.renderers||{},Handsontable.renderers.registerRenderer=o,Handsontable.renderers.getRenderer=r},{"helpers/string":52}],89:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){s.className&&(t.className?t.className=t.className+" "+s.className:t.className=s.className),s.readOnly&&l(t,s.readOnlyCellClassName),s.valid===!1&&s.invalidCellClassName?l(t,s.invalidCellClassName):a(t,s.invalidCellClassName),s.wordWrap===!1&&s.noWordWrapClassName&&l(t,s.noWordWrapClassName),!i&&s.placeholder&&l(t,s.placeholderCellClassName)}Object.defineProperties(n,{cellDecorator:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),l=s.addClass,a=s.removeClass,u=(i=e("renderers"),i&&i.__esModule&&i||{"default":i}).registerRenderer;u("base",o),Handsontable.renderers.cellDecorator=o},{"helpers/dom/element":45,renderers:88}],90:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){var l=(m.cloneNode(!0),w.cloneNode(!0));if(f("text")(e,t,n,o,r,i,s),t.appendChild(l),u(t,"htAutocomplete"),t.firstChild||t.appendChild(document.createTextNode(String.fromCharCode(160))),!e.acArrowListener){var a=d(e);e.acArrowListener=function(r){c(r.target,"htAutocompleteArrow")&&e.view.wt.getSetting("onCellDblClick",null,new p(n,o),t)},a.addEventListener(e.rootElement,"mousedown",e.acArrowListener),e.addHookOnce("afterDestroy",function(){a.destroy()})}}Object.defineProperties(n,{autocompleteRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=a.addClass,c=a.hasClass,d=(a.empty,(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager),h=(s=e("renderers"),s&&s.__esModule&&s||{"default":s}),f=h.getRenderer,g=h.registerRenderer,p=(l=e("3rdparty/walkontable/src/cell/coords"),l&&l.__esModule&&l||{"default":l}).WalkontableCellCoords,m=document.createElement("DIV");m.className="htAutocompleteWrapper";var w=document.createElement("DIV");w.className="htAutocompleteArrow",w.appendChild(document.createTextNode(String.fromCharCode(9660)));g("autocomplete",o)},{"3rdparty/walkontable/src/cell/coords":5,eventManager:41,"helpers/dom/element":45,renderers:88}],91:[function(e,t,n){"use strict";function o(e,t,n,o,l,a,u){function c(e){var t=[y.SPACE,y.ENTER,y.DELETE,y.BACKSPACE];-1===t.indexOf(e.keyCode)||T(e)||f(function(){S(e),e.preventDefault()}),(e.keyCode==y.SPACE||e.keyCode==y.ENTER)&&d(),(e.keyCode==y.DELETE||e.keyCode==y.BACKSPACE)&&d(!1)}function d(){var e=void 0!==arguments[0]?arguments[0]:null;f(function(t){for(var n=0,o=t.length;o>n;n++){if(m(t[n],_)&&null===e)return;h(t[n],e)}})}function h(e){var t=void 0!==arguments[1]?arguments[1]:null;null===t?e.checked=!e.checked:e.checked=t,b.fireEvent(e,"change")}function f(t){for(var n=e.getSelectedRange(),o=n.getTopLeftCorner(),r=n.getBottomRightCorner(),i=o.row;i<=r.row;i++)for(var s=o.col;s<=r.col;s++){var l=e.getCell(i,s),a=e.getCellMeta(i,s),u=l.querySelectorAll("input[type=checkbox]");u.length>0&&!a.readOnly&&t(u)}}var b=new v(e),C=r(),R=u.label,M=!1;if("undefined"==typeof u.checkedTemplate&&(u.checkedTemplate=!0),"undefined"==typeof u.uncheckedTemplate&&(u.uncheckedTemplate=!1),g(t),a===u.checkedTemplate||w(a,u.checkedTemplate)?C.checked=!0:a===u.uncheckedTemplate||w(a,u.uncheckedTemplate)?C.checked=!1:null===a?p(C,"noValue"):(C.style.display="none",p(C,_),M=!0),!M&&R){var H="";R.value?H="function"==typeof R.value?R.value.call(this,n,o,l,a):R.value:R.property&&(H=e.getDataAtRowProp(n,R.property));var k=i(H);"before"===R.position?k.appendChild(C):k.insertBefore(C,k.firstChild),C=k}t.appendChild(C),M&&t.appendChild(document.createTextNode("#bad-value#")),u.readOnly?b.addEventListener(C,"click",s):(b.addEventListener(C,"mousedown",E),b.addEventListener(C,"mouseup",E),b.addEventListener(C,"change",function(t){e.setDataAtRowProp(n,l,t.target.checked?u.checkedTemplate:u.uncheckedTemplate)})),O.has(e)||(O.set(e,!0),e.addHook("beforeKeyDown",c))}function r(){var e=document.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("autocomplete","off"),e.cloneNode(!1)}function i(e){var t=document.createElement("label");return t.className="htCheckboxRendererLabel",t.appendChild(document.createTextNode(e)),t.cloneNode(!0)}function s(e){e.preventDefault()}Object.defineProperties(n,{checkboxRenderer:{get:function(){return o}},__esModule:{value:!0}});var l,a,u,c,d,h,f=(l=e("helpers/dom/element"),l&&l.__esModule&&l||{"default":l}),g=f.empty,p=f.addClass,m=f.hasClass,w=(a=e("helpers/string"),a&&a.__esModule&&a||{"default":a}).equalsIgnoreCase,v=(u=e("eventManager"),u&&u.__esModule&&u||{"default":u}).EventManager,b=(c=e("renderers"),c&&c.__esModule&&c||{"default":c}),C=(b.getRenderer,b.registerRenderer),y=(d=e("helpers/unicode"),d&&d.__esModule&&d||{"default":d}).KEY_CODES,R=(h=e("helpers/dom/event"),h&&h.__esModule&&h||{"default":h}),E=R.stopPropagation,S=R.stopImmediatePropagation,T=R.isImmediatePropagationStopped,O=new WeakMap,_="htBadValue";C("checkbox",o)},{eventManager:41,"helpers/dom/element":45, -"helpers/dom/event":46,"helpers/string":52,"helpers/unicode":53,renderers:88}],92:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,l){a("base").apply(this,arguments),s(t,i)}Object.defineProperties(n,{htmlRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}).fastInnerHTML,l=(i=e("renderers"),i&&i.__esModule&&i||{"default":i}),a=l.getRenderer,u=l.registerRenderer;u("html",o)},{"helpers/dom/element":45,renderers:88}],93:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){f(i)&&("undefined"!=typeof s.language&&a.language(s.language),i=a(i).format(s.format||"0"),u(t,"htNumeric")),d("text")(e,t,n,o,r,i,s)}Object.defineProperties(n,{numericRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a=(r=e("numeral"),r&&r.__esModule&&r||{"default":r})["default"],u=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).addClass,c=(s=e("renderers"),s&&s.__esModule&&s||{"default":s}),d=c.getRenderer,h=c.registerRenderer,f=(l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}).isNumeric;h("numeric",o)},{"helpers/dom/element":45,"helpers/number":49,numeral:"numeral",renderers:88}],94:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,l){a("text").apply(this,arguments),i=t.innerHTML;var u,c=l.hashLength||i.length,d=l.hashSymbol||"*";for(u="";u.split(d).length-13?("function"==typeof o&&(e.__proto__=o),e.prototype=d(l(o),i(t))):e.prototype=t,f(e,"prototype",{configurable:!1,writable:!1}),h(e,i(n))}function l(e){if("function"==typeof e){var t=e.prototype;if(u(t)===t||null===t)return e.prototype;throw new c("super prototype must be an Object or null")}if(null===e)return null;throw new c("Super expression must either be null or a function, not "+typeof e+".")}function a(e,t,o){null!==p(t)&&n(e,t,"constructor",o)}var u=Object,c=TypeError,d=u.create,h=$traceurRuntime.defineProperties,f=$traceurRuntime.defineProperty,g=$traceurRuntime.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=$traceurRuntime.toProperty,w=Object,v=w.getOwnPropertyNames,b=w.getOwnPropertySymbols;$traceurRuntime.createClass=s,$traceurRuntime.defaultSuperCall=a,$traceurRuntime.superCall=n,$traceurRuntime.superConstructor=t,$traceurRuntime.superGet=o,$traceurRuntime.superSet=r}()},{}],97:[function(e,t,n){"use strict";function o(e){var t=this;this.eventManager=C(e),this.instance=e,this.settings=e.getSettings(),this.selectionMouseDown=!1;var n=e.rootElement.getAttribute("style");n&&e.rootElement.setAttribute("data-originalstyle",n),d(e.rootElement,"handsontable");var o=document.createElement("TABLE");d(o,"htCore"),e.getSettings().tableClassName&&d(o,e.getSettings().tableClassName),this.THEAD=document.createElement("THEAD"),o.appendChild(this.THEAD),this.TBODY=document.createElement("TBODY"),o.appendChild(this.TBODY),e.table=o,e.container.insertBefore(o,e.container.firstChild),this.eventManager.addEventListener(e.rootElement,"mousedown",function(e){this.selectionMouseDown=!0,t.isTextSelectionAllowed(e.target)||(i(),e.preventDefault(),window.focus())}),this.eventManager.addEventListener(e.rootElement,"mouseup",function(e){this.selectionMouseDown=!1}),this.eventManager.addEventListener(e.rootElement,"mousemove",function(e){this.selectionMouseDown&&!t.isTextSelectionAllowed(e.target)&&(i(),e.preventDefault())}),this.eventManager.addEventListener(document.documentElement,"keyup",function(t){e.selection.isInProgress()&&!t.shiftKey&&e.selection.finish()});var r;this.isMouseDown=function(){return r},this.eventManager.addEventListener(document.documentElement,"mouseup",function(t){e.selection.isInProgress()&&1===t.which&&e.selection.finish(),r=!1,b(document.activeElement)&&e.unlisten()}),this.eventManager.addEventListener(document.documentElement,"mousedown",function(n){var o=n.target,i=n.x||n.clientX,s=n.y||n.clientY;if(!r&&e.rootElement){if(o===e.view.wt.wtTable.holder){var l=p();if(document.elementFromPoint(i+l,s)!==e.view.wt.wtTable.holder||document.elementFromPoint(i,s+l)!==e.view.wt.wtTable.holder)return}else for(;o!==document.documentElement;){if(null===o){if(n.isTargetWebComponent)break;return}if(o===e.rootElement)return;o=o.parentNode}t.settings.outsideClickDeselects?e.deselectCell():e.destroyEditor()}}),this.eventManager.addEventListener(o,"selectstart",function(e){t.settings.fragmentSelection||v(e.target)||e.preventDefault()});var i=function(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty()},s=[new T({className:"current",border:{width:2,color:"#5292F7",cornerVisible:function(){return t.settings.fillHandle&&!t.isCellEdited()&&!e.selection.isMultiple()},multipleSelectionHandlesVisible:function(){return!t.isCellEdited()&&!e.selection.isMultiple()}}}),new T({className:"area",border:{width:1,color:"#89AFF9",cornerVisible:function(){return t.settings.fillHandle&&!t.isCellEdited()&&e.selection.isMultiple()},multipleSelectionHandlesVisible:function(){return!t.isCellEdited()&&e.selection.isMultiple()}}}),new T({className:"highlight",highlightRowClassName:t.settings.currentRowClassName,highlightColumnClassName:t.settings.currentColClassName}),new T({className:"fill",border:{width:1,color:"red"}})];s.current=s[0],s.area=s[1],s.highlight=s[2],s.fill=s[3];var l={debug:function(){return t.settings.debug},externalRowCalculator:this.instance.getPlugin("autoRowSize")&&this.instance.getPlugin("autoRowSize").isEnabled(),table:o,stretchH:this.settings.stretchH,data:e.getDataAtCell,totalRows:function(){return e.countRows()},totalColumns:function(){return e.countCols()},fixedColumnsLeft:function(){return t.settings.fixedColumnsLeft},fixedRowsTop:function(){return t.settings.fixedRowsTop},fixedRowsBottom:function(){return t.settings.fixedRowsBottom},minSpareRows:function(){return t.settings.minSpareRows},renderAllRows:t.settings.renderAllRows,rowHeaders:function(){var n=[];return e.hasRowHeaders()&&n.push(function(e,n){t.appendRowHeader(e,n)}),Handsontable.hooks.run(e,"afterGetRowHeaderRenderers",n),n},columnHeaders:function(){var n=[];return e.hasColHeaders()&&n.push(function(e,n){t.appendColHeader(e,n)}),Handsontable.hooks.run(e,"afterGetColumnHeaderRenderers",n),n},columnWidth:e.getColWidth,rowHeight:e.getRowHeight,cellRenderer:function(e,n,o){var r=t.instance.colToProp(n),i=t.instance.getCellMeta(e,n),s=t.instance.getCellRenderer(i),l=t.instance.getDataAtRowProp(e,r);s(t.instance,o,e,n,r,l,i),Handsontable.hooks.run(t.instance,"afterRenderer",o,e,n,r,l,i)},selections:s,hideBorderOnMouseDownOver:function(){return t.settings.fragmentSelection},onCellMouseDown:function(n,o,i,s){var l,a,u=i.parentNode,c=u.parentNode;if(e.listen(),t.activeWt=s,r=!0,Handsontable.hooks.run(e,"beforeOnCellMouseDown",n,o,i),e.selection.setSelectedHeaders(!1,!1),!E(n)){if(2===n.button&&e.selection.inInSelection(o));else n.shiftKey?o.row>=0&&o.col>=0&&e.selection.setRangeEnd(o):(o.row<0||o.col<0)&&(o.row>=0||o.col>=0)?(o.row<0&&(l=c.childNodes.length-Array.prototype.indexOf.call(c.childNodes,u)-1,a=e.getHeaderColspan(o.col,l),e.selection.setSelectedHeaders(!1,!0),e.selectCell(0,o.col,e.countRows()-1,o.col+Math.max(0,a-1))),o.col<0&&(e.selection.setSelectedHeaders(!0,!1),e.selectCell(o.row,0,o.row,e.countCols()-1))):(o.row=o.row<0?0:o.row,o.col=o.col<0?0:o.col,e.selection.setRangeStart(o));Handsontable.hooks.run(e,"afterOnCellMouseDown",n,o,i),t.activeWt=t.wt}},onCellMouseOver:function(n,o,i,s){t.activeWt=s,o.row>=0&&o.col>=0?r&&e.selection.setRangeEnd(o):r&&(o.row<0&&(e.selection.selectedHeader.cols?(e.selection.setRangeEnd(new S(e.countRows()-1,o.col)),e.selection.setSelectedHeaders(!1,!0)):e.selection.setRangeEnd(new S(o.row,o.col))),o.col<0&&(e.selection.selectedHeader.rows?(e.selection.setRangeEnd(new S(o.row,e.countCols()-1)),e.selection.setSelectedHeaders(!0,!1)):e.selection.setRangeEnd(new S(o.row,o.col)))),Handsontable.hooks.run(e,"afterOnCellMouseOver",n,o,i),t.activeWt=t.wt},onCellCornerMouseDown:function(t){t.preventDefault(),Handsontable.hooks.run(e,"afterOnCellCornerMouseDown",t)},beforeDraw:function(e){t.beforeRender(e)},onDraw:function(e){t.onDraw(e)},onScrollVertically:function(){e.runHooks("afterScrollVertically")},onScrollHorizontally:function(){e.runHooks("afterScrollHorizontally")},onBeforeDrawBorders:function(t,n){e.runHooks("beforeDrawBorders",t,n)},onBeforeTouchScroll:function(){e.runHooks("beforeTouchScroll")},onAfterMomentumScroll:function(){e.runHooks("afterMomentumScroll")},viewportRowCalculatorOverride:function(n){var o=e.countRows(),r=t.settings.viewportRowRenderingOffset;if("auto"===r&&t.settings.fixedRowsTop&&(r=10),"number"==typeof r&&(n.startRow=Math.max(n.startRow-r,0),n.endRow=Math.min(n.endRow+r,o-1)),"auto"===r){var i=n.startRow+n.endRow-n.startRow,s=Math.ceil(i/o*12);n.startRow=Math.max(n.startRow-s,0),n.endRow=Math.min(n.endRow+s,o-1)}e.runHooks("afterViewportRowCalculatorOverride",n)},viewportColumnCalculatorOverride:function(n){var o=e.countCols(),r=t.settings.viewportColumnRenderingOffset;if("auto"===r&&t.settings.fixedColumnsLeft&&(r=10),"number"==typeof r&&(n.startColumn=Math.max(n.startColumn-r,0),n.endColumn=Math.min(n.endColumn+r,o-1)),"auto"===r){var i=n.startColumn+n.endColumn-n.startColumn,s=Math.ceil(i/o*12);n.startRow=Math.max(n.startColumn-s,0),n.endColumn=Math.min(n.endColumn+s,o-1)}e.runHooks("afterViewportColumnCalculatorOverride",n)}};Handsontable.hooks.run(e,"beforeInitWalkontable",l),this.wt=new O(l),this.activeWt=this.wt,this.eventManager.addEventListener(t.wt.wtTable.spreader,"mousedown",function(e){e.target===t.wt.wtTable.spreader&&3===e.which&&R(e)}),this.eventManager.addEventListener(t.wt.wtTable.spreader,"contextmenu",function(e){e.target===t.wt.wtTable.spreader&&3===e.which&&R(e)}),this.eventManager.addEventListener(document.documentElement,"click",function(){t.settings.observeDOMVisibility&&t.wt.drawInterrupted&&(t.instance.forceFullRender=!0,t.render())})}Object.defineProperties(n,{TableView:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a,u,c=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),d=c.addClass,h=c.empty,f=c.fastInnerHTML,g=c.fastInnerText,p=c.getScrollbarWidth,m=c.hasClass,w=c.isChildOf,v=c.isInput,b=c.isOutsideInput,C=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,y=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),R=y.stopPropagation,E=y.isImmediatePropagationStopped,S=(l=e("3rdparty/walkontable/src/cell/coords"),l&&l.__esModule&&l||{"default":l}).WalkontableCellCoords,T=(a=e("3rdparty/walkontable/src/selection"),a&&a.__esModule&&a||{"default":a}).WalkontableSelection,O=(u=e("3rdparty/walkontable/src/core"),u&&u.__esModule&&u||{"default":u}).Walkontable;Handsontable.TableView=o,o.prototype.isTextSelectionAllowed=function(e){if(v(e))return!0;var t=w(e,this.instance.view.wt.wtTable.spreader);return this.settings.fragmentSelection===!0&&t?!0:"cell"===this.settings.fragmentSelection&&this.isSelectedOnlyCell()&&t?!0:!1},o.prototype.isSelectedOnlyCell=function(){var e=this.instance.getSelected()||[],t=e[0],n=e[1],o=e[2],r=e[3];return void 0!==t&&t===o&&n===r},o.prototype.isCellEdited=function(){var e=this.instance.getActiveEditor();return e&&e.isOpened()},o.prototype.beforeRender=function(e){e&&Handsontable.hooks.run(this.instance,"beforeRender",this.instance.forceFullRender)},o.prototype.onDraw=function(e){e&&Handsontable.hooks.run(this.instance,"afterRender",this.instance.forceFullRender)},o.prototype.render=function(){this.wt.draw(!this.instance.forceFullRender),this.instance.forceFullRender=!1,this.instance.renderCall=!1},o.prototype.getCellAtCoords=function(e,t){var n=this.wt.getCell(e,t);return 0>n?null:n},o.prototype.scrollViewport=function(e){this.wt.scrollViewport(e)},o.prototype.appendRowHeader=function(e,t){if(t.firstChild){var n=t.firstChild;if(!m(n,"relative"))return h(t),void this.appendRowHeader(e,t);this.updateCellHeader(n.querySelector(".rowHeader"),e,this.instance.getRowHeader)}else{var o=document.createElement("div"),r=document.createElement("span");o.className="relative",r.className="rowHeader",this.updateCellHeader(r,e,this.instance.getRowHeader),o.appendChild(r),t.appendChild(o)}Handsontable.hooks.run(this.instance,"afterGetRowHeader",e,t)},o.prototype.appendColHeader=function(e,t){if(t.firstChild){var n=t.firstChild;m(n,"relative")?this.updateCellHeader(n.querySelector(".colHeader"),e,this.instance.getColHeader):(h(t),this.appendColHeader(e,t))}else{var o=document.createElement("div"),r=document.createElement("span");o.className="relative",r.className="colHeader",this.updateCellHeader(r,e,this.instance.getColHeader),o.appendChild(r),t.appendChild(o)}Handsontable.hooks.run(this.instance,"afterGetColHeader",e,t)},o.prototype.updateCellHeader=function(e,t,n){t>-1?f(e,n(t)):(g(e,String.fromCharCode(160)),d(e,"cornerHeader"))},o.prototype.maximumVisibleElementWidth=function(e){var t=this.wt.wtViewport.getWorkspaceWidth(),n=t-e;return n>0?n:0},o.prototype.maximumVisibleElementHeight=function(e){var t=this.wt.wtViewport.getWorkspaceHeight(),n=t-e;return n>0?n:0},o.prototype.mainViewIsActive=function(){return this.wt===this.activeWt},o.prototype.destroy=function(){this.wt.destroy(),this.eventManager.destroy()}},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/core":7,"3rdparty/walkontable/src/selection":18,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46}],98:[function(e,t,n){"use strict";Object.defineProperties(n,{GhostTable:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s,l,a=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),u=a.addClass,c=a.outerHeight,d=a.outerWidth,h=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,f=((i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}).objectEach,(s=e("helpers/number"),s&&s.__esModule&&s||{"default":s}).rangeEach,(l=e("helpers/mixed"),l&&l.__esModule&&l||{"default":l}).stringify,function(e){this.hot=e,this.container=null,this.injected=!1,this.rows=[],this.columns=[],this.samples=null});$traceurRuntime.createClass(f,{addRow:function(e,t){if(this.columns.length)throw new Error("Doesn't support multi-dimensional table");this.rows.length||(this.container=this.createContainer(this.hot.rootElement.className));var n={row:e};this.rows.push(n),this.samples=t,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol()),this.table.tr.appendChild(this.createRow(e)),this.container.container.appendChild(this.table.fragment),n.table=this.table.table},addColumn:function(e,t){if(this.rows.length)throw new Error("Doesn't support multi-dimensional table");this.columns.length||(this.container=this.createContainer(this.hot.rootElement.className));var n={col:e};this.columns.push(n),this.samples=t,this.table=this.createTable(this.hot.table.className),null!==this.hot.getColHeader(e)&&this.hot.view.appendColHeader(e,this.table.th),this.table.tBody.appendChild(this.createCol(e)),this.container.container.appendChild(this.table.fragment),n.table=this.table.table},getHeights:function(e){this.injected||this.injectTable(),h(this.rows,function(t){e(t.row,c(t.table)-1)})},getWidths:function(e){this.injected||this.injectTable(),h(this.columns,function(t){e(t.col,d(t.table))})},createColGroupsCol:function(){var e=this,t=document,n=t.createDocumentFragment();return n.appendChild(this.createColElement(-1)),this.samples.forEach(function(t){h(t.strings,function(t){n.appendChild(e.createColElement(t.col))})}),n},createRow:function(e){var t=this,n=document,o=n.createDocumentFragment(),r=n.createElement("th");return null!==this.hot.getRowHeader(e)&&this.hot.view.appendRowHeader(e,r),o.appendChild(r),this.samples.forEach(function(r){h(r.strings,function(r){var i=r.col,s=t.hot.getCellMeta(e,i);s.col=i,s.row=e;var l=t.hot.getCellRenderer(s),a=n.createElement("td");l(t.hot,a,e,i,t.hot.colToProp(i),r.value,s),o.appendChild(a)})}),o},createCol:function(e){var t=this,n=document,o=n.createDocumentFragment();return this.samples.forEach(function(r){h(r.strings,function(r){var i=r.row,s=t.hot.getCellMeta(i,e);s.col=e,s.row=i;var l=t.hot.getCellRenderer(s),a=n.createElement("td"),u=n.createElement("tr");l(t.hot,a,i,e,t.hot.colToProp(i),r.value,s),u.appendChild(a),o.appendChild(u)})}),o},clean:function(){this.rows.length=0,this.columns.length=0,this.samples&&this.samples.clear(),this.samples=null,this.removeTable()},injectTable:function(){var e=void 0!==arguments[0]?arguments[0]:null;this.injected||((e||this.hot.rootElement).appendChild(this.container.fragment),this.injected=!0)},removeTable:function(){this.injected&&this.container.container.parentNode&&(this.container.container.parentNode.removeChild(this.container.container),this.container=null,this.injected=!1)},createColElement:function(e){var t=document,n=t.createElement("col");return n.style.width=this.hot.view.wt.wtTable.getStretchedColumnWidth(e)+"px",n},createTable:function(){var e=void 0!==arguments[0]?arguments[0]:"",t=document,n=t.createDocumentFragment(),o=t.createElement("table"),r=t.createElement("thead"),i=t.createElement("tbody"),s=t.createElement("colgroup"),l=t.createElement("tr"),a=t.createElement("th");return this.isVertical()&&o.appendChild(s),this.isHorizontal()&&(l.appendChild(a),r.appendChild(l),o.style.tableLayout="auto",o.style.width="auto"),o.appendChild(r),this.isVertical()&&i.appendChild(l),o.appendChild(i),u(o,e),n.appendChild(o),{fragment:n,table:o,tHead:r,tBody:i,colGroup:s,tr:l,th:a}},createContainer:function(){var e=void 0!==arguments[0]?arguments[0]:"",t=document,n=t.createDocumentFragment(),o=t.createElement("div");return e="htGhostTable htAutoSize "+e.trim(),u(o,e),n.appendChild(o),{fragment:n,container:o}},isVertical:function(){return this.rows.length&&!this.columns.length?!0:!1},isHorizontal:function(){return this.columns.length&&!this.rows.length?!0:!1}},{}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.GhostTable=f},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],99:[function(e,t,n){"use strict";var o;Object.defineProperties(n,{SamplesGenerator:{get:function(){return h}},__esModule:{value:!0}});var r,i,s,l,a,u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=(u.addClass,u.outerHeight,u.outerWidth,(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,(s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}).objectEach,(l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}).rangeEach),d=(a=e("helpers/mixed"),a&&a.__esModule&&a||{"default":a}).stringify,h=function(e){this.samples=null,this.dataFactory=e},f=h;$traceurRuntime.createClass(h,(o={},Object.defineProperty(o,"generateRowSamples",{value:function(e,t){return this.generateSamples("row",t,e)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateColumnSamples",{value:function(e,t){return this.generateSamples("col",t,e)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateSamples",{value:function(e,t,n){var o=this,r=new Map;return"number"==typeof n&&(n={from:n,to:n}),c(n.from,n.to,function(n){var i=o.generateSample(e,t,n);r.set(n,i)}),r},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateSample",{value:function(e,t,n){var o=this,r=new Map;return c(t.from,t.to,function(t){var i,s;if("row"===e)s=o.dataFactory(n,t);else{if("col"!==e)throw new Error("Unsupported sample type");s=o.dataFactory(t,n)}Array.isArray(s)||(s=d(s));var l=s.length;r.has(l)||r.set(l,{needed:f.SAMPLE_COUNT,strings:[]});var a=r.get(l);if(a.needed){var u="row"===e?"col":"row";a.strings.push((i={},Object.defineProperty(i,"value",{value:s,configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,u,{value:t,configurable:!0,enumerable:!0,writable:!0}),i)),a.needed--}}),r},configurable:!0,enumerable:!0,writable:!0}),o),{get SAMPLE_COUNT(){return 3}}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.SamplesGenerator=h},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],100:[function(e,t,n){"use strict";function o(e,t){var n=e,o="string"==typeof n?n.toLowerCase():null;return function(e){for(var r=!1,s=0,l=e.length;l>s;s++){if(n===e[s]){r=!0;break}if(o===i(e[s]).toLowerCase()){r=!0;break}}t(r)}}var r,i=(r=e("helpers/mixed"),r&&r.__esModule&&r||{"default":r}).stringify;Handsontable.AutocompleteValidator=function(e,t){this.strict&&this.source?"function"==typeof this.source?this.source(e,o(e,t)):o(e,t)(this.source):t(!0)}},{"helpers/mixed":48}],101:[function(e,t,n){"use strict";var o,r,i=(o=e("moment"),o&&o.__esModule&&o||{"default":o})["default"],s=(r=e("editors"),r&&r.__esModule&&r||{"default":r}).getEditor;Handsontable.DateValidator=function(e,t){var n=!0,o=s("date",this.instance);null===e&&(e="");var r=i(new Date(e)).isValid(),a=i(e,this.dateFormat||o.defaultDateFormat,!0).isValid();if(r||(n=!1),!r&&a&&(n=!0),r&&!a)if(this.correctFormat===!0){var u=l(e,this.dateFormat);this.instance.setDataAtCell(this.row,this.col,u,"dateValidator"),n=!0}else n=!1;t(n)};var l=function(e,t){var n=i(new Date(e)),o=n.format("YYYY"),r=i().format("YYYY");return o.substr(0,2)!==r.substr(0,2)?e.match(new RegExp(o))||n.year(o.replace(o.substr(0,2),r.substr(0,2))):o.length>4&&n.year((n.year()+"").substr(0,4)),n.format(t)}},{editors:29,moment:void 0}],102:[function(e,t,n){"use strict";Handsontable.NumericValidator=function(e,t){null===e&&(e=""),t(/^-?\d*(\.|\,)?\d*$/.test(e))}},{}],SheetClip:[function(e,t,n){"use strict";!function(e){function t(e){return e.split('"').length-1}var o={parse:function(e){var n,o,r,i,s,l,a,u=[],c=0;for(r=e.split("\n"),r.length>1&&""===r[r.length-1]&&r.pop(),n=0,o=r.length;o>n;n+=1){for(r[n]=r[n].split(" "),i=0,s=r[n].length;s>i;i+=1)u[c]||(u[c]=[]),l&&0===i?(a=u[c].length-1,u[c][a]=u[c][a]+"\n"+r[n][0],l&&1&t(r[n][0])&&(l=!1,u[c][a]=u[c][a].substring(0,u[c][a].length-1).replace(/""/g,'"'))):i===s-1&&0===r[n][i].indexOf('"')&&1&t(r[n][i])?(u[c].push(r[n][i].substring(1).replace(/""/g,'"')),l=!0):(u[c].push(r[n][i].replace(/""/g,'"')),l=!1);l||(c+=1)}return u},stringify:function(e){var t,n,o,r,i,s="";for(t=0,n=e.length;n>t;t+=1){for(r=e[t].length,o=0;r>o;o+=1)o>0&&(s+=" "),i=e[t][o],s+="string"==typeof i?i.indexOf("\n")>-1?'"'+i.replace(/"/g,'""')+'"':i:null===i||void 0===i?"":i;s+="\n"}return s}};"undefined"!=typeof n?(n.parse=o.parse,n.stringify=o.stringify):e.SheetClip=o}(window)},{}],autoResize:[function(e,t,n){"use strict";function o(){var e,t={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300},n=document.body,o=document.createTextNode(""),r=document.createElement("SPAN"),i=function(e,t,n){window.attachEvent?e.attachEvent("on"+t,n):e.addEventListener(t,n,!1)},s=function(e,t,n){window.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)},l=function(i){var s,l;i?/^[a-zA-Z \.,\\\/\|0-9]$/.test(i)||(i="."):i="",void 0!==o.textContent?o.textContent=e.value+i:o.data=e.value+i,r.style.fontSize=Handsontable.Dom.getComputedStyle(e).fontSize,r.style.fontFamily=Handsontable.Dom.getComputedStyle(e).fontFamily,r.style.whiteSpace="pre",n.appendChild(r),s=r.clientWidth+2,n.removeChild(r),e.style.height=t.minHeight+"px",t.minWidth>s?e.style.width=t.minWidth+"px":s>t.maxWidth?e.style.width=t.maxWidth+"px":e.style.width=s+"px",l=e.scrollHeight?e.scrollHeight-1:0,t.minHeight>l?e.style.height=t.minHeight+"px":t.maxHeight-1||"true"===e.contentEditable}var n=this,o=!1;if(e.metaKey?o=!0:e.ctrlKey&&-1===navigator.userAgent.indexOf("Mac")&&(o=!0),o){ -if(document.activeElement!==this.elTextarea&&(""!==this.getSelectionText()||t()))return;this.selectNodeText(this.elTextarea),setTimeout(function(){document.activeElement!==n.elTextarea&&n.selectNodeText(n.elTextarea)},0)}!o||67!==e.keyCode&&86!==e.keyCode&&88!==e.keyCode||(88===e.keyCode?setTimeout(function(){n.triggerCut(e)},0):86===e.keyCode&&setTimeout(function(){n.triggerPaste(e)},0))},r.prototype.selectNodeText=function(e){e&&e.select()},r.prototype.getSelectionText=function(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e},r.prototype.copyable=function(e){if("string"!=typeof e&&void 0===e.toString)throw new Error("copyable requires string parameter");this.elTextarea.value=e,this.selectNodeText(this.elTextarea)},r.prototype.onCut=function(e){this.cutCallbacks.push(e)},r.prototype.onPaste=function(e){this.pasteCallbacks.push(e)},r.prototype.removeCallback=function(e){var t,n;for(t=0,n=this.copyCallbacks.length;n>t;t++)if(this.copyCallbacks[t]===e)return this.copyCallbacks.splice(t,1),!0;for(t=0,n=this.cutCallbacks.length;n>t;t++)if(this.cutCallbacks[t]===e)return this.cutCallbacks.splice(t,1),!0;for(t=0,n=this.pasteCallbacks.length;n>t;t++)if(this.pasteCallbacks[t]===e)return this.pasteCallbacks.splice(t,1),!0;return!1},r.prototype.triggerCut=function(e){var t=this;t.cutCallbacks&&setTimeout(function(){for(var n=0,o=t.cutCallbacks.length;o>n;n++)t.cutCallbacks[n](e)},50)},r.prototype.triggerPaste=function(e,t){var n=this;n.pasteCallbacks&&setTimeout(function(){for(var o=t||n.elTextarea.value,r=0,i=n.pasteCallbacks.length;i>r;r++)n.pasteCallbacks[r](o,e)},50)},r.prototype.destroy=function(){this.hasBeenDestroyed()||0!==--this.refCounter||(this.elDiv&&this.elDiv.parentNode&&(this.elDiv.parentNode.removeChild(this.elDiv),this.elDiv=null,this.elTextarea=null),document.documentElement.removeEventListener("keydown",this.onKeyDownRef),this.onKeyDownRef=null)},r.prototype.hasBeenDestroyed=function(){return!this.refCounter}},{}],es6collections:[function(e,t,n){"use strict";!function(e){function t(e,t){function o(e){return this&&this.constructor===o?(this._keys=[],this._values=[],this._itp=[],this.objectOnly=t,void(e&&n.call(this,e))):new o(e)}return t||b(e,"size",{get:m}),e.constructor=o,o.prototype=e,o}function n(e){this.add?e.forEach(this.add,this):e.forEach(function(e){this.set(e[0],e[1])},this)}function o(e){return this.has(e)&&(this._keys.splice(v,1),this._values.splice(v,1),this._itp.forEach(function(e){v-1}function r(e){return this.has(e)?this._values[v]:void 0}function i(e,t){if(this.objectOnly&&t!==Object(t))throw new TypeError("Invalid value used as weak collection key");if(t!=t||0===t)for(v=e.length;v--&&!C(e[v],t););else v=e.indexOf(t);return v>-1}function s(e){return i.call(this,this._values,e)}function l(e){return i.call(this,this._keys,e)}function a(e,t){return this.has(e)?this._values[v]=t:this._values[this._keys.push(e)-1]=t,this}function u(e){return this.has(e)||this._values.push(e),this}function c(){this._values.length=0}function d(){return p(this._itp,this._keys)}function h(){return p(this._itp,this._values)}function f(){return p(this._itp,this._keys,this._values)}function g(){return p(this._itp,this._values,this._values)}function p(e,t,n){var o=[0],r=!1;return e.push(o),{next:function(){var i,s=o[0];return!r&&st;t++)if(v[t].obj===e)return v[t]}function i(e){for(var t=0,n=v.length;n>t;t++)v[t]===e&&v.splice(t,1)}function s(e,t){for(var n=0,o=e.observers.length;o>n;n++)if(e.observers[n].callback===t)return e.observers[n].observer}function l(e,t){for(var n=0,o=e.observers.length;o>n;n++)if(e.observers[n].observer===t)return e.observers.splice(n,1),void(e.observers.length||i(e))}function a(e,t){h(t),Object.observe?d(t,e):clearTimeout(t.next);var n=r(e);l(n,t)}function u(e,t){var n,i=[],l=e,a=r(e);if(a?n=s(a,t):(a=new b(e),v.push(a)),n)return n;if(Object.observe)n=function(r){d(n,e),c(n,e);for(var s=0,a=r.length;a>s;){if(("length"!==r[s].name||!R(r[s].object))&&"__Jasmine_been_here_before__"!==r[s].name){var u=r[s].type;switch(u){case"new":u="add";break;case"deleted":u="delete";break;case"updated":u="update"}w[u].call(r[s],i,o(l,r[s].object))}s++}i&&t&&t(i),n.patches=i,i=[]};else if(n={},a.value=JSON.parse(JSON.stringify(e)),t){n.callback=t,n.next=null;var u=this.intervals||[100,1e3,1e4,6e4],f=0,g=function(){h(n)},p=function(){clearTimeout(n.next),n.next=setTimeout(function(){g(),f=0,n.next=setTimeout(m,u[f++])},0)},m=function(){g(),f==u.length&&(f=u.length-1),n.next=setTimeout(m,u[f++])};"undefined"!=typeof window&&(window.addEventListener?(window.addEventListener("mousedown",p),window.addEventListener("mouseup",p),window.addEventListener("keydown",p)):(window.attachEvent("onmousedown",p),window.attachEvent("onmouseup",p),window.attachEvent("onkeydown",p))),n.next=setTimeout(m,u[f++])}return n.patches=i,n.object=e,a.observers.push(new C(t,n)),c(n,e)}function c(e,t){if(Object.observe){Object.observe(t,e);for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];o&&"object"==typeof o&&c(e,o)}}return e}function d(e,t){if(Object.observe){Object.unobserve(t,e);for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];o&&"object"==typeof o&&d(e,o)}}return e}function h(e){if(Object.observe)Object.deliverChangeRecords(e);else{for(var t,n=0,o=v.length;o>n;n++)if(v[n].obj===e.object){t=v[n];break}t&&f(t.value,e.object,e.patches,"")}var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function f(e,n,o,r){for(var i=y(n),s=y(e),l=!1,a=!1,u=s.length-1;u>=0;u--){var c=s[u],d=e[c];if(n.hasOwnProperty(c)){var h=n[c];d instanceof Object?f(d,h,o,r+"/"+t(c)):d!=h&&(l=!0,o.push({op:"replace",path:r+"/"+t(c),value:h}),e[c]=h)}else o.push({op:"remove",path:r+"/"+t(c)}),delete e[c],a=!0}if(a||i.length!=s.length)for(var u=0;ur;){n=t[r];for(var s=n.path.split("/"),l=e,a=1,u=s.length;;)if(R(l)){var c=parseInt(s[a],10);if(a++,a>=u){o=m[n.op].call(n,l,c,e);break}l=l[c]}else{var d=s[a];if(-1!=d.indexOf("~")&&(d=d.replace(/~1/g,"/").replace(/~0/g,"~")),a++,a>=u){o=p[n.op].call(n,l,d,e);break}l=l[d]}r++}return o}var p={add:function(e,t){return e[t]=this.value,!0},remove:function(e,t){return delete e[t],!0},replace:function(e,t){return e[t]=this.value,!0},move:function(e,t,n){var o={op:"_get",path:this.from};return g(n,[o]),g(n,[{op:"remove",path:this.from}]),g(n,[{op:"add",path:this.path,value:o.value}]),!0},copy:function(e,t,n){var o={op:"_get",path:this.from};return g(n,[o]),g(n,[{op:"add",path:this.path,value:o.value}]),!0},test:function(e,t){return JSON.stringify(e[t])===JSON.stringify(this.value)},_get:function(e,t){this.value=e[t]}},m={add:function(e,t){return e.splice(t,0,this.value),!0},remove:function(e,t){return e.splice(t,1),!0},replace:function(e,t){return e[t]=this.value,!0},move:p.move,copy:p.copy,test:p.test,_get:p._get},w={add:function(e,n){var o={op:"add",path:n+t(this.name),value:this.object[this.name]};e.push(o)},"delete":function(e,n){var o={op:"remove",path:n+t(this.name)};e.push(o)},update:function(e,n){var o={op:"replace",path:n+t(this.name),value:this.object[this.name]};e.push(o)}},v=[];e.intervals;var b=function(){function e(e){this.observers=[],this.obj=e}return e}(),C=function(){function e(e,t){this.callback=e,this.observer=t}return e}();e.unobserve=a,e.observe=u,e.generate=h;var y;y=Object.keys?Object.keys:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t};var R;R=Array.isArray?Array.isArray:function(e){return e.push&&"number"==typeof e.length},e.apply=g}(o||(o={})),"undefined"!=typeof n&&(n.apply=o.apply,n.observe=o.observe,n.unobserve=o.unobserve,n.generate=o.generate)},{}],numeral:[function(t,n,o){"use strict";(function(){function t(e){this._value=e}function o(e,t,n,o){var r,i,s=Math.pow(10,t);return i=(n(e*s)/s).toFixed(t),o&&(r=new RegExp("0{1,"+o+"}$"),i=i.replace(r,"")),i}function r(e,t,n){var o;return o=t.indexOf("$")>-1?s(e,t,n):t.indexOf("%")>-1?l(e,t,n):t.indexOf(":")>-1?a(e,t):c(e._value,t,n)}function i(e,t){var n,o,r,i,s,l=t,a=["KB","MB","GB","TB","PB","EB","ZB","YB"],c=!1;if(t.indexOf(":")>-1)e._value=u(t);else if(t===v)e._value=0;else{for("."!==m[w].delimiters.decimal&&(t=t.replace(/\./g,"").replace(m[w].delimiters.decimal,".")),n=new RegExp("[^a-zA-Z]"+m[w].abbreviations.thousand+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),o=new RegExp("[^a-zA-Z]"+m[w].abbreviations.million+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),r=new RegExp("[^a-zA-Z]"+m[w].abbreviations.billion+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),i=new RegExp("[^a-zA-Z]"+m[w].abbreviations.trillion+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),s=0;s<=a.length&&!(c=t.indexOf(a[s])>-1?Math.pow(1024,s+1):!1);s++);e._value=(c?c:1)*(l.match(n)?Math.pow(10,3):1)*(l.match(o)?Math.pow(10,6):1)*(l.match(r)?Math.pow(10,9):1)*(l.match(i)?Math.pow(10,12):1)*(t.indexOf("%")>-1?.01:1)*((t.split("-").length+Math.min(t.split("(").length-1,t.split(")").length-1))%2?1:-1)*Number(t.replace(/[^0-9\.]+/g,"")),e._value=c?Math.ceil(e._value):e._value}return e._value}function s(e,t,n){var o,r,i=t.indexOf("$"),s=t.indexOf("("),l=t.indexOf("-"),a="";return t.indexOf(" $")>-1?(a=" ",t=t.replace(" $","")):t.indexOf("$ ")>-1?(a=" ",t=t.replace("$ ","")):t=t.replace("$",""),r=c(e._value,t,n),1>=i?r.indexOf("(")>-1||r.indexOf("-")>-1?(r=r.split(""),o=1,(s>i||l>i)&&(o=0),r.splice(o,0,m[w].currency.symbol+a),r=r.join("")):r=m[w].currency.symbol+a+r:r.indexOf(")")>-1?(r=r.split(""),r.splice(-1,0,a+m[w].currency.symbol),r=r.join("")):r=r+a+m[w].currency.symbol,r}function l(e,t,n){var o,r="",i=100*e._value;return t.indexOf(" %")>-1?(r=" ",t=t.replace(" %","")):t=t.replace("%",""),o=c(i,t,n),o.indexOf(")")>-1?(o=o.split(""),o.splice(-1,0,r+"%"),o=o.join("")):o=o+r+"%",o}function a(e){var t=Math.floor(e._value/60/60),n=Math.floor((e._value-60*t*60)/60),o=Math.round(e._value-60*t*60-60*n);return t+":"+(10>n?"0"+n:n)+":"+(10>o?"0"+o:o)}function u(e){var t=e.split(":"),n=0;return 3===t.length?(n+=60*Number(t[0])*60,n+=60*Number(t[1]),n+=Number(t[2])):2===t.length&&(n+=60*Number(t[0]),n+=Number(t[1])),Number(n)}function c(e,t,n){var r,i,s,l,a,u,c=!1,d=!1,h=!1,f="",g=!1,p=!1,b=!1,C=!1,y=!1,R="",E="",S=Math.abs(e),T=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],O="",_=!1;if(0===e&&null!==v)return v;if(t.indexOf("(")>-1?(c=!0,t=t.slice(1,-1)):t.indexOf("+")>-1&&(d=!0,t=t.replace(/\+/g,"")),t.indexOf("a")>-1&&(g=t.indexOf("aK")>=0,p=t.indexOf("aM")>=0,b=t.indexOf("aB")>=0,C=t.indexOf("aT")>=0,y=g||p||b||C,t.indexOf(" a")>-1?(f=" ",t=t.replace(" a","")):t=t.replace("a",""),S>=Math.pow(10,12)&&!y||C?(f+=m[w].abbreviations.trillion,e/=Math.pow(10,12)):S=Math.pow(10,9)&&!y||b?(f+=m[w].abbreviations.billion,e/=Math.pow(10,9)):S=Math.pow(10,6)&&!y||p?(f+=m[w].abbreviations.million,e/=Math.pow(10,6)):(S=Math.pow(10,3)&&!y||g)&&(f+=m[w].abbreviations.thousand,e/=Math.pow(10,3))),t.indexOf("b")>-1)for(t.indexOf(" b")>-1?(R=" ",t=t.replace(" b","")):t=t.replace("b",""),s=0;s<=T.length;s++)if(r=Math.pow(1024,s),i=Math.pow(1024,s+1),e>=r&&i>e){R+=T[s],r>0&&(e/=r);break}return t.indexOf("o")>-1&&(t.indexOf(" o")>-1?(E=" ",t=t.replace(" o","")):t=t.replace("o",""),E+=m[w].ordinal(e)),t.indexOf("[.]")>-1&&(h=!0,t=t.replace("[.]",".")),l=e.toString().split(".")[0],a=t.split(".")[1],u=t.indexOf(","),a?(a.indexOf("[")>-1?(a=a.replace("]",""),a=a.split("["),O=o(e,a[0].length+a[1].length,n,a[1].length)):O=o(e,a.length,n),l=O.split(".")[0],O=O.split(".")[1].length?m[w].delimiters.decimal+O.split(".")[1]:"",h&&0===Number(O.slice(1))&&(O="")):l=o(e,null,n),l.indexOf("-")>-1&&(l=l.slice(1),_=!0),u>-1&&(l=l.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+m[w].delimiters.thousands)),0===t.indexOf(".")&&(l=""),(c&&_?"(":"")+(!c&&_?"-":"")+(!_&&d?"+":"")+l+O+(E?E:"")+(f?f:"")+(R?R:"")+(c&&_?")":"")}function d(e,t){m[e]=t}function h(e){var t=e.toString().split(".");return t.length<2?1:Math.pow(10,t[1].length)}function f(){var e=Array.prototype.slice.call(arguments);return e.reduce(function(e,t){var n=h(e),o=h(t);return n>o?n:o},-(1/0))}var g,p="1.5.3",m={},w="en",v=null,b="0,0",C="undefined"!=typeof n&&n.exports;g=function(e){return g.isNumeral(e)?e=e.value():0===e||"undefined"==typeof e?e=0:Number(e)||(e=g.fn.unformat(e)),new t(Number(e))},g.version=p,g.isNumeral=function(e){return e instanceof t},g.language=function(e,t){if(!e)return w;if(e&&!t){if(!m[e])throw new Error("Unknown language : "+e);w=e}return(t||!m[e])&&d(e,t),g},g.languageData=function(e){if(!e)return m[w];if(!m[e])throw new Error("Unknown language : "+e);return m[e]},g.language("en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var t=e%10;return 1===~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$"}}),g.zeroFormat=function(e){v="string"==typeof e?e:null},g.defaultFormat=function(e){b="string"==typeof e?e:"0.0"},g.validate=function(e,t){var n,o,r,i,s,l,a,u;if("string"!=typeof e&&(e+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",e)),e=e.trim(),""===e)return!1;e=e.replace(/^[+-]?/,"");try{a=g.languageData(t)}catch(c){a=g.languageData(g.language())}return r=a.currency.symbol,s=a.abbreviations,n=a.delimiters.decimal,o="."===a.delimiters.thousands?"\\.":a.delimiters.thousands,u=e.match(/^[^\d\.\,]+/),null!==u&&(e=e.substr(1),u[0]!==r)?!1:(u=e.match(/[^\d]+$/),null!==u&&(e=e.slice(0,-1),u[0]!==s.thousand&&u[0]!==s.million&&u[0]!==s.billion&&u[0]!==s.trillion)?!1:e.match(/^\d+$/)?!0:(l=new RegExp(o+"{2}"),e.match(/[^\d.,]/g)?!1:(i=e.split(n),i.length>2?!1:i.length<2?!!i[0].match(/^\d+.*\d$/)&&!i[0].match(l):""===i[0]?!i[0].match(l)&&!!i[1].match(/^\d+$/):1===i[0].length?!!i[0].match(/^\d+$/)&&!i[0].match(l)&&!!i[1].match(/^\d+$/):!!i[0].match(/^\d+.*\d$/)&&!i[0].match(l)&&!!i[1].match(/^\d+$/))))},"function"!=typeof Array.prototype.reduce&&(Array.prototype.reduce=function(e,t){if(null===this||"undefined"==typeof this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof e)throw new TypeError(e+" is not a function");var n,o,r=this.length>>>0,i=!1;for(1n;++n)this.hasOwnProperty(n)&&(i?o=e(o,this[n],n,this):(o=this[n],i=!0));if(!i)throw new TypeError("Reduce of empty array with no initial value");return o}),g.fn=t.prototype={clone:function(){return g(this)},format:function(e,t){return r(this,e?e:b,void 0!==t?t:Math.round)},unformat:function(e){return"[object Number]"===Object.prototype.toString.call(e)?e:i(this,e?e:b)},value:function(){return this._value},valueOf:function(){return this._value},set:function(e){return this._value=Number(e),this},add:function(e){function t(e,t,o,r){return e+n*t}var n=f.call(null,this._value,e);return this._value=[this._value,e].reduce(t,0)/n,this},subtract:function(e){function t(e,t,o,r){return e-n*t}var n=f.call(null,this._value,e);return this._value=[e].reduce(t,this._value*n)/n,this},multiply:function(e){function t(e,t,n,o){var r=f(e,t);return e*r*(t*r)/(r*r)}return this._value=[this._value,e].reduce(t,1),this},divide:function(e){function t(e,t,n,o){var r=f(e,t);return e*r/(t*r)}return this._value=[this._value,e].reduce(t),this},difference:function(e){return Math.abs(g(this._value).subtract(e).value())}},C&&(n.exports=g),"undefined"==typeof ender&&(this.numeral=g),"function"==typeof e&&e.amd&&e([],function(){return g})}).call(window)},{}]},{},[23,59,61,60,62,83,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,84,85,86,87,100,101,102,90,91,92,93,94,95,31,35,32,33,40,34,36,37,38,39])("numeral")}); \ No newline at end of file +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Handsontable=e()}}(function(){var e;return function(e,t,o){return function n(e,t,o){function r(l,a){if(!t[l]){if(!e[l]){var u="function"==typeof require&&require;if(!a&&u)return u(l,!0);if(i)return i(l,!0);if(s[l]&&"undefined"!=typeof window[s[l]])return window[s[l]];var c=new Error("Cannot find module '"+l+"'");throw c.code="MODULE_NOT_FOUND",c}var d=t[l]={exports:{}};e[l][0].call(d.exports,function(t){var o=e[l][1][t];return r(o?o:t)},d,d.exports,n,e,t,o)}return t[l].exports}for(var i="function"==typeof require&&require,s=JSON.parse('{"zeroclipboard":"ZeroClipboard","moment":"moment","pikaday":"Pikaday"}')||{},l=0;l1)for(t=1,n=arguments.length;n>t;t++)r.push(arguments[t]);if(a){if("undefined"==typeof a[e])throw new Error("Handsontable do not provide action: "+e);i=a[e].apply(a,r),"destroy"===e&&l.removeData()}return i}}(window,jQuery,Handsontable)},{}],2:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableBorder:{get:function(){return C}},__esModule:{value:!0}});var n,r,i,s,l,a=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),u=a.getComputedStyle,c=a.getTrimmingContainer,d=a.innerWidth,h=a.innerHeight,f=a.offset,g=a.outerHeight,p=a.outerWidth,m=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}).stopImmediatePropagation,w=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,v=(s=e("cell/coords"),s&&s.__esModule&&s||{"default":s}).WalkontableCellCoords,b=(l=e("overlay/_base.js"),l&&l.__esModule&&l||{"default":l}).WalkontableOverlay,C=function(e,t){t&&(this.eventManager=new w(e),this.instance=e,this.wot=e,this.settings=t,this.mouseDown=!1,this.main=null,this.top=null,this.left=null,this.bottom=null,this.right=null,this.topStyle=null,this.leftStyle=null,this.bottomStyle=null,this.rightStyle=null,this.cornerDefaultStyle={width:"5px",height:"5px",borderWidth:"2px",borderStyle:"solid",borderColor:"#FFF"},this.corner=null,this.cornerStyle=null,this.createBorders(t),this.registerListeners())};$traceurRuntime.createClass(C,{registerListeners:function(){var e=this;this.eventManager.addEventListener(document.body,"mousedown",function(){return e.onMouseDown()}),this.eventManager.addEventListener(document.body,"mouseup",function(){return e.onMouseUp()});for(var t=this,o=function(o,n){t.eventManager.addEventListener(t.main.childNodes[o],"mouseenter",function(t){return e.onMouseEnter(t,e.main.childNodes[o])})},n=0,r=this.main.childNodes.length;r>n;n++)o(n,r)},onMouseDown:function(){this.mouseDown=!0},onMouseUp:function(){this.mouseDown=!1},onMouseEnter:function(e,t){function o(e){return e.clientYMath.ceil(i.top+i.height)?!0:e.clientXMath.ceil(i.left+i.width)?!0:void 0}function n(e){o(e)&&(r.eventManager.removeEventListener(document.body,"mousemove",n),t.style.display="block")}if(this.mouseDown&&this.wot.getSetting("hideBorderOnMouseDownOver")){e.preventDefault(),m(e);var r=this,i=t.getBoundingClientRect();t.style.display="none",this.eventManager.addEventListener(document.body,"mousemove",n)}},createBorders:function(e){this.main=document.createElement("div");var t=["top","left","bottom","right","corner"],o=this.main.style;o.position="absolute",o.top=0,o.left=0;for(var n=0;5>n;n++){var r=t[n],i=document.createElement("div");i.className="wtBorder "+(this.settings.className||""),this.settings[r]&&this.settings[r].hide&&(i.className+=" hidden"),o=i.style,o.backgroundColor=this.settings[r]&&this.settings[r].color?this.settings[r].color:e.border.color,o.height=this.settings[r]&&this.settings[r].width?this.settings[r].width+"px":e.border.width+"px",o.width=this.settings[r]&&this.settings[r].width?this.settings[r].width+"px":e.border.width+"px",this.main.appendChild(i)}this.top=this.main.childNodes[0],this.left=this.main.childNodes[1],this.bottom=this.main.childNodes[2],this.right=this.main.childNodes[3],this.topStyle=this.top.style,this.leftStyle=this.left.style,this.bottomStyle=this.bottom.style,this.rightStyle=this.right.style,this.corner=this.main.childNodes[4],this.corner.className+=" corner",this.cornerStyle=this.corner.style,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.height=this.cornerDefaultStyle.height,this.cornerStyle.border=[this.cornerDefaultStyle.borderWidth,this.cornerDefaultStyle.borderStyle,this.cornerDefaultStyle.borderColor].join(" "),Handsontable.mobileBrowser&&this.createMultipleSelectorHandles(),this.disappear(),this.wot.wtTable.bordersHolder||(this.wot.wtTable.bordersHolder=document.createElement("div"),this.wot.wtTable.bordersHolder.className="htBorders",this.wot.wtTable.spreader.appendChild(this.wot.wtTable.bordersHolder)),this.wot.wtTable.bordersHolder.insertBefore(this.main,this.wot.wtTable.bordersHolder.firstChild)},createMultipleSelectorHandles:function(){this.selectionHandles={topLeft:document.createElement("DIV"),topLeftHitArea:document.createElement("DIV"),bottomRight:document.createElement("DIV"),bottomRightHitArea:document.createElement("DIV")};var e=10,t=40;this.selectionHandles.topLeft.className="topLeftSelectionHandle",this.selectionHandles.topLeftHitArea.className="topLeftSelectionHandle-HitArea",this.selectionHandles.bottomRight.className="bottomRightSelectionHandle",this.selectionHandles.bottomRightHitArea.className="bottomRightSelectionHandle-HitArea",this.selectionHandles.styles={topLeft:this.selectionHandles.topLeft.style,topLeftHitArea:this.selectionHandles.topLeftHitArea.style,bottomRight:this.selectionHandles.bottomRight.style,bottomRightHitArea:this.selectionHandles.bottomRightHitArea.style};var o={position:"absolute",height:t+"px",width:t+"px","border-radius":parseInt(t/1.5,10)+"px"};for(var n in o)o.hasOwnProperty(n)&&(this.selectionHandles.styles.bottomRightHitArea[n]=o[n],this.selectionHandles.styles.topLeftHitArea[n]=o[n]);var r={position:"absolute",height:e+"px",width:e+"px","border-radius":parseInt(e/1.5,10)+"px",background:"#F5F5FF",border:"1px solid #4285c8"};for(var i in r)r.hasOwnProperty(i)&&(this.selectionHandles.styles.bottomRight[i]=r[i],this.selectionHandles.styles.topLeft[i]=r[i]);this.main.appendChild(this.selectionHandles.topLeft),this.main.appendChild(this.selectionHandles.bottomRight),this.main.appendChild(this.selectionHandles.topLeftHitArea),this.main.appendChild(this.selectionHandles.bottomRightHitArea)},isPartRange:function(e,t){return!this.wot.selections.area.cellRange||e==this.wot.selections.area.cellRange.to.row&&t==this.wot.selections.area.cellRange.to.col?!1:!0},updateMultipleSelectionHandlesPosition:function(e,t,o,n,r,i){var s=parseInt(this.selectionHandles.styles.topLeft.width,10),l=parseInt(this.selectionHandles.styles.topLeftHitArea.width,10);this.selectionHandles.styles.topLeft.top=parseInt(o-s,10)+"px",this.selectionHandles.styles.topLeft.left=parseInt(n-s,10)+"px",this.selectionHandles.styles.topLeftHitArea.top=parseInt(o-l/4*3,10)+"px",this.selectionHandles.styles.topLeftHitArea.left=parseInt(n-l/4*3,10)+"px",this.selectionHandles.styles.bottomRight.top=parseInt(o+i,10)+"px",this.selectionHandles.styles.bottomRight.left=parseInt(n+r,10)+"px",this.selectionHandles.styles.bottomRightHitArea.top=parseInt(o+i-l/4,10)+"px",this.selectionHandles.styles.bottomRightHitArea.left=parseInt(n+r-l/4,10)+"px",this.settings.border.multipleSelectionHandlesVisible&&this.settings.border.multipleSelectionHandlesVisible()?(this.selectionHandles.styles.topLeft.display="block",this.selectionHandles.styles.topLeftHitArea.display="block",this.isPartRange(e,t)?(this.selectionHandles.styles.bottomRight.display="none",this.selectionHandles.styles.bottomRightHitArea.display="none"):(this.selectionHandles.styles.bottomRight.display="block",this.selectionHandles.styles.bottomRightHitArea.display="block")):(this.selectionHandles.styles.topLeft.display="none",this.selectionHandles.styles.bottomRight.display="none",this.selectionHandles.styles.topLeftHitArea.display="none",this.selectionHandles.styles.bottomRightHitArea.display="none"),e==this.wot.wtSettings.getSetting("fixedRowsTop")||t==this.wot.wtSettings.getSetting("fixedColumnsLeft")?(this.selectionHandles.styles.topLeft.zIndex="9999",this.selectionHandles.styles.topLeftHitArea.zIndex="9999"):(this.selectionHandles.styles.topLeft.zIndex="",this.selectionHandles.styles.topLeftHitArea.zIndex="")},appear:function(e){if(!this.disabled){var t,o,n,r,i,s,l,a,m,w,C,y,R,E,S,T,O,_,M;M=b.isOverlayTypeOf(this.wot.cloneOverlay,b.CLONE_TOP)||b.isOverlayTypeOf(this.wot.cloneOverlay,b.CLONE_TOP_LEFT_CORNER)?this.wot.getSetting("fixedRowsTop"):b.isOverlayTypeOf(this.wot.cloneOverlay,b.CLONE_BOTTOM)||b.isOverlayTypeOf(this.wot.cloneOverlay,b.CLONE_BOTTOM_LEFT_CORNER)?this.wot.getSetting("fixedRowsBottom"):this.wot.wtTable.getRenderedRowsCount();for(var H=0;M>H;H++){var k=this.wot.wtTable.rowFilter.renderedToSource(H);if(k>=e[0]&&k<=e[2]){R=k;break}}for(var A=M-1;A>=0;A--){var P=this.wot.wtTable.rowFilter.renderedToSource(A);if(P>=e[0]&&P<=e[2]){S=P;break}}M=this.wot.wtTable.getRenderedColumnsCount();for(var x=0;M>x;x++){var D=this.wot.wtTable.columnFilter.renderedToSource(x);if(D>=e[1]&&D<=e[3]){E=D;break}}for(var N=M-1;N>=0;N--){var L=this.wot.wtTable.columnFilter.renderedToSource(N);if(L>=e[1]&&L<=e[3]){T=L;break}}if(void 0===R||void 0===E)return void this.disappear();t=R!==S||E!==T,o=this.wot.wtTable.getCell(new v(R,E)),n=t?this.wot.wtTable.getCell(new v(S,T)):o,r=f(o),i=t?f(n):r,s=f(this.wot.wtTable.TABLE),a=r.top,C=i.top+g(n)-a,w=r.left,y=i.left+p(n)-w,l=a-s.top-1,m=w-s.left-1;var W=u(o);parseInt(W.borderTopWidth,10)>0&&(l+=1,C=C>0?C-1:0),parseInt(W.borderLeftWidth,10)>0&&(m+=1,y=y>0?y-1:0),this.topStyle.top=l+"px",this.topStyle.left=m+"px",this.topStyle.width=y+"px",this.topStyle.display="block",this.leftStyle.top=l+"px",this.leftStyle.left=m+"px",this.leftStyle.height=C+"px",this.leftStyle.display="block";var I=Math.floor(this.settings.border.width/2);this.bottomStyle.top=l+C-I+"px",this.bottomStyle.left=m+"px",this.bottomStyle.width=y+"px",this.bottomStyle.display="block",this.rightStyle.top=l+"px",this.rightStyle.left=m+y-I+"px",this.rightStyle.height=C+1+"px",this.rightStyle.display="block",Handsontable.mobileBrowser||!this.hasSetting(this.settings.border.cornerVisible)||this.isPartRange(S,T)?this.cornerStyle.display="none":(this.cornerStyle.top=l+C-4+"px",this.cornerStyle.left=m+y-4+"px",this.cornerStyle.borderRightWidth=this.cornerDefaultStyle.borderWidth,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.display="block",O=c(this.wot.wtTable.TABLE),T===this.wot.getSetting("totalColumns")-1&&(_=n.offsetLeft+p(n)>=d(O),_&&(this.cornerStyle.left=Math.floor(m+y-3-parseInt(this.cornerDefaultStyle.width)/2)+"px",this.cornerStyle.borderRightWidth=0)),S===this.wot.getSetting("totalRows")-1&&(_=n.offsetTop+g(n)>=h(O),_&&(this.cornerStyle.top=Math.floor(l+C-3-parseInt(this.cornerDefaultStyle.height)/2)+"px",this.cornerStyle.borderBottomWidth=0))),Handsontable.mobileBrowser&&this.updateMultipleSelectionHandlesPosition(R,E,l,m,y,C)}},disappear:function(){this.topStyle.display="none",this.leftStyle.display="none",this.bottomStyle.display="none",this.rightStyle.display="none",this.cornerStyle.display="none",Handsontable.mobileBrowser&&(this.selectionHandles.styles.topLeft.display="none",this.selectionHandles.styles.bottomRight.display="none")},hasSetting:function(e){return"function"==typeof e?e():!!e}},{}),window.WalkontableBorder=C},{"cell/coords":5,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"overlay/_base.js":11}],3:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableViewportColumnsCalculator:{get:function(){return r}},__esModule:{value:!0}});var n=new WeakMap,r=function(e,t,o,r,i,s,l){n.set(this,{viewportWidth:e,scrollOffset:t,totalColumns:o,columnWidthFn:r,overrideFn:i,onlyFullyVisible:s}),this.count=0,this.startColumn=null,this.endColumn=null,this.startPosition=null,this.stretchAllRatio=0,this.stretchLastWidth=0,this.stretch=l,this.totalTargetWidth=0,this.needVerifyLastColumnWidth=!0,this.stretchAllColumnsWidth=[],this.calculate()},i=r;$traceurRuntime.createClass(r,{calculate:function(){for(var e,t=0,o=!0,r=[],i=n.get(this),s=i.onlyFullyVisible,l=i.overrideFn,a=i.scrollOffset,u=i.totalColumns,c=i.viewportWidth,d=0;u>d;d++)if(e=this._getColumnWidth(d),a>=t&&!s&&(this.startColumn=d),t>=a&&a+c>=t+e&&(null==this.startColumn&&(this.startColumn=d),this.endColumn=d),r.push(t),t+=e,s||(this.endColumn=d),t>=a+c){o=!1;break}if(this.endColumn===u-1&&o)for(this.startColumn=this.endColumn;this.startColumn>0;){var h=r[this.endColumn]+e-r[this.startColumn-1];if((c>=h||!s)&&this.startColumn--,h>c)break}null!==this.startColumn&&l&&l(this),this.startPosition=r[this.startColumn],void 0==this.startPosition&&(this.startPosition=null),null!==this.startColumn&&(this.count=this.endColumn-this.startColumn+1)},refreshStretching:function(e){if("none"!==this.stretch){for(var t,o,r=0,i=n.get(this),s=i.totalColumns,l=0;s>l;l++)t=this._getColumnWidth(l),r+=t;if(this.totalTargetWidth=e,o=r-e,"all"===this.stretch&&0>o)this.stretchAllRatio=e/r,this.stretchAllColumnsWidth=[],this.needVerifyLastColumnWidth=!0;else if("last"===this.stretch&&e!==1/0){var a=this._getColumnWidth(s-1),u=-o+a;this.stretchLastWidth=u>=0?u:a}}},getStretchedColumnWidth:function(e,t){var o=null;return"all"===this.stretch&&0!==this.stretchAllRatio?o=this._getStretchedAllColumnWidth(e,t):"last"===this.stretch&&0!==this.stretchLastWidth&&(o=this._getStretchedLastColumnWidth(e)),o},_getStretchedAllColumnWidth:function(e,t){var o=0,r=n.get(this),i=r.totalColumns;if(this.stretchAllColumnsWidth[e]||(this.stretchAllColumnsWidth[e]=Math.round(t*this.stretchAllRatio)),this.stretchAllColumnsWidth.length===i&&this.needVerifyLastColumnWidth){this.needVerifyLastColumnWidth=!1;for(var s=0;sf;f++){var g=a(f);if(void 0===g&&(g=i.DEFAULT_HEIGHT),u>=e&&!s&&(this.startRow=f),e>=u&&u+d-h>=e+g&&(null===this.startRow&&(this.startRow=f),this.endRow=f),o.push(e),e+=g,s||(this.endRow=f),e>=u+d-h){t=!1;break}}if(this.endRow===c-1&&t)for(this.startRow=this.endRow;this.startRow>0;){var p=o[this.endRow]+g-o[this.startRow-1];if((d-h>=p||!s)&&this.startRow--,p>=d-h)break}null!==this.startRow&&l&&l(this),this.startPosition=o[this.startRow],void 0==this.startPosition&&(this.startPosition=null),null!==this.startRow&&(this.count=this.endRow-this.startRow+1)}},{get DEFAULT_HEIGHT(){return 23}}),window.WalkontableViewportRowsCalculator=r},{}],5:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableCellCoords:{get:function(){return n}},__esModule:{value:!0}});var n=function(e,t){"undefined"!=typeof e&&"undefined"!=typeof t?(this.row=e,this.col=t):(this.row=null,this.col=null)};$traceurRuntime.createClass(n,{isValid:function(e){return this.row<0||this.col<0?!1:this.row>=e.getSetting("totalRows")||this.col>=e.getSetting("totalColumns")?!1:!0},isEqual:function(e){return e===this?!0:this.row===e.row&&this.col===e.col},isSouthEastOf:function(e){return this.row>=e.row&&this.col>=e.col},isNorthWestOf:function(e){return this.row<=e.row&&this.col<=e.col},isSouthWestOf:function(e){return this.row>=e.row&&this.col<=e.col},isNorthEastOf:function(e){return this.row<=e.row&&this.col>=e.col}},{}),window.WalkontableCellCoords=n},{}],6:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableCellRange:{get:function(){return i}},__esModule:{value:!0}});var n,r=(n=e("cell/coords"),n&&n.__esModule&&n||{"default":n}).WalkontableCellCoords,i=function(e,t,o){this.highlight=e,this.from=t,this.to=o},s=i;$traceurRuntime.createClass(i,{isValid:function(e){return this.from.isValid(e)&&this.to.isValid(e)},isSingle:function(){return this.from.row===this.to.row&&this.from.col===this.to.col},getHeight:function(){return Math.max(this.from.row,this.to.row)-Math.min(this.from.row,this.to.row)+1},getWidth:function(){return Math.max(this.from.col,this.to.col)-Math.min(this.from.col,this.to.col)+1},includes:function(e){var t=this.getTopLeftCorner(),o=this.getBottomRightCorner();return e.row<0&&(e.row=0),e.col<0&&(e.col=0),t.row<=e.row&&o.row>=e.row&&t.col<=e.col&&o.col>=e.col},includesRange:function(e){return this.includes(e.getTopLeftCorner())&&this.includes(e.getBottomRightCorner())},isEqual:function(e){return Math.min(this.from.row,this.to.row)==Math.min(e.from.row,e.to.row)&&Math.max(this.from.row,this.to.row)==Math.max(e.from.row,e.to.row)&&Math.min(this.from.col,this.to.col)==Math.min(e.from.col,e.to.col)&&Math.max(this.from.col,this.to.col)==Math.max(e.from.col,e.to.col)},overlaps:function(e){return e.isSouthEastOf(this.getTopLeftCorner())&&e.isNorthWestOf(this.getBottomRightCorner())},isSouthEastOf:function(e){return this.getTopLeftCorner().isSouthEastOf(e)||this.getBottomRightCorner().isSouthEastOf(e)},isNorthWestOf:function(e){return this.getTopLeftCorner().isNorthWestOf(e)||this.getBottomRightCorner().isNorthWestOf(e)},expand:function(e){var t=this.getTopLeftCorner(),o=this.getBottomRightCorner();return e.rowo.row||e.col>o.col?(this.from=new r(Math.min(t.row,e.row),Math.min(t.col,e.col)),this.to=new r(Math.max(o.row,e.row),Math.max(o.col,e.col)),!0):!1},expandByRange:function(e){if(this.includesRange(e)||!this.overlaps(e))return!1;var t=this.getTopLeftCorner(),o=this.getBottomRightCorner(),n=(this.getTopRightCorner(),this.getBottomLeftCorner(),e.getTopLeftCorner()),i=e.getBottomRightCorner(),l=Math.min(t.row,n.row),a=Math.min(t.col,n.col),u=Math.max(o.row,i.row),c=Math.max(o.col,i.col),d=new r(l,a),h=new r(u,c),f=new s(d,d,h).isCorner(this.from,e),g=e.isEqual(new s(d,d,h));return f&&!g&&(this.from.col>d.col&&(d.col=c,h.col=a),this.from.row>d.row&&(d.row=u,h.row=l)),this.from=d,this.to=h,!0},getDirection:function(){return this.from.isNorthWestOf(this.to)?"NW-SE":this.from.isNorthEastOf(this.to)?"NE-SW":this.from.isSouthEastOf(this.to)?"SE-NW":this.from.isSouthWestOf(this.to)?"SW-NE":void 0},setDirection:function(e){switch(e){case"NW-SE":this.from=this.getTopLeftCorner(),this.to=this.getBottomRightCorner();break;case"NE-SW":this.from=this.getTopRightCorner(),this.to=this.getBottomLeftCorner();break;case"SE-NW":this.from=this.getBottomRightCorner(),this.to=this.getTopLeftCorner();break;case"SW-NE":this.from=this.getBottomLeftCorner(),this.to=this.getTopRightCorner()}},getTopLeftCorner:function(){return new r(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))},getBottomRightCorner:function(){return new r(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))},getTopRightCorner:function(){return new r(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))},getBottomLeftCorner:function(){return new r(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))},isCorner:function(e,t){return t&&t.includes(e)&&(this.getTopLeftCorner().isEqual(new r(t.from.row,t.from.col))||this.getTopRightCorner().isEqual(new r(t.from.row,t.to.col))||this.getBottomLeftCorner().isEqual(new r(t.to.row,t.from.col))||this.getBottomRightCorner().isEqual(new r(t.to.row,t.to.col)))?!0:e.isEqual(this.getTopLeftCorner())||e.isEqual(this.getTopRightCorner())||e.isEqual(this.getBottomLeftCorner())||e.isEqual(this.getBottomRightCorner())},getOppositeCorner:function(e,t){if(!(e instanceof r))return!1;if(t&&t.includes(e)){if(this.getTopLeftCorner().isEqual(new r(t.from.row,t.from.col)))return this.getBottomRightCorner();if(this.getTopRightCorner().isEqual(new r(t.from.row,t.to.col)))return this.getBottomLeftCorner();if(this.getBottomLeftCorner().isEqual(new r(t.to.row,t.from.col)))return this.getTopRightCorner();if(this.getBottomRightCorner().isEqual(new r(t.to.row,t.to.col)))return this.getTopLeftCorner()}return e.isEqual(this.getBottomRightCorner())?this.getTopLeftCorner():e.isEqual(this.getTopLeftCorner())?this.getBottomRightCorner():e.isEqual(this.getTopRightCorner())?this.getBottomLeftCorner():e.isEqual(this.getBottomLeftCorner())?this.getTopRightCorner():void 0},getBordersSharedWith:function(e){if(!this.includesRange(e))return[];var t={top:Math.min(this.from.row,this.to.row),bottom:Math.max(this.from.row,this.to.row),left:Math.min(this.from.col,this.to.col),right:Math.max(this.from.col,this.to.col)},o={top:Math.min(e.from.row,e.to.row),bottom:Math.max(e.from.row,e.to.row),left:Math.min(e.from.col,e.to.col),right:Math.max(e.from.col,e.to.col)},n=[];return t.top==o.top&&n.push("top"),t.right==o.right&&n.push("right"),t.bottom==o.bottom&&n.push("bottom"),t.left==o.left&&n.push("left"),n},getInner:function(){for(var e=this.getTopLeftCorner(),t=this.getBottomRightCorner(),o=[],n=e.row;n<=t.row;n++)for(var i=e.col;i<=t.col;i++)this.from.row===n&&this.from.col===i||this.to.row===n&&this.to.col===i||o.push(new r(n,i));return o},getAll:function(){for(var e=this.getTopLeftCorner(),t=this.getBottomRightCorner(),o=[],n=e.row;n<=t.row;n++)for(var i=e.col;i<=t.col;i++)e.row===n&&e.col===i?o.push(e):t.row===n&&t.col===i?o.push(t):o.push(new r(n,i));return o},forAll:function(e){for(var t=this.getTopLeftCorner(),o=this.getBottomRightCorner(),n=t.row;n<=o.row;n++)for(var r=t.col;r<=o.col;r++){var i=e(n,r);if(i===!1)return}}},{}),window.WalkontableCellRange=i},{"cell/coords":5}],7:[function(e,t,o){"use strict";Object.defineProperties(o,{Walkontable:{get:function(){return P}},__esModule:{value:!0}});var n,r,i,s,l,a,u,c,d,h,f,g,p,m,w=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),v=w.addClass,b=w.fastInnerText,C=w.isVisible,y=w.removeClass,R=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).objectEach,E=(i=e("helpers/string"),i&&i.__esModule&&i||{"default":i}),S=E.toUpperCaseFirst,T=E.randomString,O=(s=e("event"),s&&s.__esModule&&s||{"default":s}).WalkontableEvent,_=(l=e("overlays"),l&&l.__esModule&&l||{"default":l}).WalkontableOverlays,M=(a=e("scroll"),a&&a.__esModule&&a||{"default":a}).WalkontableScroll,H=(u=e("settings"),u&&u.__esModule&&u||{"default":u}).WalkontableSettings,k=(c=e("table"),c&&c.__esModule&&c||{"default":c}).WalkontableTable,A=(d=e("viewport"),d&&d.__esModule&&d||{"default":d}).WalkontableViewport,P=((h=e("overlay/_base.js"),h&&h.__esModule&&h||{"default":h}).WalkontableOverlay,(f=e("overlay/top.js"),f&&f.__esModule&&f||{"default":f}).WalkontableTopOverlay,(g=e("overlay/left.js"),g&&g.__esModule&&g||{"default":g}).WalkontableLeftOverlay,(p=e("overlay/debug.js"),p&&p.__esModule&&p||{"default":p}).WalkontableDebugOverlay,(m=e("overlay/topLeftCorner.js"),m&&m.__esModule&&m||{"default":m}).WalkontableTopLeftCornerOverlay,function(e){var t=[];if(this.guid="wt_"+T(),e.cloneSource?(this.cloneSource=e.cloneSource,this.cloneOverlay=e.cloneOverlay,this.wtSettings=e.cloneSource.wtSettings,this.wtTable=new k(this,e.table,e.wtRootElement),this.wtScroll=new M(this),this.wtViewport=e.cloneSource.wtViewport,this.wtEvent=new O(this),this.selections=this.cloneSource.selections):(this.wtSettings=new H(this,e),this.wtTable=new k(this,e.table),this.wtScroll=new M(this),this.wtViewport=new A(this),this.wtEvent=new O(this),this.selections=this.getSetting("selections"),this.wtOverlays=new _(this),this.exportSettingsAsClassNames()),this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(var o=0,n=this.wtTable.THEAD.childNodes[0].childNodes.length;n>o;o++)t.push(this.wtTable.THEAD.childNodes[0].childNodes[o].innerHTML);this.getSetting("columnHeaders").length||this.update("columnHeaders",[function(e,o){b(o,t[e])}])}this.drawn=!1,this.drawInterrupted=!1});$traceurRuntime.createClass(P,{draw:function(){var e=void 0!==arguments[0]?arguments[0]:!1;return this.drawInterrupted=!1,e||C(this.wtTable.TABLE)?this.wtTable.draw(e):this.drawInterrupted=!0,this},getCell:function(e){var t=void 0!==arguments[1]?arguments[1]:!1;if(!t)return this.wtTable.getCell(e);var o=this.wtSettings.getSetting("totalRows"),n=this.wtSettings.getSetting("fixedRowsTop"),r=this.wtSettings.getSetting("fixedRowsBottom"),i=this.wtSettings.getSetting("fixedColumnsLeft");if(e.row=o-r){if(this.wtOverlays.bottomLeftCornerOverlay.clone)return this.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell(e)}else{if(e.colo-r&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)},update:function(e,t){return this.wtSettings.update(e,t)},scrollVertical:function(e){return this.wtOverlays.topOverlay.scrollTo(e),this.getSetting("onScrollVertically"),this},scrollHorizontal:function(e){return this.wtOverlays.leftOverlay.scrollTo(e),this.getSetting("onScrollHorizontally"),this},scrollViewport:function(e){return this.wtScroll.scrollViewport(e),this},getViewport:function(){return[this.wtTable.getFirstVisibleRow(),this.wtTable.getFirstVisibleColumn(),this.wtTable.getLastVisibleRow(),this.wtTable.getLastVisibleColumn()]},getOverlayName:function(){return this.cloneOverlay?this.cloneOverlay.type:"master"},exportSettingsAsClassNames:function(){var e=this,t={rowHeaders:["array"],columnHeaders:["array"]},o=[],n=[];R(t,function(t,r){t.indexOf("array")>-1&&e.getSetting(r).length&&n.push("ht"+S(r)),o.push("ht"+S(r))}),y(this.wtTable.wtRootElement.parentNode,o),v(this.wtTable.wtRootElement.parentNode,n)},getSetting:function(e,t,o,n,r){return this.wtSettings.getSetting(e,t,o,n,r)},hasSetting:function(e){return this.wtSettings.has(e)},destroy:function(){this.wtOverlays.destroy(),this.wtEvent.destroy()}},{}),window.Walkontable=P},{event:8,"helpers/dom/element":45,"helpers/object":50,"helpers/string":52,"overlay/_base.js":11,"overlay/debug.js":12,"overlay/left.js":13,"overlay/top.js":14,"overlay/topLeftCorner.js":15,overlays:16,scroll:17,settings:19,table:20,viewport:22}],8:[function(e,t,o){"use strict";function n(e){var t=this,o=c(e);this.instance=e;var n=[null,null];this.dblClickTimeout=[null,null];var r,i=function(e){var o=t.parentCell(e.realTarget);a(e.realTarget,"corner")?t.instance.getSetting("onCellCornerMouseDown",e,e.realTarget):o.TD&&t.instance.hasSetting("onCellMouseDown")&&t.instance.getSetting("onCellMouseDown",e,o.coords,o.TD,t.instance),2!==e.button&&o.TD&&(n[0]=o.TD,clearTimeout(t.dblClickTimeout[0]),t.dblClickTimeout[0]=setTimeout(function(){n[0]=null},1e3))},s=function(e){t.instance.touchMoving=!0},d=function(e){o.addEventListener(this,"touchmove",s),t.checkIfTouchMove=setTimeout(function(){return t.instance.touchMoving===!0?(t.instance.touchMoving=void 0,void o.removeEventListener("touchmove",s,!1)):void i(e)},30)},h=function(e){var o,n,r;t.instance.hasSetting("onCellMouseOver")&&(o=t.instance.wtTable.TABLE,n=l(e.realTarget,["TD","TH"],o),r=t.instance.cloneSource||t.instance,n&&n!==r.lastMouseOver&&u(n,o)&&(r.lastMouseOver=n,t.instance.getSetting("onCellMouseOver",e,t.instance.wtTable.getCoords(n),n,t.instance)))},f=function(e){if(2!==e.button){var o=t.parentCell(e.realTarget);o.TD===n[0]&&o.TD===n[1]?(a(e.realTarget,"corner")?t.instance.getSetting("onCellCornerDblClick",e,o.coords,o.TD,t.instance):t.instance.getSetting("onCellDblClick",e,o.coords,o.TD,t.instance),n[0]=null,n[1]=null):o.TD===n[0]&&(n[1]=o.TD,clearTimeout(t.dblClickTimeout[1]),t.dblClickTimeout[1]=setTimeout(function(){n[1]=null},500))}},g=function(e){clearTimeout(r),e.preventDefault(),f(e)};if(o.addEventListener(this.instance.wtTable.holder,"mousedown",i),o.addEventListener(this.instance.wtTable.TABLE,"mouseover",h),o.addEventListener(this.instance.wtTable.holder,"mouseup",f),this.instance.wtTable.holder.parentNode.parentNode&&Handsontable.mobileBrowser&&!t.instance.wtTable.isWorkingOnClone()){var p="."+this.instance.wtTable.holder.parentNode.className.split(" ").join(".");o.addEventListener(this.instance.wtTable.holder,"touchstart",function(e){t.instance.touchApplied=!0,u(e.target,p)&&d.call(e.target,e)}),o.addEventListener(this.instance.wtTable.holder,"touchend",function(e){t.instance.touchApplied=!1,u(e.target,p)&&g.call(e.target,e)}),t.instance.momentumScrolling||(t.instance.momentumScrolling={}),o.addEventListener(this.instance.wtTable.holder,"scroll",function(e){clearTimeout(t.instance.momentumScrolling._timeout),t.instance.momentumScrolling.ongoing||t.instance.getSetting("onBeforeTouchScroll"),t.instance.momentumScrolling.ongoing=!0,t.instance.momentumScrolling._timeout=setTimeout(function(){t.instance.touchApplied||(t.instance.momentumScrolling.ongoing=!1,t.instance.getSetting("onAfterMomentumScroll"))},200)})}o.addEventListener(window,"resize",function(){"none"!==t.instance.getSetting("stretchH")&&t.instance.draw()}),this.destroy=function(){clearTimeout(this.dblClickTimeout[0]),clearTimeout(this.dblClickTimeout[1]),o.destroy()}}Object.defineProperties(o,{WalkontableEvent:{get:function(){return n}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),l=s.closest,a=s.hasClass,u=s.isChildOf,c=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager;n.prototype.parentCell=function(e){var t={},o=this.instance.wtTable.TABLE,n=l(e,["TD","TH"],o);return n&&u(n,o)?(t.coords=this.instance.wtTable.getCoords(n),t.TD=n):a(e,"wtBorder")&&a(e,"current")?(t.coords=this.instance.selections.current.cellRange.highlight,t.TD=this.instance.wtTable.getCell(t.coords)):a(e,"wtBorder")&&a(e,"area")&&this.instance.selections.area.cellRange&&(t.coords=this.instance.selections.area.cellRange.to,t.TD=this.instance.wtTable.getCell(t.coords)),t},window.WalkontableEvent=n},{eventManager:41,"helpers/dom/element":45}],9:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableColumnFilter:{get:function(){return n}},__esModule:{value:!0}});var n=function(e,t,o){this.offset=e,this.total=t,this.countTH=o};$traceurRuntime.createClass(n,{offsetted:function(e){return e+this.offset},unOffsetted:function(e){return e-this.offset},renderedToSource:function(e){return this.offsetted(e)},sourceToRendered:function(e){return this.unOffsetted(e)},offsettedTH:function(e){return e-this.countTH},unOffsettedTH:function(e){return e+this.countTH},visibleRowHeadedColumnToSourceColumn:function(e){return this.renderedToSource(this.offsettedTH(e))},sourceColumnToVisibleRowHeadedColumn:function(e){ +return this.unOffsettedTH(this.sourceToRendered(e))}},{}),window.WalkontableColumnFilter=n},{}],10:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableRowFilter:{get:function(){return n}},__esModule:{value:!0}});var n=function(e,t,o){this.offset=e,this.total=t,this.countTH=o};$traceurRuntime.createClass(n,{offsetted:function(e){return e+this.offset},unOffsetted:function(e){return e-this.offset},renderedToSource:function(e){return this.offsetted(e)},sourceToRendered:function(e){return this.unOffsetted(e)},offsettedTH:function(e){return e-this.countTH},unOffsettedTH:function(e){return e+this.countTH},visibleColHeadedRowToSourceRow:function(e){return this.renderedToSource(this.offsettedTH(e))},sourceRowToVisibleColHeadedRow:function(e){return this.unOffsettedTH(this.sourceToRendered(e))}},{}),window.WalkontableRowFilter=n},{}],11:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableOverlay:{get:function(){return h}},__esModule:{value:!0}});var n,r,i,s=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),l=s.getScrollableElement,a=s.getTrimmingContainer,u=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).defineGetter,c=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,d={},h=function(e){u(this,"wot",e,{writable:!1}),this.instance=this.wot,this.type="",this.mainTableScrollableElement=null,this.TABLE=this.wot.wtTable.TABLE,this.hider=this.wot.wtTable.hider,this.spreader=this.wot.wtTable.spreader,this.holder=this.wot.wtTable.holder,this.wtRootElement=this.wot.wtTable.wtRootElement,this.trimmingContainer=a(this.hider.parentNode.parentNode),this.needFullRender=this.shouldBeRendered(),this.areElementSizesAdjusted=!1},f=h;$traceurRuntime.createClass(h,{shouldBeRendered:function(){return!0},makeClone:function(e){if(-1===f.CLONE_TYPES.indexOf(e))throw new Error('Clone type "'+e+'" is not supported.');var t=document.createElement("DIV"),o=document.createElement("TABLE");t.className="ht_clone_"+e+" handsontable",t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.overflow="hidden",o.className=this.wot.wtTable.TABLE.className,t.appendChild(o),this.type=e,this.wot.wtTable.wtRootElement.parentNode.appendChild(t);var n=this.wot.getSetting("preventOverflow");return n===!0||"horizontal"===n&&this.type===f.CLONE_TOP||"vertical"===n&&this.type===f.CLONE_LEFT?this.mainTableScrollableElement=window:this.mainTableScrollableElement=l(this.wot.wtTable.TABLE),new Walkontable({cloneSource:this.wot,cloneOverlay:this,table:o})},refresh:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=this.shouldBeRendered();this.clone&&(this.needFullRender||t)&&this.clone.draw(e),this.needFullRender=t},destroy:function(){c(this.clone).destroy()}},{get CLONE_TOP(){return"top"},get CLONE_BOTTOM(){return"bottom"},get CLONE_LEFT(){return"left"},get CLONE_TOP_LEFT_CORNER(){return"top_left_corner"},get CLONE_BOTTOM_LEFT_CORNER(){return"bottom_left_corner"},get CLONE_DEBUG(){return"debug"},get CLONE_TYPES(){return[f.CLONE_TOP,f.CLONE_BOTTOM,f.CLONE_LEFT,f.CLONE_TOP_LEFT_CORNER,f.CLONE_BOTTOM_LEFT_CORNER,f.CLONE_DEBUG]},registerOverlay:function(e,t){if(-1===f.CLONE_TYPES.indexOf(e))throw new Error("Unsupported overlay ("+e+").");d[e]=t},createOverlay:function(e,t){return new d[e](t)},isOverlayTypeOf:function(e,t){return e&&d[t]?e instanceof d[t]:!1}}),window.WalkontableOverlay=h},{eventManager:41,"helpers/dom/element":45,"helpers/object":50}],12:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableDebugOverlay:{get:function(){return l}},__esModule:{value:!0}});var n,r,i=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}).addClass,s=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,l=function(e){$traceurRuntime.superConstructor(a).call(this,e),this.clone=this.makeClone(s.CLONE_DEBUG),this.clone.wtTable.holder.style.opacity=.4,this.clone.wtTable.holder.style.textShadow="0 0 2px #ff0000",i(this.clone.wtTable.holder.parentNode,"wtDebugVisible")},a=l;$traceurRuntime.createClass(l,{},{},s),window.WalkontableDebugOverlay=l,s.registerOverlay(s.CLONE_DEBUG,l)},{_base:11,"helpers/dom/element":45}],13:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableLeftOverlay:{get:function(){return m}},__esModule:{value:!0}});var n,r,i=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),s=i.addClass,l=i.getScrollbarWidth,a=i.getScrollLeft,u=i.getWindowScrollTop,c=i.hasClass,d=i.outerWidth,h=i.innerHeight,f=i.removeClass,g=i.setOverlayPosition,p=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,m=function(e){$traceurRuntime.superConstructor(w).call(this,e),this.clone=this.makeClone(p.CLONE_LEFT)},w=m;$traceurRuntime.createClass(m,{shouldBeRendered:function(){return this.wot.getSetting("fixedColumnsLeft")||this.wot.getSetting("rowHeaders").length?!0:!1},resetFixedPosition:function(){if(this.needFullRender&&this.wot.wtTable.holder.parentNode){var e=this.clone.wtTable.holder.parentNode,t=0,o=this.wot.getSetting("preventOverflow");if(this.trimmingContainer!==window||o&&"horizontal"===o)t=this.getScrollPosition();else{var n,r,i=this.wot.wtTable.hider.getBoundingClientRect(),s=Math.ceil(i.left),l=Math.ceil(i.right);r=this.wot.wtTable.hider.style.top,r=""===r?0:r,n=0>s&&l-e.offsetWidth>0?-s:0,t=n,n+="px",g(e,n,r)}this.adjustHeaderBordersPosition(t),this.adjustElementsSize()}},setScrollPosition:function(e){this.mainTableScrollableElement===window?window.scrollTo(e,u()):this.mainTableScrollableElement.scrollLeft=e},onScroll:function(){this.wot.getSetting("onScrollVertically")},sumCellSizes:function(e,t){for(var o=0,n=this.wot.wtSettings.defaultColumnWidth;t>e;)o+=this.wot.wtTable.getStretchedColumnWidth(e)||n,e++;return o},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1;(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize(),e||(this.areElementSizesAdjusted=!0))},adjustRootElementSize:function(){var e,t=this.wot.wtTable.holder,o=t.clientHeight===t.offsetHeight?0:l(),n=this.clone.wtTable.holder.parentNode,r=n.style,i=this.wot.getSetting("preventOverflow");if(this.trimmingContainer!==window||"vertical"===i){var s=this.wot.wtViewport.getWorkspaceHeight()-o;s=Math.min(s,h(this.wot.wtTable.wtRootElement)),r.height=s+"px"}this.clone.wtTable.holder.style.height=r.height,e=d(this.clone.wtTable.TABLE),r.width=(0===e?e:e+4)+"px"},adjustRootChildrenSize:function(){var e=l();this.clone.wtTable.hider.style.height=this.hider.style.height,this.clone.wtTable.holder.style.height=this.clone.wtTable.holder.parentNode.style.height,0===e&&(e=30),this.clone.wtTable.holder.style.width=parseInt(this.clone.wtTable.holder.parentNode.style.width,10)+e+"px"},applyToDOM:function(){var e=this.wot.getSetting("totalColumns");if(this.areElementSizesAdjusted||this.adjustElementsSize(),"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition)this.spreader.style.left=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the columnsRenderCalculator");this.spreader.style.left="0"}this.spreader.style.right="",this.needFullRender&&this.syncOverlayOffset()},syncOverlayOffset:function(){"number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px":this.clone.wtTable.spreader.style.top=""},scrollTo:function(e,t){var o=this.getTableParentOffset(),n=this.wot.cloneSource?this.wot.cloneSource:this.wot,r=n.wtTable.holder,i=0;t&&r.offsetWidth!==r.clientWidth&&(i=l()),t?(o+=this.sumCellSizes(0,e+1),o-=this.wot.wtViewport.getViewportWidth()):o+=this.sumCellSizes(this.wot.getSetting("fixedColumnsLeft"),e),o+=i,this.setScrollPosition(o)},getTableParentOffset:function(){var e=this.wot.getSetting("preventOverflow"),t=0;return e||this.trimmingContainer!==window||(t=this.wot.wtTable.holderOffset.left),t},getScrollPosition:function(){return a(this.mainTableScrollableElement)},adjustHeaderBordersPosition:function(e){var t=this.wot.wtTable.holder.parentNode,o=this.wot.getSetting("rowHeaders"),n=this.wot.getSetting("fixedColumnsLeft");if(n&&!o.length)s(t,"innerBorderLeft");else if(!n&&o.length){var r=c(t,"innerBorderLeft");e?s(t,"innerBorderLeft"):f(t,"innerBorderLeft"),(!r&&e||r&&!e)&&this.wot.wtOverlays.adjustElementsSize()}}},{},p),window.WalkontableLeftOverlay=m,p.registerOverlay(p.CLONE_LEFT,m)},{_base:11,"helpers/dom/element":45}],14:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableTopOverlay:{get:function(){return m}},__esModule:{value:!0}});var n,r,i=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),s=i.addClass,l=i.getScrollbarWidth,a=i.getScrollTop,u=i.getWindowScrollLeft,c=i.hasClass,d=i.outerHeight,h=i.innerWidth,f=i.removeClass,g=i.setOverlayPosition,p=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,m=function(e){$traceurRuntime.superConstructor(w).call(this,e),this.clone=this.makeClone(p.CLONE_TOP)},w=m;$traceurRuntime.createClass(m,{shouldBeRendered:function(){return this.wot.getSetting("fixedRowsTop")||this.wot.getSetting("columnHeaders").length?!0:!1},resetFixedPosition:function(){if(this.needFullRender&&this.wot.wtTable.holder.parentNode){var e=this.clone.wtTable.holder.parentNode,t=0,o=this.wot.getSetting("preventOverflow");if(this.trimmingContainer!==window||o&&"vertical"===o)t=this.getScrollPosition();else{var n,r,i=this.wot.wtTable.hider.getBoundingClientRect(),s=Math.ceil(i.top),l=Math.ceil(i.bottom);n=this.wot.wtTable.hider.style.left,n=""===n?0:n,r=0>s&&l-e.offsetHeight>0?-s:0,t=r,r+="px",g(e,n,r)}this.adjustHeaderBordersPosition(t),this.adjustElementsSize()}},setScrollPosition:function(e){this.mainTableScrollableElement===window?window.scrollTo(u(),e):this.mainTableScrollableElement.scrollTop=e},onScroll:function(){this.wot.getSetting("onScrollHorizontally")},sumCellSizes:function(e,t){for(var o=0,n=this.wot.wtSettings.settings.defaultRowHeight;t>e;){var r=this.wot.wtTable.getRowHeight(e);o+=void 0===r?n:r,e++}return o},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1;(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize(),e||(this.areElementSizesAdjusted=!0))},adjustRootElementSize:function(){var e,t=this.wot.wtTable.holder,o=t.clientWidth===t.offsetWidth?0:l(),n=this.clone.wtTable.holder.parentNode,r=n.style,i=this.wot.getSetting("preventOverflow");if(this.trimmingContainer!==window||"horizontal"===i){var s=this.wot.wtViewport.getWorkspaceWidth()-o;s=Math.min(s,h(this.wot.wtTable.wtRootElement)),r.width=s+"px"}this.clone.wtTable.holder.style.width=r.width,e=d(this.clone.wtTable.TABLE),r.height=(0===e?e:e+4)+"px"},adjustRootChildrenSize:function(){var e=l();this.clone.wtTable.hider.style.width=this.hider.style.width,this.clone.wtTable.holder.style.width=this.clone.wtTable.holder.parentNode.style.width,0===e&&(e=30),this.clone.wtTable.holder.style.height=parseInt(this.clone.wtTable.holder.parentNode.style.height,10)+e+"px"},applyToDOM:function(){var e=this.wot.getSetting("totalRows");if(this.areElementSizesAdjusted||this.adjustElementsSize(),"number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition)this.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.top="0"}this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()},syncOverlayOffset:function(){"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.left=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px":this.clone.wtTable.spreader.style.left=""},scrollTo:function(e,t){var o=this.getTableParentOffset(),n=this.wot.cloneSource?this.wot.cloneSource:this.wot,r=n.wtTable.holder,i=0;if(t&&r.offsetHeight!==r.clientHeight&&(i=l()),t){var s=this.wot.getSetting("fixedRowsBottom"),a=(this.wot.getSetting("fixedRowsTop"),this.wot.getSetting("totalRows"));o+=this.sumCellSizes(0,e+1),o-=this.wot.wtViewport.getViewportHeight()-this.sumCellSizes(a-s,a),o+=1}else o+=this.sumCellSizes(this.wot.getSetting("fixedRowsTop"),e);o+=i,this.setScrollPosition(o)},getTableParentOffset:function(){return this.mainTableScrollableElement===window?this.wot.wtTable.holderOffset.top:0},getScrollPosition:function(){return a(this.mainTableScrollableElement)},adjustHeaderBordersPosition:function(e){if(0===this.wot.getSetting("fixedRowsTop")&&this.wot.getSetting("columnHeaders").length>0){var t=this.wot.wtTable.holder.parentNode,o=c(t,"innerBorderTop");e||0===this.wot.getSetting("totalRows")?s(t,"innerBorderTop"):f(t,"innerBorderTop"),(!o&&e||o&&!e)&&this.wot.wtOverlays.adjustElementsSize()}if(0===this.wot.getSetting("rowHeaders").length){var n=this.clone.wtTable.THEAD.querySelectorAll("th:nth-of-type(2)");if(n)for(var r=0;ru&&d-e.offsetWidth>0&&(h=-u+"px"),n&&"horizontal"!==n||0>i&&c-e.offsetHeight>0&&(f=-i+"px"),a(e,h,f)}e.style.height=(0===t?t:t+4)+"px",e.style.width=(0===o?o:o+4)+"px"}}},{},u),window.WalkontableTopLeftCornerOverlay=c,u.registerOverlay(u.CLONE_TOP_LEFT_CORNER,c)},{_base:11,"helpers/dom/element":45}],16:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableOverlays:{get:function(){return f}},__esModule:{value:!0}});var n,r,i,s=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),l=s.getScrollableElement,a=s.getScrollbarWidth,u=s.getScrollLeft,c=s.getScrollTop,d=(r=e("helpers/unicode"),r&&r.__esModule&&r||{"default":r}).isKey,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,f=function(e){this.wot=e,this.instance=this.wot,this.eventManager=new h(this.wot),this.wot.update("scrollbarWidth",a()),this.wot.update("scrollbarHeight",a()),this.scrollableElement=l(this.wot.wtTable.TABLE),this.topOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP,this.wot),"undefined"==typeof WalkontableBottomOverlay?this.bottomOverlay={needFullRender:!1}:this.bottomOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM,this.wot),this.leftOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_LEFT,this.wot),this.topOverlay.needFullRender&&this.leftOverlay.needFullRender&&(this.topLeftCornerOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP_LEFT_CORNER,this.wot)),this.bottomOverlay.needFullRender&&this.leftOverlay.needFullRender&&"undefined"!=typeof WalkontableBottomLeftCornerOverlay?this.bottomLeftCornerOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER,this.wot):this.bottomLeftCornerOverlay={needFullRender:!1},this.wot.getSetting("debug")&&(this.debug=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_DEBUG,this.wot)),this.destroyed=!1,this.keyPressed=!1,this.spreaderLastSize={width:null,height:null},this.overlayScrollPositions={master:{top:0,left:0},top:{top:null,left:0},bottom:{top:null,left:0},left:{top:0,left:null}},this.verticalScrolling=!1,this.horizontalScrolling=!1,this.delegatedScrollCallback=!1,this.registerListeners()};$traceurRuntime.createClass(f,{refreshAll:function(){if(this.wot.drawn){if(!this.wot.wtTable.holder.parentNode)return void this.destroy();this.wot.draw(!0),this.verticalScrolling&&this.leftOverlay.onScroll(),this.horizontalScrolling&&this.topOverlay.onScroll(),this.verticalScrolling=!1,this.horizontalScrolling=!1}},registerListeners:function(){var e=this;this.eventManager.addEventListener(document.documentElement,"keydown",function(t){return e.onKeyDown(t)}),this.eventManager.addEventListener(document.documentElement,"keyup",function(){return e.onKeyUp()}),this.eventManager.addEventListener(document,"visibilitychange",function(){return e.onKeyUp()});var t=this.topOverlay.mainTableScrollableElement,o=this.leftOverlay.mainTableScrollableElement;this.eventManager.addEventListener(t,"scroll",function(t){return e.onTableScroll(t)}),t!==o&&this.eventManager.addEventListener(o,"scroll",function(t){return e.onTableScroll(t)}),this.topOverlay.needFullRender&&(this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.bottomOverlay.needFullRender&&(this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.leftOverlay.needFullRender&&(this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.topOverlay.trimmingContainer!==window&&this.leftOverlay.trimmingContainer!==window&&this.eventManager.addEventListener(window,"wheel",function(t){var o,n=t.wheelDeltaY||t.deltaY,r=t.wheelDeltaX||t.deltaX;e.topOverlay.clone.wtTable.holder.contains(t.realTarget)?o="top":e.bottomOverlay.clone&&e.bottomOverlay.clone.wtTable.holder.contains(t.realTarget)?o="bottom":e.leftOverlay.clone.wtTable.holder.contains(t.realTarget)&&(o="left"),"top"==o&&0!==n?t.preventDefault():"left"==o&&0!==r?t.preventDefault():"bottom"==o&&0!==n&&t.preventDefault()})},onTableScroll:function(e){if(!Handsontable.mobileBrowser){var t=this.leftOverlay.mainTableScrollableElement,o=this.topOverlay.mainTableScrollableElement,n=e.target;this.keyPressed&&(o!==window&&n!==window&&!e.target.contains(o)||t!==window&&n!==window&&!e.target.contains(t))||("scroll"===e.type?this.syncScrollPositions(e):this.translateMouseWheelToScroll(e))}},onKeyDown:function(e){this.keyPressed=d(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")},onKeyUp:function(){this.keyPressed=!1},translateMouseWheelToScroll:function(e){for(var t,o=this.topOverlay.clone.wtTable.holder,n=this.bottomOverlay.clone?this.bottomOverlay.clone.wtTable.holder:null,r=this.leftOverlay.clone.wtTable.holder,i={type:"wheel"},s=e.target,l=e.wheelDeltaY||-1*e.deltaY,a=e.wheelDeltaX||-1*e.deltaX;s!=document&&null!=s;){if(s.className.indexOf("wtHolder")>-1){t=s;break}s=s.parentNode}return i.target=t,t==o?this.syncScrollPositions(i,-.2*l):t==n?this.syncScrollPositions(i,-.2*l):t==r&&this.syncScrollPositions(i,-.2*a),!1},syncScrollPositions:function(e){var t=void 0!==arguments[1]?arguments[1]:null;if(!this.destroyed){if(0===arguments.length)return void this.syncScrollWithMaster();var o,n,r,i=this.leftOverlay.mainTableScrollableElement,s=this.topOverlay.mainTableScrollableElement,l=e.target,a=0,d=!1,h=!1,f=this.wot.getSetting("preventOverflow");this.topOverlay.needFullRender&&(o=this.topOverlay.clone.wtTable.holder),this.bottomOverlay.needFullRender&&(r=this.bottomOverlay.clone.wtTable.holder),this.leftOverlay.needFullRender&&(n=this.leftOverlay.clone.wtTable.holder),l===document&&(l=window),l===i||l===s?(a=u(f?this.scrollableElement:l),this.overlayScrollPositions.master.left!==a&&(this.horizontalScrolling=!0,this.overlayScrollPositions.master.left=a,d=!0,o&&(o.scrollLeft=a,h=i!==window),r&&(r.scrollLeft=a,h=i!==window)),a=c(l),this.overlayScrollPositions.master.top!==a&&(this.verticalScrolling=!0,this.overlayScrollPositions.master.top=a,d=!0,n&&(n.scrollTop=a,h=s!==window))):l===r?(a=u(l),this.overlayScrollPositions.bottom.left!==a&&(this.horizontalScrolling=!0,this.overlayScrollPositions.bottom.left=a,d=!0,i.scrollLeft=a),null!==t&&(d=!0,s.scrollTop+=t)):l===o?(a=u(l),this.overlayScrollPositions.top.left!==a&&(this.horizontalScrolling=!0,this.overlayScrollPositions.top.left=a,d=!0,i.scrollLeft=a),null!==t&&(d=!0,s.scrollTop+=t)):l===n&&(a=c(l),this.overlayScrollPositions.left.top!==a&&(this.verticalScrolling=!0,this.overlayScrollPositions.left.top=a,d=!0,s.scrollTop=a),null!==t&&(d=!0,s.scrollLeft+=t)),!this.keyPressed&&d&&"scroll"===e.type&&(this.delegatedScrollCallback?this.delegatedScrollCallback=!1:this.refreshAll(),h&&(this.delegatedScrollCallback=!0))}},syncScrollWithMaster:function(){var e=this.topOverlay.mainTableScrollableElement;this.topOverlay.needFullRender&&(this.topOverlay.clone.wtTable.holder.scrollLeft=e.scrollLeft),this.leftOverlay.needFullRender&&(this.leftOverlay.clone.wtTable.holder.scrollTop=e.scrollTop)},destroy:function(){this.eventManager.destroy(),this.topOverlay.destroy(),this.bottomOverlay.clone&&this.bottomOverlay.destroy(),this.leftOverlay.destroy(),this.topLeftCornerOverlay&&this.topLeftCornerOverlay.destroy(),this.bottomLeftCornerOverlay&&this.bottomLeftCornerOverlay.clone&&this.bottomLeftCornerOverlay.destroy(),this.debug&&this.debug.destroy(),this.destroyed=!0},refresh:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(this.topOverlay.areElementSizesAdjusted&&this.leftOverlay.areElementSizesAdjusted){var t=this.wot.wtTable.wtRootElement.parentNode||this.wot.wtTable.wtRootElement,o=t.clientWidth,n=t.clientHeight;(o!==this.spreaderLastSize.width||n!==this.spreaderLastSize.height)&&(this.spreaderLastSize.width=o,this.spreaderLastSize.height=n,this.adjustElementsSize())}this.bottomOverlay.clone&&this.bottomOverlay.refresh(e),this.leftOverlay.refresh(e),this.topOverlay.refresh(e),this.topLeftCornerOverlay&&this.topLeftCornerOverlay.refresh(e),this.bottomLeftCornerOverlay&&this.bottomLeftCornerOverlay.clone&&this.bottomLeftCornerOverlay.refresh(e),this.debug&&this.debug.refresh(e)},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=this.wot.getSetting("totalColumns"),o=this.wot.getSetting("totalRows"),n=this.wot.wtViewport.getRowHeaderWidth(),r=this.wot.wtViewport.getColumnHeaderHeight(),i=this.wot.wtTable.hider.style;i.width=n+this.leftOverlay.sumCellSizes(0,t)+"px",i.height=r+this.topOverlay.sumCellSizes(0,o)+1+"px",this.topOverlay.adjustElementsSize(e),this.leftOverlay.adjustElementsSize(e),this.bottomOverlay.clone&&this.bottomOverlay.adjustElementsSize(e)},applyToDOM:function(){this.topOverlay.areElementSizesAdjusted&&this.leftOverlay.areElementSizesAdjusted||this.adjustElementsSize(),this.topOverlay.applyToDOM(),this.bottomOverlay.clone&&this.bottomOverlay.applyToDOM(),this.leftOverlay.applyToDOM()}},{}),window.WalkontableOverlays=f},{eventManager:41,"helpers/dom/element":45,"helpers/unicode":53}],17:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableScroll:{get:function(){return g}},__esModule:{value:!0}});var n,r,i=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),s=i.innerHeight,l=i.innerWidth,a=i.getScrollLeft,u=i.getScrollTop,c=i.offset,d=(r=e("helpers/number"),r&&r.__esModule&&r||{"default":r}),h=d.rangeEach,f=d.rangeEachReverse,g=function(e){this.wot=e,this.instance=e};$traceurRuntime.createClass(g,{scrollViewport:function(e){if(this.wot.drawn){var t=this._getVariables(),o=t.topOverlay,n=t.leftOverlay,r=t.totalRows,i=t.totalColumns,s=t.fixedRowsTop,l=t.fixedRowsBottom,a=t.fixedColumnsLeft;if(e.row<0||e.row>r-1)throw new Error("row "+e.row+" does not exist");if(e.col<0||e.col>i-1)throw new Error("column "+e.col+" does not exist");e.row>=s&&e.rowthis.getLastVisibleRow()&&e.row=a&&e.colthis.getLastVisibleColumn()&&n.scrollTo(e.col,!0)}},getFirstVisibleRow:function(){var e=this._getVariables(),t=e.topOverlay,o=e.wtTable,n=e.wtViewport,r=e.totalRows,i=e.fixedRowsTop,l=o.getFirstVisibleRow();if(t.mainTableScrollableElement===window){var a=c(o.wtRootElement),d=s(o.hider),h=s(window),g=u(window);if(a.top+d-h<=g){var p=n.getColumnHeaderHeight();p+=t.sumCellSizes(0,i),f(r,1,function(e){return p+=t.sumCellSizes(e-1,e),a.top+d-p<=g?(l=e,!1):void 0})}}return l},getLastVisibleRow:function(){var e=this._getVariables(),t=e.topOverlay,o=e.wtTable,n=e.wtViewport,r=e.totalRows,i=o.getLastVisibleRow();if(t.mainTableScrollableElement===window){var l=c(o.wtRootElement),a=s(window),d=u(window);if(l.top>d){var f=n.getColumnHeaderHeight();h(1,r,function(e){return f+=t.sumCellSizes(e-1,e),l.top+f-d>=a?(i=e-2,!1):void 0})}}return i},getFirstVisibleColumn:function(){var e=this._getVariables(),t=e.leftOverlay,o=e.wtTable,n=e.wtViewport,r=e.totalColumns,i=(e.fixedColumnsLeft,o.getFirstVisibleColumn());if(t.mainTableScrollableElement===window){var s=c(o.wtRootElement),u=l(o.hider),d=l(window),h=a(window);if(s.left+u-d<=h){var g=n.getRowHeaderWidth();f(r,1,function(e){return g+=t.sumCellSizes(e-1,e),s.left+u-g<=h?(i=e,!1):void 0})}}return i},getLastVisibleColumn:function(){var e=this._getVariables(),t=e.leftOverlay,o=e.wtTable,n=e.wtViewport,r=e.totalColumns,i=o.getLastVisibleColumn();if(t.mainTableScrollableElement===window){var s=c(o.wtRootElement),u=l(window),d=a(window);if(s.left>d){var f=n.getRowHeaderWidth();h(1,r,function(e){return f+=t.sumCellSizes(e-1,e),s.left+f-d>=u?(i=e-2,!1):void 0})}}return i},_getVariables:function(){var e=this.wot,t=e.wtOverlays.topOverlay,o=e.wtOverlays.leftOverlay,n=e.wtTable,r=e.wtViewport,i=e.getSetting("totalRows"),s=e.getSetting("totalColumns"),l=e.getSetting("fixedRowsTop"),a=e.getSetting("fixedRowsBottom"),u=e.getSetting("fixedColumnsLeft");return{topOverlay:t,leftOverlay:o,wtTable:n,wtViewport:r,totalRows:i,totalColumns:s,fixedRowsTop:l,fixedRowsBottom:a,fixedColumnsLeft:u}}},{}),window.WalkontableScroll=g},{"helpers/dom/element":45,"helpers/number":49}],18:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableSelection:{get:function(){return d}},__esModule:{value:!0}});var n,r,i,s,l=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}).addClass,a=(r=e("border"),r&&r.__esModule&&r||{"default":r}).WalkontableBorder,u=(i=e("cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords,c=(s=e("cell/range"),s&&s.__esModule&&s||{"default":s}).WalkontableCellRange,d=function(e,t){this.settings=e,this.cellRange=t||null,this.instanceBorders={}};$traceurRuntime.createClass(d,{getBorder:function(e){return this.instanceBorders[e.guid]?this.instanceBorders[e.guid]:void(this.instanceBorders[e.guid]=new a(e,this.settings))},isEmpty:function(){return null===this.cellRange},add:function(e){this.isEmpty()?this.cellRange=new c(e,e,e):this.cellRange.expand(e)},replace:function(e,t){if(!this.isEmpty()){if(this.cellRange.from.isEqual(e))return this.cellRange.from=t,!0;if(this.cellRange.to.isEqual(e))return this.cellRange.to=t,!0}return!1},clear:function(){this.cellRange=null},getCorners:function(){var e=this.cellRange.getTopLeftCorner(),t=this.cellRange.getBottomRightCorner();return[e.row,e.col,t.row,t.col]},addClassAtCoords:function(e,t,o,n){var r=e.wtTable.getCell(new u(t,o));"object"==typeof r&&l(r,n)},draw:function(e){if(this.isEmpty()){if(this.settings.border){var t=this.getBorder(e);t&&t.disappear()}}else{for(var o,n,r,i=e.wtTable.getRenderedRowsCount(),s=e.wtTable.getRenderedColumnsCount(),a=this.getCorners(),u=0;s>u;u++)n=e.wtTable.columnFilter.renderedToSource(u),n>=a[1]&&n<=a[3]&&(r=e.wtTable.getColumnHeader(n),r&&this.settings.highlightColumnClassName&&l(r,this.settings.highlightColumnClassName));for(var c=0;i>c;c++){o=e.wtTable.rowFilter.renderedToSource(c),o>=a[0]&&o<=a[2]&&(r=e.wtTable.getRowHeader(o),r&&this.settings.highlightRowClassName&&l(r,this.settings.highlightRowClassName));for(var d=0;s>d;d++)n=e.wtTable.columnFilter.renderedToSource(d),o>=a[0]&&o<=a[2]&&n>=a[1]&&n<=a[3]?this.settings.className&&this.addClassAtCoords(e,o,n,this.settings.className):o>=a[0]&&o<=a[2]?this.settings.highlightRowClassName&&this.addClassAtCoords(e,o,n,this.settings.highlightRowClassName):n>=a[1]&&n<=a[3]&&this.settings.highlightColumnClassName&&this.addClassAtCoords(e,o,n,this.settings.highlightColumnClassName)}if(e.getSetting("onBeforeDrawBorders",a,this.settings.className),this.settings.border){var h=this.getBorder(e);h&&h.appear(a)}}}},{}),window.WalkontableSelection=d},{border:2,"cell/coords":5,"cell/range":6,"helpers/dom/element":45}],19:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableSettings:{get:function(){return i}},__esModule:{value:!0}});var n,r=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}).fastInnerText,i=function(e,t){var o=this;this.wot=e,this.instance=e,this.defaults={table:void 0,debug:!1,externalRowCalculator:!1,stretchH:"none",currentRowClassName:null,currentColumnClassName:null,preventOverflow:function(){return!1},data:void 0,fixedColumnsLeft:0,fixedRowsTop:0,fixedRowsBottom:0,minSpareRows:0,rowHeaders:function(){return[]},columnHeaders:function(){return[]},totalRows:void 0,totalColumns:void 0,cellRenderer:function(e,t,n){var i=o.getSetting("data",e,t);r(n,void 0===i||null===i?"":i)},columnWidth:function(e){},rowHeight:function(e){},defaultRowHeight:23,defaultColumnWidth:50,selections:null,hideBorderOnMouseDownOver:!1,viewportRowCalculatorOverride:null,viewportColumnCalculatorOverride:null,onCellMouseDown:null,onCellMouseOver:null,onCellDblClick:null,onCellCornerMouseDown:null,onCellCornerDblClick:null,beforeDraw:null,onDraw:null,onBeforeDrawBorders:null,onScrollVertically:null,onScrollHorizontally:null,onBeforeTouchScroll:null,onAfterMomentumScroll:null,scrollbarWidth:10,scrollbarHeight:10,renderAllRows:!1,groups:!1},this.settings={};for(var n in this.defaults)if(this.defaults.hasOwnProperty(n))if(void 0!==t[n])this.settings[n]=t[n];else{if(void 0===this.defaults[n])throw new Error('A required setting "'+n+'" was not provided');this.settings[n]=this.defaults[n]}};$traceurRuntime.createClass(i,{update:function(e,t){if(void 0===t)for(var o in e)e.hasOwnProperty(o)&&(this.settings[o]=e[o]);else this.settings[e]=t;return this.wot},getSetting:function(e,t,o,n,r){return"function"==typeof this.settings[e]?this.settings[e](t,o,n,r):void 0!==t&&Array.isArray(this.settings[e])?this.settings[e][t]:this.settings[e]},has:function(e){return!!this.settings[e]}},{}),window.WalkontableSettings=i},{"helpers/dom/element":45}],20:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableTable:{get:function(){return y}},__esModule:{value:!0}});var n,r,i,s,l,a,u=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),c=u.getStyle,d=u.getTrimmingContainer,h=u.hasClass,f=u.index,g=u.offset,p=u.removeClass,m=u.removeTextNodes,w=(u.overlayContainsElement,(r=e("cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords),v=((i=e("cell/range"),i&&i.__esModule&&i||{"default":i}).WalkontableCellRange,(s=e("filter/column"),s&&s.__esModule&&s||{"default":s}).WalkontableColumnFilter),b=(l=e("filter/row"),l&&l.__esModule&&l||{"default":l}).WalkontableRowFilter,C=(a=e("tableRenderer"),a&&a.__esModule&&a||{"default":a}).WalkontableTableRenderer,y=function(e,t){this.wot=e,this.instance=this.wot, +this.TABLE=t,this.TBODY=null,this.THEAD=null,this.COLGROUP=null,this.tableOffset=0,this.holderOffset=0,m(this.TABLE),this.spreader=this.createSpreader(this.TABLE),this.hider=this.createHider(this.spreader),this.holder=this.createHolder(this.hider),this.wtRootElement=this.holder.parentNode,this.alignOverlaysWithTrimmingContainer(),this.fixTableDomTree(),this.colgroupChildrenLength=this.COLGROUP.childNodes.length,this.theadChildrenLength=this.THEAD.firstChild?this.THEAD.firstChild.childNodes.length:0,this.tbodyChildrenLength=this.TBODY.childNodes.length,this.rowFilter=null,this.columnFilter=null};$traceurRuntime.createClass(y,{fixTableDomTree:function(){this.TBODY=this.TABLE.querySelector("tbody"),this.TBODY||(this.TBODY=document.createElement("tbody"),this.TABLE.appendChild(this.TBODY)),this.THEAD=this.TABLE.querySelector("thead"),this.THEAD||(this.THEAD=document.createElement("thead"),this.TABLE.insertBefore(this.THEAD,this.TBODY)),this.COLGROUP=this.TABLE.querySelector("colgroup"),this.COLGROUP||(this.COLGROUP=document.createElement("colgroup"),this.TABLE.insertBefore(this.COLGROUP,this.THEAD)),this.wot.getSetting("columnHeaders").length&&!this.THEAD.childNodes.length&&this.THEAD.appendChild(document.createElement("TR"))},createSpreader:function(e){var t,o=e.parentNode;return o&&1===o.nodeType&&h(o,"wtHolder")||(t=document.createElement("div"),t.className="wtSpreader",o&&o.insertBefore(t,e),t.appendChild(e)),t.style.position="relative",t},createHider:function(e){var t,o=e.parentNode;return o&&1===o.nodeType&&h(o,"wtHolder")||(t=document.createElement("div"),t.className="wtHider",o&&o.insertBefore(t,e),t.appendChild(e)),t},createHolder:function(e){var t,o=e.parentNode;return o&&1===o.nodeType&&h(o,"wtHolder")||(t=document.createElement("div"),t.style.position="relative",t.className="wtHolder",o&&o.insertBefore(t,e),this.isWorkingOnClone()||(t.parentNode.className+="ht_master handsontable"),t.appendChild(e)),t},alignOverlaysWithTrimmingContainer:function(){var e=d(this.wtRootElement);if(!this.isWorkingOnClone())if(this.holder.parentNode.style.position="relative",e===window){var t=this.wot.getSetting("preventOverflow");t||(this.holder.style.overflow="visible",this.wtRootElement.style.overflow="visible")}else this.holder.style.width=c(e,"width"),this.holder.style.height=c(e,"height"),this.holder.style.overflow=""},isWorkingOnClone:function(){return!!this.wot.cloneSource},draw:function(e){var t=this.instance.getSetting("totalRows");if(this.isWorkingOnClone()||(this.holderOffset=g(this.holder),e=this.wot.wtViewport.createRenderCalculators(e)),e)this.isWorkingOnClone()||this.wot.wtViewport.createVisibleCalculators(),this.wot.wtOverlays&&this.wot.wtOverlays.refresh(!0);else{this.isWorkingOnClone()?this.tableOffset=this.wot.cloneSource.wtTable.tableOffset:this.tableOffset=g(this.TABLE);var o;o=WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)?0:WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?t-this.wot.getSetting("fixedRowsBottom"):this.wot.wtViewport.rowsRenderCalculator.startRow;var n;n=WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_LEFT)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?0:this.wot.wtViewport.columnsRenderCalculator.startColumn,this.rowFilter=new b(o,t,this.wot.getSetting("columnHeaders").length),this.columnFilter=new v(n,this.wot.getSetting("totalColumns"),this.wot.getSetting("rowHeaders").length),this._doDraw(),this.alignOverlaysWithTrimmingContainer()}return this.refreshSelections(e),this.isWorkingOnClone()||(this.wot.wtOverlays.topOverlay.resetFixedPosition(),this.wot.wtOverlays.bottomOverlay.clone&&this.wot.wtOverlays.bottomOverlay.resetFixedPosition(),this.wot.wtOverlays.leftOverlay.resetFixedPosition(),this.wot.wtOverlays.topLeftCornerOverlay&&this.wot.wtOverlays.topLeftCornerOverlay.resetFixedPosition(),this.instance.wtOverlays.bottomLeftCornerOverlay&&this.instance.wtOverlays.bottomLeftCornerOverlay.clone&&this.wot.wtOverlays.bottomLeftCornerOverlay.resetFixedPosition()),this.wot.drawn=!0,this},_doDraw:function(){var e=new C(this);e.render()},removeClassFromCells:function(e){for(var t=this.TABLE.querySelectorAll("."+e),o=0,n=t.length;n>o;o++)p(t[o],e)},refreshSelections:function(e){if(this.wot.selections){var t=this.wot.selections.length;if(e)for(var o=0;t>o;o++)this.wot.selections[o].settings.className&&this.removeClassFromCells(this.wot.selections[o].settings.className),this.wot.selections[o].settings.highlightRowClassName&&this.removeClassFromCells(this.wot.selections[o].settings.highlightRowClassName),this.wot.selections[o].settings.highlightColumnClassName&&this.removeClassFromCells(this.wot.selections[o].settings.highlightColumnClassName);for(var n=0;t>n;n++)this.wot.selections[n].draw(this.wot,e)}},getCell:function(e){if(this.isRowBeforeRenderedRows(e.row))return-1;if(this.isRowAfterRenderedRows(e.row))return-2;var t=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e.row)];return t?t.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e.col)]:void 0},getColumnHeader:function(e){var t=void 0!==arguments[1]?arguments[1]:0,o=this.THEAD.childNodes[t];return o?o.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]:void 0},getRowHeader:function(e){if(0===this.columnFilter.sourceColumnToVisibleRowHeadedColumn(0))return null;var t=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)];return t?t.childNodes[0]:void 0},getCoords:function(e){var t=e.parentNode,o=f(t);o=t.parentNode===this.THEAD?this.rowFilter.visibleColHeadedRowToSourceRow(o):this.rowFilter.renderedToSource(o);var n=this.columnFilter.visibleRowHeadedColumnToSourceColumn(e.cellIndex);return new w(o,n)},getTrForRow:function(e){return this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)]},getFirstRenderedRow:function(){return this.wot.wtViewport.rowsRenderCalculator.startRow},getFirstVisibleRow:function(){return this.wot.wtViewport.rowsVisibleCalculator.startRow},getFirstRenderedColumn:function(){return this.wot.wtViewport.columnsRenderCalculator.startColumn},getFirstVisibleColumn:function(){return this.wot.wtViewport.columnsVisibleCalculator.startColumn},getLastRenderedRow:function(){return this.wot.wtViewport.rowsRenderCalculator.endRow},getLastVisibleRow:function(){return this.wot.wtViewport.rowsVisibleCalculator.endRow},getLastRenderedColumn:function(){return this.wot.wtViewport.columnsRenderCalculator.endColumn},getLastVisibleColumn:function(){return this.wot.wtViewport.columnsVisibleCalculator.endColumn},isRowBeforeRenderedRows:function(e){return this.rowFilter.sourceToRendered(e)<0&&e>=0},isRowAfterViewport:function(e){return this.rowFilter.sourceToRendered(e)>this.getLastVisibleRow()},isRowAfterRenderedRows:function(e){return this.rowFilter.sourceToRendered(e)>this.getLastRenderedRow()},isColumnBeforeViewport:function(e){return this.columnFilter.sourceToRendered(e)<0&&e>=0},isColumnAfterViewport:function(e){return this.columnFilter.sourceToRendered(e)>this.getLastVisibleColumn()},isLastRowFullyVisible:function(){return this.getLastVisibleRow()===this.getLastRenderedRow()},isLastColumnFullyVisible:function(){return this.getLastVisibleColumn()===this.getLastRenderedColumn()},getRenderedColumnsCount:function(){return WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)?this.wot.getSetting("totalColumns"):WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_LEFT)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?this.wot.getSetting("fixedColumnsLeft"):this.wot.wtViewport.columnsRenderCalculator.count},getRenderedRowsCount:function(){return WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)?this.wot.getSetting("totalRows"):WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)?this.wot.getSetting("fixedRowsTop"):WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?this.instance.getSetting("fixedRowsBottom"):this.wot.wtViewport.rowsRenderCalculator.count},getVisibleRowsCount:function(){return this.wot.wtViewport.rowsVisibleCalculator.count},allRowsInViewport:function(){return this.wot.getSetting("totalRows")==this.getVisibleRowsCount()},getRowHeight:function(e){var t=this.wot.wtSettings.settings.rowHeight(e),o=this.wot.wtViewport.oversizedRows[e];return void 0!==o&&(t=void 0===t?o:Math.max(t,o)),t},getColumnHeaderHeight:function(e){var t=this.wot.wtSettings.settings.defaultRowHeight,o=this.wot.wtViewport.oversizedColumnHeaders[e];return void 0!==o&&(t=t?Math.max(t,o):o),t},getVisibleColumnsCount:function(){return this.wot.wtViewport.columnsVisibleCalculator.count},allColumnsInViewport:function(){return this.wot.getSetting("totalColumns")==this.getVisibleColumnsCount()},getColumnWidth:function(e){var t=this.wot.wtSettings.settings.columnWidth;return"function"==typeof t?t=t(e):"object"==typeof t&&(t=t[e]),t||this.wot.wtSettings.settings.defaultColumnWidth},getStretchedColumnWidth:function(e){var t=this.getColumnWidth(e),o=-1===[void 0,null].indexOf(t)?t:this.instance.wtSettings.settings.defaultColumnWidth,n=this.wot.wtViewport.columnsRenderCalculator;if(n){var r=n.getStretchedColumnWidth(e,o);r&&(o=r)}return o}},{}),window.WalkontableTable=y},{"cell/coords":5,"cell/range":6,"filter/column":9,"filter/row":10,"helpers/dom/element":45,tableRenderer:21}],21:[function(e,t,o){"use strict";function n(e,t){var o=document.createElement("TH");return t.insertBefore(o,e),t.removeChild(e),o}function r(e,t){var o=document.createElement("TD");return t.insertBefore(o,e),t.removeChild(e),o}Object.defineProperties(o,{WalkontableTableRenderer:{get:function(){return f}},__esModule:{value:!0}});var i,s=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),l=s.addClass,a=s.empty,u=s.getScrollbarWidth,c=s.hasClass,d=s.innerHeight,h=s.outerWidth,f=function(e){this.wtTable=e,this.wot=e.instance,this.instance=e.instance,this.rowFilter=e.rowFilter,this.columnFilter=e.columnFilter,this.TABLE=e.TABLE,this.THEAD=e.THEAD,this.TBODY=e.TBODY,this.COLGROUP=e.COLGROUP,this.rowHeaders=[],this.rowHeaderCount=0,this.columnHeaders=[],this.columnHeaderCount=0,this.fixedRowsTop=0,this.fixedRowsBottom=0};$traceurRuntime.createClass(f,{render:function(){this.wtTable.isWorkingOnClone()||this.wot.getSetting("beforeDraw",!0),this.rowHeaders=this.wot.getSetting("rowHeaders"),this.rowHeaderCount=this.rowHeaders.length,this.fixedRowsTop=this.wot.getSetting("fixedRowsTop"),this.fixedRowsBottom=this.wot.getSetting("fixedRowsBottom"),this.columnHeaders=this.wot.getSetting("columnHeaders"),this.columnHeaderCount=this.columnHeaders.length;var e,t=this.wtTable.getRenderedColumnsCount(),o=this.wtTable.getRenderedRowsCount(),n=this.wot.getSetting("totalColumns"),r=this.wot.getSetting("totalRows"),i=!1;if((WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER))&&(this.columnHeaders=[],this.columnHeaderCount=0),n>0&&(this.adjustAvailableNodes(),i=!0,this.renderColumnHeaders(),this.renderRows(r,o,t),this.wtTable.isWorkingOnClone()||(e=this.wot.wtViewport.getWorkspaceWidth(),this.wot.wtViewport.containerWidth=null),this.adjustColumnHeaderHeights(),this.adjustColumnWidths(t),this.markOversizedColumns()),i||this.adjustAvailableNodes(),this.removeRedundantRows(o),this.wtTable.isWorkingOnClone()){if(WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)){var s=this.wot.cloneOverlay.instance;this.wot.cloneOverlay.markOversizedFixedBottomRows(),s.wtOverlays.adjustElementsSize()}}else{this.markOversizedRows(),this.wot.wtViewport.createVisibleCalculators(),this.wot.wtOverlays.refresh(!1);var l=h(this.wtTable.hider),a=h(this.wtTable.TABLE);if(0!==l&&a!==l&&this.adjustColumnWidths(t),this.wot.wtOverlays.applyToDOM(),e!==this.wot.wtViewport.getWorkspaceWidth()){this.wot.wtViewport.containerWidth=null;for(var u=this.wtTable.getFirstRenderedColumn(),c=this.wtTable.getLastRenderedColumn(),d=u;c>d;d++){var f=this.wtTable.getStretchedColumnWidth(d),g=this.columnFilter.sourceToRendered(d);this.COLGROUP.childNodes[g+this.rowHeaderCount].style.width=f+"px"}}this.wot.getSetting("onDraw",!0)}},removeRedundantRows:function(e){for(;this.wtTable.tbodyChildrenLength>e;)this.TBODY.removeChild(this.TBODY.lastChild),this.wtTable.tbodyChildrenLength--},renderRows:function(e,t,o){for(var n,r,i=0,s=this.rowFilter.renderedToSource(i),l=this.wtTable.isWorkingOnClone();e>s&&s>=0&&(i>1e3&&console.error("Security brake: Too much TRs. Please define height for your table, which will enforce scrollbars."),void 0===t||i!==t);){if(r=this.getOrCreateTrForRow(i,r),this.renderRowHeaders(s,r),this.adjustColumns(r,o+this.rowHeaderCount),n=this.renderCells(s,r,o),(!l||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM))&&this.resetOversizedRow(s),r.firstChild){var a=this.wot.wtTable.getRowHeight(s);a?(a--,r.firstChild.style.height=a+"px"):r.firstChild.style.height=""}i++,s=this.rowFilter.renderedToSource(i)}},resetOversizedRow:function(e){this.wot.getSetting("externalRowCalculator")||this.wot.wtViewport.oversizedRows&&this.wot.wtViewport.oversizedRows[e]&&(this.wot.wtViewport.oversizedRows[e]=void 0)},markOversizedRows:function(){if(!this.wot.getSetting("externalRowCalculator")){var e,t,o,n,r,i=this.instance.wtTable.TBODY.childNodes.length,s=i*this.instance.wtSettings.settings.defaultRowHeight,l=d(this.instance.wtTable.TBODY)-1;this.instance.getSetting("totalRows");if(s!==l||this.instance.getSetting("fixedRowsBottom"))for(;i;)i--,o=this.instance.wtTable.rowFilter.renderedToSource(i),e=this.instance.wtTable.getRowHeight(o),n=this.instance.wtTable.getTrForRow(o),r=n.querySelector("th"),t=r?d(r):d(n)-1,(!e&&this.instance.wtSettings.settings.defaultRowHeighte)&&(this.instance.wtViewport.oversizedRows[o]=++t)}},markOversizedColumns:function(){var e=this.wot.getOverlayName();if(this.columnHeaderCount&&!this.wot.wtViewport.isMarkedOversizedColumn[e]&&!this.wtTable.isWorkingOnClone()){for(var t=this.wtTable.getRenderedColumnsCount(),o=0;on;n++)this.markIfOversizedColumnHeader(n);this.wot.wtViewport.isMarkedOversizedColumn[e]=!0}},adjustColumnHeaderHeights:function(){for(var e=this.wot.getSetting("columnHeaders"),t=this.wot.wtTable.THEAD.childNodes,o=this.wot.wtViewport.oversizedColumnHeaders,n=0,r=e.length;r>n;n++)if(o[n]){if(0===t[n].childNodes.length)return;t[n].childNodes[0].style.height=o[n]+"px"}},markIfOversizedColumnHeader:function(e){for(var t,o,n,r=this.wot.wtTable.columnFilter.renderedToSource(e),i=this.columnHeaderCount,s=this.wot.wtSettings.settings.defaultRowHeight;i;)i--,t=this.wot.wtTable.getColumnHeaderHeight(i),o=this.wot.wtTable.getColumnHeader(r,i),o&&(n=d(o),(!t&&n>s||n>t)&&(this.wot.wtViewport.oversizedColumnHeaders[i]=n))},renderCells:function(e,t,o){for(var n,i,s=0;o>s;s++)i=this.columnFilter.renderedToSource(s),n=0===s?t.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(i)]:n.nextSibling,"TH"==n.nodeName&&(n=r(n,t)),c(n,"hide")||(n.className=""),n.removeAttribute("style"),this.wot.wtSettings.settings.cellRenderer(e,i,n);return n},adjustColumnWidths:function(e){var t=0,o=this.wot.cloneSource?this.wot.cloneSource:this.wot,n=o.wtTable.holder;n.offsetHeightr;r++){var i=this.wtTable.getStretchedColumnWidth(this.columnFilter.renderedToSource(r));this.COLGROUP.childNodes[r+this.rowHeaderCount].style.width=i+"px"}},appendToTbody:function(e){this.TBODY.appendChild(e),this.wtTable.tbodyChildrenLength++},getOrCreateTrForRow:function(e,t){var o;return e>=this.wtTable.tbodyChildrenLength?(o=this.createRow(),this.appendToTbody(o)):o=0===e?this.TBODY.firstChild:t.nextSibling,o.className&&o.removeAttribute("class"),o},createRow:function(){for(var e=document.createElement("TR"),t=0;tn;n++){var r=this.columnFilter.renderedToSource(n);this.renderColumnHeader(t,r,o.childNodes[n+this.rowHeaderCount])}},adjustColGroups:function(){for(var e=this.wtTable.getRenderedColumnsCount();this.wtTable.colgroupChildrenLengthe+this.rowHeaderCount;)this.COLGROUP.removeChild(this.COLGROUP.lastChild),this.wtTable.colgroupChildrenLength--;this.rowHeaderCount&&l(this.COLGROUP.childNodes[0],"rowHeader")},adjustThead:function(){var e=this.wtTable.getRenderedColumnsCount(),t=this.THEAD.firstChild;if(this.columnHeaders.length){for(var o=0,n=this.columnHeaders.length;n>o;o++){for(t=this.THEAD.childNodes[o],t||(t=document.createElement("TR"),this.THEAD.appendChild(t)),this.theadChildrenLength=t.childNodes.length;this.theadChildrenLengthe+this.rowHeaderCount;)t.removeChild(t.lastChild),this.theadChildrenLength--}var r=this.THEAD.childNodes.length;if(r>this.columnHeaders.length)for(var i=this.columnHeaders.length;r>i;i++)this.THEAD.removeChild(this.THEAD.lastChild)}else t&&a(t)},getTrForColumnHeaders:function(e){return this.THEAD.childNodes[e]},renderColumnHeader:function(e,t,o){return o.className="",o.removeAttribute("style"),this.columnHeaders[e](t,o,e)},adjustColumns:function(e,t){for(var o=e.childNodes.length;t>o;){var n=document.createElement("TD");e.appendChild(n),o++}for(;o>t;)e.removeChild(e.lastChild),o--},removeRedundantColumns:function(e){for(;this.wtTable.tbodyChildrenLength>e;)this.TBODY.removeChild(this.TBODY.lastChild),this.wtTable.tbodyChildrenLength--}},{}),window.WalkontableTableRenderer=f},{"helpers/dom/element":45}],22:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableViewport:{get:function(){return m}},__esModule:{value:!0}});var n,r,i,s,l=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),a=l.getScrollbarWidth,u=(l.getScrollTop,l.getStyle),c=l.offset,d=l.outerHeight,h=l.outerWidth,f=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,g=(i=e("calculator/viewportColumns"),i&&i.__esModule&&i||{"default":i}).WalkontableViewportColumnsCalculator,p=(s=e("calculator/viewportRows"),s&&s.__esModule&&s||{"default":s}).WalkontableViewportRowsCalculator,m=function(e){var t=this;this.wot=e,this.instance=this.wot,this.oversizedRows=[],this.oversizedColumnHeaders=[],this.isMarkedOversizedColumn={},this.clientHeight=0,this.containerWidth=NaN,this.rowHeaderWidth=NaN,this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,this.eventManager=new f(this.wot),this.eventManager.addEventListener(window,"resize",function(){t.clientHeight=t.getWorkspaceHeight()})};$traceurRuntime.createClass(m,{getWorkspaceHeight:function(){var e,t=this.instance.wtOverlays.topOverlay.trimmingContainer,o=0;return t===window?o=document.documentElement.clientHeight:(e=d(t),o=e>0&&t.clientHeight>0?t.clientHeight:1/0),o},getWorkspaceWidth:function(){var e,t,o=this.wot.getSetting("totalColumns"),n=this.instance.wtOverlays.leftOverlay.trimmingContainer,r=this.wot.getSetting("stretchH"),i=document.documentElement.offsetWidth,s=this.wot.getSetting("preventOverflow");return s?h(this.instance.wtTable.wtRootElement):(e=Handsontable.freezeOverlays?Math.min(i-this.getWorkspaceOffset().left,i):Math.min(this.getContainerFillWidth(),i-this.getWorkspaceOffset().left,i),n===window&&o>0&&this.sumColumnWidths(0,o-1)>e?document.documentElement.clientWidth:n!==window&&(t=u(this.instance.wtOverlays.leftOverlay.trimmingContainer,"overflow"),"scroll"==t||"hidden"==t||"auto"==t)?Math.max(e,n.clientWidth):"none"!==r&&r?e:Math.max(e,h(this.instance.wtTable.TABLE)))},hasVerticalScroll:function(){return this.getWorkspaceActualHeight()>this.getWorkspaceHeight()},hasHorizontalScroll:function(){return this.getWorkspaceActualWidth()>this.getWorkspaceWidth()},sumColumnWidths:function(e,t){for(var o=0;t>e;)o+=this.wot.wtTable.getColumnWidth(e),e++;return o},getContainerFillWidth:function(){if(this.containerWidth)return this.containerWidth;var e,t,o=this.instance.wtTable.holder;return t=document.createElement("div"),t.style.width="100%",t.style.height="1px",o.appendChild(t),e=t.offsetWidth,this.containerWidth=e,o.removeChild(t),e},getWorkspaceOffset:function(){return c(this.wot.wtTable.TABLE)},getWorkspaceActualHeight:function(){return d(this.wot.wtTable.TABLE)},getWorkspaceActualWidth:function(){return h(this.wot.wtTable.TABLE)||h(this.wot.wtTable.TBODY)||h(this.wot.wtTable.THEAD)},getColumnHeaderHeight:function(){return isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=d(this.wot.wtTable.THEAD)),this.columnHeaderHeight},getViewportHeight:function(){var e,t=this.getWorkspaceHeight();return t===1/0?t:(e=this.getColumnHeaderHeight(),e>0&&(t-=e),t)},getRowHeaderWidth:function(){if(this.wot.cloneSource)return this.wot.cloneSource.wtViewport.getRowHeaderWidth();if(isNaN(this.rowHeaderWidth)){var e=this.instance.getSetting("rowHeaders");if(e.length){var t=this.instance.wtTable.TABLE.querySelector("TH");this.rowHeaderWidth=0;for(var o=0,n=e.length;n>o;o++)t?(this.rowHeaderWidth+=h(t),t=t.nextSibling):this.rowHeaderWidth+=50}else this.rowHeaderWidth=0}return this.rowHeaderWidth},getViewportWidth:function(){var e,t=this.getWorkspaceWidth();return t===1/0?t:(e=this.getRowHeaderWidth(),e>0?t-e:t)},createRowsCalculator:function(){var e,t,o,n,r,i,s,l=void 0!==arguments[0]?arguments[0]:!1,u=this;return this.rowHeaderWidth=NaN,e=this.wot.wtSettings.settings.renderAllRows?1/0:this.getViewportHeight(),t=this.wot.wtOverlays.topOverlay.getScrollPosition()-this.wot.wtOverlays.topOverlay.getTableParentOffset(),0>t&&(t=0),o=this.wot.getSetting("fixedRowsTop"),r=this.wot.getSetting("fixedRowsBottom"),s=this.wot.getSetting("totalRows"),o&&(i=this.wot.wtOverlays.topOverlay.sumCellSizes(0,o),t+=i,e-=i),r&&this.wot.wtOverlays.bottomOverlay.clone&&(i=this.wot.wtOverlays.bottomOverlay.sumCellSizes(s-r,s),e-=i),n=this.wot.wtTable.holder.clientHeight===this.wot.wtTable.holder.offsetHeight?0:a(),new p(e,t,this.wot.getSetting("totalRows"),function(e){return u.wot.wtTable.getRowHeight(e)},l?null:this.wot.wtSettings.settings.viewportRowCalculatorOverride,l,n)},createColumnsCalculator:function(){var e,t,o=void 0!==arguments[0]?arguments[0]:!1,n=this,r=this.getViewportWidth();if(this.columnHeaderHeight=NaN,e=this.wot.wtOverlays.leftOverlay.getScrollPosition()-this.wot.wtOverlays.leftOverlay.getTableParentOffset(),0>e&&(e=0),t=this.wot.getSetting("fixedColumnsLeft")){var i=this.wot.wtOverlays.leftOverlay.sumCellSizes(0,t);e+=i,r-=i}return this.wot.wtTable.holder.clientWidth!==this.wot.wtTable.holder.offsetWidth&&(r-=a()),new g(r,e,this.wot.getSetting("totalColumns"),function(e){return n.wot.wtTable.getColumnWidth(e)},o?null:this.wot.wtSettings.settings.viewportColumnCalculatorOverride,o,this.wot.getSetting("stretchH"))},createRenderCalculators:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(e){var t=this.createRowsCalculator(!0),o=this.createColumnsCalculator(!0);this.areAllProposedVisibleRowsAlreadyRendered(t)&&this.areAllProposedVisibleColumnsAlreadyRendered(o)||(e=!1)}return e||(this.rowsRenderCalculator=this.createRowsCalculator(),this.columnsRenderCalculator=this.createColumnsCalculator()),this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,e},createVisibleCalculators:function(){this.rowsVisibleCalculator=this.createRowsCalculator(!0),this.columnsVisibleCalculator=this.createColumnsCalculator(!0)},areAllProposedVisibleRowsAlreadyRendered:function(e){return this.rowsVisibleCalculator?e.startRow0?!1:e.endRow>this.rowsRenderCalculator.endRow||e.endRow===this.rowsRenderCalculator.endRow&&e.endRow0?!1:e.endColumn>this.columnsRenderCalculator.endColumn||e.endColumn===this.columnsRenderCalculator.endColumn&&e.endColumn=0;s--)if(null===e[s])e.splice(s,1);else{var l=e[s][0],a=d.propToCol(e[s][1]),u=m.runHooks("modifyCol",a),c=m.getCellMeta(l,u);if("numeric"===c.type&&"string"==typeof e[s][3]&&e[s][3].length>0&&(/^-?[\d\s]*(\.|\,)?\d*$/.test(e[s][3])||c.format)){var h=e[s][3].length;"undefined"==typeof c.language?R.language("en"):e[s][3].indexOf(".")===h-3&&-1===e[s][3].indexOf(",")?R.language("en"):R.language(c.language),R.validate(e[s][3])&&(e[s][3]=R().unformat(e[s][3]))}m.getCellValidator(c)&&(i.addValidatorToQueue(),m.validateCell(e[s][3],c,function(t,o){return function(n){if("boolean"!=typeof n)throw new Error("Validation error: result is not boolean");n===!1&&o.allowInvalid===!1&&(e.splice(t,1),o.valid=!0,--t),i.removeValidatorFormQueue()}}(s,c),t))}i.checkIfQueueIsEmpty()}function r(e,t){var o=e.length-1;if(!(0>o)){for(;o>=0;o--)if(null!==e[o]){if(null!=e[o][2]||null!=e[o][3]){if(c.settings.allowInsertRow)for(;e[o][0]>m.countRows()-1;)d.createRow();if("array"===m.dataType&&c.settings.allowInsertColumn)for(;d.propToCol(e[o][1])>m.countCols()-1;)d.createCol();d.set(e[o][0],e[o][1],e[o][3])}}else e.splice(o,1);m.forceFullRender=!0,f.adjustRowsAndCols(),Handsontable.hooks.run(m,"beforeChangeRender",e,t),g.refreshBorders(null,!0),m.view.wt.wtOverlays.adjustElementsSize(),Handsontable.hooks.run(m,"afterChange",e,t||"edit")}}function i(e,t,o){return"object"==typeof e?e:[[e,t,o]]}function s(e){if(e.hasOwnProperty("type")){var t,o={};if("object"==typeof e.type)t=e.type;else if("string"==typeof e.type&&(t=Handsontable.cellTypes[e.type],void 0===t))throw new Error('You declared cell type "'+e.type+'" as a string that is not mapped to a known object. Cell type must be an object or a string mapped to an object in Handsontable.cellTypes');for(var n in t)t.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(o[n]=t[n]);return o}}function l(e){return Handsontable.hooks.run(m,"modifyRow",e)}function a(e){return Handsontable.hooks.run(m,"modifyCol",e)}function u(){throw new Error("This method cannot be called because this Handsontable instance has been destroyed")}var c,d,h,f,g,p,m=this,w=function(){},v=A(m);x(w.prototype,Q.prototype),x(w.prototype,t),x(w.prototype,s(t)),this.rootElement=e,this.isHotTableEnv=O(this.rootElement),Handsontable.eventManager.isHotTableEnv=this.isHotTableEnv,this.container=document.createElement("DIV"),this.renderCall=!1,e.insertBefore(this.container,e.firstChild),this.guid="ht_"+B(),this.rootElement.id&&"ht_"!==this.rootElement.id.substring(0,3)||(this.rootElement.id=this.guid),c={cellSettings:[],columnSettings:[],columnsSettingConflicts:["data","width"],settings:new w,selRange:null,isPopulated:null,scrollable:null,firstRun:!0},f={alter:function(e,t,o,n,r){var i;switch(o=o||1,e){case"insert_row":if(m.getSettings().maxRows===m.countSourceRows())return;i=d.createRow(t,o),i&&(g.isSelected()&&c.selRange.from.row>=t?(c.selRange.from.row=c.selRange.from.row+i,g.transformEnd(i,0)):g.refreshBorders());break;case"insert_col":if(i=d.createCol(t,o)){if(Array.isArray(m.getSettings().colHeaders)){var s=[t,0];s.length+=i,Array.prototype.splice.apply(m.getSettings().colHeaders,s)}g.isSelected()&&c.selRange.from.col>=t?(c.selRange.from.col=c.selRange.from.col+i,g.transformEnd(0,i)):g.refreshBorders()}break;case"remove_row":d.removeRow(t,o),c.cellSettings.splice(t,o);var l=m.countRows(),a=m.getSettings().fixedRowsTop;a>=t+1&&(m.getSettings().fixedRowsTop-=Math.min(o,a-t));var u=m.getSettings().fixedRowsBottom;u&&t>=l-u&&(m.getSettings().fixedRowsBottom-=Math.min(o,u)),f.adjustRowsAndCols(),g.refreshBorders();break;case"remove_col":d.removeCol(t,o);for(var h=0,p=d.getAll().length;p>h;h++)h in c.cellSettings&&c.cellSettings[h].splice(t,o);var w=m.getSettings().fixedColumnsLeft;w>=t+1&&(m.getSettings().fixedColumnsLeft-=Math.min(o,w-t)),Array.isArray(m.getSettings().colHeaders)&&("undefined"==typeof t&&(t=-1),m.getSettings().colHeaders.splice(t,o)),f.adjustRowsAndCols(),g.refreshBorders();break;default:throw new Error('There is no such action "'+e+'"')}r||f.adjustRowsAndCols()},adjustRowsAndCols:function(){if(c.settings.minRows){var e=m.countRows();if(et;t++)d.createRow(m.countRows(),1,!0)}if(c.settings.minSpareRows){var n=m.countEmptyRows(!0);if(ni-1?(a=i-1,l=!0,h>a&&(h=a)):h>i-1&&(h=i-1,l=!0,a>h&&(a=h)),u>s-1?(u=s-1,l=!0,f>u&&(f=u)):f>s-1&&(f=s-1,l=!0,u>f&&(u=f)),l&&m.selectCell(a,u,h,f)}m.view&&m.view.wt.wtOverlays.adjustElementsSize()},populateFromArray:function(e,t,o,n,r,i,s){var l,a,u,d,h=[],f={};if(a=t.length,0===a)return!1;var g,p,w,v;({row:null===o?null:o.row,col:null===o?null:o.col});switch(r){case"shift_down":for(g=o?o.col-e.col+1:0,p=o?o.row-e.row+1:0,t=G(t),u=0,d=t.length,w=Math.max(d,g);w>u;u++)if(d>u){for(l=0,a=t[u].length;p-a>l;l++)t[u].push(t[u][l%a]);t[u].unshift(e.col+u,e.row,0),m.spliceCol.apply(m,t[u])}else t[u%d][0]=e.col+u,m.spliceCol.apply(m,t[u%d]);break;case"shift_right":for(g=o?o.col-e.col+1:0,p=o?o.row-e.row+1:0,l=0,a=t.length,v=Math.max(a,p);v>l;l++)if(a>l){for(u=0,d=t[l].length;g-d>u;u++)t[l].push(t[l][u%d]);t[l].unshift(e.row+l,e.col,0),m.spliceRow.apply(m,t[l])}else t[l%a][0]=e.row+l,m.spliceRow.apply(m,t[l%a]);break;case"overwrite":default:f.row=e.row,f.col=e.col;var b,C={row:o&&e?o.row-e.row+1:1,col:o&&e?o.col-e.col+1:1},y=0,R=0,E=!0,S=function(e){var o=void 0!==arguments[1]?arguments[1]:null,n=t[e%t.length];return null!==o?n[o%n.length]:n},T=t.length,O=o?o.row-e.row+1:0;for(a=o?O:Math.max(T,O),l=0;a>l&&!(o&&f.row>o.row&&O>T||!c.settings.allowInsertRow&&f.row>m.countRows()-1||f.row>=c.settings.maxRows);l++){var _=l-y,M=S(_).length,H=o?o.col-e.col+1:0;if(d=o?H:Math.max(M,H),f.col=e.col,b=m.getCellMeta(f.row,f.col),"paste"!==n&&"autofill"!==n||!b.skipRowOnPaste){for(R=0,u=0;d>u&&!(o&&f.col>o.col&&H>M||!c.settings.allowInsertColumn&&f.col>m.countCols()-1||f.col>=c.settings.maxCols);u++)if(b=m.getCellMeta(f.row,f.col),"paste"!==n&&"autofill"!==n||!b.skipColumnOnPaste)if(b.readOnly)f.col++;else{var k=u-R,A=S(_,k),P=m.getDataAtCell(f.row,f.col),x={row:_,col:k};if("autofill"===n){var W=m.runHooks("beforeAutofillInsidePopulate",x,i,t,s,{},C);W&&(A="undefined"==typeof W.value?A:W.value)}if(null!==A&&"object"==typeof A)if(null===P||"object"!=typeof P)E=!1;else{var I=D(P[0]||P),j=D(A[0]||A);N(I,j)?A=L(A):E=!1}else null!==P&&"object"==typeof P&&(E=!1);E&&h.push([f.row,f.col,A]),E=!0,f.col++}else R++,f.col++,d++;f.row++}else y++,f.row++,a++}m.setDataAtCell(h,null,null,n||"populateFromArray")}}},this.selection=g={inProgress:!1,selectedHeader:{cols:!1,rows:!1},setSelectedHeaders:function(e,t){m.selection.selectedHeader.rows=e,m.selection.selectedHeader.cols=t},begin:function(){m.selection.inProgress=!0},finish:function(){var e=m.getSelected();Handsontable.hooks.run(m,"afterSelectionEnd",e[0],e[1],e[2],e[3]),Handsontable.hooks.run(m,"afterSelectionEndByProp",e[0],m.colToProp(e[1]),e[2],m.colToProp(e[3])),m.selection.inProgress=!1},isInProgress:function(){return m.selection.inProgress},setRangeStart:function(e,t){Handsontable.hooks.run(m,"beforeSetRangeStart",e),c.selRange=new X(e,e,e),g.setRangeEnd(e,null,t)},setRangeEnd:function(e,t,o){if(null!==c.selRange){var n,r=!1,i=!0,s=m.view.wt.wtTable.getFirstVisibleRow(),l=m.view.wt.wtTable.getFirstVisibleColumn(),a={row:null,col:null};Handsontable.hooks.run(m,"beforeSetRangeEnd",e),m.selection.begin(),a.row=e.row<0?s:e.row,a.col=e.col<0?l:e.col,c.selRange.to=new Y(a.row,a.col),c.settings.multiSelect||(c.selRange.from=e),m.view.wt.selections.current.clear(),n=m.getCellMeta(c.selRange.highlight.row,c.selRange.highlight.col).disableVisualSelection,"string"==typeof n&&(n=[n]),(n===!1||Array.isArray(n)&&-1===n.indexOf("current"))&&m.view.wt.selections.current.add(c.selRange.highlight),m.view.wt.selections.area.clear(),(n===!1||Array.isArray(n)&&-1===n.indexOf("area"))&&g.isMultiple()&&(m.view.wt.selections.area.add(c.selRange.from),m.view.wt.selections.area.add(c.selRange.to)),(c.settings.currentRowClassName||c.settings.currentColClassName)&&(m.view.wt.selections.highlight.clear(),m.view.wt.selections.highlight.add(c.selRange.from),m.view.wt.selections.highlight.add(c.selRange.to)),Handsontable.hooks.run(m,"afterSelection",c.selRange.from.row,c.selRange.from.col,c.selRange.to.row,c.selRange.to.col),Handsontable.hooks.run(m,"afterSelectionByProp",c.selRange.from.row,d.colToProp(c.selRange.from.col),c.selRange.to.row,d.colToProp(c.selRange.to.col)),(0===c.selRange.from.row&&c.selRange.to.row===m.countRows()-1&&m.countRows()>1||0===c.selRange.from.col&&c.selRange.to.col===m.countCols()-1&&m.countCols()>1)&&(r=!0),(e.row<0||e.col<0)&&(i=!1),t!==!1&&!r&&i&&(c.selRange.from&&!g.isMultiple()?m.view.scrollViewport(c.selRange.from):m.view.scrollViewport(e)),g.refreshBorders(null,o)}},refreshBorders:function(e,t){t||p.destroyEditor(e),m.view.render(),g.isSelected()&&!t&&p.prepareEditor()},isMultiple:function(){var e=!(c.selRange.to.col===c.selRange.from.col&&c.selRange.to.row===c.selRange.from.row),t=Handsontable.hooks.run(m,"afterIsMultipleSelection",e);return e?t:void 0},transformStart:function(e,t,o,n){var r,i,s,l,a=new Y(e,t),u=0,d=0;m.runHooks("modifyTransformStart",a),r=m.countRows(),i=m.countCols(),l=m.getSettings().fixedRowsBottom,c.selRange.highlight.row+e>r-1?o&&c.settings.minSpareRows>0&&!(l&&c.selRange.highlight.row>=r-l-1)?(m.alter("insert_row",r),r=m.countRows()):c.settings.autoWrapCol&&(a.row=1-r,a.col=c.selRange.highlight.col+a.col==i-1?1-i:1):c.settings.autoWrapCol&&c.selRange.highlight.row+a.row<0&&c.selRange.highlight.col+a.col>=0&&(a.row=r-1,a.col=c.selRange.highlight.col+a.col==0?i-1:-1),c.selRange.highlight.col+a.col>i-1?o&&c.settings.minSpareCols>0?(m.alter("insert_col",i),i=m.countCols()):c.settings.autoWrapRow&&(a.row=c.selRange.highlight.row+a.row==r-1?1-r:1,a.col=1-i):c.settings.autoWrapRow&&c.selRange.highlight.col+a.col<0&&c.selRange.highlight.row+a.row>=0&&(a.row=c.selRange.highlight.row+a.row==0?r-1:-1,a.col=i-1),s=new Y(c.selRange.highlight.row+a.row,c.selRange.highlight.col+a.col),s.row<0?(u=-1,s.row=0):s.row>0&&s.row>=r&&(u=1,s.row=r-1),s.col<0?(d=-1,s.col=0):s.col>0&&s.col>=i&&(d=1,s.col=i-1),m.runHooks("afterModifyTransformStart",s,u,d),g.setRangeStart(s,n)},transformEnd:function(e,t){var o,n,r,i=new Y(e,t),s=0,l=0;m.runHooks("modifyTransformEnd",i),o=m.countRows(),n=m.countCols(),r=new Y(c.selRange.to.row+i.row,c.selRange.to.col+i.col),r.row<0?(s=-1,r.row=0):r.row>0&&r.row>=o&&(s=1,r.row=o-1),r.col<0?(l=-1,r.col=0):r.col>0&&r.col>=n&&(l=1,r.col=n-1),m.runHooks("afterModifyTransformEnd",r,s,l),g.setRangeEnd(r,!0)},isSelected:function(){return null!==c.selRange},inInSelection:function(e){return g.isSelected()?c.selRange.includes(e):!1},deselect:function(){g.isSelected()&&(m.selection.inProgress=!1,c.selRange=null,m.view.wt.selections.current.clear(),m.view.wt.selections.area.clear(),(c.settings.currentRowClassName||c.settings.currentColClassName)&&m.view.wt.selections.highlight.clear(),p.destroyEditor(),g.refreshBorders(),Handsontable.hooks.run(m,"afterDeselect"))},selectAll:function(){c.settings.multiSelect&&(g.setRangeStart(new Y(0,0)),g.setRangeEnd(new Y(m.countRows()-1,m.countCols()-1),!1))},empty:function(){if(g.isSelected()){var e,t,o=c.selRange.getTopLeftCorner(),n=c.selRange.getBottomRightCorner(),r=[];for(e=o.row;e<=n.row;e++)for(t=o.col;t<=n.col;t++)m.getCellMeta(e,t).readOnly||r.push([e,t,""]);m.setDataAtCell(r)}}},this.init=function(){h=new z(m,c.settings.data),Handsontable.hooks.run(m,"beforeInit"),Handsontable.mobileBrowser&&S(m.rootElement,"mobile"),this.updateSettings(c.settings,!0),this.view=new F(this),p=new k(m,c,g,d),this.forceFullRender=!0,Handsontable.hooks.run(m,"init"),this.view.render(),"object"==typeof c.firstRun&&(Handsontable.hooks.run(m,"afterChange",c.firstRun[0],c.firstRun[1]),c.firstRun=!1),Handsontable.hooks.run(m,"afterInit")},this.validateCell=function(e,t,o,n){function r(e){var n=t.physicalCol,r=t.physicalRow,i=m.getCell(r,n,!0);i&&m.view.wt.wtSettings.settings.cellRenderer(r,n,i),o(e)}var i=m.getCellValidator(t);"[object RegExp]"===Object.prototype.toString.call(i)&&(i=function(e){return function(t,o){o(e.test(t))}}(i)),"function"==typeof i?(e=Handsontable.hooks.run(m,"beforeValidate",e,t.row,t.prop,n),m._registerTimeout(setTimeout(function(){i.call(t,e,function(o){o=Handsontable.hooks.run(m,"afterValidate",o,e,t.row,t.prop,n),t.valid=o,r(o),Handsontable.hooks.run(m,"postAfterValidate",o,e,t.row,t.prop,n)})},0))):(t.valid=!0,r(t.valid))},this.setDataAtCell=function(e,t,o,s){var l,a,u,c=i(e,t,o),h=[];for(l=0,a=c.length;a>l;l++){if("object"!=typeof c[l])throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if("number"!=typeof c[l][1])throw new Error("Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`");u=d.colToProp(c[l][1]),h.push([c[l][0],u,d.get(c[l][0],u),c[l][2]])}s||"object"!=typeof e||(s=t),n(h,s,function(){r(h,s)})},this.setDataAtRowProp=function(e,t,o,s){var l,a,u=i(e,t,o),c=[];for(l=0,a=u.length;a>l;l++)c.push([u[l][0],u[l][1],d.get(u[l][0],u[l][1]),u[l][2]]);s||"object"!=typeof e||(s=t),n(c,s,function(){r(c,s)})},this.listen=function(){Handsontable.activeGuid=m.guid},this.unlisten=function(){Handsontable.activeGuid=null},this.isListening=function(){return Handsontable.activeGuid===m.guid},this.destroyEditor=function(e){g.refreshBorders(e)},this.populateFromArray=function(e,t,o,n,r,i,s,l,a){var u;if("object"!=typeof o||"object"!=typeof o[0])throw new Error("populateFromArray parameter `input` must be an array of arrays");return u="number"==typeof n?new Y(n,r):null,f.populateFromArray(new Y(e,t),o,u,i,s,l,a)},this.spliceCol=function(e,t,o){return d.spliceCol.apply(d,arguments)},this.spliceRow=function(e,t,o){return d.spliceRow.apply(d,arguments)},this.getSelected=function(){return g.isSelected()?[c.selRange.from.row,c.selRange.from.col,c.selRange.to.row,c.selRange.to.col]:void 0},this.getSelectedRange=function(){return g.isSelected()?c.selRange:void 0},this.render=function(){m.view&&(m.renderCall=!0,m.forceFullRender=!0,g.refreshBorders(null,!0))},this.loadData=function(e){function t(){c.cellSettings.length=0}if("object"==typeof e&&null!==e)e.push&&e.splice||(e=[e]);else{if(null!==e)throw new Error("loadData only accepts array of objects or array of arrays ("+typeof e+" given)");e=[];for(var o,n=0,r=c.settings.startRows;r>n;n++){o=[];for(var i=0,s=c.settings.startCols;s>i;i++)o.push(null);e.push(o)}}c.isPopulated=!1,w.prototype.data=e,Array.isArray(c.settings.dataSchema)||Array.isArray(e[0])?m.dataType="array":"function"==typeof c.settings.dataSchema?m.dataType="function":m.dataType="object",d=new H(m,c,w),h.data=e,h.dataType=m.dataType,h.colToProp=d.colToProp.bind(d),h.propToCol=d.propToCol.bind(d),t(),f.adjustRowsAndCols(),Handsontable.hooks.run(m,"afterLoadData",c.firstRun),c.firstRun?c.firstRun=[null,"loadData"]:(Handsontable.hooks.run(m,"afterChange",null,"loadData"),m.render()),c.isPopulated=!0},this.getData=function(e,t,o,n){return"undefined"==typeof e?d.getAll():d.getRange(new Y(e,t),new Y(o,n),d.DESTINATION_RENDERER)},this.getCopyableText=function(e,t,o,n){return d.getCopyableText(new Y(e,t),new Y(o,n))},this.getCopyableData=function(e,t){return d.getCopyable(e,d.colToProp(t))},this.getSchema=function(){return d.getSchema()},this.updateSettings=function(e,t){var o,n;if("undefined"!=typeof e.rows)throw new Error('"rows" setting is no longer supported. do you mean startRows, minRows or maxRows?');if("undefined"!=typeof e.cols)throw new Error('"cols" setting is no longer supported. do you mean startCols, minCols or maxCols?');for(o in e)"data"!==o&&(Handsontable.hooks.getRegistered().indexOf(o)>-1?("function"==typeof e[o]||Array.isArray(e[o]))&&m.addHook(o,e[o]):!t&&e.hasOwnProperty(o)&&(w.prototype[o]=e[o]));if(void 0===e.data&&void 0===c.settings.data?m.loadData(null):void 0!==e.data?m.loadData(e.data):void 0!==e.columns&&d.createMap(),n=m.countCols(),c.cellSettings.length=0,n>0){var r,i;for(o=0;n>o;o++)c.columnSettings[o]=M(w,c.columnsSettingConflicts),r=c.columnSettings[o].prototype,w.prototype.columns&&(i=w.prototype.columns[o],x(r,i),x(r,s(i)))}if("undefined"!=typeof e.cell)for(o in e.cell)if(e.cell.hasOwnProperty(o)){var l=e.cell[o];m.setCellMetaObject(l.row,l.col,l)}if(Handsontable.hooks.run(m,"afterCellMetaReset"),"undefined"!=typeof e.className&&(w.prototype.className&&_(m.rootElement,w.prototype.className),e.className&&S(m.rootElement,e.className)),"undefined"!=typeof e.height){var a=e.height;"function"==typeof a&&(a=a()),m.rootElement.style.height=a+"px"}if("undefined"!=typeof e.width){var u=e.width;"function"==typeof u&&(u=u()),m.rootElement.style.width=u+"px"}a&&(m.rootElement.style.overflow="hidden"),t||Handsontable.hooks.run(m,"afterUpdateSettings"),f.adjustRowsAndCols(),m.view&&!c.firstRun&&(m.forceFullRender=!0,g.refreshBorders(null,!0))},this.getValue=function(){var e=m.getSelected();if(w.prototype.getValue){if("function"==typeof w.prototype.getValue)return w.prototype.getValue.call(m);if(e)return m.getData()[e[0]][w.prototype.getValue]}else if(e)return m.getDataAtCell(e[0],e[1])},this.getSettings=function(){return c.settings},this.clear=function(){g.selectAll(),g.empty()},this.alter=function(e,t,o,n,r){f.alter(e,t,o,n,r)},this.getCell=function(e,t,o){return m.view.getCellAtCoords(new Y(e,t),o)},this.getCoords=function(e){return this.view.wt.wtTable.getCoords.call(this.view.wt.wtTable,e)},this.colToProp=function(e){return d.colToProp(e)},this.propToCol=function(e){return d.propToCol(e)},this.getDataAtCell=function(e,t){return d.get(e,d.colToProp(t))},this.getDataAtRowProp=function(e,t){return d.get(e,t)},this.getDataAtCol=function(e){var t=[];return t.concat.apply(t,d.getRange(new Y(0,e),new Y(c.settings.data.length-1,e),d.DESTINATION_RENDERER))},this.getDataAtProp=function(e){var t,o=[];return t=d.getRange(new Y(0,d.propToCol(e)),new Y(c.settings.data.length-1,d.propToCol(e)),d.DESTINATION_RENDERER),o.concat.apply(o,t)},this.getSourceData=function(e,t,o,n){var r;return r=void 0===e?h.getData():h.getByRange(new Y(e,t),new Y(o,n))},this.getSourceDataAtCol=function(e){return h.getAtColumn(e)},this.getSourceDataAtRow=function(e){return h.getAtRow(e)},this.getSourceDataAtCell=function(e,t){return h.getAtCell(e,t)},this.getDataAtRow=function(e){var t=d.getRange(new Y(e,0),new Y(e,this.countCols()-1),d.DESTINATION_RENDERER);return t[0]},this.getDataType=function(e,t,o,n){var r=this,i=null,s=null;void 0===e&&(e=0,o=this.countRows(),t=0,n=this.countCols()),void 0===o&&(o=e),void 0===n&&(n=t);var l="mixed";return V(Math.min(e,o),Math.max(e,o),function(e){var o=!0;return V(Math.min(t,n),Math.max(t,n),function(t){var n=r.getCellMeta(e,t);return s=n.type,i?o=i===s:i=s,o}),l=o?s:"mixed",o}),l},this.removeCellMeta=function(e,t,o){var n=m.getCellMeta(e,t);void 0!=n[o]&&delete c.cellSettings[e][t][o]},this.setCellMetaObject=function(e,t,o){if("object"==typeof o)for(var n in o)if(o.hasOwnProperty(n)){var r=o[n];this.setCellMeta(e,t,n,r)}},this.setCellMeta=function(e,t,o,n){c.cellSettings[e]||(c.cellSettings[e]=[]),c.cellSettings[e][t]||(c.cellSettings[e][t]=new c.columnSettings[t]),c.cellSettings[e][t][o]=n,Handsontable.hooks.run(m,"afterSetCellMeta",e,t,o,n)},this.getCellsMeta=function(){return W(c.cellSettings)},this.getCellMeta=function(e,t){var o,n=d.colToProp(t),r=e,i=t;if(e=l(e),t=a(t),c.columnSettings[t]||(c.columnSettings[t]=M(w,c.columnsSettingConflicts)),c.cellSettings[e]||(c.cellSettings[e]=[]),c.cellSettings[e][t]||(c.cellSettings[e][t]=new c.columnSettings[t]),o=c.cellSettings[e][t],o.row=e,o.col=t,o.physicalRow=r,o.physicalCol=i,o.prop=n,o.instance=m,Handsontable.hooks.run(m,"beforeGetCellMeta",e,t,o),x(o,s(o)),o.cells){var u=o.cells.call(o,e,t,n);u&&(x(o,u),x(o,s(u)))}return Handsontable.hooks.run(m,"afterGetCellMeta",e,t,o),o},this.isColumnModificationAllowed=function(){return!("object"===m.dataType||m.getSettings().columns)};var b=$("renderer");this.getCellRenderer=function(e,t){var o=b.call(this,e,t);return j(o)},this.getCellEditor=$("editor"),this.getCellValidator=$("validator"),this.validateCells=function(e){var t=new o;t.onQueueEmpty=e;for(var n=m.countRows()-1;n>=0;){for(var r=m.countCols()-1;r>=0;)t.addValidatorToQueue(),m.validateCell(m.getDataAtCell(n,r),m.getCellMeta(n,r),function(e){if("boolean"!=typeof e)throw new Error("Validation error: result is not boolean");e===!1&&(t.valid=!1),t.removeValidatorFormQueue()},"validateCells"),r--;n--}t.checkIfQueueIsEmpty()},this.getRowHeader=function(e){var t=c.settings.rowHeaders;return void 0!==e&&(e=Handsontable.hooks.run(m,"modifyRowHeader",e)),void 0===e?(t=[],V(m.countRows()-1,function(e){t.push(m.getRowHeader(e))})):Array.isArray(t)&&void 0!==t[e]?t=t[e]:"function"==typeof t?t=t(e):t&&"string"!=typeof t&&"number"!=typeof t&&(t=e+1),t},this.hasRowHeaders=function(){return!!c.settings.rowHeaders},this.hasColHeaders=function(){if(void 0!==c.settings.colHeaders&&null!==c.settings.colHeaders)return!!c.settings.colHeaders;for(var e=0,t=m.countCols();t>e;e++)if(m.getColHeader(e))return!0;return!1},this.getColHeader=function(e){if(e=Handsontable.hooks.run(m,"modifyColHeader",e),void 0===e){for(var t=[],o=0,n=m.countCols();n>o;o++)t.push(m.getColHeader(o));return t}var r=e;return e=Handsontable.hooks.run(m,"modifyCol",e),c.settings.columns&&c.settings.columns[e]&&c.settings.columns[e].title?c.settings.columns[e].title:Array.isArray(c.settings.colHeaders)&&void 0!==c.settings.colHeaders[e]?c.settings.colHeaders[e]:"function"==typeof c.settings.colHeaders?c.settings.colHeaders(e):c.settings.colHeaders&&"string"!=typeof c.settings.colHeaders&&"number"!=typeof c.settings.colHeaders?K(r):c.settings.colHeaders},this._getColWidthFromSettings=function(e){var t=m.getCellMeta(0,e),o=t.width;if((void 0===o||o===c.settings.width)&&(o=t.colWidths),void 0!==o&&null!==o){switch(typeof o){case"object":o=o[e];break;case"function":o=o(e)}"string"==typeof o&&(o=parseInt(o,10))}return o},this.getColWidth=function(e){var t=m._getColWidthFromSettings(e);return t=Handsontable.hooks.run(m,"modifyColWidth",t,e),void 0===t&&(t=q.DEFAULT_WIDTH),t},this._getRowHeightFromSettings=function(e){var t=c.settings.rowHeights;if(void 0!==t&&null!==t){switch(typeof t){case"object":t=t[e];break;case"function":t=t(e)}"string"==typeof t&&(t=parseInt(t,10))}return t},this.getRowHeight=function(e){var t=m._getRowHeightFromSettings(e);return t=Handsontable.hooks.run(m,"modifyRowHeight",t,e)},this.countSourceRows=function(){return m.getSourceData()?m.getSourceData().length:0},this.countRows=function(){return d.getLength()},this.countCols=function(){return"object"===m.dataType||"function"===m.dataType?c.settings.columns&&c.settings.columns.length?c.settings.columns.length:d.colToPropCache.length:"array"===m.dataType?c.settings.columns&&c.settings.columns.length?c.settings.columns.length:c.settings.data&&c.settings.data[0]&&c.settings.data[0].length?c.settings.data[0].length:0:void 0},this.getColspanOffset=function(e,t){var o=0;if(m.colspanArray){for(var n=0;e>n;n++)o+=m.colspanArray[t][n]-1||0;return o}for(var o=0,r=m.view.wt.wtTable.THEAD.childNodes.length-t-1,i=m.view.wt.wtTable.THEAD.querySelector("tr:nth-child("+parseInt(r+1,10)+")"),s=m.view.wt.wtSettings.settings.rowHeaders().length,n=s;s+e>n;n++)i.childNodes[n].hasAttribute("colspan")&&(o+=parseInt(i.childNodes[n].getAttribute("colspan"),10)-1);return o},this.getHeaderColspan=function(e,t){var o=m.view.wt.wtTable.THEAD.childNodes.length-t-1,n=m.view.wt.wtSettings.settings.rowHeaders().length,r=m.view.wt.wtTable.THEAD.querySelector("tr:nth-child("+parseInt(o+1,10)+")"),i=n+e-m.view.wt.wtViewport.columnsRenderCalculator.startColumn;return r.childNodes[i].hasAttribute("colspan")?parseInt(r.childNodes[i].getAttribute("colspan"),10):0},this.rowOffset=function(){return m.view.wt.wtTable.getFirstRenderedRow()},this.colOffset=function(){return m.view.wt.wtTable.getFirstRenderedColumn()},this.countRenderedRows=function(){return m.view.wt.drawn?m.view.wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return m.view.wt.drawn?m.view.wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return m.view.wt.drawn?m.view.wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return m.view.wt.drawn?m.view.wt.wtTable.getVisibleColumnsCount():-1},this.countEmptyRows=function(e){for(var t,o=m.countRows()-1,n=0;o>=0;){if(t=Handsontable.hooks.run(this,"modifyRow",o),m.isEmptyRow(t))n++;else if(e)break;o--}return n},this.countEmptyCols=function(e){if(m.countRows()<1)return 0;for(var t=m.countCols()-1,o=0;t>=0;){if(m.isEmptyCol(t))o++;else if(e)break;t--}return o},this.isEmptyRow=function(e){return c.settings.isEmptyRow.call(m,e)},this.isEmptyCol=function(e){return c.settings.isEmptyCol.call(m,e)},this.selectCell=function(e,t,o,n,r,i){var s;if(i="undefined"==typeof i||i===!0,"number"!=typeof e||0>e||e>=m.countRows())return!1;if("number"!=typeof t||0>t||t>=m.countCols())return!1;if("undefined"!=typeof o){if("number"!=typeof o||0>o||o>=m.countRows())return!1;if("number"!=typeof n||0>n||n>=m.countCols())return!1}return s=new Y(e,t),c.selRange=new X(s,s,s),i&&m.listen(),"undefined"==typeof o?g.setRangeEnd(c.selRange.from,r):g.setRangeEnd(new Y(o,n),r),m.selection.finish(),!0},this.selectCellByProp=function(e,t,o,n,r){return arguments[1]=d.propToCol(arguments[1]),"undefined"!=typeof arguments[3]&&(arguments[3]=d.propToCol(arguments[3])),m.selectCell.apply(m,arguments)},this.deselectCell=function(){g.deselect()},this.destroy=function(){m._clearTimeouts(),m.view&&m.view.destroy(),h&&h.destroy(),h=null,T(m.rootElement),v.destroy(),Handsontable.hooks.run(m,"afterDestroy"),Handsontable.hooks.destroy(m);for(var e in m)m.hasOwnProperty(e)&&("function"==typeof m[e]?m[e]=u:"guid"!==e&&(m[e]=null));c=null,d=null,f=null,g=null,p=null,m=null,w=null},this.getActiveEditor=function(){return p.getActiveEditor()},this.getPlugin=function(e){return I(this,e)},this.getInstance=function(){return m},this.addHook=function(e,t){Handsontable.hooks.add(e,t,m)},this.hasHook=function(e){return Handsontable.hooks.has(e,m)},this.addHookOnce=function(e,t){Handsontable.hooks.once(e,t,m)},this.removeHook=function(e,t){Handsontable.hooks.remove(e,t,m)},this.runHooks=function(e,t,o,n,r,i,s){return Handsontable.hooks.run(m,e,t,o,n,r,i,s)},this.timeouts=[],this._registerTimeout=function(e){this.timeouts.push(e)},this._clearTimeouts=function(){for(var e=0,t=this.timeouts.length;t>e;e++)clearTimeout(this.timeouts[e])},this.version=Handsontable.version,Handsontable.hooks.run(m,"construct")};var Q=function(){};Q.prototype={data:void 0,dataSchema:void 0,width:void 0,height:void 0,startRows:5,startCols:5,rowHeaders:null,colHeaders:null,colWidths:void 0,rowHeights:void 0,columns:void 0,cells:void 0,cell:[],comments:!1,customBorders:!1,minRows:0,minCols:0,maxRows:1/0,maxCols:1/0,minSpareRows:0,minSpareCols:0,allowInsertRow:!0,allowInsertColumn:!0,allowRemoveRow:!0,allowRemoveColumn:!0,multiSelect:!0,fillHandle:!0,fixedRowsTop:0,fixedRowsBottom:0,fixedColumnsLeft:0,outsideClickDeselects:!0,enterBeginsEditing:!0,enterMoves:{row:1,col:0},tabMoves:{row:0,col:1},autoWrapRow:!1,autoWrapCol:!1,copyRowsLimit:1e3,copyColsLimit:1e3,pasteMode:"overwrite",persistentState:!1,currentRowClassName:void 0,currentColClassName:void 0,className:void 0,tableClassName:void 0,stretchH:"none",isEmptyRow:function(e){var t,o,n,r;for(t=0,o=this.countCols();o>t;t++)if(n=this.getDataAtCell(e,t),""!==n&&null!==n&&"undefined"!=typeof n)return"object"==typeof n?(r=this.getCellMeta(e,t),N(this.getSchema()[r.prop],n)):!1;return!0},isEmptyCol:function(e){var t,o,n;for(t=0,o=this.countRows();o>t;t++)if(n=this.getDataAtCell(t,e),""!==n&&null!==n&&"undefined"!=typeof n)return!1;return!0},observeDOMVisibility:!0,allowInvalid:!0,invalidCellClassName:"htInvalid",placeholder:!1,placeholderCellClassName:"htPlaceholder",readOnlyCellClassName:"htDimmed",renderer:void 0,commentedCellClassName:"htCommentCell",fragmentSelection:!1,readOnly:!1,skipColumnOnPaste:!1,search:!1,type:"text",copyable:!0,editor:void 0,autoComplete:void 0,visibleRows:10,trimDropdown:!0,debug:!1,wordWrap:!0,noWordWrapClassName:"htNoWrap",contextMenu:void 0,contextMenuCopyPaste:void 0,copyPaste:void 0,undo:void 0,columnSorting:void 0,manualColumnMove:void 0,manualColumnResize:void 0,manualRowMove:void 0,manualRowResize:void 0,mergeCells:!1,viewportRowRenderingOffset:"auto", +viewportColumnRenderingOffset:"auto",validator:void 0,disableVisualSelection:!1,sortIndicator:!1,manualColumnFreeze:void 0,trimWhitespace:!0,settings:void 0,source:void 0,title:void 0,checkedTemplate:void 0,uncheckedTemplate:void 0,label:void 0,format:void 0,language:void 0,selectOptions:void 0,autoColumnSize:void 0,autoRowSize:void 0,dateFormat:void 0,correctFormat:!1,defaultDate:void 0,strict:void 0,renderAllRows:void 0,preventOverflow:!1},Handsontable.DefaultSettings=Q},{"3rdparty/walkontable/src/calculator/viewportColumns":3,"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/selection":18,dataMap:26,dataSource:27,editorManager:28,eventManager:41,"helpers/array":42,"helpers/data":44,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/setting":51,"helpers/string":52,numeral:"numeral",plugins:57,renderers:88,tableView:97}],26:[function(e,t,o){"use strict";function n(e,t,o){this.instance=e,this.priv=t,this.GridSettings=o,this.dataSource=this.instance.getSettings().data,this.dataSource[0]?this.duckSchema=this.recursiveDuckSchema(this.dataSource[0]):this.duckSchema={},this.createMap()}Object.defineProperties(o,{DataMap:{get:function(){return n}},__esModule:{value:!0}});var r,i,s,l,a,u,c,d=(r=e("SheetClip"),r&&r.__esModule&&r||{"default":r})["default"],h=(i=e("helpers/data"),i&&i.__esModule&&i||{"default":i}).cellMethodLookupFactory,f=(s=e("helpers/setting"),s&&s.__esModule&&s||{"default":s}).columnFactory,g=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),p=g.duckSchema,m=g.deepExtend,w=(a=e("helpers/array"),a&&a.__esModule&&a||{"default":a}),v=w.extendArray,b=w.to2dArray,C=(u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}).rangeEach,y=(c=e("multiMap"),c&&c.__esModule&&c||{"default":c}).MultiMap;n.prototype.DESTINATION_RENDERER=1,n.prototype.DESTINATION_CLIPBOARD_GENERATOR=2,n.prototype.recursiveDuckSchema=function(e){return p(e)},n.prototype.recursiveDuckColumns=function(e,t,o){var n,r;if("undefined"==typeof t&&(t=0,o=""),"object"==typeof e&&!Array.isArray(e))for(r in e)e.hasOwnProperty(r)&&(null===e[r]?(n=o+r,this.colToPropCache.push(n),this.propToColCache.set(n,t),t++):t=this.recursiveDuckColumns(e[r],t,r+"."));return t},n.prototype.createMap=function(){var e,t,o=this.getSchema();if("undefined"==typeof o)throw new Error("trying to create `columns` definition but you didnt' provide `schema` nor `data`");this.colToPropCache=[],this.propToColCache=new y;var n=this.instance.getSettings().columns;if(n)for(e=0,t=n.length;t>e;e++)"undefined"!=typeof n[e].data&&(this.colToPropCache[e]=n[e].data,this.propToColCache.set(n[e].data,e));else this.recursiveDuckColumns(o)},n.prototype.colToProp=function(e){return e=Handsontable.hooks.run(this.instance,"modifyCol",e),this.colToPropCache&&"undefined"!=typeof this.colToPropCache[e]?this.colToPropCache[e]:e},n.prototype.propToCol=function(e){var t;return t="undefined"==typeof this.propToColCache.get(e)?e:this.propToColCache.get(e),t=Handsontable.hooks.run(this.instance,"modifyCol",t)},n.prototype.getSchema=function(){var e=this.instance.getSettings().dataSchema;return e?"function"==typeof e?e():e:this.duckSchema},n.prototype.createRow=function(e,t,o){var n,r,i=this.instance.countCols(),s=0;t||(t=1),("number"!=typeof e||e>=this.instance.countSourceRows())&&(e=this.instance.countSourceRows()),r=e;for(var l=this.instance.getSettings().maxRows;t>s&&this.instance.countSourceRows()a;a++)n.push(null)}else"function"===this.instance.dataType?n=this.instance.getSettings().dataSchema(e):(n={},m(n,this.getSchema()));e===this.instance.countSourceRows()?this.dataSource.push(n):this.dataSource.splice(e,0,n),s++,r++}return Handsontable.hooks.run(this.instance,"afterCreateRow",e,s,o),this.instance.forceFullRender=!0,s},n.prototype.createCol=function(e,t,o){if(!this.instance.isColumnModificationAllowed())throw new Error("Cannot create new column. When data source in an object, you can only have as much columns as defined in first data row, data schema or in the 'columns' setting.If you want to be able to add new columns, you have to use array datasource.");var n,r,i=this.instance.countSourceRows(),s=this.dataSource,l=0;t||(t=1),r=e;for(var a=this.instance.getSettings().maxCols;t>l&&this.instance.countCols()=this.instance.countCols()){for(var u=0;i>u;u++)"undefined"==typeof s[u]&&(s[u]=[]),s[u].push(null);this.priv.columnSettings.push(n)}else{for(var u=0;i>u;u++)s[u].splice(r,0,null);this.priv.columnSettings.splice(r,0,n)}l++,r++}return Handsontable.hooks.run(this.instance,"afterCreateCol",e,l,o),this.instance.forceFullRender=!0,l},n.prototype.removeRow=function(e,t){t||(t=1),"number"!=typeof e&&(e=-t),e=(this.instance.countSourceRows()+e)%this.instance.countSourceRows();var o=this.physicalRowsToLogical(e,t),n=Handsontable.hooks.run(this.instance,"beforeRemoveRow",e,t,o);if(n!==!1){var r=this.dataSource,i=r.filter(function(e,t){return-1==o.indexOf(t)});r.length=0,Array.prototype.push.apply(r,i),Handsontable.hooks.run(this.instance,"afterRemoveRow",e,t,o),this.instance.forceFullRender=!0}},n.prototype.removeCol=function(e,t){if("object"===this.instance.dataType||this.instance.getSettings().columns)throw new Error("cannot remove column with object data source or columns option specified");t||(t=1),"number"!=typeof e&&(e=-t),e=(this.instance.countCols()+e)%this.instance.countCols();var o=Handsontable.hooks.run(this.instance,"beforeRemoveCol",e,t);if(o!==!1){for(var n=this.dataSource,r=0,i=this.instance.countSourceRows();i>r;r++)n[r].splice(e,t);this.priv.columnSettings.splice(e,t),Handsontable.hooks.run(this.instance,"afterRemoveCol",e,t),this.instance.forceFullRender=!0}},n.prototype.spliceCol=function(e,t,o){var n=4<=arguments.length?[].slice.call(arguments,3):[],r=this.instance.getDataAtCol(e),i=r.slice(t,t+o),s=r.slice(t+o);v(n,s);for(var l=0;o>l;)n.push(null),l++;return b(n),this.instance.populateFromArray(t,e,n,null,null,"spliceCol"),i},n.prototype.spliceRow=function(e,t,o){var n=4<=arguments.length?[].slice.call(arguments,3):[],r=this.instance.getSourceDataAtRow(e),i=r.slice(t,t+o),s=r.slice(t+o);v(n,s);for(var l=0;o>l;)n.push(null),l++;return this.instance.populateFromArray(e,t,[n],null,null,"spliceRow"),i},n.prototype.get=function(e,t){if(e=Handsontable.hooks.run(this.instance,"modifyRow",e),"string"==typeof t&&t.indexOf(".")>-1){var o=t.split("."),n=this.dataSource[e];if(!n)return null;for(var r=0,i=o.length;i>r;r++)if(n=n[o[r]],"undefined"==typeof n)return null;return n}return"function"==typeof t?t(this.dataSource.slice(e,e+1)[0]):this.dataSource[e]&&this.dataSource[e].hasOwnProperty&&this.dataSource[e].hasOwnProperty(t)?this.dataSource[e][t]:null};var R=h("copyable",!1);n.prototype.getCopyable=function(e,t){return R.call(this.instance,e,this.propToCol(t))?this.get(e,t):""},n.prototype.set=function(e,t,o,n){if(e=Handsontable.hooks.run(this.instance,"modifyRow",e,n||"datamapGet"),"string"==typeof t&&t.indexOf(".")>-1){for(var r=t.split("."),i=this.dataSource[e],s=0,l=r.length-1;l>s;s++)"undefined"==typeof i[r[s]]&&(i[r[s]]={}),i=i[r[s]];i[r[s]]=o}else"function"==typeof t?t(this.dataSource.slice(e,e+1)[0],o):this.dataSource[e][t]=o},n.prototype.physicalRowsToLogical=function(e,t){for(var o,n=this.instance.countSourceRows(),r=(n+e)%n,i=[],s=t;n>r&&s;)o=Handsontable.hooks.run(this.instance,"modifyRow",r),i.push(o),s--,r++;return i},n.prototype.clear=function(){for(var e=0;e=n;n++){l=[];var c=Handsontable.hooks.run(this.instance,"modifyRow",n);for(i=Math.min(e.col,t.col);s>=i;i++){if(null===c)break;l.push(u.call(this,n,this.colToProp(i)))}null!==c&&a.push(l)}return a},n.prototype.getText=function(e,t){return d.stringify(this.getRange(e,t,this.DESTINATION_RENDERER))},n.prototype.getCopyableText=function(e,t){return d.stringify(this.getRange(e,t,this.DESTINATION_CLIPBOARD_GENERATOR))},Handsontable.DataMap=n},{SheetClip:"SheetClip","helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51,multiMap:55}],27:[function(e,t,o){"use strict";Object.defineProperties(o,{DataSource:{get:function(){return f}},__esModule:{value:!0}});var n,r,i,s,l,a=((n=e("helpers/data"),n&&n.__esModule&&n||{"default":n}).cellMethodLookupFactory,(r=e("helpers/setting"),r&&r.__esModule&&r||{"default":r}).columnFactory,i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}),u=(a.duckSchema,a.deepExtend,a.getProperty),c=(s=e("helpers/array"),s&&s.__esModule&&s||{"default":s}),d=(c.extendArray,c.arrayEach),h=(l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}).rangeEach,f=function(e,t){this.hot=e,this.data=t,this.dataType="array",this.colToProp=function(){},this.propToCol=function(){}};$traceurRuntime.createClass(f,{getData:function(){return this.data},getAtColumn:function(e){var t=this,o=[];return d(this.data,function(n){var r=t.colToProp(e);n="string"==typeof r?u(n,r):n[r],o.push(n)}),o},getAtRow:function(e){return this.data[e]},getAtCell:function(e,t){return this.data[e][this.colToProp(t)]},getByRange:function(e,t){var o=this,n=Math.min(e.row,t.row),r=Math.min(e.col,t.col),i=Math.max(e.row,t.row),s=Math.max(e.col,t.col),l=[];return h(n,i,function(e){var t,n=o.getAtRow(e);"array"===o.dataType?t=n.slice(r,s):"object"===o.dataType&&(t={},h(r,s,function(e){var r=o.colToProp(e);t[r]=n[r]})),l.push(t)}),l},destroy:function(){this.data=null,this.hot=null}},{})},{"helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51}],28:[function(e,t,o){"use strict";function n(e,t,o){function n(e){var n="function"==typeof t.settings.enterMoves?t.settings.enterMoves(event):t.settings.enterMoves;e?o.transformStart(-n.row,-n.col):o.transformStart(n.row,n.col,!0)}function r(e){e?o.transformEnd(-1,0):o.transformStart(-1,0)}function i(e){e?o.transformEnd(1,0):o.transformStart(1,0)}function s(e){e?o.transformEnd(0,1):o.transformStart(0,1)}function l(e){e?o.transformEnd(0,-1):o.transformStart(0,-1)}function a(a){var c,g;if(e.isListening()&&(Handsontable.hooks.run(e,"beforeKeyDown",a),!y&&!w(a)&&(t.lastKeyCode=a.keyCode,o.isSelected()))){if(c=(a.ctrlKey||a.metaKey)&&!a.altKey,b&&!b.isWaiting()&&!(h(a.keyCode)||f(a.keyCode)||c||C.isEditorOpened()))return void C.openEditor("",a);switch(g=a.shiftKey?o.setRangeEnd:o.setRangeStart,a.keyCode){case d.A:!C.isEditorOpened()&&c&&(o.selectAll(),a.preventDefault(),p(a));break;case d.ARROW_UP:C.isEditorOpened()&&!b.isWaiting()&&C.closeEditorAndSaveChanges(c),r(a.shiftKey),a.preventDefault(),p(a);break;case d.ARROW_DOWN:C.isEditorOpened()&&!b.isWaiting()&&C.closeEditorAndSaveChanges(c),i(a.shiftKey),a.preventDefault(),p(a);break;case d.ARROW_RIGHT:C.isEditorOpened()&&!b.isWaiting()&&C.closeEditorAndSaveChanges(c),s(a.shiftKey),a.preventDefault(),p(a);break;case d.ARROW_LEFT:C.isEditorOpened()&&!b.isWaiting()&&C.closeEditorAndSaveChanges(c),l(a.shiftKey),a.preventDefault(),p(a);break;case d.TAB:var v="function"==typeof t.settings.tabMoves?t.settings.tabMoves(a):t.settings.tabMoves;a.shiftKey?o.transformStart(-v.row,-v.col):o.transformStart(v.row,v.col,!0),a.preventDefault(),p(a);break;case d.BACKSPACE:case d.DELETE:o.empty(a),C.prepareEditor(),a.preventDefault();break;case d.F2:C.openEditor(null,a),b&&b.enableFullEditMode(),a.preventDefault();break;case d.ENTER:C.isEditorOpened()?(b&&b.state!==Handsontable.EditorState.WAITING&&C.closeEditorAndSaveChanges(c),n(a.shiftKey)):e.getSettings().enterBeginsEditing?(C.openEditor(null,a),b&&b.enableFullEditMode()):n(a.shiftKey),a.preventDefault(),m(a);break;case d.ESCAPE:C.isEditorOpened()&&C.closeEditorAndRestoreOriginalValue(c),a.preventDefault();break;case d.HOME:g(a.ctrlKey||a.metaKey?new u(0,t.selRange.from.col):new u(t.selRange.from.row,0)),a.preventDefault(),p(a);break;case d.END:g(a.ctrlKey||a.metaKey?new u(e.countRows()-1,t.selRange.from.col):new u(t.selRange.from.row,e.countCols()-1)),a.preventDefault(),p(a);break;case d.PAGE_UP:o.transformStart(-e.countVisibleRows(),0),a.preventDefault(),p(a);break;case d.PAGE_DOWN:o.transformStart(e.countVisibleRows(),0),a.preventDefault(),p(a)}}}function c(){function t(e,t,o){"TD"==o.nodeName&&(C.openEditor(),b&&b.enableFullEditMode())}e.addHook("afterDocumentKeyDown",a),g.addEventListener(document.documentElement,"keydown",function(t){e.runHooks("afterDocumentKeyDown",t)}),e.view.wt.update("onCellDblClick",t),e.addHook("afterDestroy",function(){y=!0})}var g,b,C=this,y=!1;g=v(e),this.destroyEditor=function(e){this.closeEditor(e)},this.getActiveEditor=function(){return b},this.prepareEditor=function(){var o,n,r,i,s,l,a;return b&&b.isWaiting()?void this.closeEditor(!1,!1,function(e){e&&C.prepareEditor()}):(o=t.selRange.highlight.row,n=t.selRange.highlight.col,r=e.colToProp(n),i=e.getCell(o,n),s=e.getDataAtCell(o,n),l=e.getCellMeta(o,n),a=e.getCellEditor(l),void(a?(b=Handsontable.editors.getEditor(a,e),b.prepare(o,n,r,i,s,l)):b=void 0))},this.isEditorOpened=function(){return b&&b.isOpened()},this.openEditor=function(e,t){b&&!b.cellProperties.readOnly?b.beginEditing(e,t):b&&b.cellProperties.readOnly&&t&&t.keyCode===d.ENTER&&n()},this.closeEditor=function(e,t,o){b?b.finishEditing(e,t,o):o&&o(!1)},this.closeEditorAndSaveChanges=function(e){return this.closeEditor(!1,e)},this.closeEditorAndRestoreOriginalValue=function(e){return this.closeEditor(!0,e)},c()}Object.defineProperties(o,{EditorManager:{get:function(){return n}},__esModule:{value:!0}});var r,i,s,l,a,u=(r=e("3rdparty/walkontable/src/cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords,c=(i=e("helpers/unicode"),i&&i.__esModule&&i||{"default":i}),d=c.KEY_CODES,h=c.isMetaKey,f=c.isCtrlKey,g=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=g.stopPropagation,m=g.stopImmediatePropagation,w=g.isImmediatePropagationStopped,v=((l=e("editors"),l&&l.__esModule&&l||{"default":l}).getEditor,(a=e("eventManager"),a&&a.__esModule&&a||{"default":a}).eventManager);Handsontable.EditorManager=n},{"3rdparty/walkontable/src/cell/coords":5,editors:29,eventManager:41,"helpers/dom/event":46,"helpers/unicode":53}],29:[function(e,t,o){"use strict";function n(e){var t,o;o={},t=e,this.getConstructor=function(){return e},this.getInstance=function(e){return e.guid in o||(o[e.guid]=new t(e)),o[e.guid]}}function r(e,t){var o=new n(t);"string"==typeof e&&(c[e]=o,Handsontable.editors[u(e)+"Editor"]=t),d.set(t,o)}function i(e,t){var o;if("function"==typeof e)d.get(e)||r(null,e),o=d.get(e);else{if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter ');o=c[e]}if(!o)throw Error('No editor registered under name "'+e+'"');return o.getInstance(t)}function s(e){var t;if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter ');if(t=c[e],!t)throw Error('No editor registered under name "'+e+'"');return t.getConstructor()}function l(e){return c[e]?!0:!1}Object.defineProperties(o,{registerEditor:{get:function(){return r}},getEditor:{get:function(){return i}},hasEditor:{get:function(){return l}},getEditorConstructor:{get:function(){return s}},__esModule:{value:!0}});var a,u=(a=e("helpers/string"),a&&a.__esModule&&a||{"default":a}).toUpperCaseFirst,c={},d=new WeakMap;Handsontable.editors=Handsontable.editors||{},Handsontable.editors.registerEditor=r,Handsontable.editors.getEditor=i},{"helpers/string":52}],30:[function(e,t,o){"use strict";function n(e){this.instance=e,this.state=Handsontable.EditorState.VIRGIN,this._opened=!1,this._fullEditMode=!1,this._closeCallback=null,this.init()}Object.defineProperties(o,{BaseEditor:{get:function(){return n}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/mixed"),r&&r.__esModule&&r||{"default":r}).stringify,l=(i=e("3rdparty/walkontable/src/cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords;Handsontable.editors=Handsontable.editors||{},Handsontable.editors.BaseEditor=n,Handsontable.EditorState={VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"},n.prototype._fireCallbacks=function(e){this._closeCallback&&(this._closeCallback(e),this._closeCallback=null)},n.prototype.init=function(){},n.prototype.getValue=function(){throw Error("Editor getValue() method unimplemented")},n.prototype.setValue=function(e){throw Error("Editor setValue() method unimplemented")},n.prototype.open=function(){throw Error("Editor open() method unimplemented")},n.prototype.close=function(){throw Error("Editor close() method unimplemented")},n.prototype.prepare=function(e,t,o,n,r,i){this.TD=n,this.row=e,this.col=t,this.prop=o,this.originalValue=r,this.cellProperties=i,this.instance.view.isMouseDown()&&document.activeElement&&document.activeElement!==document.body?document.activeElement.blur():document.activeElement||document.body.focus(),this.state=Handsontable.EditorState.VIRGIN},n.prototype.extend=function(){function e(){o.apply(this,arguments)}function t(e,t){function o(){}return o.prototype=t.prototype,e.prototype=new o,e.prototype.constructor=e,e}var o=this.constructor;return t(e,o)},n.prototype.saveValue=function(e,t){var o,n;t?(o=this.instance.getSelected(),o[0]>o[2]&&(n=o[0],o[0]=o[2],o[2]=n),o[1]>o[3]&&(n=o[1],o[1]=o[3],o[3]=n),this.instance.populateFromArray(o[0],o[1],e,o[2],o[3],"edit")):this.instance.populateFromArray(this.row,this.col,e,null,null,"edit")},n.prototype.beginEditing=function(e,t){this.state==Handsontable.EditorState.VIRGIN&&(this.instance.view.scrollViewport(new l(this.row,this.col)),this.instance.view.render(),this.state=Handsontable.EditorState.EDITING,e="string"==typeof e?e:this.originalValue,this.setValue(s(e)),this.open(t),this._opened=!0,this.focus(),this.instance.view.render())},n.prototype.finishEditing=function(e,t,o){var n,r=this;if(o){var i=this._closeCallback;this._closeCallback=function(e){i&&i(e),o(e)}}if(!this.isWaiting()){if(this.state==Handsontable.EditorState.VIRGIN)return void this.instance._registerTimeout(setTimeout(function(){r._fireCallbacks(!0)},0));if(this.state==Handsontable.EditorState.EDITING){if(e)return this.cancelChanges(),void this.instance.view.render();n=this.instance.getSettings().trimWhitespace?[["string"==typeof this.getValue()?String.prototype.trim.call(this.getValue()||""):this.getValue()]]:[[this.getValue()]],this.state=Handsontable.EditorState.WAITING,this.saveValue(n,t),this.instance.getCellValidator(this.cellProperties)?this.instance.addHookOnce("postAfterValidate",function(e){r.state=Handsontable.EditorState.FINISHED,r.discardEditor(e)}):(this.state=Handsontable.EditorState.FINISHED,this.discardEditor(!0))}}},n.prototype.cancelChanges=function(){this.state=Handsontable.EditorState.FINISHED,this.discardEditor()},n.prototype.discardEditor=function(e){this.state===Handsontable.EditorState.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.instance.selectCell(this.row,this.col),this.focus(),this.state=Handsontable.EditorState.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=Handsontable.EditorState.VIRGIN,this._fireCallbacks(!0)))},n.prototype.enableFullEditMode=function(){this._fullEditMode=!0},n.prototype.isInFullEditMode=function(){return this._fullEditMode},n.prototype.isOpened=function(){return this._opened},n.prototype.isWaiting=function(){return this.state===Handsontable.EditorState.WAITING},n.prototype.checkEditorSection=function(){var e=this.instance.countRows(),t="";return this.row=e-this.instance.getSettings().fixedRowsBottom?t=this.col"+l+"")))},autoColumnSize:!0,modifyColWidth:function(e,t){var n=this.getPlugin("autoColumnSize").widths;return n[t]&&(e=n[t]),o?e:e+15}}),this.htEditor.view.wt.wtTable.holder.parentNode.style["padding-right"]=v()+2+"px",O&&(O=!1),t.instance._registerTimeout(setTimeout(function(){t.queryChoices(t.TEXTAREA.value)},0))},T.prototype.close=function(){S.prototype.close.apply(this,arguments)},T.prototype.queryChoices=function(e){if(this.query=e,"function"==typeof this.cellProperties.source){var t=this;this.cellProperties.source(e,function(e){t.updateChoicesList(e)})}else if(Array.isArray(this.cellProperties.source)){var o;if(e&&this.cellProperties.filter!==!1){var n=this.cellProperties.filteringCaseSensitive===!0,r=e.toLowerCase();o=this.cellProperties.source.filter(function(t){return n?-1!=t.indexOf(e):-1!=t.toLowerCase().indexOf(r)})}else o=this.cellProperties.source;this.updateChoicesList(o)}else this.updateChoicesList([])},T.prototype.updateChoicesList=function(e){var t,o=w(this.TEXTAREA),n=b(this.TEXTAREA),r=T.sortByRelevance(this.getValue(),e,this.cellProperties.filteringCaseSensitive);if(0==this.cellProperties.filter)t=r[0];else{for(var i=[],s=0,l=r.length;l>s;s++)i.push(e[r[s]]);t=0,e=i}this.choices=e,this.htEditor.loadData(g([e])),this.updateDropdownHeight(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(t),this.instance.listen(),this.TEXTAREA.focus(),y(this.TEXTAREA,o,o==n?void 0:n)},T.prototype.updateDropdownHeight=function(){var e=this.htEditor.getColWidth(0)+v()+2,t=void 0===this.cellProperties.trimDropdown?!0:this.cellProperties.trimDropdown;this.htEditor.updateSettings({height:this.getDropdownHeight(),width:t?void 0:e}),this.htEditor.view.wt.wtTable.alignOverlaysWithTrimmingContainer()},T.prototype.finishEditing=function(e){e||this.instance.removeHook("beforeKeyDown",n),S.prototype.finishEditing.apply(this,arguments)},T.prototype.highlightBestMatchingChoice=function(e){"number"==typeof e?this.htEditor.selectCell(e,0):this.htEditor.deselectCell()},T.sortByRelevance=function(e,t,o){var n,r,i,s,l,a=[],u=e.length,c=[];if(0===u){for(s=0,l=t.length;l>s;s++)c.push(s);return c}for(s=0,l=t.length;l>s;s++)n=f(t[s]),r=o?n.indexOf(e):n.toLowerCase().indexOf(e.toLowerCase()),-1!=r&&(i=n.length-r-u,a.push({baseIndex:s,index:r,charsLeft:i,value:n}));for(a.sort(function(e,t){return-1===t.index?-1:-1===e.index?1:e.indext.charsLeft?1:0:void 0}),s=0,l=a.length;l>s;s++)c.push(a[s].baseIndex);return c},T.prototype.getDropdownHeight=function(){var e=this.htEditor.getInstance().getRowHeight(0)||23,t=this.cellProperties.visibleRows;return this.choices.length>=t?t*e:this.choices.length*e+8},T.prototype.allowKeyEventPropagation=function(e){var t={row:this.htEditor.getSelectedRange()?this.htEditor.getSelectedRange().from.row:-1},o=!1;return e===d.ARROW_DOWN&&t.row-1&&(o=!0),o},E("autocomplete",T)},{editors:29,handsontableEditor:35,"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/unicode":53}],32:[function(e,t,o){"use strict";Object.defineProperties(o,{CheckboxEditor:{get:function(){return u}},__esModule:{value:!0}});var n,r,i,s=(n=e("editors"),n&&n.__esModule&&n||{"default":n}).registerEditor,l=(r=e("_baseEditor"),r&&r.__esModule&&r||{"default":r}).BaseEditor,a=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).hasClass,u=function(){$traceurRuntime.superConstructor(c).apply(this,arguments)},c=u;$traceurRuntime.createClass(u,{beginEditing:function(){var e=this.TD.querySelector('input[type="checkbox"]');a(e,"htBadValue")||e.click()},finishEditing:function(){},init:function(){},open:function(){},close:function(){},getValue:function(){},setValue:function(){},focus:function(){}},{},l),s("checkbox",u)},{_baseEditor:30,editors:29,"helpers/dom/element":45}],33:[function(e,t,o){"use strict";Object.defineProperties(o,{DateEditor:{get:function(){return S}},__esModule:{value:!0}});var n,r,i,s,l,a,u,c,d,h=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),f=h.addClass,g=h.outerHeight,p=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).deepExtend,m=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,w=(s=e("editors"),s&&s.__esModule&&s||{"default":s}),v=(w.getEditor,w.registerEditor),b=(l=e("helpers/unicode"),l&&l.__esModule&&l||{"default":l}).isMetaKey,C=(a=e("helpers/dom/event"),a&&a.__esModule&&a||{"default":a}).stopPropagation,y=(u=e("textEditor"),u&&u.__esModule&&u||{"default":u}).TextEditor,R=(c=e("moment"),c&&c.__esModule&&c||{"default":c})["default"],E=(d=e("pikaday"),d&&d.__esModule&&d||{"default":d})["default"];Handsontable.editors=Handsontable.editors||{},Handsontable.editors.DateEditor=S;var S=function(e){this.$datePicker=null,this.datePicker=null,this.datePickerStyle=null,this.defaultDateFormat="DD/MM/YYYY",this.isCellEdited=!1,this.parentDestroyed=!1,$traceurRuntime.superConstructor(T).call(this,e)},T=S;$traceurRuntime.createClass(S,{init:function(){var e=this;if("function"!=typeof R)throw new Error("You need to include moment.js to your project.");if("function"!=typeof E)throw new Error("You need to include Pikaday to your project.");$traceurRuntime.superGet(this,T.prototype,"init").call(this),this.instance.addHook("afterDestroy",function(){e.parentDestroyed=!0,e.destroyElements()})},createElements:function(){$traceurRuntime.superGet(this,T.prototype,"createElements").call(this),this.datePicker=document.createElement("DIV"),this.datePickerStyle=this.datePicker.style,this.datePickerStyle.position="absolute",this.datePickerStyle.top=0,this.datePickerStyle.left=0,this.datePickerStyle.zIndex=9999,f(this.datePicker,"htDatepickerHolder"),document.body.appendChild(this.datePicker),this.$datePicker=new E(this.getDatePickerConfig());var e=new m(this);e.addEventListener(this.datePicker,"mousedown",function(e){return C(e)}),this.hideDatepicker()},destroyElements:function(){this.$datePicker.destroy()},prepare:function(e,t,o,n,r,i){this._opened=!1,$traceurRuntime.superGet(this,T.prototype,"prepare").call(this,e,t,o,n,r,i)},open:function(){var e=void 0!==arguments[0]?arguments[0]:null;$traceurRuntime.superGet(this,T.prototype,"open").call(this),this.showDatepicker(e)},close:function(){var e=this;this._opened=!1,this.instance._registerTimeout(setTimeout(function(){e.instance.selection.refreshBorders()},0)),$traceurRuntime.superGet(this,T.prototype,"close").call(this)},finishEditing:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=void 0!==arguments[1]?arguments[1]:!1;if(e){var o=this.originalValue;void 0!==o&&this.setValue(o)}this.hideDatepicker(),$traceurRuntime.superGet(this,T.prototype,"finishEditing").call(this,e,t)},showDatepicker:function(e){this.$datePicker.config(this.getDatePickerConfig());var t,o=this.TD.getBoundingClientRect(),n=this.cellProperties.dateFormat||this.defaultDateFormat,r=this.$datePicker.config(),i=this.instance.view.isMouseDown(),s=e?b(e.keyCode):!1;this.datePickerStyle.top=window.pageYOffset+o.top+g(this.TD)+"px",this.datePickerStyle.left=window.pageXOffset+o.left+"px",this.$datePicker._onInputFocus=function(){},r.format=n,this.originalValue?(t=this.originalValue,R(t,n,!0).isValid()&&this.$datePicker.setMoment(R(t,n),!0),s||i||this.setValue("")):this.cellProperties.defaultDate?(t=this.cellProperties.defaultDate,r.defaultDate=t,R(t,n,!0).isValid()&&this.$datePicker.setMoment(R(t,n),!0),s||i||this.setValue("")):this.$datePicker.gotoToday(),this.datePickerStyle.display="block",this.$datePicker.show()},hideDatepicker:function(){this.datePickerStyle.display="none",this.$datePicker.hide()},getDatePickerConfig:function(){var e=this,t=this.TEXTAREA,o={};this.cellProperties&&this.cellProperties.datePickerConfig&&p(o,this.cellProperties.datePickerConfig);var n=o.onSelect,r=o.onClose;return o.field=t,o.trigger=t,o.container=this.datePicker,o.bound=!1,o.format=o.format||this.defaultDateFormat,o.reposition=o.reposition||!1,o.onSelect=function(t){isNaN(t.getTime())||(t=R(t).format(e.cellProperties.dateFormat||e.defaultDateFormat)),e.setValue(t),e.hideDatepicker(),n&&n()},o.onClose=function(){e.parentDestroyed||e.finishEditing(!1),r&&r()},o}},{},y),v("date",S)},{editors:29,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,moment:void 0,pikaday:void 0,textEditor:40}],34:[function(e,t,o){"use strict";Object.defineProperties(o,{DropdownEditor:{get:function(){return a}},__esModule:{value:!0}});var n,r,i=(n=e("editors"),n&&n.__esModule&&n||{"default":n}),s=(i.getEditor,i.registerEditor),l=(r=e("autocompleteEditor"),r&&r.__esModule&&r||{"default":r}).AutocompleteEditor,a=function(){$traceurRuntime.superConstructor(u).apply(this,arguments)},u=a;$traceurRuntime.createClass(a,{prepare:function(e,t,o,n,r,i){$traceurRuntime.superGet(this,u.prototype,"prepare").call(this,e,t,o,n,r,i),this.cellProperties.filter=!1,this.cellProperties.strict=!0}},{},l),Handsontable.hooks.add("beforeValidate",function(e,t,o,n){var r=this.getCellMeta(t,o); +r.editor===Handsontable.editors.DropdownEditor&&void 0===r.strict&&(r.filter=!1,r.strict=!0)}),s("dropdown",a)},{autocompleteEditor:31,editors:29}],35:[function(e,t,o){"use strict";Object.defineProperties(o,{HandsontableEditor:{get:function(){return v}},__esModule:{value:!0}});var n,r,i,s,l,a,u=(n=e("helpers/unicode"),n&&n.__esModule&&n||{"default":n}).KEY_CODES,c=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).extend,d=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).setCaretPosition,h=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),f=h.stopImmediatePropagation,g=h.isImmediatePropagationStopped,p=(l=e("editors"),l&&l.__esModule&&l||{"default":l}),m=(p.getEditor,p.registerEditor),w=(a=e("textEditor"),a&&a.__esModule&&a||{"default":a}).TextEditor,v=w.prototype.extend();v.prototype.createElements=function(){w.prototype.createElements.apply(this,arguments);var e=document.createElement("DIV");e.className="handsontableEditor",this.TEXTAREA_PARENT.appendChild(e),this.htContainer=e,this.assignHooks()},v.prototype.prepare=function(e,t,o,n,r,i){w.prototype.prepare.apply(this,arguments);var s=this,l={startRows:0,startCols:0,minRows:0,minCols:0,className:"listbox",copyPaste:!1,autoColumnSize:!1,autoRowSize:!1,readOnly:!0,fillHandle:!1,afterOnCellMouseDown:function(){var e=this.getValue();void 0!==e&&s.setValue(e),s.instance.destroyEditor()}};this.cellProperties.handsontable&&c(l,i.handsontable),this.htOptions=l};var b=function(e){if(!g(e)){var t,o=this.getActiveEditor(),n=o.htEditor.getInstance();if(e.keyCode==u.ARROW_DOWN)if(n.getSelected()){var r=n.getSelected()[0],i=n.countRows()-1;t=Math.min(i,r+1)}else t=0;else if(e.keyCode==u.ARROW_UP&&n.getSelected()){var r=n.getSelected()[0];t=r-1}void 0!==t&&(0>t?n.deselectCell():n.selectCell(t,0),n.getData().length&&(e.preventDefault(),f(e),o.instance.listen(),o.TEXTAREA.focus()))}};v.prototype.open=function(){this.instance.addHook("beforeKeyDown",b),w.prototype.open.apply(this,arguments),this.htEditor&&this.htEditor.destroy(),this.htEditor=new Handsontable(this.htContainer,this.htOptions),this.cellProperties.strict?(this.htEditor.selectCell(0,0),this.TEXTAREA.style.visibility="hidden"):(this.htEditor.deselectCell(),this.TEXTAREA.style.visibility="visible"),d(this.TEXTAREA,0,this.TEXTAREA.value.length)},v.prototype.close=function(){this.instance.removeHook("beforeKeyDown",b),this.instance.listen(),w.prototype.close.apply(this,arguments)},v.prototype.focus=function(){this.instance.listen(),w.prototype.focus.apply(this,arguments)},v.prototype.beginEditing=function(e){var t=this.instance.getSettings().onBeginEditing;t&&t()===!1||w.prototype.beginEditing.apply(this,arguments)},v.prototype.finishEditing=function(e,t){if(this.htEditor&&this.htEditor.isListening()&&this.instance.listen(),this.htEditor&&this.htEditor.getSelected()){var o=this.htEditor.getInstance().getValue();void 0!==o&&this.setValue(o)}return w.prototype.finishEditing.apply(this,arguments)},v.prototype.assignHooks=function(){var e=this;this.instance.addHook("afterDestroy",function(){e.htEditor&&e.htEditor.destroy()})},m("handsontable",v)},{editors:29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,textEditor:40}],36:[function(e,t,o){"use strict";Object.defineProperties(o,{MobileTextEditor:{get:function(){return M}},__esModule:{value:!0}});var n,r,i,s,l,a,u=(n=e("helpers/unicode"),n&&n.__esModule&&n||{"default":n}).KEY_CODES,c=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}),d=c.stopImmediatePropagation,h=c.isImmediatePropagationStopped,f=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),g=f.addClass,p=f.getScrollLeft,m=f.getScrollTop,w=f.hasClass,v=f.isChildOf,b=f.offset,C=f.outerHeight,y=f.outerWidth,R=f.removeClass,E=f.setCaretPosition,S=(s=e("editors"),s&&s.__esModule&&s||{"default":s}),T=(S.getEditor,S.registerEditor),O=(l=e("_baseEditor"),l&&l.__esModule&&l||{"default":l}).BaseEditor,_=(a=e("eventManager"),a&&a.__esModule&&a||{"default":a}).eventManager,M=O.prototype.extend(),H={},k=function(){this.controls={},this.controls.leftButton=document.createElement("DIV"),this.controls.leftButton.className="leftButton",this.controls.rightButton=document.createElement("DIV"),this.controls.rightButton.className="rightButton",this.controls.upButton=document.createElement("DIV"),this.controls.upButton.className="upButton",this.controls.downButton=document.createElement("DIV"),this.controls.downButton.className="downButton";for(var e in this.controls)this.controls.hasOwnProperty(e)&&this.positionControls.appendChild(this.controls[e])};M.prototype.valueChanged=function(){return this.initValue!=this.getValue()},M.prototype.init=function(){var e=this;this.eventManager=_(this.instance),this.createElements(),this.bindEvents(),this.instance.addHook("afterDestroy",function(){e.destroy()})},M.prototype.getValue=function(){return this.TEXTAREA.value},M.prototype.setValue=function(e){this.initValue=e,this.TEXTAREA.value=e},M.prototype.createElements=function(){this.editorContainer=document.createElement("DIV"),this.editorContainer.className="htMobileEditorContainer",this.cellPointer=document.createElement("DIV"),this.cellPointer.className="cellPointer",this.moveHandle=document.createElement("DIV"),this.moveHandle.className="moveHandle",this.inputPane=document.createElement("DIV"),this.inputPane.className="inputs",this.positionControls=document.createElement("DIV"),this.positionControls.className="positionControls",this.TEXTAREA=document.createElement("TEXTAREA"),g(this.TEXTAREA,"handsontableInput"),this.inputPane.appendChild(this.TEXTAREA),this.editorContainer.appendChild(this.cellPointer),this.editorContainer.appendChild(this.moveHandle),this.editorContainer.appendChild(this.inputPane),this.editorContainer.appendChild(this.positionControls),k.call(this),document.body.appendChild(this.editorContainer)},M.prototype.onBeforeKeyDown=function(e){var t=this,o=t.getActiveEditor();if(e.target===o.TEXTAREA&&!h(e))switch(e.keyCode){case u.ENTER:o.close(),e.preventDefault();break;case u.BACKSPACE:d(e)}},M.prototype.open=function(){this.instance.addHook("beforeKeyDown",this.onBeforeKeyDown),g(this.editorContainer,"active"),R(this.cellPointer,"hidden"),this.updateEditorPosition()},M.prototype.focus=function(){this.TEXTAREA.focus(),E(this.TEXTAREA,this.TEXTAREA.value.length)},M.prototype.close=function(){this.TEXTAREA.blur(),this.instance.removeHook("beforeKeyDown",this.onBeforeKeyDown),R(this.editorContainer,"active")},M.prototype.scrollToView=function(){var e=this.instance.getSelectedRange().highlight;this.instance.view.scrollViewport(e)},M.prototype.hideCellPointer=function(){w(this.cellPointer,"hidden")||g(this.cellPointer,"hidden")},M.prototype.updateEditorPosition=function(e,t){if(e&&t)e=parseInt(e,10),t=parseInt(t,10),this.editorContainer.style.top=t+"px",this.editorContainer.style.left=e+"px";else{var o=this.instance.getSelected(),n=this.instance.getCell(o[0],o[1]);if(H.cellPointer||(H.cellPointer={height:C(this.cellPointer),width:y(this.cellPointer)}),H.editorContainer||(H.editorContainer={width:y(this.editorContainer)}),void 0!==n){var r=this.instance.view.wt.wtOverlays.leftOverlay.trimmingContainer==window?0:p(this.instance.view.wt.wtOverlays.leftOverlay.holder),i=this.instance.view.wt.wtOverlays.topOverlay.trimmingContainer==window?0:m(this.instance.view.wt.wtOverlays.topOverlay.holder),s=b(n),l=y(n),a={x:r,y:i};this.editorContainer.style.top=parseInt(s.top+C(n)-a.y+H.cellPointer.height,10)+"px",this.editorContainer.style.left=parseInt(window.innerWidth/2-H.editorContainer.width/2,10)+"px",s.left+l/2>parseInt(this.editorContainer.style.left,10)+H.editorContainer.width?this.editorContainer.style.left=window.innerWidth-H.editorContainer.width+"px":s.left+l/2o;o++)t[e[o]]=e[o];else"object"==typeof e&&(t=e);return t},S.prototype.getValue=function(){return this.select.value},S.prototype.setValue=function(e){this.select.value=e};var T=function(e){var t=this,o=t.getActiveEditor();switch(e.keyCode){case C.ARROW_UP:var n=o.select.selectedIndex-1;n>=0&&(o.select[n].selected=!0),b(e),e.preventDefault();break;case C.ARROW_DOWN:var r=o.select.selectedIndex+1;r<=o.select.length-1&&(o.select[r].selected=!0),b(e),e.preventDefault()}};S.prototype.open=function(){this._opened=!0,this.refreshDimensions(),this.select.style.display="",this.instance.addHook("beforeKeyDown",T)},S.prototype.close=function(){this._opened=!1,this.select.style.display="none",this.instance.removeHook("beforeKeyDown",T)},S.prototype.focus=function(){this.select.focus()},S.prototype.refreshDimensions=function(){if(this.state===Handsontable.EditorState.EDITING){if(this.TD=this.getEditedCell(),!this.TD)return void this.close();var e,t=w(this.TD)+1,o=m(this.TD)+1,n=p(this.TD),r=p(this.instance.rootElement),i=g(this.TD),s=n.top-r.top-1-(i.scrollTop||0),l=n.left-r.left-1-(i.scrollLeft||0),a=this.checkEditorSection(),u=this.instance.getSettings();u.rowHeaders?1:0,u.colHeaders?1:0;switch(a){case"top":e=f(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":e=f(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":e=f(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":e=f(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":e=f(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}0===this.instance.getSelected()[0]&&(s+=1),0===this.instance.getSelected()[1]&&(l+=1);var c=this.select.style;e&&-1!=e?c[e[0]]=e[1]:v(this.select);var d=h(this.TD);parseInt(d.borderTopWidth,10)>0&&(o-=1),parseInt(d.borderLeftWidth,10)>0&&(t-=1),c.height=o+"px",c.minWidth=t+"px",c.top=s+"px",c.left=l+"px",c.margin="0px"}},S.prototype.getEditedCell=function(){var e,t=this.checkEditorSection();switch(t){case"top":e=this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=101;break;case"corner":e=this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=103;break;case"left":e=this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=102;break;default:e=this.instance.getCell(this.row,this.col),this.select.style.zIndex=""}return-1!=e&&-2!=e?e:void 0},R("select",S)},{_baseEditor:30,editors:29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],40:[function(e,t,o){"use strict";Object.defineProperties(o,{TextEditor:{get:function(){return k}},__esModule:{value:!0}});var n,r,i,s,l,a,u,c=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),d=c.addClass,h=c.getCaretPosition,f=c.getComputedStyle,g=c.getCssTransform,p=c.getScrollableElement,m=c.innerWidth,w=c.offset,v=c.resetCssTransform,b=c.setCaretPosition,C=(r=e("autoResize"),r&&r.__esModule&&r||{"default":r})["default"],y=(i=e("_baseEditor"),i&&i.__esModule&&i||{"default":i}).BaseEditor,R=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).eventManager,E=(l=e("editors"),l&&l.__esModule&&l||{"default":l}),S=(E.getEditor,E.registerEditor),T=(a=e("helpers/unicode"),a&&a.__esModule&&a||{"default":a}).KEY_CODES,O=(u=e("helpers/dom/event"),u&&u.__esModule&&u||{"default":u}),_=O.stopPropagation,M=O.stopImmediatePropagation,H=O.isImmediatePropagationStopped,k=y.prototype.extend();k.prototype.init=function(){var e=this;this.createElements(),this.eventManager=R(this),this.bindEvents(),this.autoResize=C(),this.instance.addHook("afterDestroy",function(){e.destroy()})},k.prototype.getValue=function(){return this.TEXTAREA.value},k.prototype.setValue=function(e){this.TEXTAREA.value=e};var A=function(e){var t,o=this,n=o.getActiveEditor();if(t=(e.ctrlKey||e.metaKey)&&!e.altKey,e.target===n.TEXTAREA&&!H(e)){if(17===e.keyCode||224===e.keyCode||91===e.keyCode||93===e.keyCode)return void M(e);switch(e.keyCode){case T.ARROW_RIGHT:n.isInFullEditMode()&&(!n.isWaiting()&&!n.allowKeyEventPropagation||!n.isWaiting()&&n.allowKeyEventPropagation&&!n.allowKeyEventPropagation(e.keyCode))&&M(e);break;case T.ARROW_LEFT:n.isInFullEditMode()&&(!n.isWaiting()&&!n.allowKeyEventPropagation||!n.isWaiting()&&n.allowKeyEventPropagation&&!n.allowKeyEventPropagation(e.keyCode))&&M(e);break;case T.ARROW_UP:case T.ARROW_DOWN:n.isInFullEditMode()&&(!n.isWaiting()&&!n.allowKeyEventPropagation||!n.isWaiting()&&n.allowKeyEventPropagation&&!n.allowKeyEventPropagation(e.keyCode))&&M(e);break;case T.ENTER:var r=n.instance.getSelected(),i=!(r[0]===r[2]&&r[1]===r[3]);if(t&&!i||e.altKey){if(n.isOpened()){var s=h(n.TEXTAREA),l=n.getValue(),a=l.slice(0,s)+"\n"+l.slice(s);n.setValue(a),b(n.TEXTAREA,s+1)}else n.beginEditing(n.originalValue+"\n");M(e)}e.preventDefault();break;case T.A:case T.X:case T.C:case T.V:t&&M(e);break;case T.BACKSPACE:case T.DELETE:case T.HOME:case T.END:M(e)}-1===[T.ARROW_UP,T.ARROW_RIGHT,T.ARROW_DOWN,T.ARROW_LEFT].indexOf(e.keyCode)&&n.autoResize.resize(String.fromCharCode(e.keyCode))}};k.prototype.open=function(){this.refreshDimensions(),this.instance.addHook("beforeKeyDown",A)},k.prototype.close=function(e){this.textareaParentStyle.display="none",this.autoResize.unObserve(),document.activeElement===this.TEXTAREA&&this.instance.listen(),this.instance.removeHook("beforeKeyDown",A)},k.prototype.focus=function(){this.TEXTAREA.focus(),b(this.TEXTAREA,this.TEXTAREA.value.length)},k.prototype.createElements=function(){this.TEXTAREA=document.createElement("TEXTAREA"),d(this.TEXTAREA,"handsontableInput"),this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,this.TEXTAREA_PARENT=document.createElement("DIV"),d(this.TEXTAREA_PARENT,"handsontableInputHolder"),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.textareaParentStyle.top=0,this.textareaParentStyle.left=0,this.textareaParentStyle.display="none",this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.instance.rootElement.appendChild(this.TEXTAREA_PARENT);var e=this;this.instance._registerTimeout(setTimeout(function(){e.refreshDimensions()},0))},k.prototype.getEditedCell=function(){var e,t=this.checkEditorSection();switch(t){case"top":e=this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=101;break;case"top-left-corner":e=this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=103;break;case"bottom-left-corner":e=this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=103;break;case"left":e=this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=102;break;case"bottom":e=this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=102;break;default:e=this.instance.getCell(this.row,this.col),this.textareaParentStyle.zIndex=""}return-1!=e&&-2!=e?e:void 0},k.prototype.refreshDimensions=function(){if(this.state===Handsontable.EditorState.EDITING){if(this.TD=this.getEditedCell(),!this.TD)return void this.close(!0);var e,t=w(this.TD),o=w(this.instance.rootElement),n=p(this.TD),r=this.instance.countRows(),i=t.top-o.top-1-(n.scrollTop||0),s=t.left-o.left-1-(n.scrollLeft||0),l=this.instance.getSettings(),a=(l.rowHeaders?1:0,l.colHeaders?1:0),u=this.checkEditorSection(),c=this.TD.style.backgroundColor;switch(u){case"top":e=g(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":e=g(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":e=g(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":e=g(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":e=g(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}(a&&0===this.instance.getSelected()[0]||l.fixedRowsBottom&&this.instance.getSelected()[0]===r-l.fixedRowsBottom)&&(i+=1),0===this.instance.getSelected()[1]&&(s+=1),e&&-1!=e?this.textareaParentStyle[e[0]]=e[1]:v(this.textareaParentStyle),this.textareaParentStyle.top=i+"px",this.textareaParentStyle.left=s+"px";var d=this.TD.offsetTop-this.instance.view.wt.wtOverlays.topOverlay.getScrollPosition(),h=this.TD.offsetLeft-this.instance.view.wt.wtOverlays.leftOverlay.getScrollPosition(),b=m(this.TD)-8,C=this.instance.view.maximumVisibleElementWidth(h)-9,y=this.TD.scrollHeight+1,R=Math.max(this.instance.view.maximumVisibleElementHeight(d)-2,23),E=f(this.TD);this.TEXTAREA.style.fontSize=E.fontSize,this.TEXTAREA.style.fontFamily=E.fontFamily,this.TEXTAREA.style.backgroundColor="",this.TEXTAREA.style.backgroundColor=c?c:f(this.TEXTAREA).backgroundColor,this.autoResize.init(this.TEXTAREA,{minHeight:Math.min(y,R),maxHeight:R,minWidth:Math.min(b,C),maxWidth:C},!0),this.textareaParentStyle.display="block"}},k.prototype.bindEvents=function(){var e=this;this.eventManager.addEventListener(this.TEXTAREA,"cut",function(e){_(e)}),this.eventManager.addEventListener(this.TEXTAREA,"paste",function(e){_(e)}),this.instance.addHook("afterScrollHorizontally",function(){e.refreshDimensions()}),this.instance.addHook("afterScrollVertically",function(){e.refreshDimensions()}),this.instance.addHook("afterColumnResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterRowResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterDestroy",function(){e.eventManager.destroy()})},k.prototype.destroy=function(){this.eventManager.destroy()},S("text",k)},{_baseEditor:30,autoResize:"autoResize",editors:29,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],41:[function(e,t,o){"use strict";function n(e,t){var o,n,r,i,s,l="HOT-TABLE";if(t.isTargetWebComponent=!1,t.realTarget=t.target,!Handsontable.eventManager.isHotTableEnv)return t;for(t=a(t),s=t.path?t.path.length:0;s--;){if(t.path[s].nodeName===l)o=!0;else if(o&&t.path[s].shadowRoot){i=t.path[s];break}0!==s||i||(i=t.path[s])}return i||(i=t.target),t.isTargetWebComponent=!0,c()?t.realTarget=t.srcElement||t.toElement:(e instanceof Handsontable.Core||e instanceof Walkontable)&&(e instanceof Handsontable.Core?n=e.view?e.view.wt.wtTable.TABLE:null:e instanceof Walkontable&&(n=e.wtTable.TABLE.parentNode.parentNode),r=u(t.target,[l],n),r?t.realTarget=n.querySelector(l)||t.target:t.realTarget=t.target),Object.defineProperty(t,"target",{get:function(){return a(i)},enumerable:!0,configurable:!0}),t}function r(e){return new d(e)}Object.defineProperties(o,{EventManager:{get:function(){return d}},eventManager:{get:function(){return r}},__esModule:{value:!0}});var i,s,l=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),a=l.polymerWrap,u=l.closest,c=(s=e("helpers/browser"),s&&s.__esModule&&s||{"default":s}).isWebComponentSupportedNatively,d=function(){var e=void 0!==arguments[0]?arguments[0]:null;this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])};$traceurRuntime.createClass(d,{addEventListener:function(e,t,o){function r(e){void 0==e.target&&void 0!=e.srcElement&&(e.definePoperty?e.definePoperty("target",{value:e.srcElement}):e.target=e.srcElement),void 0==e.preventDefault&&(e.definePoperty?e.definePoperty("preventDefault",{value:function(){this.returnValue=!1}}):e.preventDefault=function(){this.returnValue=!1}),e=n(s,e),o.call(this,e)}var i=this,s=this.context;return this.context.eventListeners.push({element:e,event:t,callback:o,callbackProxy:r}),window.addEventListener?e.addEventListener(t,r,!1):e.attachEvent("on"+t,r),Handsontable.countEventManagerListeners++,function(){i.removeEventListener(e,t,o)}},removeEventListener:function(e,t,o){for(var n,r=this.context.eventListeners.length;r--;)if(n=this.context.eventListeners[r],n.event==t&&n.element==e){if(o&&o!=n.callback)continue;this.context.eventListeners.splice(r,1),n.element.removeEventListener?n.element.removeEventListener(n.event,n.callbackProxy,!1):n.element.detachEvent("on"+n.event,n.callbackProxy),Handsontable.countEventManagerListeners--}},clearEvents:function(){if(this.context)for(var e=this.context.eventListeners.length;e--;){var t=this.context.eventListeners[e];t&&this.removeEventListener(t.element,t.event,t.callback)}},clear:function(){this.clearEvents()},destroy:function(){this.clearEvents(),this.context=null},fireEvent:function(e,t){var o,n={bubbles:!0,cancelable:"mousemove"!==t,view:window,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:void 0};document.createEvent?(o=document.createEvent("MouseEvents"),o.initMouseEvent(t,n.bubbles,n.cancelable,n.view,n.detail,n.screenX,n.screenY,n.clientX,n.clientY,n.ctrlKey,n.altKey,n.shiftKey,n.metaKey,n.button,n.relatedTarget||document.body.parentNode)):o=document.createEventObject(),e.dispatchEvent?e.dispatchEvent(o):e.fireEvent("on"+t,o)}},{}),window.Handsontable=window.Handsontable||{},Handsontable.countEventManagerListeners=0,Handsontable.eventManager=r},{"helpers/browser":43,"helpers/dom/element":45}],42:[function(e,t,o){"use strict";function n(e){for(var t=0,o=e.length;o>t;)e[t]=[e[t]],t++}function r(e,t){for(var o=0,n=t.length;n>o;)e.push(t[o]),o++}function i(e){var t=[];if(!e||0===e.length||!e[0]||0===e[0].length)return t;for(var o=e.length,n=e[0].length,r=0;o>r;r++)for(var i=0;n>i;i++)t[i]||(t[i]=[]),t[i][r]=e[r][i];return t}function s(e,t,o,n){var r=-1,i=e.length;for(n&&i&&(o=e[++r]);++rt?e:t},Array.isArray(e)?e[0]:void 0)}function h(e){return s(e,function(e,t){return t>e?e:t},Array.isArray(e)?e[0]:void 0)}function f(e){return e.length?c(e)/e.length:0}function g(e){return s(e,function(e,t){return e.concat(Array.isArray(t)?g(t):t)},[])}function p(e){var t=[];return u(e,function(e){-1===t.indexOf(e)&&t.push(e)}),t}Object.defineProperties(o,{to2dArray:{get:function(){return n}},extendArray:{get:function(){return r}},pivot:{get:function(){return i}},arrayReduce:{get:function(){return s}},arrayFilter:{get:function(){return l}},arrayMap:{get:function(){return a}},arrayEach:{get:function(){return u}},arraySum:{get:function(){return c}},arrayMax:{get:function(){return d}},arrayMin:{get:function(){return h}},arrayAvg:{get:function(){return f}},arrayFlatten:{get:function(){return g}},arrayUnique:{get:function(){return p}},__esModule:{value:!0}})},{}],43:[function(e,t,o){"use strict";function n(){return f}function r(){return g}function i(){return p}function s(){return m}function l(e){return e||(e=navigator.userAgent),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e)}function a(){return"ontouchstart"in window}function u(){var e=document.createElement("div");return e.createShadowRoot&&e.createShadowRoot.toString().match(/\[native code\]/)?!0:!1}function c(){var e=document.createElement("TABLE");e.style.borderSpacing=0,e.style.borderWidth=0,e.style.padding=0;var t=document.createElement("TBODY");e.appendChild(t),t.appendChild(document.createElement("TR")),t.firstChild.appendChild(document.createElement("TD")),t.firstChild.firstChild.innerHTML="t
t";var o=document.createElement("CAPTION");o.innerHTML="c
c
c
c",o.style.padding=0,o.style.margin=0,e.insertBefore(o,t),document.body.appendChild(e),h=e.offsetHeight<2*e.lastChild.offsetHeight,document.body.removeChild(e)}function d(){return void 0===h&&c(),h}Object.defineProperties(o,{isIE8:{get:function(){return n}},isIE9:{get:function(){return r}},isSafari:{get:function(){return i}},isChrome:{get:function(){return s}},isMobileBrowser:{get:function(){return l}},isTouchSupported:{get:function(){return a}},isWebComponentSupportedNatively:{get:function(){return u}},hasCaptionProblem:{get:function(){return d}},__esModule:{value:!0}});var h,f=!document.createTextNode("test").textContent,g=!!document.documentMode,p=/Safari/.test(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor),m=/Chrome/.test(navigator.userAgent)&&/Google/.test(navigator.vendor)},{}],44:[function(e,t,o){"use strict";function n(e){for(var t,o=e+1,n="";o>0;)t=(o-1)%26,n=String.fromCharCode(65+t)+n,o=parseInt((o-t)/26,10);return n}function r(e,t){e="number"==typeof e?e:100,t="number"==typeof t?t:4;var o,r,i=[];for(o=0;e>o;o++){var s=[];for(r=0;t>r;r++)s.push(n(r)+(o+1));i.push(s)}return i}function i(e,t){e="number"==typeof e?e:100,t="number"==typeof t?t:4;var o,r,i=[];for(o=0;e>o;o++){var s={};for(r=0;t>r;r++)s["prop"+r]=n(r)+(o+1);i.push(s)}return i}function s(e,t){for(var o,n=[],r=0;e>r;r++){o=[];for(var i=0;t>i;i++)o.push("");n.push(o)}return n}function l(e){var t,o,n,r,i=[],s=0;for(t=0,o=e.length;o>t;t++)for(n=0,r=e[t].length;r>n;n++)n==s&&(i.push([]),s++),i[n].push(e[t][n]);return i}function a(e,t){function o(e){var t=Handsontable.cellTypes[e];if("undefined"==typeof t)throw new Error('You declared cell type "'+e+'" as a string that is not mapped to a known object. Cell type must be an object or a string mapped to an object in Handsontable.cellTypes');return t}return t="undefined"==typeof t?!0:t,function(n,r){return function i(n){if(n){if(n.hasOwnProperty(e)&&void 0!==n[e])return n[e];if(n.hasOwnProperty("type")&&n.type){var r;if("string"!=typeof n.type)throw new Error("Cell type must be a string "); +if(r=o(n.type),r.hasOwnProperty(e))return r[e];if(t)return}return i(c(n))}}("number"==typeof n?this.getCellMeta(n,r):n)}}Object.defineProperties(o,{spreadsheetColumnLabel:{get:function(){return n}},createSpreadsheetData:{get:function(){return r}},createSpreadsheetObjectData:{get:function(){return i}},createEmptySpreadsheetData:{get:function(){return s}},translateRowsToColumns:{get:function(){return l}},cellMethodLookupFactory:{get:function(){return a}},__esModule:{value:!0}});var u,c=(u=e("object"),u&&u.__esModule&&u||{"default":u}).getPrototypeOf},{object:50}],45:[function(e,t,o){"use strict";function n(e,t,o){for(;null!=e&&e!==o;){if(e.nodeType===Node.ELEMENT_NODE&&(t.indexOf(e.nodeName)>-1||t.indexOf(e)>-1))return e;e=e.host&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.host:e.parentNode}return null}function r(e,t){var o=e.parentNode,n=[];for("string"==typeof t?n=Array.prototype.slice.call(document.querySelectorAll(t),0):n.push(t);null!=o;){if(n.indexOf(o)>-1)return!0;o=o.parentNode}return!1}function i(e){function t(e){return e.nodeType===Node.ELEMENT_NODE&&e.nodeName===n.toUpperCase()}var o,n="hot-table",r=!1;for(o=s(e);null!=o;){if(t(o)){r=!0;break}if(o.host&&o.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(r=t(o.host))break;o=o.host}o=o.parentNode}return r}function s(e){return"undefined"!=typeof Polymer&&"function"==typeof wrap?wrap(e):e}function l(e){return"undefined"!=typeof Polymer&&"function"==typeof unwrap?unwrap(e):e}function a(e){var t=0;if(e.previousSibling)for(;e=e.previousSibling;)++t;return t}function u(e,t){var o=document.querySelector(".ht_clone_"+e);return o?o.contains(t):null}function c(e){var t=0,o=[];if(!e||!e.length)return o;for(;e[t];)o.push(e[t]),t++;return o}function d(e,t){return Y(e,t)}function h(e,t){return X(e,t)}function f(e,t){return q(e,t)}function g(e,t){if(3===e.nodeType)t.removeChild(e);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(e.nodeName)>-1)for(var o=e.childNodes,n=o.length-1;n>=0;n--)g(o[n],e)}function p(e){for(var t;t=e.lastChild;)e.removeChild(t)}function m(e,t){se.test(t)?e.innerHTML=t:w(e,t)}function w(e,t){var o=e.firstChild;o&&3===o.nodeType&&null===o.nextSibling?le?o.textContent=t:o.data=t:(p(e),e.appendChild(document.createTextNode(t)))}function v(e){for(var t=e;l(t)!==document.documentElement;){if(null===t)return!1;if(t.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(t.host){if(t.host.impl)return v(t.host.impl);if(t.host)return v(t.host);throw new Error("Lost in Web Components world")}return!1}if("none"===t.style.display)return!1;t=t.parentNode}return!0}function b(e){var t,o,n,r,i;if(r=document.documentElement,te()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName)return i=e.getBoundingClientRect(),{top:i.top+(window.pageYOffset||r.scrollTop)-(r.clientTop||0),left:i.left+(window.pageXOffset||r.scrollLeft)-(r.clientLeft||0)};for(t=e.offsetLeft,o=e.offsetTop,n=e;(e=e.offsetParent)&&e!==document.body;)t+=e.offsetLeft,o+=e.offsetTop,n=e;return n&&"fixed"===n.style.position&&(t+=window.pageXOffset||r.scrollLeft,o+=window.pageYOffset||r.scrollTop),{left:t,top:o}}function C(){var e=window.scrollY;return void 0===e&&(e=document.documentElement.scrollTop),e}function y(){var e=window.scrollX;return void 0===e&&(e=document.documentElement.scrollLeft),e}function R(e){return e===window?C():e.scrollTop}function E(e){return e===window?y():e.scrollLeft}function S(e){for(var t,o,n,r=e.parentNode,i=["auto","scroll"],s="",l="",a="",u="";r&&r.style&&document.body!==r;){if(t=r.style.overflow,o=r.style.overflowX,n=r.style.overflowY,"scroll"==t||"scroll"==o||"scroll"==n)return r;if(window.getComputedStyle&&(s=window.getComputedStyle(r),l=s.getPropertyValue("overflow"),a=s.getPropertyValue("overflow-y"),u=s.getPropertyValue("overflow-x"),"scroll"===l||"scroll"===u||"scroll"===a))return r;if(r.clientHeight<=r.scrollHeight&&(-1!==i.indexOf(n)||-1!==i.indexOf(t)||-1!==i.indexOf(l)||-1!==i.indexOf(a)))return r;if(r.clientWidth<=r.scrollWidth&&(-1!==i.indexOf(o)||-1!==i.indexOf(t)||-1!==i.indexOf(l)||-1!==i.indexOf(u)))return r;r=r.parentNode}return window}function T(e){for(var t=e.parentNode;t&&t.style&&document.body!==t;){if("visible"!==t.style.overflow&&""!==t.style.overflow)return t;if(window.getComputedStyle){var o=window.getComputedStyle(t);if("visible"!==o.getPropertyValue("overflow")&&""!==o.getPropertyValue("overflow"))return t}t=t.parentNode}return window}function O(e,t){if(e){if(e!==window){var o,n=e.style[t];return""!==n&&void 0!==n?n:(o=_(e),""!==o[t]&&void 0!==o[t]?o[t]:void 0)}if("width"===t)return window.innerWidth+"px";if("height"===t)return window.innerHeight+"px"}}function _(e){return e.currentStyle||document.defaultView.getComputedStyle(e)}function M(e){return e.offsetWidth}function H(e){return te()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName?e.offsetHeight+e.firstChild.offsetHeight:e.offsetHeight}function k(e){return e.clientHeight||e.innerHeight}function A(e){return e.clientWidth||e.innerWidth}function P(e,t,o){window.addEventListener?e.addEventListener(t,o,!1):e.attachEvent("on"+t,o)}function x(e,t,o){window.removeEventListener?e.removeEventListener(t,o,!1):e.detachEvent("on"+t,o)}function D(e){if(e.selectionStart)return e.selectionStart;if(document.selection){e.focus();var t=document.selection.createRange();if(null==t)return 0;var o=e.createTextRange(),n=o.duplicate();return o.moveToBookmark(t.getBookmark()),n.setEndPoint("EndToStart",o),n.text.length}return 0}function N(e){if(e.selectionEnd)return e.selectionEnd;if(document.selection){var t=document.selection.createRange();if(null==t)return 0;var o=e.createTextRange();return o.text.indexOf(t.text)+t.text.length}}function L(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e}function W(e,t,o){if(void 0===o&&(o=t),e.setSelectionRange){e.focus();try{e.setSelectionRange(t,o)}catch(n){var r=e.parentNode,i=r.style.display;r.style.display="block",e.setSelectionRange(t,o),r.style.display=i}}else if(e.createTextRange){var s=e.createTextRange();s.collapse(!0),s.moveEnd("character",o),s.moveStart("character",t),s.select()}}function I(){var e=document.createElement("p");e.style.width="100%",e.style.height="200px";var t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),(document.body||document.documentElement).appendChild(t);var o=e.offsetWidth;t.style.overflow="scroll";var n=e.offsetWidth;return o==n&&(n=t.clientWidth),(document.body||document.documentElement).removeChild(t),o-n}function j(){return void 0===ie&&(ie=I()),ie}function B(e,t,o){J()||Z()?(e.style.top=o,e.style.left=t):ee()?e.style["-webkit-transform"]="translate3d("+t+","+o+",0)":e.style.transform="translate3d("+t+","+o+",0)"}function V(e){var t;return e.style.transform&&""!==(t=e.style.transform)?["transform",t]:e.style["-webkit-transform"]&&""!==(t=e.style["-webkit-transform"])?["-webkit-transform",t]:-1}function F(e){e.transform&&""!==e.transform?e.transform="":e["-webkit-transform"]&&""!==e["-webkit-transform"]&&(e["-webkit-transform"]="")}function z(e){var t=["INPUT","SELECT","TEXTAREA"];return t.indexOf(e.nodeName)>-1||"true"===e.contentEditable}function U(e){return z(e)&&-1==e.className.indexOf("handsontableInput")&&-1==e.className.indexOf("copyPaste")}function G(e){return ce.call(window,e)}function $(e){de.call(window,e)}Object.defineProperties(o,{closest:{get:function(){return n}},isChildOf:{get:function(){return r}},isChildOfWebComponentTable:{get:function(){return i}},polymerWrap:{get:function(){return s}},polymerUnwrap:{get:function(){return l}},index:{get:function(){return a}},overlayContainsElement:{get:function(){return u}},hasClass:{get:function(){return d}},addClass:{get:function(){return h}},removeClass:{get:function(){return f}},removeTextNodes:{get:function(){return g}},empty:{get:function(){return p}},HTML_CHARACTERS:{get:function(){return se}},fastInnerHTML:{get:function(){return m}},fastInnerText:{get:function(){return w}},isVisible:{get:function(){return v}},offset:{get:function(){return b}},getWindowScrollTop:{get:function(){return C}},getWindowScrollLeft:{get:function(){return y}},getScrollTop:{get:function(){return R}},getScrollLeft:{get:function(){return E}},getScrollableElement:{get:function(){return S}},getTrimmingContainer:{get:function(){return T}},getStyle:{get:function(){return O}},getComputedStyle:{get:function(){return _}},outerWidth:{get:function(){return M}},outerHeight:{get:function(){return H}},innerHeight:{get:function(){return k}},innerWidth:{get:function(){return A}},addEvent:{get:function(){return P}},removeEvent:{get:function(){return x}},getCaretPosition:{get:function(){return D}},getSelectionEndPosition:{get:function(){return N}},getSelectionText:{get:function(){return L}},setCaretPosition:{get:function(){return W}},getScrollbarWidth:{get:function(){return j}},setOverlayPosition:{get:function(){return B}},getCssTransform:{get:function(){return V}},resetCssTransform:{get:function(){return F}},isInput:{get:function(){return z}},isOutsideInput:{get:function(){return U}},requestAnimationFrame:{get:function(){return G}},cancelAnimationFrame:{get:function(){return $}},__esModule:{value:!0}});var K,Y,X,q,Q=(K=e("../browser"),K&&K.__esModule&&K||{"default":K}),J=Q.isIE8,Z=Q.isIE9,ee=Q.isSafari,te=Q.hasCaptionProblem,oe=document.documentElement.classList?!0:!1;if(oe){var ne=function(){var e=document.createElement("div");return e.classList.add("test","test2"),e.classList.contains("test2")}();Y=function(e,t){return""===t?!1:e.classList.contains(t)},X=function(e,t){var o=0;if("string"==typeof t&&(t=t.split(" ")),t=c(t),ne)e.classList.add.apply(e.classList,t);else for(;t&&t[o];)e.classList.add(t[o]),o++},q=function(e,t){var o=0;if("string"==typeof t&&(t=t.split(" ")),t=c(t),ne)e.classList.remove.apply(e.classList,t);else for(;t&&t[o];)e.classList.remove(t[o]),o++}}else{var re=function(e){return new RegExp("(\\s|^)"+e+"(\\s|$)")};Y=function(e,t){return e.className.match(re(t))?!0:!1},X=function(e,t){var o=0,n=e.className;if("string"==typeof t&&(t=t.split(" ")),""===n)n=t.join(" ");else for(;t&&t[o];)re(t[o]).test(n)||(n+=" "+t[o]),o++;e.className=n},q=function(e,t){var o=0,n=e.className;for("string"==typeof t&&(t=t.split(" "));t&&t[o];)n=n.replace(re(t[o])," ").trim(),o++;e.className!==n&&(e.className=n)}}for(var ie,se=/(<(.*)>|&(.*);)/,le=document.createTextNode("test").textContent?!0:!1,ae=0,ue=["ms","moz","webkit","o"],ce=window.requestAnimationFrame,de=window.cancelAnimationFrame,he=0;he=t&&o(n)!==!1;);}function s(e,t){return t=parseInt(t.toString().replace("%",""),10),t=parseInt(e*t/100)}Object.defineProperties(o,{isNumeric:{get:function(){return n}},rangeEach:{get:function(){return r}},rangeEachReverse:{get:function(){return i}},valueAccordingPercent:{get:function(){return s}},__esModule:{value:!0}})},{}],50:[function(e,t,o){"use strict";function n(e){var t;return Array.isArray(e)?t=[]:(t={},g(e,function(e,o){e&&"object"==typeof e&&!Array.isArray(e)?t[o]=n(e):Array.isArray(e)?e.length&&"object"==typeof e[0]&&!Array.isArray(e[0])?t[o]=[n(e[0])]:t[o]=[]:t[o]=null})),t}function r(e,t){return t.prototype.constructor=t,e.prototype=new t,e.prototype.constructor=e,e}function i(e,t){return g(t,function(t,o){e[o]=t}),e}function s(e,t){g(t,function(o,n){t[n]&&"object"==typeof t[n]?(e[n]||(Array.isArray(t[n])?e[n]=[]:e[n]={}),s(e[n],t[n])):e[n]=t[n]})}function l(e){return"object"==typeof e?JSON.parse(JSON.stringify(e)):e}function a(e){var t={};return g(e,function(e,o){t[o]=e}),t}function u(e){for(var t=[],o=1;on;n++)o.prototype[t[n]]=void 0;return o}Object.defineProperties(o,{columnFactory:{get:function(){return n}},__esModule:{value:!0}});var r,i=(r=e("object"),r&&r.__esModule&&r||{"default":r}).inherit},{object:50}],52:[function(e,t,o){"use strict";function n(e){return e[0].toUpperCase()+e.substr(1)}function r(e,t){var o=!0;return g(t.length-1,function(n){return e.charAt(n)!==t.charAt(n)?(o=!1,!1):void 0}),o}function i(e,t){var o=!0,n=t.length-1,r=e.length-1;return g(n,function(i){var s=r-i,l=n-i;return e.charAt(s)!==t.charAt(l)?(o=!1,!1):void 0}),o}function s(){for(var e=[],t=0;t=t)return e;o=String(o);var n=o.length;n||(o=" ");var r=t-e.length,i=Math.ceil(r/o.length),s="";return g(i,function(e){s+=o}),s=s.slice(0,r),s+e}Object.defineProperties(o,{toUpperCaseFirst:{get:function(){return n}},startsWith:{get:function(){return r}},endsWith:{get:function(){return i}},equalsIgnoreCase:{get:function(){return s}},randomString:{get:function(){return l}},isPercentValue:{get:function(){return a}},substitute:{get:function(){return u}},padStart:{get:function(){return c}},__esModule:{value:!0}});var d,h,f=(d=e("mixed"),d&&d.__esModule&&d||{"default":d}).stringify,g=(h=e("number"),h&&h.__esModule&&h||{"default":h}).rangeEach},{mixed:48,number:49}],53:[function(e,t,o){"use strict";function n(e){return 32==e||e>=48&&57>=e||e>=96&&111>=e||e>=186&&192>=e||e>=219&&222>=e||e>=226||e>=65&&90>=e}function r(e){var t=[u.ARROW_DOWN,u.ARROW_UP,u.ARROW_LEFT,u.ARROW_RIGHT,u.HOME,u.END,u.DELETE,u.BACKSPACE,u.F1,u.F2,u.F3,u.F4,u.F5,u.F6,u.F7,u.F8,u.F9,u.F10,u.F11,u.F12,u.TAB,u.PAGE_DOWN,u.PAGE_UP,u.ENTER,u.ESCAPE,u.SHIFT,u.CAPS_LOCK,u.ALT];return-1!==t.indexOf(e)}function i(e){return-1!==[u.CONTROL_LEFT,224,u.COMMAND_LEFT,u.COMMAND_RIGHT].indexOf(e)}function s(e,t){var o=t.split("|"),n=!1;return a(o,function(t){return e===u[t]?(n=!0,!1):void 0}),n}Object.defineProperties(o,{KEY_CODES:{get:function(){return u}},isPrintableChar:{get:function(){return n}},isMetaKey:{get:function(){return r}},isCtrlKey:{get:function(){return i}},isKey:{get:function(){return s}},__esModule:{value:!0}});var l,a=(l=e("array"),l&&l.__esModule&&l||{"default":l}).arrayEach,u={MOUSE_LEFT:1,MOUSE_RIGHT:3,MOUSE_MIDDLE:2,BACKSPACE:8,COMMA:188,INSERT:45,DELETE:46,END:35,ENTER:13,ESCAPE:27,CONTROL_LEFT:91,COMMAND_LEFT:17,COMMAND_RIGHT:93,ALT:18,HOME:36,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,SPACE:32,SHIFT:16,CAPS_LOCK:20,TAB:9,ARROW_RIGHT:39,ARROW_LEFT:37,ARROW_UP:38,ARROW_DOWN:40,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,A:65,X:88,C:67,V:86}},{array:42}],54:[function(e,t,o){"use strict";Object.defineProperties(o,{localHooks:{get:function(){return a}},__esModule:{value:!0}});var n,r,i=(n=e("helpers/array"),n&&n.__esModule&&n||{"default":n}).arrayEach,s=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).defineGetter,l="localHooks",a={_localHooks:Object.create(null),addLocalHook:function(e,t){this._localHooks[e]||(this._localHooks[e]=[]),this._localHooks[e].push(t)},runLocalHooks:function(e){for(var t=[],o=1;o=0?(t.skip=!0,!0):!1},has:function(e){var t=void 0!==arguments[1]?arguments[1]:null,o=this.getBucket(t);return void 0!==o[e]&&o[e].length?!0:!1},run:function(e,t,o,n,r,i,s,l){var a=this.globalBucket[t],u=-1,c=a?a.length:0;if(c)for(;++u=0},getRegistered:function(){return i}},{}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.Hooks=a},{"helpers/array":42,"helpers/object":50}],57:[function(e,t,o){"use strict";function n(e,t){e=c(e),Handsontable.plugins[e]=t,Handsontable.hooks.add("construct",function(){var o;d.has(this)||d.set(this,{}),o=d.get(this),o[e]||(o[e]=new t(this))}),Handsontable.hooks.add("afterDestroy",function(){if(d.has(this)){var e=d.get(this);u(e,function(e){return e.destroy()}),d["delete"](this)}})}function r(e,t){if("string"!=typeof t)throw Error('Only strings can be passed as "plugin" parameter');var o=c(t);if(d.has(e)&&d.get(e)[o])return d.get(e)[o]}function i(e){return d.has(e)?Object.keys(d.get(e)):[]}function s(e,t){var o=null;return d.has(e)&&u(d.get(e),function(e,n){e===t&&(o=n)}),o}Object.defineProperties(o,{registerPlugin:{get:function(){return n}},getPlugin:{get:function(){return r}},getRegistredPluginNames:{get:function(){return i}},getPluginName:{get:function(){return s}},__esModule:{value:!0}});var l,a,u=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}).objectEach,c=(a=e("helpers/string"),a&&a.__esModule&&a||{"default":a}).toUpperCaseFirst,d=new WeakMap;Handsontable.plugins=Handsontable.plugins||{},Handsontable.plugins.utils=Handsontable.plugins.utils||{},Handsontable.plugins.registerPlugin=n},{"helpers/object":50,"helpers/string":52}],58:[function(e,t,o){"use strict";Object.defineProperties(o,{"default":{get:function(){return m}},__esModule:{value:!0}});var n,r,i,s=(n=e("helpers/object"),n&&n.__esModule&&n||{"default":n}),l=s.defineGetter,a=s.objectEach,u=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,c=(i=e("plugins"),i&&i.__esModule&&i||{"default":i}),d=c.getRegistredPluginNames,h=c.getPluginName,f=new WeakMap,g=null,p=function(e){var t=this;l(this,"hot",e,{writable:!1}),f.set(this,{hooks:{}}),g=null,this.pluginName=null,this.pluginsInitializedCallbacks=[],this.isPluginsReady=!1,this.enabled=!1,this.initialized=!1,this.hot.addHook("afterPluginsInitialized",function(){return t.onAfterPluginsInitialized()}),this.hot.addHook("afterUpdateSettings",function(){return t.onUpdateSettings()}),this.hot.addHook("beforeInit",function(){return t.init()})};$traceurRuntime.createClass(p,{init:function(){this.pluginName=h(this.hot,this),this.isEnabled&&this.isEnabled()&&this.enablePlugin(),g||(g=d(this.hot)),g.indexOf(this.pluginName)>=0&&g.splice(g.indexOf(this.pluginName),1),g.length||this.hot.runHooks("afterPluginsInitialized"),this.initialized=!0},enablePlugin:function(){this.enabled=!0},disablePlugin:function(){this.eventManager&&this.eventManager.clear(),this.clearHooks(),this.enabled=!1},addHook:function(e,t){var o=f.get(this).hooks[e]=f.get(this).hooks[e]||[];this.hot.addHook(e,t),o.push(t),f.get(this).hooks[e]=o},removeHooks:function(e){var t=this;u(f.get(this).hooks[e]||[],function(o){t.hot.removeHook(e,o)})},clearHooks:function(){var e=this,t=f.get(this).hooks;a(t,function(t,o){return e.removeHooks(o)}),t.length=0},callOnPluginsReady:function(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)},onAfterPluginsInitialized:function(){u(this.pluginsInitializedCallbacks,function(e){return e()}),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0},onUpdateSettings:function(){this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&this.updatePlugin())},updatePlugin:function(){},destroy:function(){var e=this;this.eventManager&&this.eventManager.destroy(),this.clearHooks(),a(this,function(t,o){"hot"!==o&&(e[o]=null)}),delete this.hot}},{});var m=p;Handsontable.plugins.BasePlugin=p},{"helpers/array":42,"helpers/object":50,plugins:57}],59:[function(e,t,o){"use strict";Object.defineProperties(o,{AutoColumnSize:{get:function(){return A}},__esModule:{value:!0}});var n,r,i,s,l,a,u,c,d,h,f=(n=e("_base"),n&&n.__esModule&&n||{"default":n})["default"],g=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),p=g.arrayEach,m=g.arrayFilter,w=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),v=w.cancelAnimationFrame,b=w.requestAnimationFrame,C=w.isVisible,y=(s=e("utils/ghostTable"),s&&s.__esModule&&s||{"default":s}).GhostTable,R=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),E=R.isObject,S=(R.objectEach,a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}),T=S.valueAccordingPercent,O=S.rangeEach,_=(u=e("plugins"),u&&u.__esModule&&u||{"default":u}).registerPlugin,M=(c=e("utils/samplesGenerator"),c&&c.__esModule&&c||{"default":c}).SamplesGenerator,H=(d=e("helpers/string"),d&&d.__esModule&&d||{"default":d}).isPercentValue,k=(h=e("3rdparty/walkontable/src/calculator/viewportColumns"),h&&h.__esModule&&h||{"default":h}).WalkontableViewportColumnsCalculator,A=function(e){var t=this;$traceurRuntime.superConstructor(P).call(this,e),this.widths=[],this.ghostTable=new y(this.hot),this.samplesGenerator=new M(function(e,o){return t.hot.getDataAtCell(e,o)}),this.firstCalculation=!0,this.inProgress=!1,this.addHook("beforeColumnResize",function(e,o,n){return t.onBeforeColumnResize(e,o,n)})},P=A;$traceurRuntime.createClass(A,{isEnabled:function(){return this.hot.getSettings().autoColumnSize!==!1&&!this.hot.getSettings().colWidths},enablePlugin:function(){var e=this;if(!this.enabled){var t=this.hot.getSettings().autoColumnSize,o=t&&t.hasOwnProperty("samplingRatio")?this.hot.getSettings().autoColumnSize.samplingRatio:void 0;o&&!isNaN(o)&&(this.samplesGenerator.customSampleCount=parseInt(o,10)),this.addHook("afterLoadData",function(){return e.onAfterLoadData()}),this.addHook("beforeChange",function(t){return e.onBeforeChange(t)}),this.addHook("beforeRender",function(t){return e.onBeforeRender(t)}),this.addHook("modifyColWidth",function(t,o){return e.getColumnWidth(o,t)}),$traceurRuntime.superGet(this,P.prototype,"enablePlugin").call(this)}},disablePlugin:function(){$traceurRuntime.superGet(this,P.prototype,"disablePlugin").call(this)},calculateColumnsWidth:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countRows()-1},o=void 0!==arguments[2]?arguments[2]:!1,n=this;"number"==typeof e&&(e={from:e,to:e}),"number"==typeof t&&(t={from:t,to:t}),O(e.from,e.to,function(e){if(o||void 0===n.widths[e]&&!n.hot._getColWidthFromSettings(e)){var r=n.samplesGenerator.generateColumnSamples(e,t);r.forEach(function(e,t){return n.ghostTable.addColumn(t,e)})}}),this.ghostTable.columns.length&&(this.ghostTable.getWidths(function(e,t){return n.widths[e]=t}),this.ghostTable.clean())},calculateAllColumnsWidth:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=this,o=0,n=this.hot.countCols()-1,r=null;this.inProgress=!0;var i=function(){return t.hot?(t.calculateColumnsWidth({from:o,to:Math.min(o+P.CALCULATION_STEP,n)},e),o=o+P.CALCULATION_STEP+1,void(n>o?r=b(i):(v(r),t.inProgress=!1,t.hot.view.wt.wtOverlays.adjustElementsSize(!0),t.hot.view.wt.wtOverlays.leftOverlay.needFullRender&&t.hot.view.wt.wtOverlays.leftOverlay.clone.draw()))):(v(r),void(t.inProgress=!1))};this.firstCalculation&&this.getSyncCalculationLimit()&&(this.calculateColumnsWidth({from:0,to:this.getSyncCalculationLimit()},e),this.firstCalculation=!1,o=this.getSyncCalculationLimit()+1),n>o?i():this.inProgress=!1},recalculateAllColumnsWidth:function(){this.hot.view&&C(this.hot.view.wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllColumnsWidth())},getSyncCalculationLimit:function(){var e=P.SYNC_CALCULATION_LIMIT,t=this.hot.countCols()-1; +return E(this.hot.getSettings().autoColumnSize)&&(e=this.hot.getSettings().autoColumnSize.syncLimit,H(e)?e=T(t,e):e>>=0),Math.min(e,t)},getColumnWidth:function(e){var t=arguments[1],o=void 0!==arguments[2]?arguments[2]:!0,n=t;return void 0===n&&(n=this.widths[e],o&&"number"==typeof n&&(n=Math.max(n,k.DEFAULT_WIDTH))),n},getFirstVisibleColumn:function(){var e=this.hot.view.wt;return e.wtViewport.columnsVisibleCalculator?e.wtTable.getFirstVisibleColumn():e.wtViewport.columnsRenderCalculator?e.wtTable.getFirstRenderedColumn():-1},getLastVisibleColumn:function(){var e=this.hot.view.wt;return e.wtViewport.columnsVisibleCalculator?e.wtTable.getLastVisibleColumn():e.wtViewport.columnsRenderCalculator?e.wtTable.getLastRenderedColumn():-1},clearCache:function(){this.widths.length=0},isNeedRecalculate:function(){return m(this.widths,function(e){return void 0===e}).length?!0:!1},onBeforeRender:function(){var e=this.hot.renderCall;this.calculateColumnsWidth({from:this.getFirstVisibleColumn(),to:this.getLastVisibleColumn()},void 0,e),this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllColumnsWidth()},onAfterLoadData:function(){var e=this;this.hot.view?this.recalculateAllColumnsWidth():setTimeout(function(){e.hot&&e.recalculateAllColumnsWidth()},0)},onBeforeChange:function(e){var t=this;p(e,function(e){return t.widths[e[1]]=void 0})},onBeforeColumnResize:function(e,t,o){return o&&(this.calculateColumnsWidth(e,void 0,!0),t=this.getColumnWidth(e,void 0,!1)),t},destroy:function(){this.ghostTable.clean(),$traceurRuntime.superGet(this,P.prototype,"destroy").call(this)}},{get CALCULATION_STEP(){return 50},get SYNC_CALCULATION_LIMIT(){return 50}},f),_("autoColumnSize",A)},{"3rdparty/walkontable/src/calculator/viewportColumns":3,_base:58,"helpers/array":42,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/string":52,plugins:57,"utils/ghostTable":98,"utils/samplesGenerator":99}],60:[function(e,t,o){"use strict";Object.defineProperties(o,{AutoRowSize:{get:function(){return M}},__esModule:{value:!0}});var n,r,i,s,l,a,u,c,d,h=(n=e("_base"),n&&n.__esModule&&n||{"default":n})["default"],f=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),g=(f.arrayEach,f.arrayFilter),p=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),m=p.cancelAnimationFrame,w=p.requestAnimationFrame,v=p.isVisible,b=(s=e("utils/ghostTable"),s&&s.__esModule&&s||{"default":s}).GhostTable,C=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),y=C.isObject,R=(C.objectEach,a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}),E=R.valueAccordingPercent,S=R.rangeEach,T=(u=e("plugins"),u&&u.__esModule&&u||{"default":u}).registerPlugin,O=(c=e("utils/samplesGenerator"),c&&c.__esModule&&c||{"default":c}).SamplesGenerator,_=(d=e("helpers/string"),d&&d.__esModule&&d||{"default":d}).isPercentValue,M=function(e){var t=this;$traceurRuntime.superConstructor(H).call(this,e),this.heights=[],this.ghostTable=new b(this.hot),this.samplesGenerator=new O(function(e,o){return t.hot.getDataAtCell(e,o)}),this.firstCalculation=!0,this.inProgress=!1,this.addHook("beforeRowResize",function(e,o,n){return t.onBeforeRowResize(e,o,n)})},H=M;$traceurRuntime.createClass(M,{isEnabled:function(){return this.hot.getSettings().autoRowSize===!0||y(this.hot.getSettings().autoRowSize)},enablePlugin:function(){var e=this;if(!this.enabled){var t=this.hot.getSettings().autoRowSize,o=t&&t.hasOwnProperty("samplingRatio")?this.hot.getSettings().autoRowSize.samplingRatio:void 0;o&&!isNaN(o)&&(this.samplesGenerator.customSampleCount=parseInt(o,10)),this.addHook("afterLoadData",function(){return e.onAfterLoadData()}),this.addHook("beforeChange",function(t){return e.onBeforeChange(t)}),this.addHook("beforeColumnMove",function(){return e.recalculateAllRowsHeight()}),this.addHook("beforeColumnResize",function(){return e.recalculateAllRowsHeight()}),this.addHook("beforeColumnSort",function(){return e.clearCache()}),this.addHook("beforeRender",function(t){return e.onBeforeRender(t)}),this.addHook("beforeRowMove",function(t,o){return e.onBeforeRowMove(t,o)}),this.addHook("modifyRowHeight",function(t,o){return e.getRowHeight(o,t)}),$traceurRuntime.superGet(this,H.prototype,"enablePlugin").call(this)}},disablePlugin:function(){$traceurRuntime.superGet(this,H.prototype,"disablePlugin").call(this)},calculateRowsHeight:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countCols()-1},o=void 0!==arguments[2]?arguments[2]:!1,n=this;"number"==typeof e&&(e={from:e,to:e}),"number"==typeof t&&(t={from:t,to:t}),S(e.from,e.to,function(e){if(o||void 0===n.heights[e]){var r=n.samplesGenerator.generateRowSamples(e,t);r.forEach(function(e,t){return n.ghostTable.addRow(t,e)})}}),this.ghostTable.rows.length&&(this.ghostTable.getHeights(function(e,t){return n.heights[e]=t}),this.ghostTable.clean())},calculateAllRowsHeight:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=this,o=0,n=this.hot.countRows()-1,r=null;this.inProgress=!0;var i=function(){return t.hot?(t.calculateRowsHeight({from:o,to:Math.min(o+H.CALCULATION_STEP,n)},e),o=o+H.CALCULATION_STEP+1,void(n>o?r=w(i):(m(r),t.inProgress=!1,t.hot.view.wt.wtOverlays.adjustElementsSize(!0),t.hot.view.wt.wtOverlays.leftOverlay.needFullRender&&t.hot.view.wt.wtOverlays.leftOverlay.clone.draw()))):(m(r),void(t.inProgress=!1))};this.firstCalculation&&this.getSyncCalculationLimit()&&(this.calculateRowsHeight({from:0,to:this.getSyncCalculationLimit()},e),this.firstCalculation=!1,o=this.getSyncCalculationLimit()+1),n>o?i():this.inProgress=!1},recalculateAllRowsHeight:function(){v(this.hot.view.wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllRowsHeight())},getSyncCalculationLimit:function(){var e=H.SYNC_CALCULATION_LIMIT,t=this.hot.countRows()-1;return y(this.hot.getSettings().autoRowSize)&&(e=this.hot.getSettings().autoRowSize.syncLimit,_(e)?e=E(t,e):e>>=0),Math.min(e,t)},getRowHeight:function(e){var t=arguments[1],o=t;return void 0!==this.heights[e]&&this.heights[e]>(t||0)&&(o=this.heights[e]),o},getFirstVisibleRow:function(){var e=this.hot.view.wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getFirstVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getFirstRenderedRow():-1},getLastVisibleRow:function(){var e=this.hot.view.wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getLastVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getLastRenderedRow():-1},clearCache:function(){this.heights.length=0},clearCacheByRange:function(e){var t=this;"number"==typeof e&&(e={from:e,to:e}),S(Math.min(e.from,e.to),Math.max(e.from,e.to),function(e){return t.heights[e]=void 0})},isNeedRecalculate:function(){return g(this.heights,function(e){return void 0===e}).length?!0:!1},onBeforeRender:function(){var e=this.hot.renderCall;this.calculateRowsHeight({from:this.getFirstVisibleRow(),to:this.getLastVisibleRow()},void 0,e),this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllRowsHeight()},onBeforeRowMove:function(e,t){this.clearCacheByRange({from:e,to:t}),this.calculateAllRowsHeight()},onBeforeRowResize:function(e,t,o){return o&&(this.calculateRowsHeight(e,void 0,!0),t=this.getRowHeight(e)),t},onAfterLoadData:function(){var e=this;this.hot.view?this.recalculateAllRowsHeight():setTimeout(function(){e.hot&&e.recalculateAllRowsHeight()},0)},onBeforeChange:function(e){var t=null;1===e.length?t=e[0][0]:e.length>1&&(t={from:e[0][0],to:e[e.length-1][0]}),null!==t&&this.clearCacheByRange(t)},destroy:function(){this.ghostTable.clean(),$traceurRuntime.superGet(this,H.prototype,"destroy").call(this)}},{get CALCULATION_STEP(){return 50},get SYNC_CALCULATION_LIMIT(){return 500}},h),T("autoRowSize",M)},{_base:58,"helpers/array":42,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/string":52,plugins:57,"utils/ghostTable":98,"utils/samplesGenerator":99}],61:[function(e,t,o){"use strict";function n(e,t,o,n){var r,i,s,l,a,u=o.length,c=o?o[0].length:0,d=[],h=[];if(r=t.row-e.row,i=t.col-e.col,-1!==["down","up"].indexOf(n)){for(var f=0;i>=f;f++)s=parseInt(o[0][f],10),l=parseInt(o[u-1][f],10),a=("down"===n?l-s:s-l)/(u-1)||0,h.push(a);d.push(h)}if(-1!==["right","left"].indexOf(n))for(var g=0;r>=g;g++)s=parseInt(o[g][0],10),l=parseInt(o[g][c-1],10),a=("right"===n?l-s:s-l)/(c-1)||0,h=[],h.push(a),d.push(h);return d}function r(e){function t(t){return e.autofill?void(e.autofill.handle&&e.autofill.handle.isDragged&&(e.autofill.handle.isDragged>1&&e.autofill.apply(),e.autofill.handle.isDragged=0,l=!1)):!0}function o(e){var t,o;return s.instance.autofill?(t=c(s.instance.table).top-(window.pageYOffset||document.documentElement.scrollTop)+d(s.instance.table),o=c(s.instance.table).left-(window.pageXOffset||document.documentElement.scrollLeft)+h(s.instance.table),s.addingStarted===!1&&s.instance.autofill.handle.isDragged>0&&e.clientY>t&&e.clientX<=o?(s.instance.mouseDragOutside=!0,s.addingStarted=!0):s.instance.mouseDragOutside=!1,void(s.instance.mouseDragOutside&&setTimeout(function(){s.addingStarted=!1,s.instance.alter("insert_row")},200))):!1}var n,r,i,s=this,l=!1;this.instance=e,this.addingStarted=!1,i=f(e),i.addEventListener(document,"mouseup",t),i.addEventListener(document,"mousemove",o),n=this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown,this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown=function(t){e.autofill.handle.isDragged=1,l=!0,n(t)},r=this.instance.view.wt.wtSettings.settings.onCellMouseOver,this.instance.view.wt.wtSettings.settings.onCellMouseOver=function(t,o,n,i){e.autofill&&l&&!e.view.isMouseDown()&&e.autofill.handle&&e.autofill.handle.isDragged&&(e.autofill.handle.isDragged++,e.autofill.showBorder(o),e.autofill.checkIfNewRowNeeded()),r(t,o,n,i)},this.instance.view.wt.wtSettings.settings.onCellCornerDblClick=function(){e.autofill.selectAdjacent()}}Object.defineProperties(o,{Autofill:{get:function(){return r}},__esModule:{value:!0}});var i,s,l,a,u=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),c=u.offset,d=u.outerHeight,h=u.outerWidth,f=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).eventManager,g=((l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin,(a=e("3rdparty/walkontable/src/cell/coords"),a&&a.__esModule&&a||{"default":a}).WalkontableCellCoords);r.prototype.init=function(){this.handle={}},r.prototype.disable=function(){this.handle.disabled=!0},r.prototype.selectAdjacent=function(){var e,t,o,n,r;e=this.instance.selection.isMultiple()?this.instance.view.wt.selections.area.getCorners():this.instance.view.wt.selections.current.getCorners(),t=this.instance.getData();e:for(o=e[2]+1;ot[3]?(s="right",o=new g(e[0],t[3]+1),r=new g(e[2],e[3])):e[0]t[2]&&e[1]===t[1]&&(s="down",o=new g(t[2]+1,e[1]),r=new g(e[2],e[3])),o&&o.row>-1&&o.col>-1?(a={from:this.instance.getSelectedRange().from,to:this.instance.getSelectedRange().to},i=this.instance.getData(a.from.row,a.from.col,a.to.row,a.to.col),l=n(o,r,i,s),Handsontable.hooks.run(this.instance,"beforeAutofill",o,r,i),this.instance.populateFromArray(o.row,o.col,i,r.row,r.col,"autofill",null,s,l),this.instance.selection.setRangeStart(new g(e[0],e[1])),this.instance.selection.setRangeEnd(new g(e[2],e[3]))):this.instance.selection.refreshBorders())},r.prototype.showBorder=function(e){var t=this.instance.getSelectedRange().getTopLeftCorner(),o=this.instance.getSelectedRange().getBottomRightCorner();if("horizontal"!==this.instance.getSettings().fillHandle&&(o.rowe.row))e=new g(e.row,o.col);else{if("vertical"===this.instance.getSettings().fillHandle)return;e=new g(o.row,e.col)}this.instance.view.wt.selections.fill.clear(),this.instance.view.wt.selections.fill.add(this.instance.getSelectedRange().from),this.instance.view.wt.selections.fill.add(this.instance.getSelectedRange().to),this.instance.view.wt.selections.fill.add(e),this.instance.view.render()},r.prototype.checkIfNewRowNeeded=function(){var e,t,o=this.instance.countRows(),n=this;this.instance.view.wt.selections.fill.cellRange&&this.addingStarted===!1&&(t=this.instance.getSelected(),e=this.instance.view.wt.selections.fill.getCorners(),t[2]o[1]?e?1:-1:0}},dateSort:function(e){return function(t,o){if(t[1]===o[1])return 0;if(null===t[1]||""===t[1])return 1;if(null===o[1]||""===o[1])return-1;var n=new Date(t[1]),r=new Date(o[1]);return r>n?e?-1:1:n>r?e?1:-1:0}},sort:function(){if("undefined"==typeof this.hot.sortOrder)return void(this.hot.sortIndex.length=0);var e,t;this.hot.sortingEnabled=!1,this.hot.sortIndex.length=0;for(var o=this.hot.colOffset(),n=0,r=this.hot.countRows()-this.hot.getSettings().minSpareRows;r>n;n++)this.hot.sortIndex.push([n,this.hot.getDataAtCell(n,this.hot.sortColumn+o)]);switch(e=this.hot.getCellMeta(0,this.hot.sortColumn),this.sortIndicators[this.hot.sortColumn]=e.sortIndicator,e.type){case"date":t=this.dateSort;break;default:t=this.defaultSort}this.hot.sortIndex.sort(t(this.hot.sortOrder));for(var n=this.hot.sortIndex.length;n=0&&-1===r&&u(o,"columnSorting"),f(o,"descending"),f(o,"ascending"),this.sortIndicators[e]&&e===this.hot.sortColumn&&("ascending"===this.sortOrderClass?u(o,"ascending"):"descending"===this.sortOrderClass&&u(o,"descending")))},isSorted:function(){return"undefined"!=typeof this.hot.sortColumn},afterCreateRow:function(e,t){if(this.isSorted()){for(var o=0;o=e&&(this.hot.sortIndex[o][0]+=t);for(var o=0;t>o;o++)this.hot.sortIndex.splice(e+o,0,[e+o,this.hot.getSourceData()[e+o][this.hot.sortColumn+this.hot.colOffset()]]);this.saveSortingState()}},afterRemoveRow:function(e,t){function o(e){return m(n,function(t,o){return e>o&&t++,t},0)}if(this.isSorted()){var n=this.hot.sortIndex.splice(e,t);n=p(n,function(e){return e[0]}),this.hot.sortIndex=p(this.hot.sortIndex,function(e,t){var n=o(e[0]);return n&&(e[0]-=n),e}),this.saveSortingState()}}},{},v),b("columnSorting",C)},{_base:58,eventManager:41,"helpers/array":42,"helpers/dom/element":45,plugins:57}],63:[function(e,t,o){"use strict";Object.defineProperties(o,{CommentEditor:{get:function(){return i}},__esModule:{value:!0}});var n,r=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}).addClass,i=function(){this.editor=this.createEditor(),this.editorStyle=this.editor.style,this.editorStyle.position="absolute",this.editorStyle.zIndex=100,this.hide()},s=i;$traceurRuntime.createClass(i,{setPosition:function(e,t){this.editorStyle.left=e+"px",this.editorStyle.top=t+"px"},show:function(){this.editorStyle.display="block"},hide:function(){this.editorStyle.display="none"},isVisible:function(){return"block"===this.editorStyle.display},setValue:function(){var e=void 0!==arguments[0]?arguments[0]:"";e=e||"",this.getInputElement().value=e},getValue:function(){return this.getInputElement().value},isFocused:function(){return document.activeElement===this.getInputElement()},focus:function(){this.getInputElement().focus()},createEditor:function(){var e,t,o=document.querySelector("."+s.CLASS_EDITOR_CONTAINER);return o||(o=document.createElement("div"),r(o,s.CLASS_EDITOR_CONTAINER),document.body.appendChild(o)),e=document.createElement("div"),r(e,s.CLASS_EDITOR),t=document.createElement("textarea"),r(t,s.CLASS_INPUT),e.appendChild(t),o.appendChild(e),e},getInputElement:function(){return this.editor.querySelector("."+s.CLASS_INPUT)},destroy:function(){this.editor.parentNode.removeChild(this.editor),this.editor=null,this.editorStyle=null}},{get CLASS_EDITOR_CONTAINER(){return"htCommentsContainer"},get CLASS_EDITOR(){return"htComments"},get CLASS_INPUT(){return"htCommentTextArea"},get CLASS_CELL(){return"htCommentCell"}})},{"helpers/dom/element":45}],64:[function(e,t,o){"use strict";Object.defineProperties(o,{Comments:{get:function(){return R}},__esModule:{value:!0}});var n,r,i,s,l,a,u=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),c=u.addClass,d=u.closest,h=u.getWindowScrollLeft,f=u.getWindowScrollTop,g=u.hasClass,p=u.offset,m=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,w=(i=e("3rdparty/walkontable/src/cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords,v=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}),b=v.registerPlugin,C=(v.getPlugin,(l=e("_base"),l&&l.__esModule&&l||{"default":l})["default"]),y=(a=e("commentEditor"),a&&a.__esModule&&a||{"default":a}).CommentEditor,R=function(e){$traceurRuntime.superConstructor(E).call(this,e),this.editor=null,this.eventManager=null,this.range={},this.mouseDown=!1,this.contextMenuEvent=!1,this.timer=null},E=R;$traceurRuntime.createClass(R,{isEnabled:function(){return this.hot.getSettings().comments},enablePlugin:function(){var e=this;this.enabled||(this.editor||(this.editor=new y),this.eventManager||(this.eventManager=new m(this)),this.addHook("afterContextMenuDefaultOptions",function(t){return e.addToContextMenu(t)}),this.addHook("afterRenderer",function(t,o,n,r,i,s){return e.onAfterRenderer(t,s)}),this.addHook("afterScrollHorizontally",function(){return e.refreshEditorPosition()}),this.addHook("afterScrollVertically",function(){return e.refreshEditorPosition()}),this.addHook("afterColumnResize",function(){return e.refreshEditorPosition()}),this.addHook("afterRowResize",function(){return e.refreshEditorPosition()}),this.registerListeners(),$traceurRuntime.superGet(this,E.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,E.prototype,"disablePlugin").call(this)},registerListeners:function(){var e=this;this.eventManager.addEventListener(document,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(document,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(document,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(document,"mouseup",function(t){return e.onMouseUp(t)}),this.eventManager.addEventListener(this.editor.getInputElement(),"blur",function(t){return e.onEditorBlur(t)})},setRange:function(e){this.range=e},clearRange:function(){this.range={}},targetIsCellWithComment:function(e){return g(e.target,"htCommentCell")&&d(e.target,[this.hot.rootElement])?!0:!1},targetIsCommentTextArea:function(e){return this.editor.getInputElement()===e.target},saveComment:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');var e=this.editor.getValue(),t=this.range.from.row,o=this.range.from.col;this.hot.setCellMeta(t,o,"comment",e),this.hot.render()},saveCommentAtCell:function(e,t){this.setRange({from:new w(e,t)}),this.saveComment()},removeComment:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');this.hot.removeCellMeta(this.range.from.row,this.range.from.col,"comment"),this.hot.render(),this.hide()},removeCommentAtCell:function(e,t){this.setRange({from:new w(e,t)}),this.removeComment()},show:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');var e=this.hot.getCellMeta(this.range.from.row,this.range.from.col);return this.refreshEditorPosition(!0),this.editor.setValue(e.comment||""),this.editor.show(),!0},showAtCell:function(e,t){return this.setRange({from:new w(e,t)}),this.show()},hide:function(){this.editor.hide()},refreshEditorPosition:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(e||this.range.from&&this.editor.isVisible()){var t=this.hot.view.wt.wtTable.getCell(this.range.from),o=p(t),n=this.hot.getColWidth(this.range.from.col),r=o.top,i=o.left,s=0,l=0;this.hot.view.wt.wtViewport.hasVerticalScroll()&&(r-=this.hot.view.wt.wtOverlays.topOverlay.getScrollPosition(),s=20),this.hot.view.wt.wtViewport.hasHorizontalScroll()&&(i-=this.hot.view.wt.wtOverlays.leftOverlay.getScrollPosition(),l=20);var a=i+n,u=r,c=this.hot.view.wt.wtTable.holder.getBoundingClientRect(),d={left:c.left+h()+l,right:c.right+h()-15,top:c.top+f()+s,bottom:c.bottom+f()};a<=d.left||a>d.right||u<=d.top||u>d.bottom?this.hide():this.editor.setPosition(a,u)}},onMouseDown:function(e){this.mouseDown=!0,this.hot.view&&this.hot.view.wt&&(this.contextMenuEvent||this.targetIsCommentTextArea(e)||this.targetIsCellWithComment(e)||this.hide(),this.contextMenuEvent=!1)},onMouseOver:function(e){if(!this.mouseDown&&!this.editor.isFocused())if(this.targetIsCellWithComment(e)){var t=this.hot.view.wt.wtTable.getCoords(e.target),o={from:new w(t.row,t.col)};this.setRange(o),this.show()}else this.targetIsCommentTextArea(e)||this.editor.isFocused()||this.hide()},onMouseMove:function(e){var t=this;this.targetIsCommentTextArea(e)&&(this.mouseDown=!0,clearTimeout(this.timer),this.timer=setTimeout(function(){t.mouseDown=!1},200))},onMouseUp:function(e){this.mouseDown=!1},onAfterRenderer:function(e,t){t.comment&&c(e,t.commentedCellClassName)},onEditorBlur:function(e){this.saveComment()},checkSelectionCommentsConsistency:function(){var e=this.hot.getSelectedRange();if(!e)return!1;var t=!1,o=e.from;return this.hot.getCellMeta(o.row,o.col).comment&&(t=!0),t},onContextMenuAddComment:function(){var e=this,t=this.hot.getSelectedRange();this.contextMenuEvent=!0,this.setRange({from:t.from}),this.show(),setTimeout(function(){e.hot&&(e.hot.deselectCell(),e.editor.focus())},10)},onContextMenuRemoveComment:function(e,t){this.contextMenuEvent=!0,this.removeCommentAtCell(t.start.row,t.start.col)},addToContextMenu:function(e){var t=this;e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR,{key:"commentsAddEdit",name:function(){return t.checkSelectionCommentsConsistency()?"Edit Comment":"Add Comment"},callback:function(){return t.onContextMenuAddComment()},disabled:function(){return this.getSelected()?!1:!0}},{key:"commentsRemove",name:function(){return"Delete Comment"},callback:function(e,o){return t.onContextMenuRemoveComment(e,o)},disabled:function(){return!t.checkSelectionCommentsConsistency()}})},destroy:function(){this.editor&&this.editor.destroy(),$traceurRuntime.superGet(this,E.prototype,"destroy").call(this)}},{},C),b("comments",R)},{"3rdparty/walkontable/src/cell/coords":5,_base:58,commentEditor:63,eventManager:41,"helpers/dom/element":45,plugins:57}],65:[function(e,t,o){"use strict";function n(e,t){var o;return i(t,function(t){var n=t.key?t.key.split(":"):null;return Array.isArray(n)&&n[1]===e?(o=t,!1):void 0}),o}Object.defineProperties(o,{CommandExecutor:{get:function(){return s}},__esModule:{value:!0}});var r,i=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,s=function(e){this.hot=e,this.commands={},this.commonCallback=null};$traceurRuntime.createClass(s,{registerCommand:function(e,t){this.commands[e]=t},setCommonCallback:function(e){this.commonCallback=e},execute:function(e){for(var t=[],o=1;o0;if(s)return}}else if(!(t(i)||v(i,"current")&&v(i,"wtBorder")))return;this.open(e)},onMenuAfterOpen:function(){this.hot.runHooks("afterContextMenuShow",this)},onMenuAfterClose:function(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)},destroy:function(){this.close(),this.menu&&this.menu.destroy(),$traceurRuntime.superGet(this,W.prototype,"destroy").call(this)}},{get DEFAULT_ITEMS(){return[T,O,N,_,M,N,H,k,N,A,P,N,x,N,D]}},g),L.SEPARATOR={name:N},Handsontable.hooks.register("afterContextMenuDefaultOptions"),Handsontable.hooks.register("afterContextMenuShow"),Handsontable.hooks.register("afterContextMenuHide"),Handsontable.hooks.register("afterContextMenuExecute"),R("contextMenu",L)},{_base:58,commandExecutor:65,eventManager:41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,itemsFactory:68,menu:69,plugins:57,predefinedItems:70}],67:[function(e,t,o){"use strict";Object.defineProperties(o,{Cursor:{get:function(){return d}},__esModule:{value:!0}});var n,r,i=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),s=i.getWindowScrollLeft,l=i.getWindowScrollTop,a=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}),u=a.pageX,c=a.pageY,d=function(e){var t,o,n,r,i,a,d,h,f=l(),g=s();this.type=this.getSourceType(e),"literal"===this.type?(t=parseInt(e.top,10),n=parseInt(e.left,10),d=e.height,h=e.width):"event"===this.type&&(t=parseInt(c(e),10),n=parseInt(u(e),10),d=e.target.clientHeight,h=e.target.clientWidth),o=t-f,r=n-g,i=f,a=g,this.top=t,this.topRelative=o,this.left=n,this.leftRelative=r,this.scrollTop=i,this.scrollLeft=a,this.cellHeight=d,this.cellWidth=h};$traceurRuntime.createClass(d,{getSourceType:function(e){var t="literal";return e instanceof Event&&(t="event"),t},fitsAbove:function(e){return this.topRelative>=e.offsetHeight},fitsBelow:function(e){var t=void 0!==arguments[1]?arguments[1]:window.innerHeight;return this.topRelative+e.offsetHeight<=t},fitsOnRight:function(e){var t=void 0!==arguments[1]?arguments[1]:window.innerWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=t},fitsOnLeft:function(e){return this.leftRelative>=e.offsetWidth}},{}),Handsontable.plugins.utils=Handsontable.plugins.utils||{},Handsontable.plugins.utils.Cursor=d},{"helpers/dom/element":45,"helpers/dom/event":46}],68:[function(e,t,o){"use strict";function n(){var e=void 0!==arguments[0]?arguments[0]:null,t=void 0!==arguments[1]?arguments[1]:[],o=void 0!==arguments[2]?arguments[2]:{},n=[];return e&&e.items?e=e.items:Array.isArray(e)||(e=t),u(e)?a(e,function(e,t){var r=o["string"==typeof e?e:t];r||(r=e),u(e)?c(r,e):"string"==typeof r&&(r={name:r}),void 0===r.key&&(r.key=t),n.push(r)}):d(e,function(e,t){var r=o[e];!r&&g.indexOf(e)>=0||(r||(r={name:e,key:t+""}),u(e)&&c(r,e),void 0===r.key&&(r.key=t),n.push(r))}),n[0].name===f&&n.shift(),n}Object.defineProperties(o,{ItemsFactory:{get:function(){return m}},__esModule:{value:!0}});var r,i,s,l=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}),a=l.objectEach,u=l.isObject,c=l.extend,d=(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,h=(s=e("predefinedItems"),s&&s.__esModule&&s||{"default":s}),f=h.SEPARATOR,g=h.ITEMS,p=h.predefinedItems,m=function(e){var t=void 0!==arguments[1]?arguments[1]:null;this.hot=e,this.predefinedItems=p(),this.defaultOrderPattern=t};$traceurRuntime.createClass(m,{setPredefinedItems:function(e){var t=this,o={};this.defaultOrderPattern.length=0,a(e,function(e,n){var r="";e.name===f?(o[f]=e,r=f):isNaN(parseInt(n,10))?(e.key=void 0===e.key?n:e.key,o[n]=e,r=e.key):(o[e.key]=e,r=e.key),t.defaultOrderPattern.push(r)}),this.predefinedItems=o},getVisibleItems:function(){var e=void 0!==arguments[0]?arguments[0]:null,t=this,o={};return a(this.predefinedItems,function(e,n){(!e.hidden||e.hidden&&!e.hidden.apply(t.hot))&&(o[n]=e)}),n(e,this.defaultOrderPattern,o)},getItems:function(){var e=void 0!==arguments[0]?arguments[0]:null;return n(e,this.defaultOrderPattern,this.predefinedItems)}},{})},{"helpers/array":42,"helpers/object":50,predefinedItems:70}],69:[function(e,t,o){"use strict";Object.defineProperties(o,{Menu:{get:function(){return W}},__esModule:{value:!0}});var n,r,i,s,l,a,u,c,d,h,f=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),g=f.addClass,p=f.empty,m=f.fastInnerHTML,w=(f.getComputedStyle,f.getScrollbarWidth),v=(f.getWindowScrollLeft,f.getWindowScrollTop,f.hasClass,f.isChildOf),b=f.removeClass,C=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,y=(i=e("cursor"),i&&i.__esModule&&i||{"default":i}).Cursor,R=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).EventManager,E=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),S=(E.extend,E.isObject,E.objectEach,E.mixin),T=(a=e("utils"),a&&a.__esModule&&a||{"default":a}),O=T.isSeparator,_=T.isDisabled,M=T.isSelectionDisabled,H=T.hasSubMenu,k=T.normalizeSelection,A=(u=e("helpers/unicode"),u&&u.__esModule&&u||{"default":u}).KEY_CODES,P=(c=e("mixins/localHooks"),c&&c.__esModule&&c||{"default":c}).localHooks,x=(d=e("predefinedItems"),d&&d.__esModule&&d||{"default":d}),D=x.SEPARATOR,N=(x.predefinedItems,h=e("helpers/dom/event"),h&&h.__esModule&&h||{"default":h}),L=(N.stopPropagation,N.stopImmediatePropagation),W=(N.pageX,N.pageY,function(e){var t=void 0!==arguments[1]?arguments[1]:{parent:null,name:null,className:"",keepInViewport:!0};this.hot=e,this.options=t,this.eventManager=new R(this),this.container=this.createContainer(this.options.name),this.hotMenu=null,this.hotSubMenus={},this.parentMenu=this.options.parent||null,this.menuItems=null,this.origOutsideClickDeselects=null,this._afterScrollCallback=null,this.registerEvents()}),I=W;$traceurRuntime.createClass(W,{registerEvents:function(){var e=this;this.eventManager.addEventListener(document.documentElement,"mousedown",function(t){return e.onDocumentMouseDown(t)})},setMenuItems:function(e){this.menuItems=e},isSubMenu:function(){return null!==this.parentMenu},open:function(){var e=this;this.container.removeAttribute("style"),this.container.style.display="block";var t={data:this.menuItems,colHeaders:!1,colWidths:[200],autoRowSize:!1,readOnly:!0,copyPaste:!1,columns:[{data:"name",renderer:function(t,o,n,r,i,s){return e.menuItemRenderer(t,o,n,r,i,s)}}],renderAllRows:!0,fragmentSelection:"cell",beforeKeyDown:function(t){return e.onBeforeKeyDown(t)},afterOnCellMouseOver:function(t,o,n){return e.openSubMenu(o.row)}};this.origOutsideClickDeselects=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1,this.hotMenu=new Handsontable.Core(this.container,t),this.hotMenu.addHook("afterInit",function(){return e.onAfterInit()}),this.hotMenu.init(),this.hotMenu.listen(),this.blockMainTableCallbacks(),this.runLocalHooks("afterOpen")},close:function(){var e=void 0!==arguments[0]?arguments[0]:!1;this.isOpened()&&(e&&this.parentMenu?this.parentMenu.close():(this.closeAllSubMenus(),this.container.style.display="none",this.releaseMainTableCallbacks(),this.hotMenu.destroy(),this.hotMenu=null,this.hot.getSettings().outsideClickDeselects=this.origOutsideClickDeselects,this.runLocalHooks("afterClose")))},openSubMenu:function(e){var t=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!t||!H(t))return!1;var o=this.hotMenu.getSourceDataAtRow(e),n=new I(this.hot,{parent:this,name:o.name,className:this.options.className});return n.setMenuItems(o.submenu.items),n.open(),n.setPosition(t.getBoundingClientRect()),this.hotSubMenus[o.key]=n,n},closeSubMenu:function(e){var t=this.hotMenu.getSourceDataAtRow(e),o=this.hotSubMenus[t.key];o&&(o.destroy(),delete this.hotSubMenus[t.key])},closeAllSubMenus:function(){var e=this;C(this.hotMenu.getData(),function(t,o){return e.closeSubMenu(o)})},isAllSubMenusClosed:function(){return 0===Object.keys(this.hotSubMenus).length},destroy:function(){this.clearLocalHooks(),this.close(),this.parentMenu=null,this.eventManager.destroy()},isOpened:function(){return null!==this.hotMenu},executeCommand:function(e){if(this.isOpened()&&this.hotMenu.getSelected()){var t=this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelected()[0]);if(this.runLocalHooks("select",t,e),t.isCommand!==!1){var o=this.hot.getSelectedRange(),n=o?k(o):{};this.runLocalHooks("executeCommand",t.key,n,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",t.key,n,e),this.close(!0)}}},setPosition:function(e){var t=new y(e);this.options.keepInViewport?(t.fitsBelow(this.container)?this.setPositionBelowCursor(t):t.fitsAbove(this.container)?this.setPositionAboveCursor(t):this.setPositionBelowCursor(t),t.fitsOnRight(this.container)?this.setPositionOnRightOfCursor(t):this.setPositionOnLeftOfCursor(t)):(this.setPositionBelowCursor(t),this.setPositionOnRightOfCursor(t))},setPositionAboveCursor:function(e){var t=e.top-this.container.offsetHeight;this.isSubMenu()&&(t=window.scrollY+e.top+e.cellHeight-this.container.offsetHeight+3),this.container.style.top=t+"px"},setPositionBelowCursor:function(e){var t=e.top-1;this.isSubMenu()&&(t=e.top+window.scrollY-1),this.container.style.top=t+"px"},setPositionOnRightOfCursor:function(e){var t;t=this.isSubMenu()?window.scrollX+1+e.left+e.cellWidth:1+e.left,this.container.style.left=t+"px"},setPositionOnLeftOfCursor:function(e){this.container.style.left=e.left-this.container.offsetWidth+w()+4+"px"},selectFirstCell:function(){var e=this.hotMenu.getCell(0,0);O(e)||_(e)||M(e)?this.selectNextCell(0,0):this.hotMenu.selectCell(0,0)},selectLastCell:function(){var e=this.hotMenu.countRows()-1,t=this.hotMenu.getCell(e,0);O(t)||_(t)||M(t)?this.selectPrevCell(e,0):this.hotMenu.selectCell(e,0)},selectNextCell:function(e,t){var o=e+1,n=o=0?this.hotMenu.getCell(o,t):null;n&&(O(n)||_(n)||M(n)?this.selectPrevCell(o,t):this.hotMenu.selectCell(o,t))},menuItemRenderer:function(e,t,o,n,r,i){var s=this,l=e.getSourceDataAtRow(o),a=document.createElement("div"),u=function(e){return e.hasOwnProperty("submenu")},c=function(e){return new RegExp(D,"i").test(e.name)},d=function(e){return e.disabled===!0||"function"==typeof e.disabled&&e.disabled.call(s.hot)===!0},h=function(e){return"function"==typeof e.hidden&&e.hidden.call(s.hot)===!0},f=function(e){return e.disableSelection},w=h(l);"function"==typeof i&&(i=i.call(this.hot)),p(t),g(a,"htItemWrapper"),t.appendChild(a),c(l)?g(t,"htSeparator"):w||"function"!=typeof l.renderer?m(a,i):(g(t,"htCustomMenuRenderer"),t.appendChild(l.renderer(e,a,o,n,r,i))),w?t.parentNode&&g(t.parentNode,"htHidden"):d(l)?(g(t,"htDisabled"),this.eventManager.addEventListener(a,"mouseenter",function(){return e.deselectCell()})):f(l)?(g(t,"htSelectionDisabled"),this.eventManager.addEventListener(a,"mouseenter",function(){return e.deselectCell()})):u(l)?(g(t,"htSubmenu"),f(l)?this.eventManager.addEventListener(a,"mouseenter",function(){return e.deselectCell()}):this.eventManager.addEventListener(a,"mouseenter",function(){return e.selectCell(o,n,void 0,void 0,void 0,!1)})):(b(t,"htSubmenu"),b(t,"htDisabled"),f(l)?this.eventManager.addEventListener(a,"mouseenter",function(){return e.deselectCell()}):this.eventManager.addEventListener(a,"mouseenter",function(){return e.selectCell(o,n,void 0,void 0,void 0,!1)}))},createContainer:function(){var e=void 0!==arguments[0]?arguments[0]:null;e&&(e=e.replace(/ /g,"_"),e=this.options.className+"Sub_"+e);var t;return t=e?document.querySelector("."+this.options.className+"."+e):document.querySelector("."+this.options.className),t||(t=document.createElement("div"),g(t,"htMenu "+this.options.className),e&&g(t,e),document.getElementsByTagName("body")[0].appendChild(t)),t},blockMainTableCallbacks:function(){this._afterScrollCallback=function(){},this.hot.addHook("afterScrollVertically",this._afterScrollCallback),this.hot.addHook("afterScrollHorizontally",this._afterScrollCallback)},releaseMainTableCallbacks:function(){this._afterScrollCallback&&(this.hot.removeHook("afterScrollVertically",this._afterScrollCallback),this.hot.removeHook("afterScrollHorizontally",this._afterScrollCallback),this._afterScrollCallback=null)},onBeforeKeyDown:function(e){var t=this.hotMenu.getSelected(),o=!1;switch(e.keyCode){case A.ESCAPE:this.close(),o=!0;break;case A.ENTER:t&&(this.hotMenu.getSourceDataAtRow(t[0]).submenu?o=!0:(this.executeCommand(e),this.close(!0)));break;case A.ARROW_DOWN:t?this.selectNextCell(t[0],t[1]):this.selectFirstCell(),o=!0;break;case A.ARROW_UP:t?this.selectPrevCell(t[0],t[1]):this.selectLastCell(),o=!0;break;case A.ARROW_RIGHT:if(t){var n=this.openSubMenu(t[0]);n&&n.selectFirstCell()}o=!0;break;case A.ARROW_LEFT:t&&this.isSubMenu()&&(this.close(),this.parentMenu&&this.parentMenu.hotMenu.listen(),o=!0)}o&&(e.preventDefault(),L(e))},onAfterInit:function(){var e=this.hotMenu.getSettings().data,t=this.hotMenu.view.wt.wtTable.hider.style,o=this.hotMenu.view.wt.wtTable.holder.style,n=parseInt(t.width,10),r=0;C(e,function(e){return r+=e.name===D?1:26}),o.width=n+22+"px",o.height=r+4+"px"},onDocumentMouseDown:function(e){this.isOpened()&&(this.container&&v(e.target,this.container)&&this.executeCommand(e),(this.isAllSubMenusClosed()||this.isSubMenu())&&!v(e.target,".htMenu")&&v(e.target,document)&&this.close(!0))}},{}),S(W,P)},{cursor:67,eventManager:41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,"mixins/localHooks":54,predefinedItems:70,utils:71}],70:[function(e,t,o){"use strict";function n(){var e={};return c(A,function(t,o){return e[o]=d(t)}),e}function r(e,t){-1===k.indexOf(e)&&(A[e]=t)}var i;Object.defineProperties(o,{ROW_ABOVE:{get:function(){return v}},ROW_BELOW:{get:function(){return b}},COLUMN_LEFT:{get:function(){return C}},COLUMN_RIGHT:{get:function(){return y}},CLEAR_COLUMN:{get:function(){return R}},REMOVE_ROW:{get:function(){return E}},REMOVE_COLUMN:{get:function(){return S}},UNDO:{get:function(){return T}},REDO:{get:function(){return O}},READ_ONLY:{get:function(){return _}},ALIGNMENT:{get:function(){return M}},SEPARATOR:{get:function(){return H}},ITEMS:{get:function(){return k}},predefinedItems:{get:function(){return n}},addItem:{get:function(){return r}},__esModule:{value:!0}});var s,l,a,u=(s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}),c=u.objectEach,d=u.clone,h=((l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}).rangeEach,a=e("utils"),a&&a.__esModule&&a||{"default":a}),f=h.align,g=h.getAlignmentClasses,p=h.getValidSelection,m=h.checkSelectionConsistency,w=h.markLabelAsSelected,v="row_above",b="row_below",C="col_left",y="col_right",R="clear_column",E="remove_row",S="remove_col",T="undo",O="redo",_="make_read_only",M="alignment",H="---------",k=[v,b,C,y,R,E,S,T,O,_,M,H],A=(i={},Object.defineProperty(i,H,{value:{name:H},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,v,{value:{key:v,name:"Insert row above",callback:function(e,t){this.alter("insert_row",t.start.row)},disabled:function(){var e=p(this);if(!e||this.countRows()>=this.getSettings().maxRows)return!0;var t=this.countRows(),o=[0,e[1],t-1,e[1]];return o.join(",")===e.join(",")&&t>1},hidden:function(){return!this.getSettings().allowInsertRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,b,{value:{key:b,name:"Insert row below",callback:function(e,t){this.alter("insert_row",t.end.row+1)},disabled:function(){var e=p(this);if(!e||this.countRows()>=this.getSettings().maxRows)return!0;var t=this.countRows(),o=[0,e[1],t-1,e[1]];return o.join(",")===e.join(",")&&t>1},hidden:function(){return!this.getSettings().allowInsertRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,C,{value:{key:C,name:"Insert column on the left",callback:function(e,t){this.alter("insert_col",t.start.col)},disabled:function(){var e=p(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],o=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||o},hidden:function(){return!this.getSettings().allowInsertColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,y,{value:{key:y,name:"Insert column on the right",callback:function(e,t){this.alter("insert_col",t.end.col+1)},disabled:function(){var e=p(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],o=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||o},hidden:function(){return!this.getSettings().allowInsertColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,R,{value:{key:R,name:"Clear column",callback:function(e,t){var o=t.start.col;this.countRows()&&this.populateFromArray(0,o,[[null]],Math.max(t.start.row,t.end.row),o)},disabled:function(){var e=p(this);if(!e)return!0;var t=[e[0],0,e[0],this.countCols()-1],o=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||o}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,E,{value:{key:E,name:"Remove row",callback:function(e,t){var o=t.end.row-t.start.row+1;this.alter("remove_row",t.start.row,o)},disabled:function(){var e=p(this);if(!e)return!0;var t=[0,e[1],this.countRows()-1,e[1]];return t.join(",")===e.join(",")},hidden:function(){return!this.getSettings().allowRemoveRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,S,{value:{key:S,name:"Remove column",callback:function(e,t){var o=t.end.col-t.start.col+1;this.alter("remove_col",t.start.col,o)},disabled:function(){var e=p(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],o=t.join(",")==e.join(",");return e[1]<0||o},hidden:function(){return!this.getSettings().allowRemoveColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,T,{value:{key:T,name:"Undo",callback:function(){this.undo()},disabled:function(){return this.undoRedo&&!this.undoRedo.isUndoAvailable()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,O,{value:{key:O,name:"Redo",callback:function(){this.redo()},disabled:function(){return this.undoRedo&&!this.undoRedo.isRedoAvailable()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,_,{value:{key:_,name:function(){var e=this,t="Read only",o=m(this.getSelectedRange(),function(t,o){return e.getCellMeta(t,o).readOnly});return o&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),o=m(t,function(t,o){return e.getCellMeta(t,o).readOnly});t.forAll(function(t,n){e.getCellMeta(t,n).readOnly=o?!1:!0}),this.render()},disabled:function(){return this.getSelectedRange()?!1:!0}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,M,{value:{key:M,name:"Alignment",disabled:function(){return this.getSelectedRange()?!1:!0},submenu:{items:[{key:M+":left",name:function(){var e=this,t="Left",o=m(this.getSelectedRange(),function(t,o){var n=e.getCellMeta(t,o).className;return n&&-1!==n.indexOf("htLeft")?!0:void 0});return o&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),o=g(t,function(t,o){return e.getCellMeta(t,o).className}),n="horizontal",r="htLeft";this.runHooks("beforeCellAlignment",o,t,n,r),f(t,n,r,function(t,o){return e.getCellMeta(t,o)}),this.render()},disabled:!1},{key:M+":center",name:function(){var e=this,t="Center",o=m(this.getSelectedRange(),function(t,o){var n=e.getCellMeta(t,o).className;return n&&-1!==n.indexOf("htCenter")?!0:void 0});return o&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),o=g(t,function(t,o){return e.getCellMeta(t,o).className}),n="horizontal",r="htCenter";this.runHooks("beforeCellAlignment",o,t,n,r),f(t,n,r,function(t,o){return e.getCellMeta(t,o)}),this.render()},disabled:!1},{key:M+":right",name:function(){var e=this,t="Right",o=m(this.getSelectedRange(),function(t,o){var n=e.getCellMeta(t,o).className;return n&&-1!==n.indexOf("htRight")?!0:void 0});return o&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),o=g(t,function(t,o){return e.getCellMeta(t,o).className}),n="horizontal",r="htRight";this.runHooks("beforeCellAlignment",o,t,n,r),f(t,n,r,function(t,o){return e.getCellMeta(t,o)}),this.render()},disabled:!1},{key:M+":justify",name:function(){var e=this,t="Justify",o=m(this.getSelectedRange(),function(t,o){var n=e.getCellMeta(t,o).className;return n&&-1!==n.indexOf("htJustify")?!0:void 0});return o&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),o=g(t,function(t,o){return e.getCellMeta(t,o).className}),n="horizontal",r="htJustify";this.runHooks("beforeCellAlignment",o,t,n,r),f(t,n,r,function(t,o){return e.getCellMeta(t,o)}),this.render()},disabled:!1},{name:H},{key:M+":top",name:function(){var e=this,t="Top",o=m(this.getSelectedRange(),function(t,o){var n=e.getCellMeta(t,o).className;return n&&-1!==n.indexOf("htTop")?!0:void 0});return o&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),o=g(t,function(t,o){return e.getCellMeta(t,o).className}),n="vertical",r="htTop";this.runHooks("beforeCellAlignment",o,t,n,r),f(t,n,r,function(t,o){return e.getCellMeta(t,o)}),this.render()},disabled:!1},{key:M+":middle",name:function(){var e=this,t="Middle",o=m(this.getSelectedRange(),function(t,o){var n=e.getCellMeta(t,o).className;return n&&-1!==n.indexOf("htMiddle")?!0:void 0});return o&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),o=g(t,function(t,o){return e.getCellMeta(t,o).className}),n="vertical",r="htMiddle";this.runHooks("beforeCellAlignment",o,t,n,r),f(t,n,r,function(t,o){return e.getCellMeta(t,o)}),this.render()},disabled:!1},{key:M+":bottom",name:function(){var e=this,t="Bottom",o=m(this.getSelectedRange(),function(t,o){var n=e.getCellMeta(t,o).className;return n&&-1!==n.indexOf("htBottom")?!0:void 0});return o&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),o=g(t,function(t,o){return e.getCellMeta(t,o).className}),n="vertical",r="htBottom";this.runHooks("beforeCellAlignment",o,t,n,r),f(t,n,r,function(t,o){return e.getCellMeta(t,o)}),this.render()},disabled:!1}]}},configurable:!0,enumerable:!0,writable:!0}),i)},{"helpers/number":49,"helpers/object":50,utils:71}],71:[function(e,t,o){"use strict";function n(e){return{start:e.getTopLeftCorner(),end:e.getBottomRightCorner()}}function r(e){return w(e,"htSeparator")}function i(e){return w(e,"htSubmenu")}function s(e){return w(e,"htDisabled")}function l(e){return w(e,"htSelectionDisabled")}function a(e){var t=e.getSelected();return t?t[0]<0?null:t:null}function u(e,t){return-1!=e.indexOf(t)?e:(e=e.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ",""),e+=" "+t)}function c(e,t){return-1!=e.indexOf(t)?e:(e=e.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ",""),e+=" "+t)}function d(e,t){for(var o={},n=e.from.row;n<=e.to.row;n++)for(var r=e.from.col;r<=e.to.col;r++)o[n]||(o[n]=[]),o[n][r]=t(n,r);return o}function h(e,t,o,n){if(e.from.row==e.to.row&&e.from.col==e.to.col)f(e.from.row,e.from.col,t,o,n);else for(var r=e.from.row;r<=e.to.row;r++)for(var i=e.from.col;i<=e.to.col;i++)f(r,i,t,o,n)}function f(e,t,o,n,r){var i=r(e,t),s=n;i.className&&(s="vertical"===o?u(i.className,n):c(i.className,n)),i.className=s}function g(e,t){var o=!1;return e&&e.forAll(function(e,n){return t(e,n)?(o=!0,!1):void 0}),o}function p(e){return''+String.fromCharCode(10003)+""+e}Object.defineProperties(o,{normalizeSelection:{get:function(){return n}},isSeparator:{get:function(){return r}},hasSubMenu:{get:function(){return i}},isDisabled:{get:function(){return s}},isSelectionDisabled:{get:function(){return l}},getValidSelection:{get:function(){return a}},prepareVerticalAlignClass:{get:function(){return u}},prepareHorizontalAlignClass:{get:function(){return c}},getAlignmentClasses:{get:function(){return d}},align:{get:function(){return h}},checkSelectionConsistency:{get:function(){return g}},markLabelAsSelected:{get:function(){return p}},__esModule:{value:!0}});var m,w=(m=e("helpers/dom/element"),m&&m.__esModule&&m||{"default":m}).hasClass},{"helpers/dom/element":45}],72:[function(e,t,o){"use strict";Object.defineProperties(o,{ContextMenuCopyPaste:{get:function(){return p}},__esModule:{value:!0}});var n,r,i,s,l,a,u=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}).removeClass,c=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,d=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,h=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}).registerPlugin,f=(l=e("_base"),l&&l.__esModule&&l||{"default":l})["default"],g=(a=e("zeroclipboard"),a&&a.__esModule&&a||{"default":a})["default"],p=function(e){$traceurRuntime.superConstructor(m).call(this,e),this.eventManager=new d(this),this.swfPath=null,this.outsideClickDeselectsCache=null},m=p;$traceurRuntime.createClass(p,{isEnabled:function(){return this.hot.getSettings().contextMenuCopyPaste},enablePlugin:function(){var e=this;if(!this.enabled){"object"==typeof this.hot.getSettings().contextMenuCopyPaste&&(this.swfPath=this.hot.getSettings().contextMenuCopyPaste.swfPath),"undefined"==typeof g&&console.error("To be able to use the Copy/Paste feature from the context menu, you need to manually include ZeroClipboard.js file to your website.");try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(t){"undefined"==typeof navigator.mimeTypes["application/x-shockwave-flash"]&&console.error("To be able to use the Copy/Paste feature from the context menu, your browser needs to have Flash Plugin installed.")}this.swfPath&&g.config({swfPath:this.swfPath}),this.hot.addHook("afterContextMenuShow",function(){return e.onAfterContextMenuShow()}),this.hot.addHook("afterContextMenuDefaultOptions",function(t){return e.onAfterContextMenuDefaultOptions(t)}),this.registerEvents(),$traceurRuntime.superGet(this,m.prototype,"enablePlugin").call(this)}},disablePlugin:function(){$traceurRuntime.superGet(this,m.prototype,"disablePlugin").call(this)},registerEvents:function(){var e=this;this.eventManager.addEventListener(document,"mouseenter",function(){return e.removeCurrentClass()}),this.eventManager.addEventListener(document,"mouseleave",function(){return e.removeZeroClipboardClass()})},getCopyValue:function(){return this.hot.copyPaste.setCopyableText(),this.hot.copyPaste.copyPasteInstance.elTextarea.value},onAfterContextMenuDefaultOptions:function(e){e.items.unshift({key:"copy",name:"Copy"},{key:"paste",name:"Paste",callback:function(){this.copyPaste.triggerPaste()}},Handsontable.plugins.ContextMenu.SEPARATOR)},onAfterContextMenuShow:function(){var e=this,t=this.hot.getPlugin("contextMenu"),o=t.menu.hotMenu.getSourceData();c(o,function(o,n){if("copy"===o.key){var r=new g(t.menu.hotMenu.getCell(n,0));return r.off(),r.on("copy",function(t){var o=t.clipboardData;o.setData("text/plain",e.getCopyValue()),e.hot.getSettings().outsideClickDeselects=e.outsideClickDeselectsCache}),!1}})},removeCurrentClass:function(){var e=this.hot.getPlugin("contextMenu");if(e.menu.isOpened()){var t=e.menu.hotMenu.rootElement.querySelector("td.current");t&&u(t,"current")}this.outsideClickDeselectsCache=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1},removeZeroClipboardClass:function(){var e=this.hot.getPlugin("contextMenu");if(e.menu.isOpened()){var t=e.menu.hotMenu.rootElement.querySelector("td.zeroclipboard-is-hover");t&&u(t,"zeroclipboard-is-hover")}this.hot.getSettings().outsideClickDeselects=this.outsideClickDeselectsCache}},{},f),h("contextMenuCopyPaste",p)},{_base:58,eventManager:41,"helpers/array":42,"helpers/dom/element":45,plugins:57,zeroclipboard:void 0}],73:[function(e,t,o){"use strict";function n(e){function t(){e.isListening()&&e.selection.empty()}function o(t){var o,n,r,i,s,l,a,u,c,d;if(e.isListening()&&e.selection.isSelected()){o=t,n=w.parse(o),r=e.getSelected(),i=new M(r[0],r[1]),s=new M(r[2],r[3]),l=new H(i,i,s),a=l.getTopLeftCorner(),u=l.getBottomRightCorner(),c=a,d=new M(Math.max(u.row,n.length-1+a.row),Math.max(u.col,n[0].length-1+a.col));var h=s.row-i.row>=n.length-1,f=s.col-i.col>=n[0].length-1;e.addHookOnce("afterChange",function(t,o){var n=t?t.length:0;if(n){var r={row:0,col:0},i=-1;y(t,function(e,o){var s=n>o+1?t[o+1]:null;s&&(h||(r.row=r.row+Math.max(s[0]-e[0]-1,0)),!f&&e[1]>i&&(i=e[1],r.col=r.col+Math.max(s[1]-e[1]-1,0)))}),e.selectCell(c.row,c.col,d.row+r.row,d.col+r.col)}}),e.populateFromArray(c.row,c.col,n,d.row,d.col,"paste",e.getSettings().pasteMode)}}function n(t){if(e.getSelected()&&!(e.getActiveEditor()&&e.getActiveEditor().isOpened()||T(t))){if(C(t.keyCode)){if(e.getSettings().fragmentSelection&&O())return;return r.setCopyableText(),void S(t)}var o=(t.ctrlKey||t.metaKey)&&!t.altKey;t.keyCode==b.A&&o&&e._registerTimeout(setTimeout(_(r.setCopyableText,r),0))}}var r=this;this.copyPasteInstance=m(),this.copyPasteInstance.onCut(t),this.copyPasteInstance.onPaste(o),this.onPaste=o,e.addHook("beforeKeyDown",n),this.destroy=function(){this.copyPasteInstance&&(this.copyPasteInstance.removeCallback(t),this.copyPasteInstance.removeCallback(o),this.copyPasteInstance.destroy(),this.copyPasteInstance=null),e.removeHook("beforeKeyDown",n)},e.addHook("afterDestroy",_(this.destroy,this)),this.triggerPaste=_(this.copyPasteInstance.triggerPaste,this.copyPasteInstance),this.triggerCut=_(this.copyPasteInstance.triggerCut,this.copyPasteInstance),this.setCopyableText=function(){var t=e.getSettings(),o=t.copyRowsLimit,n=t.copyColsLimit,r=e.getSelectedRange(),i=r.getTopLeftCorner(),s=r.getBottomRightCorner(),l=i.row,a=i.col,u=s.row,c=s.col,d=Math.min(u,l+o-1),h=Math.min(c,a+n-1),f=[];f.push({startRow:l,startCol:a,endRow:d,endCol:h}),f=Handsontable.hooks.run(e,"modifyCopyableRange",f);var g=this.getRangedCopyableData(f);e.copyPaste.copyPasteInstance.copyable(g),(u!==d||c!==h)&&Handsontable.hooks.run(e,"afterCopyLimit",u-l+1,c-a+1,o,n)},this.getRangedCopyableData=function(t){var o=[],n=[],r=[];return y(t,function(e){R(e.startRow,e.endRow,function(e){-1===n.indexOf(e)&&n.push(e)}),R(e.startCol,e.endCol,function(e){-1===r.indexOf(e)&&r.push(e)})}),y(n,function(t){var n=[];y(r,function(o){n.push(e.getCopyableData(t,o))}),o.push(n)}),w.stringify(o)}}function r(){var e=this,t=e.getSettings().copyPaste!==!1;t&&!e.copyPaste?e.copyPaste=new n(e):!t&&e.copyPaste&&(e.copyPaste.destroy(),e.copyPaste=null)}Object.defineProperties(o,{CopyPastePlugin:{get:function(){return n}},__esModule:{value:!0}});var i,s,l,a,u,c,d,h,f,g,p,m=(i=e("copyPaste"),i&&i.__esModule&&i||{"default":i})["default"],w=(s=e("SheetClip"), +s&&s.__esModule&&s||{"default":s})["default"],v=(l=e("helpers/unicode"),l&&l.__esModule&&l||{"default":l}),b=v.KEY_CODES,C=v.isCtrlKey,y=(a=e("helpers/array"),a&&a.__esModule&&a||{"default":a}).arrayEach,R=(u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}).rangeEach,E=(c=e("helpers/dom/event"),c&&c.__esModule&&c||{"default":c}),S=E.stopImmediatePropagation,T=E.isImmediatePropagationStopped,O=(d=e("helpers/dom/element"),d&&d.__esModule&&d||{"default":d}).getSelectionText,_=(h=e("helpers/function"),h&&h.__esModule&&h||{"default":h}).proxy,M=((f=e("plugins"),f&&f.__esModule&&f||{"default":f}).registerPlugin,(g=e("3rdparty/walkontable/src/cell/coords"),g&&g.__esModule&&g||{"default":g}).WalkontableCellCoords),H=(p=e("3rdparty/walkontable/src/cell/range"),p&&p.__esModule&&p||{"default":p}).WalkontableCellRange;Handsontable.hooks.add("afterInit",r),Handsontable.hooks.add("afterUpdateSettings",r),Handsontable.hooks.register("afterCopyLimit"),Handsontable.hooks.register("modifyCopyableRange")},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,SheetClip:"SheetClip",copyPaste:"copyPaste","helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/function":47,"helpers/number":49,"helpers/unicode":53,plugins:57}],74:[function(e,t,o){"use strict";function n(){}var r,i,s,l,a=((r=e("plugins"),r&&r.__esModule&&r||{"default":r}).registerPlugin,(i=e("3rdparty/walkontable/src/cell/range"),i&&i.__esModule&&i||{"default":i}).WalkontableCellRange),u=(s=e("3rdparty/walkontable/src/selection"),s&&s.__esModule&&s||{"default":s}).WalkontableSelection,c=function(e){return"boolean"==typeof e&&e===!0?!0:"object"==typeof e&&e.length>0?!0:!1},d=function(){c(this.getSettings().customBorders)&&(this.customBorders||(l=this,this.customBorders=new n))},h=function(e){for(var t=0;t=0?l.view.wt.selections[n]=o:l.view.wt.selections.push(o)},g=function(e,t,o){var n=C(e,t);n=y(n,o),this.setCellMeta(e,t,"borders",n),f(n)},p=function(e){for(var t=e.range,o=t.from.row;o<=t.to.row;o++)for(var n=t.from.col;n<=t.to.col;n++){var r=C(o,n),i=0;o==t.from.row&&(i++,e.hasOwnProperty("top")&&(r.top=e.top)),o==t.to.row&&(i++,e.hasOwnProperty("bottom")&&(r.bottom=e.bottom)),n==t.from.col&&(i++,e.hasOwnProperty("left")&&(r.left=e.left)),n==t.to.col&&(i++,e.hasOwnProperty("right")&&(r.right=e.right)),i>0&&(this.setCellMeta(o,n,"borders",r),f(r))}},m=function(e,t){return"border_row"+e+"col"+t},w=function(){return{width:1,color:"#000"}},v=function(){return{hide:!0}},b=function(){return{width:1,color:"#000",cornerVisible:!1}},C=function(e,t){return{className:m(e,t),border:b(),row:e,col:t,top:v(),right:v(),bottom:v(),left:v()}},y=function(e,t){return t.hasOwnProperty("border")&&(e.border=t.border),t.hasOwnProperty("top")&&(e.top=t.top),t.hasOwnProperty("right")&&(e.right=t.right),t.hasOwnProperty("bottom")&&(e.bottom=t.bottom),t.hasOwnProperty("left")&&(e.left=t.left),e},R=function(e){for(var t=document.querySelectorAll("."+e),o=0;o'+String.fromCharCode(10003)+""+e},M=function(e){this.getSettings().customBorders&&(e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR),e.items.push({key:"borders",name:"Borders",submenu:{items:[{key:"borders:top",name:function(){var e="Top",t=O(this,"top");return t&&(e=_(e)),e},callback:function(){var e=O(this,"top");T.call(this,this.getSelectedRange(),"top",e)},disabled:!1},{key:"borders:right",name:function(){var e="Right",t=O(this,"right");return t&&(e=_(e)),e},callback:function(){var e=O(this,"right");T.call(this,this.getSelectedRange(),"right",e)},disabled:!1},{key:"borders:bottom",name:function(){var e="Bottom",t=O(this,"bottom");return t&&(e=_(e)),e},callback:function(){var e=O(this,"bottom");T.call(this,this.getSelectedRange(),"bottom",e)},disabled:!1},{key:"borders:left",name:function(){var e="Left",t=O(this,"left");return t&&(e=_(e)),e},callback:function(){var e=O(this,"left");T.call(this,this.getSelectedRange(),"left",e)},disabled:!1},{key:"borders:no_borders",name:"Remove border(s)",callback:function(){T.call(this,this.getSelectedRange(),"noBorders")},disabled:function(){return!O(this)}}]}}))};Handsontable.hooks.add("beforeInit",d),Handsontable.hooks.add("afterContextMenuDefaultOptions",M),Handsontable.hooks.add("afterInit",function(){var e=this.getSettings().customBorders;if(e){for(var t=0;tthis.boundaries.bottom&&(n=t-this.boundaries.bottom),ethis.boundaries.right&&(o=e-this.boundaries.right),this.callback(o,n)};var l,a=function(e){e.dragToScrollListening=!1;var t=e.view.wt.wtTable.holder;l=new n,t!==window&&(l.setBoundaries(t.getBoundingClientRect()),l.setCallback(function(e,o){0>e?t.scrollLeft-=50:e>0&&(t.scrollLeft+=50),0>o?t.scrollTop-=20:o>0&&(t.scrollTop+=20)}),e.dragToScrollListening=!0)};Handsontable.hooks.add("afterInit",function(){var e=this,t=s(this);t.addEventListener(document,"mouseup",function(){e.dragToScrollListening=!1}),t.addEventListener(document,"mousemove",function(t){e.dragToScrollListening&&l.check(t.clientX,t.clientY)})}),Handsontable.hooks.add("afterDestroy",function(){s(this).clear()}),Handsontable.hooks.add("afterOnCellMouseDown",function(){a(this)}),Handsontable.hooks.add("afterOnCellCornerMouseDown",function(){a(this)}),Handsontable.plugins.DragToScroll=n},{eventManager:41,plugins:57}],76:[function(e,t,o){"use strict";Object.defineProperties(o,{ManualColumnFreeze:{get:function(){return l}},__esModule:{value:!0}});var n,r,i=(n=e("_base"),n&&n.__esModule&&n||{"default":n})["default"],s=(r=e("plugins"),r&&r.__esModule&&r||{"default":r}).registerPlugin,l=function(e){$traceurRuntime.superConstructor(a).call(this,e)},a=l;$traceurRuntime.createClass(l,{isEnabled:function(){return!!this.hot.getSettings().manualColumnFreeze},enablePlugin:function(){var e=this;this.enabled||(this.addHook("modifyCol",function(t){return e.onModifyCol(t)}),this.addHook("afterContextMenuDefaultOptions",function(t){return e.addContextMenuEntry(t)}),$traceurRuntime.superGet(this,a.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,a.prototype,"disablePlugin").call(this)},init:function(){$traceurRuntime.superGet(this,a.prototype,"init").call(this),"undefined"==typeof this.hot.manualColumnPositionsPluginUsages?this.hot.manualColumnPositionsPluginUsages=["manualColumnFreeze"]:this.hot.manualColumnPositionsPluginUsages.push("manualColumnFreeze"),this.fixedColumnsCount=this.hot.getSettings().fixedColumnsLeft},onModifyCol:function(e){return this.hot.manualColumnPositionsPluginUsages.length>1?e:this.getModifiedColumnIndex(e)},getModifiedColumnIndex:function(e){return this.hot.manualColumnPositions[e]},addContextMenuEntry:function(e){var t=this;e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR,{key:"freeze_column",name:function(){var e=t.hot.getSelected()[1];return e>t.fixedColumnsCount-1?"Freeze this column":"Unfreeze this column"},disabled:function(){var e=t.hot.getSelected();return e[1]!==e[3]},callback:function(){var e=t.hot.getSelected()[1];e>t.fixedColumnsCount-1?t.freezeColumn(e):t.unfreezeColumn(e)}})},freezeColumn:function(e){if(!(e<=this.fixedColumnsCount-1)){var t=this.getModifiedColumnIndex(e)||e;this.checkPositionData(t),this.modifyColumnOrder(t,e,null,"freeze"),this.addFixedColumn(),this.hot.view.wt.wtOverlays.leftOverlay.refresh(),this.hot.view.wt.wtOverlays.adjustElementsSize()}},unfreezeColumn:function(e){if(!(e>this.fixedColumnsCount-1)){var t=this.getBestColumnReturnPosition(e),o=this.getModifiedColumnIndex(e)||e;this.checkPositionData(o),this.modifyColumnOrder(o,e,t,"unfreeze"),this.removeFixedColumn(),this.hot.view.wt.wtOverlays.leftOverlay.refresh(),this.hot.view.wt.wtOverlays.adjustElementsSize()}},addFixedColumn:function(){this.hot.updateSettings({fixedColumnsLeft:this.fixedColumnsCount+1}),this.fixedColumnsCount++},removeFixedColumn:function(){this.hot.updateSettings({fixedColumnsLeft:this.fixedColumnsCount-1}),this.fixedColumnsCount--},checkPositionData:function(e){this.hot.manualColumnPositions&&0!==this.hot.manualColumnPositions.length||this.hot.manualColumnPositions||(this.hot.manualColumnPositions=[]),e?this.hot.manualColumnPositions[e]||this.createPositionData(e+1):this.createPositionData(this.hot.countCols())},createPositionData:function(e){if(this.hot.manualColumnPositions.lengtht;t++)this.hot.manualColumnPositions[t]=t},modifyColumnOrder:function(e,t,o,n){null==o&&(o=e),"freeze"===n?this.hot.manualColumnPositions.splice(this.fixedColumnsCount,0,this.hot.manualColumnPositions.splice(t,1)[0]):"unfreeze"===n&&this.hot.manualColumnPositions.splice(o,0,this.hot.manualColumnPositions.splice(t,1)[0])},getBestColumnReturnPosition:function(e){for(var t=this.fixedColumnsCount,o=this.getModifiedColumnIndex(t),n=this.getModifiedColumnIndex(e);n>o;)t++,o=this.getModifiedColumnIndex(t);return t-1}},{},i),s("manualColumnFreeze",l)},{_base:58,plugins:57}],77:[function(e,t,o){"use strict";function n(){function e(e){p=this,m=e;var t=this.view.wt.wtTable.getCoords(e).col;if(t>=0){f=t;var o=m.getBoundingClientRect();a=o.left,w.style.top=o.top+"px",w.style.left=a+"px",p.rootElement.appendChild(w)}}function t(e,t){var o=e.getBoundingClientRect(),n=6;t>0?w.style.left=o.left+o.width-n+"px":w.style.left=o.left+"px"}function o(){var e=this;u(w,"active"),u(v,"active");var t=m.getBoundingClientRect();v.style.width=t.width+"px",v.style.height=e.view.maximumVisibleElementHeight(0)+"px",v.style.top=w.style.top,v.style.left=a+"px",e.rootElement.appendChild(v)}function n(e){v.style.left=a+e+"px"}function r(){d(w,"active"),d(v,"active")}var i,s,l,a,f,p,m,w=document.createElement("DIV"),v=document.createElement("DIV"),b=h(this);w.className="manualColumnMover",v.className="manualColumnMoverGuide";var C=function(){var e=this;Handsontable.hooks.run(e,"persistentStateSave","manualColumnPositions",e.manualColumnPositions)},y=function(){var e=this,t={};return Handsontable.hooks.run(e,"persistentStateLoad","manualColumnPositions",t),t.value},R=function(e){return"BODY"!=e.tagName?"THEAD"==e.parentNode.tagName?!0:(e=e.parentNode,R(e)):!1},E=function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:E(e.parentNode):null},S=function(){var a,u=this;b.addEventListener(u.rootElement,"mouseover",function(o){if(R(o.target)){var n=E(o.target);if(n)if(a){var r=u.view.wt.wtTable.getCoords(n).col;r>=0&&(s=r,t(o.target,s-i))}else e.call(u,n)}}),b.addEventListener(u.rootElement,"mousedown",function(e){c(e.target,"manualColumnMover")&&(l=g(e),o.call(u),a=u,i=f,s=f)}),b.addEventListener(window,"mousemove",function(e){a&&n(g(e)-l)}),b.addEventListener(window,"mouseup",function(t){a&&(r(),a=!1,O(u.manualColumnPositions,u.countCols()),u.manualColumnPositions.splice(s,0,u.manualColumnPositions.splice(i,1)[0]),Handsontable.hooks.run(u,"beforeColumnMove",i,s),u.forceFullRender=!0,u.view.render(),C.call(u),Handsontable.hooks.run(u,"afterColumnMove",i,s),e.call(u,m))}),u.addHook("afterDestroy",T)},T=function(){b.clear()},O=function(e,t){if(e.lengtho;o++)e[o]=o};this.beforeInit=function(){this.manualColumnPositions=[]},this.init=function(e){var t=this,o=!!this.getSettings().manualColumnMove;if(o){var n=this.getSettings().manualColumnMove,r=y.call(t);"undefined"!=typeof r?this.manualColumnPositions=r:Array.isArray(n)?this.manualColumnPositions=n:this.manualColumnPositions=[],("afterInit"===e||"afterUpdateSettings"===e&&0===b.context.eventListeners.length)&&("undefined"==typeof t.manualColumnPositionsPluginUsages?t.manualColumnPositionsPluginUsages=["manualColumnMove"]:t.manualColumnPositionsPluginUsages.push("manualColumnMove"),S.call(this),this.manualColumnPositions.length>0&&(this.forceFullRender=!0,this.render()))}else{var i=t.manualColumnPositionsPluginUsages?t.manualColumnPositionsPluginUsages.indexOf("manualColumnMove"):-1;i>-1&&(T.call(this),this.manualColumnPositions=[],t.manualColumnPositionsPluginUsages[i]=void 0)}},this.modifyCol=function(e){return this.getSettings().manualColumnMove?("undefined"==typeof this.manualColumnPositions[e]&&O(this.manualColumnPositions,e+1),this.manualColumnPositions[e]):e},this.afterRemoveCol=function(e,t){if(this.getSettings().manualColumnMove){var o,n=this.manualColumnPositions;o=n.splice(e,t),n=n.map(function(e){var t,n=e;for(t=0;to[t]&&n--;return n}),this.manualColumnPositions=n}},this.afterCreateCol=function(e,t){if(this.getSettings().manualColumnMove){var o=this.manualColumnPositions;if(o.length){for(var n=[],r=0;t>r;r++)n.push(e+r);e>=o.length?o.concat(n):(o=o.map(function(o){return o>=e?o+t:o}),o.splice.apply(o,[e,0].concat(n))),this.manualColumnPositions=o}}}}Object.defineProperties(o,{ManualColumnMove:{get:function(){return n}},__esModule:{value:!0}});var r,i,s,l,a=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=a.addClass,c=a.hasClass,d=a.removeClass,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,f=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=f.pageX,p=(f.pageY,(l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin,new n);Handsontable.hooks.add("beforeInit",p.beforeInit),Handsontable.hooks.add("afterInit",function(){p.init.call(this,"afterInit")}),Handsontable.hooks.add("afterUpdateSettings",function(){p.init.call(this,"afterUpdateSettings")}),Handsontable.hooks.add("modifyCol",p.modifyCol),Handsontable.hooks.add("afterRemoveCol",p.afterRemoveCol),Handsontable.hooks.add("afterCreateCol",p.afterCreateCol),Handsontable.hooks.register("beforeColumnMove"),Handsontable.hooks.register("afterColumnMove")},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],78:[function(e,t,o){"use strict";Object.defineProperties(o,{ManualColumnResize:{get:function(){return w}},__esModule:{value:!0}});var n,r,i,s,l,a=(n=e("_base.js"),n&&n.__esModule&&n||{"default":n})["default"],u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=u.addClass,d=u.hasClass,h=u.removeClass,f=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,g=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=g.pageX,m=(g.pageY,(l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin),w=function(e){$traceurRuntime.superConstructor(v).call(this,e),this.currentTH=null,this.currentCol=null,this.currentWidth=null,this.newSize=null,this.startY=null,this.startWidth=null,this.startOffset=null,this.handle=document.createElement("DIV"),this.guide=document.createElement("DIV"),this.eventManager=f(this),this.pressed=null,this.dblclick=0,this.autoresizeTimeout=null,this.manualColumnWidths=[],c(this.handle,"manualColumnResizer"),c(this.guide,"manualColumnResizerGuide")},v=w;$traceurRuntime.createClass(w,{isEnabled:function(){return this.hot.getSettings().manualColumnResize},enablePlugin:function(){var e=this;if(!this.enabled){this.manualColumnWidths=[];var t=this.hot.getSettings().manualColumnResize,o=this.loadManualColumnWidths();this.addHook("modifyColWidth",function(t,o){return e.onModifyColWidth(t,o)}),"undefined"!=typeof o?this.manualColumnWidths=o:Array.isArray(t)?this.manualColumnWidths=t:this.manualColumnWidths=[],Handsontable.hooks.register("beforeColumnResize"),Handsontable.hooks.register("afterColumnResize"),this.bindEvents(),$traceurRuntime.superGet(this,v.prototype,"enablePlugin").call(this)}},updatePlugin:function(){var e=this.hot.getSettings().manualColumnResize;Array.isArray(e)?this.manualColumnWidths=e:this.manualColumnWidths=[]},disablePlugin:function(){$traceurRuntime.superGet(this,v.prototype,"disablePlugin").call(this)},saveManualColumnWidths:function(){this.hot.runHooks("persistentStateSave","manualColumnWidths",this.manualColumnWidths)},loadManualColumnWidths:function(){var e={};return this.hot.runHooks("persistentStateLoad","manualColumnWidths",e),e.value},setupHandlePosition:function(e){this.currentTH=e;var t=this.hot.view.wt.wtTable.getCoords(e).col;if(t>=0){var o=this.currentTH.getBoundingClientRect();this.currentCol=t,this.startOffset=o.left-6,this.startWidth=parseInt(o.width,10),this.handle.style.top=o.top+"px",this.handle.style.left=this.startOffset+this.startWidth+"px",this.hot.rootElement.appendChild(this.handle)}},refreshHandlePosition:function(){this.handle.style.left=this.startOffset+this.currentWidth+"px"},setupGuidePosition:function(){c(this.handle,"active"),c(this.guide,"active"),this.guide.style.top=this.handle.style.top,this.guide.style.left=this.handle.style.left,this.guide.style.height=this.hot.view.maximumVisibleElementHeight(0)+"px",this.hot.rootElement.appendChild(this.guide)},refreshGuidePosition:function(){this.guide.style.left=this.handle.style.left},hideHandleAndGuide:function(){h(this.handle,"active"),h(this.guide,"active")},checkIfColumnHeader:function(e){return"BODY"!=e.tagName?"THEAD"==e.parentNode.tagName?!0:(e=e.parentNode,this.checkIfColumnHeader(e)):!1},getTHFromTargetElement:function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:this.getTHFromTargetElement(e.parentNode):null},onMouseOver:function(e){if(this.checkIfColumnHeader(e.target)){var t=this.getTHFromTargetElement(e.target);if(!t)return;var o=t.getAttribute("colspan");!t||null!==o&&1!==o||this.pressed||this.setupHandlePosition(t)}},afterMouseDownTimeout:function(){if(this.dblclick>=2){var e=this.hot.runHooks("beforeColumnResize",this.currentCol,this.newSize,!0);void 0!==e&&(this.newSize=e),this.setManualSize(this.currentCol,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.hot.runHooks("afterColumnResize",this.currentCol,this.newSize,!0)}this.dblclick=0,this.autoresizeTimeout=null},onMouseDown:function(e){var t=this;d(e.target,"manualColumnResizer")&&(this.setupGuidePosition(),this.pressed=this.hot,null===this.autoresizeTimeout&&(this.autoresizeTimeout=setTimeout(function(){return t.afterMouseDownTimeout()},500),this.hot._registerTimeout(this.autoresizeTimeout)),this.dblclick++,this.startX=p(e),this.newSize=this.startWidth)},onMouseMove:function(e){this.pressed&&(this.currentWidth=this.startWidth+(p(e)-this.startX),this.newSize=this.setManualSize(this.currentCol,this.currentWidth),this.refreshHandlePosition(),this.refreshGuidePosition())},onMouseUp:function(e){this.pressed&&(this.hideHandleAndGuide(),this.pressed=!1,this.newSize!=this.startWidth&&(this.hot.runHooks("beforeColumnResize",this.currentCol,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",this.currentCol,this.newSize)),this.setupHandlePosition(this.currentTH))},bindEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},setManualSize:function(e,t){return t=Math.max(t,20),e=this.hot.runHooks("modifyCol",e),this.manualColumnWidths[e]=t,t},onModifyColWidth:function(e,t){return this.enabled&&(t=this.hot.runHooks("modifyCol",t),this.hot.getSettings().manualColumnResize&&this.manualColumnWidths[t])?this.manualColumnWidths[t]:e}},{},a),m("manualColumnResize",w)},{"_base.js":58,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],79:[function(e,t,o){"use strict";function n(){function e(e){var t=this;p=e;var o=this.view.wt.wtTable.getCoords(e).row;if(o>=0){f=o;var n=p.getBoundingClientRect();a=n.top,m.style.top=a+"px",m.style.left=n.left+"px",t.rootElement.appendChild(m)}}function t(e,t){var o=e.getBoundingClientRect(),n=6;t>0?m.style.top=o.top+o.height-n+"px":m.style.top=o.top+"px"}function o(){var e=this;u(m,"active"),u(w,"active");var t=p.getBoundingClientRect();w.style.width=e.view.maximumVisibleElementWidth(0)+"px",w.style.height=t.height+"px",w.style.top=a+"px",w.style.left=m.style.left,e.rootElement.appendChild(w)}function n(e){w.style.top=a+e+"px"}function r(){d(m,"active"),d(w,"active")}var i,s,l,a,f,p,m=document.createElement("DIV"),w=document.createElement("DIV"),v=h(this);m.className="manualRowMover",w.className="manualRowMoverGuide";var b=function(){var e=this;Handsontable.hooks.run(e,"persistentStateSave","manualRowPositions",e.manualRowPositions)},C=function(){var e=this,t={};return Handsontable.hooks.run(e,"persistentStateLoad","manualRowPositions",t),t.value},y=function(e){return"BODY"!=e.tagName?"TBODY"==e.parentNode.tagName?!0:(e=e.parentNode,y(e)):!1},R=function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:R(e.parentNode):null},E=function(){var a,u=this;v.addEventListener(u.rootElement,"mouseover",function(o){if(y(o.target)){var n=R(o.target);n&&(a?(s=u.view.wt.wtTable.getCoords(n).row,t(n,s-i)):e.call(u,n))}}),v.addEventListener(u.rootElement,"mousedown",function(e){c(e.target,"manualRowMover")&&(l=g(e),o.call(u),a=u,i=f,s=f)}),v.addEventListener(window,"mousemove",function(e){a&&n(g(e)-l)}),v.addEventListener(window,"mouseup",function(t){a&&(r(),a=!1,T(u.manualRowPositions,u.countRows()),u.manualRowPositions.splice(s,0,u.manualRowPositions.splice(i,1)[0]),Handsontable.hooks.run(u,"beforeRowMove",i,s),u.forceFullRender=!0,u.view.render(),b.call(u),Handsontable.hooks.run(u,"afterRowMove",i,s),e.call(u,p))}),u.addHook("afterDestroy",S)},S=function(){v.clear()},T=function(e,t){if(e.lengtho;o++)e[o]=o};this.beforeInit=function(){this.manualRowPositions=[]},this.init=function(e){var t=this,o=!!t.getSettings().manualRowMove;if(o){var n=t.getSettings().manualRowMove,r=C.call(t);"undefined"==typeof t.manualRowPositionsPluginUsages?t.manualRowPositionsPluginUsages=["manualColumnMove"]:t.manualRowPositionsPluginUsages.push("manualColumnMove"),"undefined"!=typeof r?this.manualRowPositions=r:Array.isArray(n)?this.manualRowPositions=n:this.manualRowPositions=[],("afterInit"===e||"afterUpdateSettings"===e&&0===v.context.eventListeners.length)&&(E.call(this),this.manualRowPositions.length>0&&(t.forceFullRender=!0,t.render()))}else{var i=t.manualRowPositionsPluginUsages?t.manualRowPositionsPluginUsages.indexOf("manualColumnMove"):-1;i>-1&&(S.call(this),t.manualRowPositions=[],t.manualRowPositionsPluginUsages[i]=void 0)}},this.modifyRow=function(e){var t=this;return t.getSettings().manualRowMove?("undefined"==typeof t.manualRowPositions[e]&&T(this.manualRowPositions,e+1),t.manualRowPositions[e]):e}}Object.defineProperties(o,{ManualRowMove:{get:function(){return n}},__esModule:{value:!0}});var r,i,s,l,a=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=a.addClass,c=a.hasClass,d=a.removeClass,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,f=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=(f.pageX,f.pageY),p=((l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin,new n);Handsontable.hooks.add("beforeInit",p.beforeInit),Handsontable.hooks.add("afterInit",function(){p.init.call(this,"afterInit")}),Handsontable.hooks.add("afterUpdateSettings",function(){p.init.call(this,"afterUpdateSettings")}),Handsontable.hooks.add("modifyRow",p.modifyRow),Handsontable.hooks.register("beforeRowMove"),Handsontable.hooks.register("afterRowMove")},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],80:[function(e,t,o){"use strict";Object.defineProperties(o,{ManualRowResize:{get:function(){return w}},__esModule:{value:!0}});var n,r,i,s,l,a=(n=e("_base.js"),n&&n.__esModule&&n||{"default":n})["default"],u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=u.addClass,d=u.hasClass,h=u.removeClass,f=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,g=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=(g.pageX,g.pageY),m=(l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin,w=function(e){$traceurRuntime.superConstructor(v).call(this,e),this.currentTH=null,this.currentRow=null,this.currentHeight=null,this.newSize=null,this.startY=null,this.startHeight=null,this.startOffset=null,this.handle=document.createElement("DIV"),this.guide=document.createElement("DIV"),this.eventManager=f(this),this.pressed=null,this.dblclick=0,this.autoresizeTimeout=null,this.manualRowHeights=[],c(this.handle,"manualRowResizer"),c(this.guide,"manualRowResizerGuide")},v=w;$traceurRuntime.createClass(w,{isEnabled:function(){return this.hot.getSettings().manualRowResize},enablePlugin:function(){var e=this;if(!this.enabled){this.manualRowHeights=[];var t=this.hot.getSettings().manualRowResize,o=this.loadManualRowHeights();"undefined"!=typeof o?this.manualRowHeights=o:Array.isArray(t)?this.manualRowHeights=t:this.manualRowHeights=[],this.addHook("modifyRowHeight",function(t,o){return e.onModifyRowHeight(t,o)}),Handsontable.hooks.register("beforeRowResize"),Handsontable.hooks.register("afterRowResize"),this.bindEvents(),$traceurRuntime.superGet(this,v.prototype,"enablePlugin").call(this)}},updatePlugin:function(){var e=this.hot.getSettings().manualRowResize;Array.isArray(e)?this.manualRowHeights=e:this.manualRowHeights=[]},disablePlugin:function(){$traceurRuntime.superGet(this,v.prototype,"disablePlugin").call(this)},saveManualRowHeights:function(){this.hot.runHooks("persistentStateSave","manualRowHeights",this.manualRowHeights)},loadManualRowHeights:function(){var e={};return this.hot.runHooks("persistentStateLoad","manualRowHeights",e),e.value},setupHandlePosition:function(e){this.currentTH=e;var t=this.hot.view.wt.wtTable.getCoords(e).row;if(t>=0){var o=this.currentTH.getBoundingClientRect();this.currentRow=t,this.startOffset=o.top-6,this.startHeight=parseInt(o.height,10),this.handle.style.left=o.left+"px",this.handle.style.top=this.startOffset+this.startHeight+"px",this.hot.rootElement.appendChild(this.handle)}},refreshHandlePosition:function(){this.handle.style.top=this.startOffset+this.currentHeight+"px"},setupGuidePosition:function(){c(this.handle,"active"),c(this.guide,"active"),this.guide.style.top=this.handle.style.top,this.guide.style.left=this.handle.style.left,this.guide.style.width=this.hot.view.maximumVisibleElementWidth(0)+"px",this.hot.rootElement.appendChild(this.guide)},refreshGuidePosition:function(){this.guide.style.top=this.handle.style.top},hideHandleAndGuide:function(){h(this.handle,"active"),h(this.guide,"active")},checkIfRowHeader:function(e){return"BODY"!=e.tagName?"TBODY"==e.parentNode.tagName?!0:(e=e.parentNode,this.checkIfRowHeader(e)):!1},getTHFromTargetElement:function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:this.getTHFromTargetElement(e.parentNode):null},onMouseOver:function(e){if(this.checkIfRowHeader(e.target)){var t=this.getTHFromTargetElement(e.target);t&&(this.pressed||this.setupHandlePosition(t))}},afterMouseDownTimeout:function(){if(this.dblclick>=2){var e=this.hot.runHooks("beforeRowResize",this.currentRow,this.newSize,!0);void 0!==e&&(this.newSize=e),this.setManualSize(this.currentRow,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.hot.runHooks("afterRowResize",this.currentRow,this.newSize,!0)}this.dblclick=0,this.autoresizeTimeout=null},onMouseDown:function(e){var t=this;d(e.target,"manualRowResizer")&&(this.setupGuidePosition(),this.pressed=this.hot,null==this.autoresizeTimeout&&(this.autoresizeTimeout=setTimeout(function(){return t.afterMouseDownTimeout()},500),this.hot._registerTimeout(this.autoresizeTimeout)),this.dblclick++,this.startY=p(e),this.newSize=this.startHeight)},onMouseMove:function(e){this.pressed&&(this.currentHeight=this.startHeight+(p(e)-this.startY),this.newSize=this.setManualSize(this.currentRow,this.currentHeight),this.refreshHandlePosition(),this.refreshGuidePosition())},onMouseUp:function(e){this.pressed&&(this.hideHandleAndGuide(),this.pressed=!1,this.newSize!=this.startHeight&&(this.hot.runHooks("beforeRowResize",this.currentRow,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.currentRow,this.newSize)),this.setupHandlePosition(this.currentTH))},bindEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},setManualSize:function(e,t){return e=this.hot.runHooks("modifyRow",e),this.manualRowHeights[e]=t,t},onModifyRowHeight:function(e,t){if(this.enabled){var o=this.hot.getPlugin("autoRowSize"),n=o?o.heights[t]:null;t=this.hot.runHooks("modifyRow",t);var r=this.manualRowHeights[t];if(void 0!==r&&(r===n||r>(e||0)))return r}return e}},{},a),m("manualRowResize",w)},{"_base.js":58,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],81:[function(e,t,o){"use strict";function n(){var e=[];return e.getInfo=function(e,t){for(var o=0,n=this.length;n>o;o++)if(this[o].row<=e&&this[o].row+this[o].rowspan-1>=e&&this[o].col<=t&&this[o].col+this[o].colspan-1>=t)return this[o]},e.setInfo=function(e){for(var t=0,o=this.length;o>t;t++)if(this[t].row===e.row&&this[t].col===e.col)return void(this[t]=e);this.push(e)},e.removeInfo=function(e,t){for(var o=0,n=this.length;n>o;o++)if(this[o].row===e&&this[o].col===t){this.splice(o,1);break}},e}function r(e){if(this.mergedCellInfoCollection=new n,Array.isArray(e))for(var t=0,o=e.length;o>t;t++)this.mergedCellInfoCollection.setInfo(e[t])}function i(e,t){var o=this.getSettings().mergeCells;if(o&&!this.selection.isMultiple()){ +var n=this.mergeCells.mergedCellInfoCollection.getInfo(e[0],e[1]);n&&(e[0]=n.row,e[1]=n.col,e[2]=n.row+n.rowspan-1,e[3]=n.col+n.colspan-1)}}function s(e,t){this.mergeCells&&this.mergeCells.shiftCollection("right",e,t)}function l(e,t){this.mergeCells&&this.mergeCells.shiftCollection("left",e,t)}function a(e,t){this.mergeCells&&this.mergeCells.shiftCollection("down",e,t)}function u(e,t){this.mergeCells&&this.mergeCells.shiftCollection("up",e,t)}Object.defineProperties(o,{MergeCells:{get:function(){return r}},__esModule:{value:!0}});var c,d,h,f,g,p=((c=e("plugins"),c&&c.__esModule&&c||{"default":c}).registerPlugin,(d=e("helpers/dom/event"),d&&d.__esModule&&d||{"default":d}).stopImmediatePropagation),m=(h=e("3rdparty/walkontable/src/cell/coords"),h&&h.__esModule&&h||{"default":h}).WalkontableCellCoords,w=(f=e("3rdparty/walkontable/src/cell/range"),f&&f.__esModule&&f||{"default":f}).WalkontableCellRange,v=(g=e("3rdparty/walkontable/src/table"),g&&g.__esModule&&g||{"default":g}).WalkontableTable;r.prototype.canMergeRange=function(e){return!e.isSingle()},r.prototype.mergeRange=function(e){if(this.canMergeRange(e)){var t=e.getTopLeftCorner(),o=e.getBottomRightCorner(),n={};n.row=t.row,n.col=t.col,n.rowspan=o.row-t.row+1,n.colspan=o.col-t.col+1,this.mergedCellInfoCollection.setInfo(n)}},r.prototype.mergeOrUnmergeSelection=function(e){var t=this.mergedCellInfoCollection.getInfo(e.from.row,e.from.col);t?this.unmergeSelection(e.from):this.mergeSelection(e)},r.prototype.mergeSelection=function(e){this.mergeRange(e)},r.prototype.unmergeSelection=function(e){var t=this.mergedCellInfoCollection.getInfo(e.row,e.col);this.mergedCellInfoCollection.removeInfo(t.row,t.col)},r.prototype.applySpanProperties=function(e,t,o){var n=this.mergedCellInfoCollection.getInfo(t,o);n?n.row===t&&n.col===o?(e.setAttribute("rowspan",n.rowspan),e.setAttribute("colspan",n.colspan)):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"),e.style.display="none"):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"))},r.prototype.modifyTransform=function(e,t,o){var n=function(e,t){return t.row>=e.row&&t.row<=e.row+e.rowspan-1?!0:!1},r=function(e,t){return t.col>=e.col&&t.col<=e.col+e.colspan-1?!0:!1},i=function(e){return new m(t.to.row+e.row,t.to.col+e.col)},s={row:o.row,col:o.col};if("modifyTransformStart"==e){this.lastDesiredCoords||(this.lastDesiredCoords=new m(null,null));for(var l,a=new m(t.highlight.row,t.highlight.col),u=this.mergedCellInfoCollection.getInfo(a.row,a.col),c=0,d=this.mergedCellInfoCollection.length;d>c;c++){var h=this.mergedCellInfoCollection[c];if(h=new m(h.row+h.rowspan-1,h.col+h.colspan-1),t.includes(h)){l=!0;break}}if(u){var f=new m(u.row,u.col),g=new m(u.row+u.rowspan-1,u.col+u.colspan-1),p=new w(f,f,g);p.includes(this.lastDesiredCoords)||(this.lastDesiredCoords=new m(null,null)),s.row=this.lastDesiredCoords.row?this.lastDesiredCoords.row-a.row:s.row,s.col=this.lastDesiredCoords.col?this.lastDesiredCoords.col-a.col:s.col,o.row>0?s.row=u.row+u.rowspan-1-a.row+o.row:o.row<0&&(s.row=a.row-u.row+o.row),o.col>0?s.col=u.col+u.colspan-1-a.col+o.col:o.col<0&&(s.col=a.col-u.col+o.col)}var v=new m(t.highlight.row+s.row,t.highlight.col+s.col),b=this.mergedCellInfoCollection.getInfo(v.row,v.col);b&&(this.lastDesiredCoords=v,s={row:b.row-a.row,col:b.col-a.col})}else if("modifyTransformEnd"==e)for(var c=0,d=this.mergedCellInfoCollection.length;d>c;c++){var C=this.mergedCellInfoCollection[c],f=new m(C.row,C.col),g=new m(C.row+C.rowspan-1,C.col+C.colspan-1),y=new w(f,f,g),R=t.getBordersSharedWith(y);if(y.isEqual(t))t.setDirection("NW-SE");else if(R.length>0){var E=t.highlight.isEqual(y.from);R.indexOf("top")>-1?t.to.isSouthEastOf(y.from)&&E?t.setDirection("NW-SE"):t.to.isSouthWestOf(y.from)&&E&&t.setDirection("NE-SW"):R.indexOf("bottom")>-1&&(t.to.isNorthEastOf(y.from)&&E?t.setDirection("SW-NE"):t.to.isNorthWestOf(y.from)&&E&&t.setDirection("SE-NW"))}var v=i(s),S=n(C,v),T=r(C,v);t.includesRange(y)&&(y.includes(v)||S||T)&&(S&&(s.row<0?s.row-=C.rowspan-1:s.row>0&&(s.row+=C.rowspan-1)),T&&(s.col<0?s.col-=C.colspan-1:s.col>0&&(s.col+=C.colspan-1)))}0!==s.row&&(o.row=s.row),0!==s.col&&(o.col=s.col)},r.prototype.shiftCollection=function(e,t,o){var n=[0,0];switch(e){case"right":n[0]+=1;break;case"left":n[0]-=1;break;case"down":n[1]+=1;break;case"up":n[1]-=1}for(var r=0;ro;o++)e.mergeCells.mergedCellInfoCollection.setInfo(t[o])}else e.mergeCells=new r(t);else e.mergeCells&&(e.mergeCells.mergedCellInfoCollection=new n)},R=function(e){if(this.mergeCells){var t=(e.ctrlKey||e.metaKey)&&!e.altKey;t&&77===e.keyCode&&(this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()),this.render(),p(e))}},E=function(e){this.getSettings().mergeCells&&(e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR),e.items.push({key:"mergeCells",name:function(){var e=this.getSelected(),t=this.mergeCells.mergedCellInfoCollection.getInfo(e[0],e[1]);return t?"Unmerge cells":"Merge cells"},callback:function(){this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()),this.render()},disabled:function(){return!1}}))},S=function(e,t,o,n,r,i){this.mergeCells&&this.mergeCells.applySpanProperties(e,t,o)},T=function(e){return function(t){var o=this.getSettings().mergeCells;if(o){var n=this.getSelectedRange();if(this.mergeCells.modifyTransform(e,n,t),"modifyTransformEnd"===e){var r=this.countRows(),i=this.countCols();n.from.row<0?n.from.row=0:n.from.row>0&&n.from.row>=r&&(n.from.row=n.from-1),n.from.col<0?n.from.col=0:n.from.col>0&&n.from.col>=i&&(n.from.col=i-1)}}}},O=function(e){this.lastDesiredCoords=null;var t=this.getSettings().mergeCells;if(t){var o=this.getSelectedRange();o.highlight=new m(o.highlight.row,o.highlight.col),o.to=e;var n=!1;do{n=!1;for(var r=0,i=this.mergeCells.mergedCellInfoCollection.length;i>r;r++){var s=this.mergeCells.mergedCellInfoCollection[r],l=new m(s.row,s.col),a=new m(s.row+s.rowspan-1,s.col+s.colspan-1),u=new w(l,l,a);o.expandByRange(u)&&(e.row=o.to.row,e.col=o.to.col,n=!0)}}while(n)}},_=function(e,t){if(t&&"area"==t){var o=this.getSettings().mergeCells;if(o)for(var n=this.getSelectedRange(),r=new w(n.from,n.from,n.from),i=new w(n.to,n.to,n.to),s=0,l=this.mergeCells.mergedCellInfoCollection.length;l>s;s++){var a=this.mergeCells.mergedCellInfoCollection[s],u=new m(a.row,a.col),c=new m(a.row+a.rowspan-1,a.col+a.colspan-1),d=new w(u,u,c);r.expandByRange(d)&&(e[0]=r.from.row,e[1]=r.from.col),i.expandByRange(d)&&(e[2]=i.from.row,e[3]=i.from.col)}}},M=function(e,t,o){var n=this.getSettings().mergeCells;if(n){var r=this.mergeCells.mergedCellInfoCollection.getInfo(e,t);!r||r.row==e&&r.col==t||(o.copyable=!1)}},H=function(e){var t=this.getSettings().mergeCells;if(t)for(var o,n=this.countCols(),r=0;n>r;r++){if(o=this.mergeCells.mergedCellInfoCollection.getInfo(e.startRow,r),o&&o.rowe.endRow)return e.endRow=i,H.call(this,e)}}},k=function(e){var t=this.getSettings().mergeCells;if(t)for(var o,n=this.countRows(),r=0;n>r;r++){if(o=this.mergeCells.mergedCellInfoCollection.getInfo(r,e.startColumn),o&&o.cole.endColumn)return e.endColumn=i,k.call(this,e)}}},A=function(e){if(e&&this.mergeCells){var t=this.mergeCells.mergedCellInfoCollection,o=this.getSelectedRange();for(var n in t)if(o.highlight.row==t[n].row&&o.highlight.col==t[n].col&&o.to.row==t[n].row+t[n].rowspan-1&&o.to.col==t[n].col+t[n].colspan-1)return!1}return e};Handsontable.hooks.add("beforeInit",b),Handsontable.hooks.add("afterInit",C),Handsontable.hooks.add("afterUpdateSettings",y),Handsontable.hooks.add("beforeKeyDown",R),Handsontable.hooks.add("modifyTransformStart",T("modifyTransformStart")),Handsontable.hooks.add("modifyTransformEnd",T("modifyTransformEnd")),Handsontable.hooks.add("beforeSetRangeEnd",O),Handsontable.hooks.add("beforeDrawBorders",_),Handsontable.hooks.add("afterIsMultipleSelection",A),Handsontable.hooks.add("afterRenderer",S),Handsontable.hooks.add("afterContextMenuDefaultOptions",E),Handsontable.hooks.add("afterGetCellMeta",M),Handsontable.hooks.add("afterViewportRowCalculatorOverride",H),Handsontable.hooks.add("afterViewportColumnCalculatorOverride",k),Handsontable.hooks.add("afterAutofillApplyValues",i),Handsontable.hooks.add("afterCreateCol",s),Handsontable.hooks.add("afterRemoveCol",l),Handsontable.hooks.add("afterCreateRow",a),Handsontable.hooks.add("afterRemoveRow",u),Handsontable.MergeCells=r},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/table":20,"helpers/dom/event":46,plugins:57}],82:[function(e,t,o){"use strict";Object.defineProperties(o,{MultipleSelectionHandles:{get:function(){return g}},__esModule:{value:!0}});var n,r,i,s,l=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),a=l.getWindowScrollTop,u=l.hasClass,c=l.getWindowScrollLeft,d=(r=e("_base"),r&&r.__esModule&&r||{"default":r})["default"],h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,f=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}).registerPlugin,g=function(e){$traceurRuntime.superConstructor(p).call(this,e),this.dragged=[],this.eventManager=null,this.lastSetCell=null},p=g;$traceurRuntime.createClass(g,{isEnabled:function(){return Handsontable.mobileBrowser},enablePlugin:function(){this.enabled||(this.eventManager||(this.eventManager=new h(this)),this.registerListeners(),$traceurRuntime.superGet(this,p.prototype,"enablePlugin").call(this))},registerListeners:function(){function e(e){if(1===t.dragged.length)return t.dragged.splice(0,t.dragged.length),!0;var o=t.dragged.indexOf(e);return-1==o?!1:void(0===o?t.dragged=t.dragged.slice(0,1):1==o&&(t.dragged=t.dragged.slice(-1)))}var t=this;this.eventManager.addEventListener(this.hot.rootElement,"touchstart",function(e){var o;return u(e.target,"topLeftSelectionHandle-HitArea")?(o=t.hot.getSelectedRange(),t.dragged.push("topLeft"),t.touchStartRange={width:o.getWidth(),height:o.getHeight(),direction:o.getDirection()},e.preventDefault(),!1):u(e.target,"bottomRightSelectionHandle-HitArea")?(o=t.hot.getSelectedRange(),t.dragged.push("bottomRight"),t.touchStartRange={width:o.getWidth(),height:o.getHeight(),direction:o.getDirection()},e.preventDefault(),!1):void 0}),this.eventManager.addEventListener(this.hot.rootElement,"touchend",function(o){return u(o.target,"topLeftSelectionHandle-HitArea")?(e.call(t,"topLeft"),t.touchStartRange=void 0,o.preventDefault(),!1):u(o.target,"bottomRightSelectionHandle-HitArea")?(e.call(t,"bottomRight"),t.touchStartRange=void 0,o.preventDefault(),!1):void 0}),this.eventManager.addEventListener(this.hot.rootElement,"touchmove",function(e){var o,n,r,i,s,l,u,d=a(),h=c();0!==t.dragged.length&&(o=document.elementFromPoint(e.touches[0].screenX-h,e.touches[0].screenY-d),o&&o!==t.lastSetCell&&(("TD"==o.nodeName||"TH"==o.nodeName)&&(n=t.hot.getCoords(o),-1==n.col&&(n.col=0),r=t.hot.getSelectedRange(),i=r.getWidth(),s=r.getHeight(),l=r.getDirection(),1==i&&1==s&&t.hot.selection.setRangeEnd(n),u=t.getCurrentRangeCoords(r,n,t.touchStartRange.direction,l,t.dragged[0]),null!==u.start&&t.hot.selection.setRangeStart(u.start),t.hot.selection.setRangeEnd(u.end),t.lastSetCell=o),e.preventDefault()))})},getCurrentRangeCoords:function(e,t,o,n,r){var i=e.getTopLeftCorner(),s=e.getBottomRightCorner(),l=e.getBottomLeftCorner(),a=e.getTopRightCorner(),u={start:null,end:null};switch(o){case"NE-SW":switch(n){case"NE-SW":case"NW-SE":u="topLeft"==r?{start:new WalkontableCellCoords(t.row,e.highlight.col),end:new WalkontableCellCoords(l.row,t.col)}:{start:new WalkontableCellCoords(e.highlight.row,t.col),end:new WalkontableCellCoords(t.row,i.col)};break;case"SE-NW":"bottomRight"==r&&(u={start:new WalkontableCellCoords(s.row,t.col),end:new WalkontableCellCoords(t.row,i.col)})}break;case"NW-SE":switch(n){case"NE-SW":"topLeft"==r?u={start:t,end:l}:u.end=t;break;case"NW-SE":"topLeft"==r?u={start:t,end:s}:u.end=t;break;case"SE-NW":"topLeft"==r?u={start:t,end:i}:u.end=t;break;case"SW-NE":"topLeft"==r?u={start:t,end:a}:u.end=t}break;case"SW-NE":switch(n){case"NW-SE":u="bottomRight"==r?{start:new WalkontableCellCoords(t.row,i.col),end:new WalkontableCellCoords(l.row,t.col)}:{start:new WalkontableCellCoords(i.row,t.col),end:new WalkontableCellCoords(t.row,s.col)};break;case"SW-NE":u="topLeft"==r?{start:new WalkontableCellCoords(e.highlight.row,t.col),end:new WalkontableCellCoords(t.row,s.col)}:{start:new WalkontableCellCoords(t.row,i.col),end:new WalkontableCellCoords(i.row,t.col)};break;case"SE-NW":"bottomRight"==r?u={start:new WalkontableCellCoords(t.row,a.col),end:new WalkontableCellCoords(i.row,t.col)}:"topLeft"==r&&(u={start:l,end:t})}break;case"SE-NW":switch(n){case"NW-SE":case"NE-SW":case"SW-NE":"topLeft"==r&&(u.end=t);break;case"SE-NW":"topLeft"==r?u.end=t:u={start:t,end:i}}}return u},isDragged:function(){return this.dragged.length>0}},{},d),f("multipleSelectionHandles",g)},{_base:58,eventManager:41,"helpers/dom/element":45,plugins:57}],83:[function(e,t,o){"use strict";function n(){}function r(){var e=this,t=e.getSettings().observeChanges;t?(e.observer&&l.call(e),i.call(e),u.call(e)):t||l.call(e)}function i(){var e=this;e.observeChangesActive=!0,e.pauseObservingChanges=function(){e.observeChangesActive=!1},e.resumeObservingChanges=function(){e.observeChangesActive=!0},e.observedData=e.getSourceData(),e.observer=g.observe(e.observedData,function(t){e.observeChangesActive&&(s.call(e,t),e.render()),e.runHooks("afterChangesObserved")})}function s(e){function t(e){var t;return t=n(e),t=o(t)}function o(e){var t=[];return e.filter(function(e){var o=r(e.path);if(-1!=["add","remove"].indexOf(e.op)&&!isNaN(o.col)){if(-1!=t.indexOf(o.col))return!1;t.push(o.col)}return!0})}function n(e){return e.filter(function(e){return!/[\/]length/gi.test(e.path)})}function r(e){var t=e.match(/^\/(\d+)\/?(.*)?$/);return{row:parseInt(t[1],10),col:/^\d*$/.test(t[2])?parseInt(t[2],10):t[2]}}for(var i=this,s=t(e),l=0,a=s.length;a>l;l++){var u=s[l],c=r(u.path);switch(u.op){case"add":isNaN(c.col)?i.runHooks("afterCreateRow",c.row):i.runHooks("afterCreateCol",c.col);break;case"remove":isNaN(c.col)?i.runHooks("afterRemoveRow",c.row,1):i.runHooks("afterRemoveCol",c.col,1);break;case"replace":i.runHooks("afterChange",[c.row,c.col,null,u.value],"external")}}}function l(){var e=this;e.observer&&(a.call(e),c.call(e))}function a(){var e=this;g.unobserve(e.observedData,e.observer),delete e.observedData,delete e.observeChangesActive,delete e.pauseObservingChanges,delete e.resumeObservingChanges}function u(){var e=this;e.addHook("afterDestroy",l),e.addHook("afterCreateRow",d),e.addHook("afterRemoveRow",d),e.addHook("afterCreateCol",d),e.addHook("afterRemoveCol",d),e.addHook("afterChange",function(e,t){"loadData"!=t&&d.call(this)})}function c(){var e=this;e.removeHook("afterDestroy",l),e.removeHook("afterCreateRow",d),e.removeHook("afterRemoveRow",d),e.removeHook("afterCreateCol",d),e.removeHook("afterRemoveCol",d),e.removeHook("afterChange",d)}function d(){var e=this;e.pauseObservingChanges(),e.addHookOnce("afterChangesObserved",function(){e.resumeObservingChanges()})}Object.defineProperties(o,{ObserveChanges:{get:function(){return n}},__esModule:{value:!0}});var h,f,g=((h=e("plugins"),h&&h.__esModule&&h||{"default":h}).registerPlugin,(f=e("jsonpatch"),f&&f.__esModule&&f||{"default":f})["default"]);Handsontable.hooks.add("afterLoadData",r),Handsontable.hooks.add("afterUpdateSettings",r),Handsontable.hooks.register("afterChangesObserved")},{jsonpatch:"jsonpatch",plugins:57}],84:[function(e,t,o){"use strict";function n(e){var t,o=function(){window.localStorage[e+"__persistentStateKeys"]=JSON.stringify(t)},n=function(){var o=window.localStorage[e+"__persistentStateKeys"],n="string"==typeof o?JSON.parse(o):void 0;t=n?n:[]},r=function(){t=[],o()};n(),this.saveValue=function(n,r){window.localStorage[e+"_"+n]=JSON.stringify(r),-1==t.indexOf(n)&&(t.push(n),o())},this.loadValue=function(t,o){t="undefined"==typeof t?o:t;var n=window.localStorage[e+"_"+t];return"undefined"==typeof n?void 0:JSON.parse(n)},this.reset=function(t){window.localStorage.removeItem(e+"_"+t)},this.resetAll=function(){for(var o=0;ol;l++)for(var a=0;i>a;a++){var u=e.getDataAtCell(l,a),c=e.getCellMeta(l,a),d=c.search.callback||o,h=c.search.queryMethod||n,f=h(t,u);if(f){var g={row:l,col:a,data:u};s.push(g)}d&&d(e,l,a,u,f)}return s}},Handsontable.Search.DEFAULT_CALLBACK=function(e,t,o,n,r){e.getCellMeta(t,o).isSearchResult=r},Handsontable.Search.DEFAULT_QUERY_METHOD=function(e,t){return"undefined"!=typeof e&&null!=e&&e.toLowerCase&&0!==e.length?"undefined"==typeof t||null==t?!1:-1!=t.toString().toLowerCase().indexOf(e.toLowerCase()):!1},Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS="htSearchResult",Handsontable.Search.global=function(){var e=Handsontable.Search.DEFAULT_CALLBACK,t=Handsontable.Search.DEFAULT_QUERY_METHOD,o=Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS;return{getDefaultCallback:function(){return e},setDefaultCallback:function(t){e=t},getDefaultQueryMethod:function(){return t},setDefaultQueryMethod:function(e){t=e},getDefaultSearchResultClass:function(){return o},setDefaultSearchResultClass:function(e){o=e}}}(),Handsontable.SearchCellDecorator=function(e,t,o,n,r,i,s){var u=null!==s.search&&"object"==typeof s.search&&s.search.searchResultClass||Handsontable.Search.global.getDefaultSearchResultClass();s.isSearchResult?l(t,u):a(t,u)};var h=d("base");c("base",function(e,t,o,n,r,i,s){h.apply(this,arguments),Handsontable.SearchCellDecorator.apply(this,arguments)}),Handsontable.hooks.add("afterInit",n),Handsontable.hooks.add("afterUpdateSettings",n)},{"helpers/dom/element":45,renderers:88}],86:[function(e,t,o){"use strict";Object.defineProperties(o,{TouchScroll:{get:function(){return d}},__esModule:{value:!0}});var n,r,i,s=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),l=s.addClass,a=s.removeClass,u=(r=e("_base"),r&&r.__esModule&&r||{"default":r})["default"],c=(i=e("plugins"),i&&i.__esModule&&i||{"default":i}).registerPlugin,d=function(e){var t=this;$traceurRuntime.superConstructor(h).call(this,e),this.hot.addHook("afterInit",function(){return t.afterInit()}),this.hot.addHook("afterUpdateSettings",function(){return t.onAfterUpdateSettings()}),this.scrollbars=[],this.clones=[]},h=d;$traceurRuntime.createClass(d,{afterInit:function(){this.registerEvents(),this.onAfterUpdateSettings()},onAfterUpdateSettings:function(){var e=this;this.hot.addHookOnce("afterRender",function(){var t=e.hot.view.wt.wtOverlays;e.scrollbars=[],e.scrollbars.push(t.topOverlay),t.bottomOverlay.clone&&e.scrollbars.push(t.bottomOverlay),e.scrollbars.push(t.leftOverlay),t.topLeftCornerOverlay&&e.scrollbars.push(t.topLeftCornerOverlay),t.bottomLeftCornerOverlay&&t.bottomLeftCornerOverlay.clone&&e.scrollbars.push(t.bottomLeftCornerOverlay),e.clones=[],t.topOverlay.needFullRender&&e.clones.push(t.topOverlay.clone.wtTable.holder.parentNode),t.bottomOverlay.needFullRender&&e.clones.push(t.bottomOverlay.clone.wtTable.holder.parentNode),t.leftOverlay.needFullRender&&e.clones.push(t.leftOverlay.clone.wtTable.holder.parentNode),t.topLeftCornerOverlay&&e.clones.push(t.topLeftCornerOverlay.clone.wtTable.holder.parentNode),t.bottomLeftCornerOverlay&&t.bottomLeftCornerOverlay.clone&&e.clones.push(t.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode)})},registerEvents:function(){var e=this;this.hot.addHook("beforeTouchScroll",function(){return e.onBeforeTouchScroll()}),this.hot.addHook("afterMomentumScroll",function(){return e.onAfterMomentumScroll()})},onBeforeTouchScroll:function(){Handsontable.freezeOverlays=!0;for(var e=0,t=this.clones.length;t>e;e++)l(this.clones[e],"hide-tween")},onAfterMomentumScroll:function(){Handsontable.freezeOverlays=!1;for(var e=this,t=0,o=this.clones.length;o>t;t++)a(this.clones[t],"hide-tween");for(var n=0,r=this.clones.length;r>n;n++)l(this.clones[n],"show-tween");setTimeout(function(){for(var t=0,o=e.clones.length;o>t;t++)a(e.clones[t],"show-tween")},400);for(var i=0,s=this.scrollbars.length;s>i;i++)this.scrollbars[i].refresh(),this.scrollbars[i].resetFixedPosition();this.hot.view.wt.wtOverlays.syncScrollWithMaster()}},{},u),c("touchScroll",d)},{_base:58,"helpers/dom/element":45,plugins:57}],87:[function(e,t,o){"use strict";function n(){var e=this,t="undefined"==typeof e.getSettings().undo||e.getSettings().undo;t?e.undoRedo||(e.undoRedo=new Handsontable.UndoRedo(e),s(e),e.addHook("beforeKeyDown",r),e.addHook("afterChange",i)):e.undoRedo&&(delete e.undoRedo,l(e),e.removeHook("beforeKeyDown",r),e.removeHook("afterChange",i))}function r(e){var t=this,o=(e.ctrlKey||e.metaKey)&&!e.altKey;o&&(89===e.keyCode||e.shiftKey&&90===e.keyCode?(t.undoRedo.redo(),f(e)):90===e.keyCode&&(t.undoRedo.undo(),f(e)))}function i(e,t){var o=this;return"loadData"==t?o.undoRedo.clear():void 0}function s(e){e.undo=function(){return e.undoRedo.undo()},e.redo=function(){return e.undoRedo.redo()},e.isUndoAvailable=function(){return e.undoRedo.isUndoAvailable()},e.isRedoAvailable=function(){return e.undoRedo.isRedoAvailable()},e.clearUndo=function(){return e.undoRedo.clear()}}function l(e){delete e.undo,delete e.redo,delete e.isUndoAvailable,delete e.isRedoAvailable,delete e.clearUndo}var a,u,c=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),d=c.inherit,h=c.deepClone,f=(u=e("helpers/dom/event"),u&&u.__esModule&&u||{"default":u}).stopImmediatePropagation;Handsontable.UndoRedo=function(e){var t=this;this.instance=e,this.doneActions=[],this.undoneActions=[],this.ignoreNewActions=!1,e.addHook("afterChange",function(e,o){if(e){var n=new Handsontable.UndoRedo.ChangeAction(e);t.done(n)}}),e.addHook("afterCreateRow",function(e,o,n){if(!n){var r=new Handsontable.UndoRedo.CreateRowAction(e,o);t.done(r)}}),e.addHook("beforeRemoveRow",function(e,o){var n=t.instance.getSourceData();e=(n.length+e)%n.length;var r=n.slice(e,e+o),i=new Handsontable.UndoRedo.RemoveRowAction(e,r);t.done(i)}),e.addHook("afterCreateCol",function(e,o,n){if(!n){var r=new Handsontable.UndoRedo.CreateColumnAction(e,o);t.done(r)}}),e.addHook("beforeRemoveCol",function(o,n){var r=t.instance.getSourceData();o=(t.instance.countCols()+o)%t.instance.countCols();for(var i=[],s=0,l=r.length;l>s;s++)i[s]=r[s].slice(o,o+n);var a;Array.isArray(e.getSettings().colHeaders)&&(a=e.getSettings().colHeaders.slice(o,o+i.length));var u=new Handsontable.UndoRedo.RemoveColumnAction(o,i,a);t.done(u)}),e.addHook("beforeCellAlignment",function(e,o,n,r){var i=new Handsontable.UndoRedo.CellAlignmentAction(e,o,n,r);t.done(i)})},Handsontable.UndoRedo.prototype.done=function(e){this.ignoreNewActions||(this.doneActions.push(e),this.undoneActions.length=0)},Handsontable.UndoRedo.prototype.undo=function(){if(this.isUndoAvailable()){var e=this.doneActions.pop();this.ignoreNewActions=!0;var t=this;e.undo(this.instance,function(){t.ignoreNewActions=!1,t.undoneActions.push(e)})}},Handsontable.UndoRedo.prototype.redo=function(){if(this.isRedoAvailable()){var e=this.undoneActions.pop();this.ignoreNewActions=!0;var t=this;e.redo(this.instance,function(){t.ignoreNewActions=!1,t.doneActions.push(e)})}},Handsontable.UndoRedo.prototype.isUndoAvailable=function(){return this.doneActions.length>0},Handsontable.UndoRedo.prototype.isRedoAvailable=function(){return this.undoneActions.length>0},Handsontable.UndoRedo.prototype.clear=function(){this.doneActions.length=0,this.undoneActions.length=0},Handsontable.UndoRedo.Action=function(){},Handsontable.UndoRedo.Action.prototype.undo=function(){},Handsontable.UndoRedo.Action.prototype.redo=function(){},Handsontable.UndoRedo.ChangeAction=function(e){this.changes=e},d(Handsontable.UndoRedo.ChangeAction,Handsontable.UndoRedo.Action),Handsontable.UndoRedo.ChangeAction.prototype.undo=function(e,t){for(var o=h(this.changes),n=e.countEmptyRows(!0),r=e.countEmptyCols(!0),i=0,s=o.length;s>i;i++)o[i].splice(3,1);e.addHookOnce("afterChange",t),e.setDataAtRowProp(o,null,null,"undo");for(var i=0,s=o.length;s>i;i++)e.getSettings().minSpareRows&&o[i][0]+1+e.getSettings().minSpareRows===e.countRows()&&n==e.getSettings().minSpareRows&&(e.alter("remove_row",parseInt(o[i][0]+1,10),e.getSettings().minSpareRows),e.undoRedo.doneActions.pop()),e.getSettings().minSpareCols&&o[i][1]+1+e.getSettings().minSpareCols===e.countCols()&&r==e.getSettings().minSpareCols&&(e.alter("remove_col",parseInt(o[i][1]+1,10),e.getSettings().minSpareCols),e.undoRedo.doneActions.pop())},Handsontable.UndoRedo.ChangeAction.prototype.redo=function(e,t){for(var o=h(this.changes),n=0,r=o.length;r>n;n++)o[n].splice(2,1);e.addHookOnce("afterChange",t),e.setDataAtRowProp(o,null,null,"redo")},Handsontable.UndoRedo.CreateRowAction=function(e,t){this.index=e,this.amount=t},d(Handsontable.UndoRedo.CreateRowAction,Handsontable.UndoRedo.Action),Handsontable.UndoRedo.CreateRowAction.prototype.undo=function(e,t){var o=e.countRows(),n=e.getSettings().minSpareRows;this.index>=o&&this.index-nr;r++)o=e.getSourceDataAtRow(r),n=[this.index,0],Array.prototype.push.apply(n,this.data[r]),Array.prototype.splice.apply(o,n);"undefined"!=typeof this.headers&&(n=[this.index,0],Array.prototype.push.apply(n,this.headers),Array.prototype.splice.apply(e.getSettings().colHeaders,n)),e.addHookOnce("afterRender",t),e.render()},Handsontable.UndoRedo.RemoveColumnAction.prototype.redo=function(e,t){e.addHookOnce("afterRemoveCol",t),e.alter("remove_col",this.index,this.amount)},Handsontable.hooks.add("afterInit",n),Handsontable.hooks.add("afterUpdateSettings",n)},{"helpers/dom/event":46,"helpers/object":50}],88:[function(e,t,o){"use strict";function n(e,t){var o;a[e]=t,o=l(e)+"Renderer",Handsontable.renderers[o]=t,Handsontable[o]=t}function r(e){if("function"==typeof e)return e;if("string"!=typeof e)throw Error('Only strings and functions can be passed as "renderer" parameter');if(!(e in a))throw Error('No editor registered under name "'+e+'"');return a[e]}function i(e){return e in a}Object.defineProperties(o,{registerRenderer:{get:function(){return n}},getRenderer:{get:function(){return r}},hasRenderer:{get:function(){return i}},__esModule:{value:!0}});var s,l=(s=e("helpers/string"),s&&s.__esModule&&s||{"default":s}).toUpperCaseFirst,a={};Handsontable.renderers=Handsontable.renderers||{},Handsontable.renderers.registerRenderer=n,Handsontable.renderers.getRenderer=r},{"helpers/string":52}],89:[function(e,t,o){"use strict";function n(e,t,o,n,r,i,s){s.className&&(t.className?t.className=t.className+" "+s.className:t.className=s.className),s.readOnly&&l(t,s.readOnlyCellClassName),s.valid===!1&&s.invalidCellClassName?l(t,s.invalidCellClassName):a(t,s.invalidCellClassName),s.wordWrap===!1&&s.noWordWrapClassName&&l(t,s.noWordWrapClassName),!i&&s.placeholder&&l(t,s.placeholderCellClassName)}Object.defineProperties(o,{cellDecorator:{get:function(){return n}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),l=s.addClass,a=s.removeClass,u=(i=e("renderers"),i&&i.__esModule&&i||{"default":i}).registerRenderer;u("base",n),Handsontable.renderers.cellDecorator=n},{"helpers/dom/element":45,renderers:88}],90:[function(e,t,o){"use strict";function n(e,t,o,n,r,i,s){var l=(m.cloneNode(!0),w.cloneNode(!0)); +if(f("text")(e,t,o,n,r,i,s),t.appendChild(l),u(t,"htAutocomplete"),t.firstChild||t.appendChild(document.createTextNode(String.fromCharCode(160))),!e.acArrowListener){var a=d(e);e.acArrowListener=function(r){c(r.target,"htAutocompleteArrow")&&e.view.wt.getSetting("onCellDblClick",null,new p(o,n),t)},a.addEventListener(e.rootElement,"mousedown",e.acArrowListener),e.addHookOnce("afterDestroy",function(){a.destroy()})}}Object.defineProperties(o,{autocompleteRenderer:{get:function(){return n}},__esModule:{value:!0}});var r,i,s,l,a=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=a.addClass,c=a.hasClass,d=(a.empty,(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager),h=(s=e("renderers"),s&&s.__esModule&&s||{"default":s}),f=h.getRenderer,g=h.registerRenderer,p=(l=e("3rdparty/walkontable/src/cell/coords"),l&&l.__esModule&&l||{"default":l}).WalkontableCellCoords,m=document.createElement("DIV");m.className="htAutocompleteWrapper";var w=document.createElement("DIV");w.className="htAutocompleteArrow",w.appendChild(document.createTextNode(String.fromCharCode(9660)));g("autocomplete",n)},{"3rdparty/walkontable/src/cell/coords":5,eventManager:41,"helpers/dom/element":45,renderers:88}],91:[function(e,t,o){"use strict";function n(e,t,o,n,l,a,u){function c(e){var t=[y.SPACE,y.ENTER,y.DELETE,y.BACKSPACE];-1===t.indexOf(e.keyCode)||T(e)||f(function(){S(e),e.preventDefault()}),(e.keyCode==y.SPACE||e.keyCode==y.ENTER)&&d(),(e.keyCode==y.DELETE||e.keyCode==y.BACKSPACE)&&d(!1)}function d(){var e=void 0!==arguments[0]?arguments[0]:null;f(function(t){for(var o=0,n=t.length;n>o;o++){if(m(t[o],_)&&null===e)return;h(t[o],e)}})}function h(e){var t=void 0!==arguments[1]?arguments[1]:null;null===t?e.checked=!e.checked:e.checked=t,b.fireEvent(e,"change")}function f(t){for(var o=e.getSelectedRange(),n=o.getTopLeftCorner(),r=o.getBottomRightCorner(),i=n.row;i<=r.row;i++)for(var s=n.col;s<=r.col;s++){var l=e.getCell(i,s),a=e.getCellMeta(i,s),u=l.querySelectorAll("input[type=checkbox]");u.length>0&&!a.readOnly&&t(u)}}var b=new v(e),C=r(),R=u.label,M=!1;if("undefined"==typeof u.checkedTemplate&&(u.checkedTemplate=!0),"undefined"==typeof u.uncheckedTemplate&&(u.uncheckedTemplate=!1),g(t),a===u.checkedTemplate||w(a,u.checkedTemplate)?C.checked=!0:a===u.uncheckedTemplate||w(a,u.uncheckedTemplate)?C.checked=!1:null===a?p(C,"noValue"):(C.style.display="none",p(C,_),M=!0),!M&&R){var H="";R.value?H="function"==typeof R.value?R.value.call(this,o,n,l,a):R.value:R.property&&(H=e.getDataAtRowProp(o,R.property));var k=i(H);"before"===R.position?k.appendChild(C):k.insertBefore(C,k.firstChild),C=k}t.appendChild(C),M&&t.appendChild(document.createTextNode("#bad-value#")),u.readOnly?b.addEventListener(C,"click",s):(b.addEventListener(C,"mousedown",E),b.addEventListener(C,"mouseup",E),b.addEventListener(C,"change",function(t){e.setDataAtRowProp(o,l,t.target.checked?u.checkedTemplate:u.uncheckedTemplate)})),O.has(e)||(O.set(e,!0),e.addHook("beforeKeyDown",c))}function r(){var e=document.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("autocomplete","off"),e.cloneNode(!1)}function i(e){var t=document.createElement("label");return t.className="htCheckboxRendererLabel",t.appendChild(document.createTextNode(e)),t.cloneNode(!0)}function s(e){e.preventDefault()}Object.defineProperties(o,{checkboxRenderer:{get:function(){return n}},__esModule:{value:!0}});var l,a,u,c,d,h,f=(l=e("helpers/dom/element"),l&&l.__esModule&&l||{"default":l}),g=f.empty,p=f.addClass,m=f.hasClass,w=(a=e("helpers/string"),a&&a.__esModule&&a||{"default":a}).equalsIgnoreCase,v=(u=e("eventManager"),u&&u.__esModule&&u||{"default":u}).EventManager,b=(c=e("renderers"),c&&c.__esModule&&c||{"default":c}),C=(b.getRenderer,b.registerRenderer),y=(d=e("helpers/unicode"),d&&d.__esModule&&d||{"default":d}).KEY_CODES,R=(h=e("helpers/dom/event"),h&&h.__esModule&&h||{"default":h}),E=R.stopPropagation,S=R.stopImmediatePropagation,T=R.isImmediatePropagationStopped,O=new WeakMap,_="htBadValue";C("checkbox",n)},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/string":52,"helpers/unicode":53,renderers:88}],92:[function(e,t,o){"use strict";function n(e,t,o,n,r,i,l){a("base").apply(this,arguments),s(t,i)}Object.defineProperties(o,{htmlRenderer:{get:function(){return n}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}).fastInnerHTML,l=(i=e("renderers"),i&&i.__esModule&&i||{"default":i}),a=l.getRenderer,u=l.registerRenderer;u("html",n)},{"helpers/dom/element":45,renderers:88}],93:[function(e,t,o){"use strict";function n(e,t,o,n,r,i,s){f(i)&&("undefined"!=typeof s.language&&a.language(s.language),i=a(i).format(s.format||"0"),u(t,"htNumeric")),d("text")(e,t,o,n,r,i,s)}Object.defineProperties(o,{numericRenderer:{get:function(){return n}},__esModule:{value:!0}});var r,i,s,l,a=(r=e("numeral"),r&&r.__esModule&&r||{"default":r})["default"],u=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).addClass,c=(s=e("renderers"),s&&s.__esModule&&s||{"default":s}),d=c.getRenderer,h=c.registerRenderer,f=(l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}).isNumeric;h("numeric",n)},{"helpers/dom/element":45,"helpers/number":49,numeral:"numeral",renderers:88}],94:[function(e,t,o){"use strict";function n(e,t,o,n,r,i,l){a("text").apply(this,arguments),i=t.innerHTML;var u,c=l.hashLength||i.length,d=l.hashSymbol||"*";for(u="";u.split(d).length-13?("function"==typeof n&&(e.__proto__=n),e.prototype=d(l(n),i(t))):e.prototype=t,f(e,"prototype",{configurable:!1,writable:!1}),h(e,i(o))}function l(e){if("function"==typeof e){var t=e.prototype;if(u(t)===t||null===t)return e.prototype;throw new c("super prototype must be an Object or null")}if(null===e)return null;throw new c("Super expression must either be null or a function, not "+typeof e+".")}function a(e,t,n){null!==p(t)&&o(e,t,"constructor",n)}var u=Object,c=TypeError,d=u.create,h=$traceurRuntime.defineProperties,f=$traceurRuntime.defineProperty,g=$traceurRuntime.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=$traceurRuntime.toProperty,w=Object,v=w.getOwnPropertyNames,b=w.getOwnPropertySymbols;$traceurRuntime.createClass=s,$traceurRuntime.defaultSuperCall=a,$traceurRuntime.superCall=o,$traceurRuntime.superConstructor=t,$traceurRuntime.superGet=n,$traceurRuntime.superSet=r}()},{}],97:[function(e,t,o){"use strict";function n(e){var t=this,o=this;this.eventManager=C(e),this.instance=e,this.settings=e.getSettings(),this.selectionMouseDown=!1;var n=e.rootElement.getAttribute("style");n&&e.rootElement.setAttribute("data-originalstyle",n),d(e.rootElement,"handsontable");var r=document.createElement("TABLE");d(r,"htCore"),e.getSettings().tableClassName&&d(r,e.getSettings().tableClassName),this.THEAD=document.createElement("THEAD"),r.appendChild(this.THEAD),this.TBODY=document.createElement("TBODY"),r.appendChild(this.TBODY),e.table=r,e.container.insertBefore(r,e.container.firstChild),this.eventManager.addEventListener(e.rootElement,"mousedown",function(e){this.selectionMouseDown=!0,o.isTextSelectionAllowed(e.target)||(s(),e.preventDefault(),window.focus())}),this.eventManager.addEventListener(e.rootElement,"mouseup",function(e){this.selectionMouseDown=!1}),this.eventManager.addEventListener(e.rootElement,"mousemove",function(e){this.selectionMouseDown&&!o.isTextSelectionAllowed(e.target)&&(s(),e.preventDefault())}),this.eventManager.addEventListener(document.documentElement,"keyup",function(t){e.selection.isInProgress()&&!t.shiftKey&&e.selection.finish()});var i;this.isMouseDown=function(){return i},this.eventManager.addEventListener(document.documentElement,"mouseup",function(t){e.selection.isInProgress()&&1===t.which&&e.selection.finish(),i=!1,b(document.activeElement)&&e.unlisten()}),this.eventManager.addEventListener(document.documentElement,"mousedown",function(t){var n=t.target,r=t.x||t.clientX,s=t.y||t.clientY;if(!i&&e.rootElement){if(n===e.view.wt.wtTable.holder){var l=p();if(document.elementFromPoint(r+l,s)!==e.view.wt.wtTable.holder||document.elementFromPoint(r,s+l)!==e.view.wt.wtTable.holder)return}else for(;n!==document.documentElement;){if(null===n){if(t.isTargetWebComponent)break;return}if(n===e.rootElement)return;n=n.parentNode}o.settings.outsideClickDeselects?e.deselectCell():e.destroyEditor()}}),this.eventManager.addEventListener(r,"selectstart",function(e){o.settings.fragmentSelection||v(e.target)||e.preventDefault()});var s=function(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty()},l=[new T({className:"current",border:{width:2,color:"#5292F7",cornerVisible:function(){return o.settings.fillHandle&&!o.isCellEdited()&&!e.selection.isMultiple()},multipleSelectionHandlesVisible:function(){return!o.isCellEdited()&&!e.selection.isMultiple()}}}),new T({className:"area",border:{width:1,color:"#89AFF9",cornerVisible:function(){return o.settings.fillHandle&&!o.isCellEdited()&&e.selection.isMultiple()},multipleSelectionHandlesVisible:function(){return!o.isCellEdited()&&e.selection.isMultiple()}}}),new T({className:"highlight",highlightRowClassName:o.settings.currentRowClassName,highlightColumnClassName:o.settings.currentColClassName}),new T({className:"fill",border:{width:1,color:"red"}})];l.current=l[0],l.area=l[1],l.highlight=l[2],l.fill=l[3];var a={debug:function(){return o.settings.debug},externalRowCalculator:this.instance.getPlugin("autoRowSize")&&this.instance.getPlugin("autoRowSize").isEnabled(),table:r,preventOverflow:function(){return t.settings.preventOverflow},stretchH:this.settings.stretchH,data:e.getDataAtCell,totalRows:function(){return e.countRows()},totalColumns:function(){return e.countCols()},fixedColumnsLeft:function(){return o.settings.fixedColumnsLeft},fixedRowsTop:function(){return o.settings.fixedRowsTop},fixedRowsBottom:function(){return o.settings.fixedRowsBottom},minSpareRows:function(){return o.settings.minSpareRows},renderAllRows:o.settings.renderAllRows,rowHeaders:function(){var t=[];return e.hasRowHeaders()&&t.push(function(e,t){o.appendRowHeader(e,t)}),Handsontable.hooks.run(e,"afterGetRowHeaderRenderers",t),t},columnHeaders:function(){var t=[];return e.hasColHeaders()&&t.push(function(e,t){o.appendColHeader(e,t)}),Handsontable.hooks.run(e,"afterGetColumnHeaderRenderers",t),t},columnWidth:e.getColWidth,rowHeight:e.getRowHeight,cellRenderer:function(e,t,n){var r=o.instance.colToProp(t),i=o.instance.getCellMeta(e,t),s=o.instance.getCellRenderer(i),l=o.instance.getDataAtRowProp(e,r);s(o.instance,n,e,t,r,l,i),Handsontable.hooks.run(o.instance,"afterRenderer",n,e,t,r,l,i)},selections:l,hideBorderOnMouseDownOver:function(){return o.settings.fragmentSelection},onCellMouseDown:function(t,n,r,s){var l,a,u=r.parentNode,c=u.parentNode;if(e.listen(),o.activeWt=s,i=!0,Handsontable.hooks.run(e,"beforeOnCellMouseDown",t,n,r),e.selection.setSelectedHeaders(!1,!1),!E(t)){if(2===t.button&&e.selection.inInSelection(n));else t.shiftKey?n.row>=0&&n.col>=0&&e.selection.setRangeEnd(n):(n.row<0||n.col<0)&&(n.row>=0||n.col>=0)?(n.row<0&&(l=c.childNodes.length-Array.prototype.indexOf.call(c.childNodes,u)-1,a=e.getHeaderColspan(n.col,l),e.selection.setSelectedHeaders(!1,!0),e.selectCell(0,n.col,e.countRows()-1,n.col+Math.max(0,a-1))),n.col<0&&(e.selection.setSelectedHeaders(!0,!1),e.selectCell(n.row,0,n.row,e.countCols()-1))):(n.row=n.row<0?0:n.row,n.col=n.col<0?0:n.col,e.selection.setRangeStart(n));Handsontable.hooks.run(e,"afterOnCellMouseDown",t,n,r),o.activeWt=o.wt}},onCellMouseOver:function(t,n,r,s){o.activeWt=s,n.row>=0&&n.col>=0?i&&e.selection.setRangeEnd(n):i&&(n.row<0&&(e.selection.selectedHeader.cols?(e.selection.setRangeEnd(new S(e.countRows()-1,n.col)),e.selection.setSelectedHeaders(!1,!0)):e.selection.setRangeEnd(new S(n.row,n.col))),n.col<0&&(e.selection.selectedHeader.rows?(e.selection.setRangeEnd(new S(n.row,e.countCols()-1)),e.selection.setSelectedHeaders(!0,!1)):e.selection.setRangeEnd(new S(n.row,n.col)))),Handsontable.hooks.run(e,"afterOnCellMouseOver",t,n,r),o.activeWt=o.wt},onCellCornerMouseDown:function(t){t.preventDefault(),Handsontable.hooks.run(e,"afterOnCellCornerMouseDown",t)},beforeDraw:function(e){o.beforeRender(e)},onDraw:function(e){o.onDraw(e)},onScrollVertically:function(){e.runHooks("afterScrollVertically")},onScrollHorizontally:function(){e.runHooks("afterScrollHorizontally")},onBeforeDrawBorders:function(t,o){e.runHooks("beforeDrawBorders",t,o)},onBeforeTouchScroll:function(){e.runHooks("beforeTouchScroll")},onAfterMomentumScroll:function(){e.runHooks("afterMomentumScroll")},viewportRowCalculatorOverride:function(t){var n=e.countRows(),r=o.settings.viewportRowRenderingOffset;if("auto"===r&&o.settings.fixedRowsTop&&(r=10),"number"==typeof r&&(t.startRow=Math.max(t.startRow-r,0),t.endRow=Math.min(t.endRow+r,n-1)),"auto"===r){var i=t.startRow+t.endRow-t.startRow,s=Math.ceil(i/n*12);t.startRow=Math.max(t.startRow-s,0),t.endRow=Math.min(t.endRow+s,n-1)}e.runHooks("afterViewportRowCalculatorOverride",t)},viewportColumnCalculatorOverride:function(t){var n=e.countCols(),r=o.settings.viewportColumnRenderingOffset;if("auto"===r&&o.settings.fixedColumnsLeft&&(r=10),"number"==typeof r&&(t.startColumn=Math.max(t.startColumn-r,0),t.endColumn=Math.min(t.endColumn+r,n-1)),"auto"===r){var i=t.startColumn+t.endColumn-t.startColumn,s=Math.ceil(i/n*12);t.startRow=Math.max(t.startColumn-s,0),t.endColumn=Math.min(t.endColumn+s,n-1)}e.runHooks("afterViewportColumnCalculatorOverride",t)}};Handsontable.hooks.run(e,"beforeInitWalkontable",a),this.wt=new O(a),this.activeWt=this.wt,this.eventManager.addEventListener(o.wt.wtTable.spreader,"mousedown",function(e){e.target===o.wt.wtTable.spreader&&3===e.which&&R(e)}),this.eventManager.addEventListener(o.wt.wtTable.spreader,"contextmenu",function(e){e.target===o.wt.wtTable.spreader&&3===e.which&&R(e)}),this.eventManager.addEventListener(document.documentElement,"click",function(){o.settings.observeDOMVisibility&&o.wt.drawInterrupted&&(o.instance.forceFullRender=!0,o.render())})}Object.defineProperties(o,{TableView:{get:function(){return n}},__esModule:{value:!0}});var r,i,s,l,a,u,c=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),d=c.addClass,h=c.empty,f=c.fastInnerHTML,g=c.fastInnerText,p=c.getScrollbarWidth,m=c.hasClass,w=c.isChildOf,v=c.isInput,b=c.isOutsideInput,C=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,y=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),R=y.stopPropagation,E=y.isImmediatePropagationStopped,S=(l=e("3rdparty/walkontable/src/cell/coords"),l&&l.__esModule&&l||{"default":l}).WalkontableCellCoords,T=(a=e("3rdparty/walkontable/src/selection"),a&&a.__esModule&&a||{"default":a}).WalkontableSelection,O=(u=e("3rdparty/walkontable/src/core"),u&&u.__esModule&&u||{"default":u}).Walkontable;Handsontable.TableView=n,n.prototype.isTextSelectionAllowed=function(e){if(v(e))return!0;var t=w(e,this.instance.view.wt.wtTable.spreader);return this.settings.fragmentSelection===!0&&t?!0:"cell"===this.settings.fragmentSelection&&this.isSelectedOnlyCell()&&t?!0:!1},n.prototype.isSelectedOnlyCell=function(){var e=this.instance.getSelected()||[],t=e[0],o=e[1],n=e[2],r=e[3];return void 0!==t&&t===n&&o===r},n.prototype.isCellEdited=function(){var e=this.instance.getActiveEditor();return e&&e.isOpened()},n.prototype.beforeRender=function(e){e&&Handsontable.hooks.run(this.instance,"beforeRender",this.instance.forceFullRender)},n.prototype.onDraw=function(e){e&&Handsontable.hooks.run(this.instance,"afterRender",this.instance.forceFullRender)},n.prototype.render=function(){this.wt.draw(!this.instance.forceFullRender),this.instance.forceFullRender=!1,this.instance.renderCall=!1},n.prototype.getCellAtCoords=function(e,t){var o=this.wt.getCell(e,t);return 0>o?null:o},n.prototype.scrollViewport=function(e){this.wt.scrollViewport(e)},n.prototype.appendRowHeader=function(e,t){if(t.firstChild){var o=t.firstChild;if(!m(o,"relative"))return h(t),void this.appendRowHeader(e,t);this.updateCellHeader(o.querySelector(".rowHeader"),e,this.instance.getRowHeader)}else{var n=document.createElement("div"),r=document.createElement("span");n.className="relative",r.className="rowHeader",this.updateCellHeader(r,e,this.instance.getRowHeader),n.appendChild(r),t.appendChild(n)}Handsontable.hooks.run(this.instance,"afterGetRowHeader",e,t)},n.prototype.appendColHeader=function(e,t){if(t.firstChild){var o=t.firstChild;m(o,"relative")?this.updateCellHeader(o.querySelector(".colHeader"),e,this.instance.getColHeader):(h(t),this.appendColHeader(e,t))}else{var n=document.createElement("div"),r=document.createElement("span");n.className="relative",r.className="colHeader",this.updateCellHeader(r,e,this.instance.getColHeader),n.appendChild(r),t.appendChild(n)}Handsontable.hooks.run(this.instance,"afterGetColHeader",e,t)},n.prototype.updateCellHeader=function(e,t,o){t>-1?f(e,o(t)):(g(e,String.fromCharCode(160)),d(e,"cornerHeader"))},n.prototype.maximumVisibleElementWidth=function(e){var t=this.wt.wtViewport.getWorkspaceWidth(),o=t-e;return o>0?o:0},n.prototype.maximumVisibleElementHeight=function(e){var t=this.wt.wtViewport.getWorkspaceHeight(),o=t-e;return o>0?o:0},n.prototype.mainViewIsActive=function(){return this.wt===this.activeWt},n.prototype.destroy=function(){this.wt.destroy(),this.eventManager.destroy()}},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/core":7,"3rdparty/walkontable/src/selection":18,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46}],98:[function(e,t,o){"use strict";Object.defineProperties(o,{GhostTable:{get:function(){return f}},__esModule:{value:!0}});var n,r,i,s,l,a=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),u=a.addClass,c=a.outerHeight,d=a.outerWidth,h=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,f=((i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}).objectEach,(s=e("helpers/number"),s&&s.__esModule&&s||{"default":s}).rangeEach,(l=e("helpers/mixed"),l&&l.__esModule&&l||{"default":l}).stringify,function(e){this.hot=e,this.container=null,this.injected=!1,this.rows=[],this.columns=[],this.samples=null});$traceurRuntime.createClass(f,{addRow:function(e,t){if(this.columns.length)throw new Error("Doesn't support multi-dimensional table");this.rows.length||(this.container=this.createContainer(this.hot.rootElement.className));var o={row:e};this.rows.push(o),this.samples=t,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol()),this.table.tr.appendChild(this.createRow(e)),this.container.container.appendChild(this.table.fragment),o.table=this.table.table},addColumn:function(e,t){if(this.rows.length)throw new Error("Doesn't support multi-dimensional table");this.columns.length||(this.container=this.createContainer(this.hot.rootElement.className));var o={col:e};this.columns.push(o),this.samples=t,this.table=this.createTable(this.hot.table.className),null!==this.hot.getColHeader(e)&&this.hot.view.appendColHeader(e,this.table.th),this.table.tBody.appendChild(this.createCol(e)),this.container.container.appendChild(this.table.fragment),o.table=this.table.table},getHeights:function(e){this.injected||this.injectTable(),h(this.rows,function(t){e(t.row,c(t.table)-1)})},getWidths:function(e){this.injected||this.injectTable(),h(this.columns,function(t){e(t.col,d(t.table))})},createColGroupsCol:function(){var e=this,t=document,o=t.createDocumentFragment();return o.appendChild(this.createColElement(-1)),this.samples.forEach(function(t){h(t.strings,function(t){o.appendChild(e.createColElement(t.col))})}),o},createRow:function(e){var t=this,o=document,n=o.createDocumentFragment(),r=o.createElement("th");return null!==this.hot.getRowHeader(e)&&this.hot.view.appendRowHeader(e,r),n.appendChild(r),this.samples.forEach(function(r){h(r.strings,function(r){var i=r.col,s=t.hot.getCellMeta(e,i);s.col=i,s.row=e;var l=t.hot.getCellRenderer(s),a=o.createElement("td");l(t.hot,a,e,i,t.hot.colToProp(i),r.value,s),n.appendChild(a)})}),n},createCol:function(e){var t=this,o=document,n=o.createDocumentFragment();return this.samples.forEach(function(r){h(r.strings,function(r){var i=r.row,s=t.hot.getCellMeta(i,e);s.col=e,s.row=i;var l=t.hot.getCellRenderer(s),a=o.createElement("td"),u=o.createElement("tr");l(t.hot,a,i,e,t.hot.colToProp(i),r.value,s),u.appendChild(a),n.appendChild(u)})}),n},clean:function(){this.rows.length=0,this.columns.length=0,this.samples&&this.samples.clear(),this.samples=null,this.removeTable()},injectTable:function(){var e=void 0!==arguments[0]?arguments[0]:null;this.injected||((e||this.hot.rootElement).appendChild(this.container.fragment),this.injected=!0)},removeTable:function(){this.injected&&this.container.container.parentNode&&(this.container.container.parentNode.removeChild(this.container.container),this.container=null,this.injected=!1)},createColElement:function(e){var t=document,o=t.createElement("col");return o.style.width=this.hot.view.wt.wtTable.getStretchedColumnWidth(e)+"px",o},createTable:function(){var e=void 0!==arguments[0]?arguments[0]:"",t=document,o=t.createDocumentFragment(),n=t.createElement("table"),r=t.createElement("thead"),i=t.createElement("tbody"),s=t.createElement("colgroup"),l=t.createElement("tr"),a=t.createElement("th");return this.isVertical()&&n.appendChild(s),this.isHorizontal()&&(l.appendChild(a),r.appendChild(l),n.style.tableLayout="auto",n.style.width="auto"),n.appendChild(r),this.isVertical()&&i.appendChild(l),n.appendChild(i),u(n,e),o.appendChild(n),{fragment:o,table:n,tHead:r,tBody:i,colGroup:s,tr:l,th:a}},createContainer:function(){var e=void 0!==arguments[0]?arguments[0]:"",t=document,o=t.createDocumentFragment(),n=t.createElement("div");return e="htGhostTable htAutoSize "+e.trim(),u(n,e),o.appendChild(n),{fragment:o,container:n}},isVertical:function(){return this.rows.length&&!this.columns.length?!0:!1},isHorizontal:function(){return this.columns.length&&!this.rows.length?!0:!1}},{}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.GhostTable=f},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],99:[function(e,t,o){"use strict";var n;Object.defineProperties(o,{SamplesGenerator:{get:function(){return h}},__esModule:{value:!0}});var r,i,s,l,a,u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=(u.addClass,u.outerHeight,u.outerWidth,(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,(s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}).objectEach,(l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}).rangeEach),d=(a=e("helpers/mixed"),a&&a.__esModule&&a||{"default":a}).stringify,h=function(e){this.samples=null,this.dataFactory=e,this.customSampleCount=null},f=h;$traceurRuntime.createClass(h,(n={},Object.defineProperty(n,"getSampleCount",{value:function(){return this.customSampleCount?this.customSampleCount:f.SAMPLE_COUNT},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(n,"generateRowSamples",{value:function(e,t){return this.generateSamples("row",t,e)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(n,"generateColumnSamples",{value:function(e,t){return this.generateSamples("col",t,e)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(n,"generateSamples",{value:function(e,t,o){var n=this,r=new Map;return"number"==typeof o&&(o={from:o,to:o}),c(o.from,o.to,function(o){var i=n.generateSample(e,t,o);r.set(o,i)}),r},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(n,"generateSample",{value:function(e,t,o){var n=this,r=new Map,i=[];return c(t.from,t.to,function(t){var s,l;if("row"===e)l=n.dataFactory(o,t);else{if("col"!==e)throw new Error("Unsupported sample type");l=n.dataFactory(t,o)}Array.isArray(l)||(l=d(l));var a=l.length;r.has(a)||r.set(a,{needed:n.getSampleCount(),strings:[]});var u=r.get(a);if(u.needed){var c=i.indexOf(l)>-1;if(!c){var h="row"===e?"col":"row";u.strings.push((s={},Object.defineProperty(s,"value",{value:l,configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(s,h,{value:t,configurable:!0,enumerable:!0,writable:!0}),s)),i.push(l),u.needed--}}}),r},configurable:!0,enumerable:!0,writable:!0}),n),{get SAMPLE_COUNT(){return 3}}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.SamplesGenerator=h},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],100:[function(e,t,o){"use strict";function n(e,t){var o=e,n="string"==typeof o?o.toLowerCase():null;return function(e){for(var r=!1,s=0,l=e.length;l>s;s++){if(o===e[s]){r=!0;break}if(n===i(e[s]).toLowerCase()){r=!0;break}}t(r)}}var r,i=(r=e("helpers/mixed"),r&&r.__esModule&&r||{"default":r}).stringify;Handsontable.AutocompleteValidator=function(e,t){this.strict&&this.source?"function"==typeof this.source?this.source(e,n(e,t)):n(e,t)(this.source):t(!0)}},{"helpers/mixed":48}],101:[function(e,t,o){"use strict";var n,r,i=(n=e("moment"),n&&n.__esModule&&n||{"default":n})["default"],s=(r=e("editors"),r&&r.__esModule&&r||{"default":r}).getEditor;Handsontable.DateValidator=function(e,t){var o=!0,n=s("date",this.instance);null===e&&(e="");var r=i(new Date(e)).isValid(),a=i(e,this.dateFormat||n.defaultDateFormat,!0).isValid();if(r||(o=!1),!r&&a&&(o=!0),r&&!a)if(this.correctFormat===!0){var u=l(e,this.dateFormat);this.instance.setDataAtCell(this.row,this.col,u,"dateValidator"),o=!0}else o=!1;t(o)};var l=function(e,t){var o=i(new Date(e)),n=o.format("YYYY"),r=i().format("YYYY");return n.substr(0,2)!==r.substr(0,2)?e.match(new RegExp(n))||o.year(n.replace(n.substr(0,2),r.substr(0,2))):n.length>4&&o.year((o.year()+"").substr(0,4)),o.format(t)}},{editors:29,moment:void 0}],102:[function(e,t,o){"use strict";Handsontable.NumericValidator=function(e,t){null===e&&(e=""),t(/^-?\d*(\.|\,)?\d*$/.test(e))}},{}],SheetClip:[function(e,t,o){"use strict";!function(e){function t(e){return e.split('"').length-1}var n={parse:function(e){var o,n,r,i,s,l,a,u=[],c=0;for(r=e.split("\n"),r.length>1&&""===r[r.length-1]&&r.pop(),o=0,n=r.length;n>o;o+=1){for(r[o]=r[o].split(" "),i=0,s=r[o].length;s>i;i+=1)u[c]||(u[c]=[]),l&&0===i?(a=u[c].length-1,u[c][a]=u[c][a]+"\n"+r[o][0],l&&1&t(r[o][0])&&(l=!1, +u[c][a]=u[c][a].substring(0,u[c][a].length-1).replace(/""/g,'"'))):i===s-1&&0===r[o][i].indexOf('"')&&1&t(r[o][i])?(u[c].push(r[o][i].substring(1).replace(/""/g,'"')),l=!0):(u[c].push(r[o][i].replace(/""/g,'"')),l=!1);l||(c+=1)}return u},stringify:function(e){var t,o,n,r,i,s="";for(t=0,o=e.length;o>t;t+=1){for(r=e[t].length,n=0;r>n;n+=1)n>0&&(s+=" "),i=e[t][n],s+="string"==typeof i?i.indexOf("\n")>-1?'"'+i.replace(/"/g,'""')+'"':i:null===i||void 0===i?"":i;s+="\n"}return s}};"undefined"!=typeof o?(o.parse=n.parse,o.stringify=n.stringify):e.SheetClip=n}(window)},{}],autoResize:[function(e,t,o){"use strict";function n(){var e,t={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300},o=document.body,n=document.createTextNode(""),r=document.createElement("SPAN"),i=function(e,t,o){window.attachEvent?e.attachEvent("on"+t,o):e.addEventListener(t,o,!1)},s=function(e,t,o){window.removeEventListener?e.removeEventListener(t,o,!1):e.detachEvent("on"+t,o)},l=function(i){var s,l;i?/^[a-zA-Z \.,\\\/\|0-9]$/.test(i)||(i="."):i="",void 0!==n.textContent?n.textContent=e.value+i:n.data=e.value+i,r.style.fontSize=Handsontable.Dom.getComputedStyle(e).fontSize,r.style.fontFamily=Handsontable.Dom.getComputedStyle(e).fontFamily,r.style.whiteSpace="pre",o.appendChild(r),s=r.clientWidth+2,o.removeChild(r),e.style.height=t.minHeight+"px",t.minWidth>s?e.style.width=t.minWidth+"px":s>t.maxWidth?e.style.width=t.maxWidth+"px":e.style.width=s+"px",l=e.scrollHeight?e.scrollHeight-1:0,t.minHeight>l?e.style.height=t.minHeight+"px":t.maxHeight-1||"true"===e.contentEditable}var o=this,n=!1;if(e.metaKey?n=!0:e.ctrlKey&&-1===navigator.userAgent.indexOf("Mac")&&(n=!0),n){if(document.activeElement!==this.elTextarea&&(""!==this.getSelectionText()||t()))return;this.selectNodeText(this.elTextarea),setTimeout(function(){document.activeElement!==o.elTextarea&&o.selectNodeText(o.elTextarea)},0)}!n||67!==e.keyCode&&86!==e.keyCode&&88!==e.keyCode||(88===e.keyCode?setTimeout(function(){o.triggerCut(e)},0):86===e.keyCode&&setTimeout(function(){o.triggerPaste(e)},0))},r.prototype.selectNodeText=function(e){e&&e.select()},r.prototype.getSelectionText=function(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e},r.prototype.copyable=function(e){if("string"!=typeof e&&void 0===e.toString)throw new Error("copyable requires string parameter");this.elTextarea.value=e,this.selectNodeText(this.elTextarea)},r.prototype.onCut=function(e){this.cutCallbacks.push(e)},r.prototype.onPaste=function(e){this.pasteCallbacks.push(e)},r.prototype.removeCallback=function(e){var t,o;for(t=0,o=this.copyCallbacks.length;o>t;t++)if(this.copyCallbacks[t]===e)return this.copyCallbacks.splice(t,1),!0;for(t=0,o=this.cutCallbacks.length;o>t;t++)if(this.cutCallbacks[t]===e)return this.cutCallbacks.splice(t,1),!0;for(t=0,o=this.pasteCallbacks.length;o>t;t++)if(this.pasteCallbacks[t]===e)return this.pasteCallbacks.splice(t,1),!0;return!1},r.prototype.triggerCut=function(e){var t=this;t.cutCallbacks&&setTimeout(function(){for(var o=0,n=t.cutCallbacks.length;n>o;o++)t.cutCallbacks[o](e)},50)},r.prototype.triggerPaste=function(e,t){var o=this;o.pasteCallbacks&&setTimeout(function(){for(var n=t||o.elTextarea.value,r=0,i=o.pasteCallbacks.length;i>r;r++)o.pasteCallbacks[r](n,e)},50)},r.prototype.destroy=function(){this.hasBeenDestroyed()||0!==--this.refCounter||(this.elDiv&&this.elDiv.parentNode&&(this.elDiv.parentNode.removeChild(this.elDiv),this.elDiv=null,this.elTextarea=null),document.documentElement.removeEventListener("keydown",this.onKeyDownRef),this.onKeyDownRef=null)},r.prototype.hasBeenDestroyed=function(){return!this.refCounter}},{}],es6collections:[function(e,t,o){"use strict";!function(e){function t(e,t){function n(e){return this&&this.constructor===n?(this._keys=[],this._values=[],this._itp=[],this.objectOnly=t,void(e&&o.call(this,e))):new n(e)}return t||b(e,"size",{get:m}),e.constructor=n,n.prototype=e,n}function o(e){this.add?e.forEach(this.add,this):e.forEach(function(e){this.set(e[0],e[1])},this)}function n(e){return this.has(e)&&(this._keys.splice(v,1),this._values.splice(v,1),this._itp.forEach(function(e){v-1}function r(e){return this.has(e)?this._values[v]:void 0}function i(e,t){if(this.objectOnly&&t!==Object(t))throw new TypeError("Invalid value used as weak collection key");if(t!=t||0===t)for(v=e.length;v--&&!C(e[v],t););else v=e.indexOf(t);return v>-1}function s(e){return i.call(this,this._values,e)}function l(e){return i.call(this,this._keys,e)}function a(e,t){return this.has(e)?this._values[v]=t:this._values[this._keys.push(e)-1]=t,this}function u(e){return this.has(e)||this._values.push(e),this}function c(){this._values.length=0}function d(){return p(this._itp,this._keys)}function h(){return p(this._itp,this._values)}function f(){return p(this._itp,this._keys,this._values)}function g(){return p(this._itp,this._values,this._values)}function p(e,t,o){var n=[0],r=!1;return e.push(n),{next:function(){var i,s=n[0];return!r&&st;t++)if(v[t].obj===e)return v[t]}function i(e){for(var t=0,o=v.length;o>t;t++)v[t]===e&&v.splice(t,1)}function s(e,t){for(var o=0,n=e.observers.length;n>o;o++)if(e.observers[o].callback===t)return e.observers[o].observer}function l(e,t){for(var o=0,n=e.observers.length;n>o;o++)if(e.observers[o].observer===t)return e.observers.splice(o,1),void(e.observers.length||i(e))}function a(e,t){h(t),Object.observe?d(t,e):clearTimeout(t.next);var o=r(e);l(o,t)}function u(e,t){var o,i=[],l=e,a=r(e);if(a?o=s(a,t):(a=new b(e),v.push(a)),o)return o;if(Object.observe)o=function(r){d(o,e),c(o,e);for(var s=0,a=r.length;a>s;){if(("length"!==r[s].name||!R(r[s].object))&&"__Jasmine_been_here_before__"!==r[s].name){var u=r[s].type;switch(u){case"new":u="add";break;case"deleted":u="delete";break;case"updated":u="update"}w[u].call(r[s],i,n(l,r[s].object))}s++}i&&t&&t(i),o.patches=i,i=[]};else if(o={},a.value=JSON.parse(JSON.stringify(e)),t){o.callback=t,o.next=null;var u=this.intervals||[100,1e3,1e4,6e4],f=0,g=function(){h(o)},p=function(){clearTimeout(o.next),o.next=setTimeout(function(){g(),f=0,o.next=setTimeout(m,u[f++])},0)},m=function(){g(),f==u.length&&(f=u.length-1),o.next=setTimeout(m,u[f++])};"undefined"!=typeof window&&(window.addEventListener?(window.addEventListener("mousedown",p),window.addEventListener("mouseup",p),window.addEventListener("keydown",p)):(window.attachEvent("onmousedown",p),window.attachEvent("onmouseup",p),window.attachEvent("onkeydown",p))),o.next=setTimeout(m,u[f++])}return o.patches=i,o.object=e,a.observers.push(new C(t,o)),c(o,e)}function c(e,t){if(Object.observe){Object.observe(t,e);for(var o in t)if(t.hasOwnProperty(o)){var n=t[o];n&&"object"==typeof n&&c(e,n)}}return e}function d(e,t){if(Object.observe){Object.unobserve(t,e);for(var o in t)if(t.hasOwnProperty(o)){var n=t[o];n&&"object"==typeof n&&d(e,n)}}return e}function h(e){if(Object.observe)Object.deliverChangeRecords(e);else{for(var t,o=0,n=v.length;n>o;o++)if(v[o].obj===e.object){t=v[o];break}t&&f(t.value,e.object,e.patches,"")}var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function f(e,o,n,r){for(var i=y(o),s=y(e),l=!1,a=!1,u=s.length-1;u>=0;u--){var c=s[u],d=e[c];if(o.hasOwnProperty(c)){var h=o[c];d instanceof Object?f(d,h,n,r+"/"+t(c)):d!=h&&(l=!0,n.push({op:"replace",path:r+"/"+t(c),value:h}),e[c]=h)}else n.push({op:"remove",path:r+"/"+t(c)}),delete e[c],a=!0}if(a||i.length!=s.length)for(var u=0;ur;){o=t[r];for(var s=o.path.split("/"),l=e,a=1,u=s.length;;)if(R(l)){var c=parseInt(s[a],10);if(a++,a>=u){n=m[o.op].call(o,l,c,e);break}l=l[c]}else{var d=s[a];if(-1!=d.indexOf("~")&&(d=d.replace(/~1/g,"/").replace(/~0/g,"~")),a++,a>=u){n=p[o.op].call(o,l,d,e);break}l=l[d]}r++}return n}var p={add:function(e,t){return e[t]=this.value,!0},remove:function(e,t){return delete e[t],!0},replace:function(e,t){return e[t]=this.value,!0},move:function(e,t,o){var n={op:"_get",path:this.from};return g(o,[n]),g(o,[{op:"remove",path:this.from}]),g(o,[{op:"add",path:this.path,value:n.value}]),!0},copy:function(e,t,o){var n={op:"_get",path:this.from};return g(o,[n]),g(o,[{op:"add",path:this.path,value:n.value}]),!0},test:function(e,t){return JSON.stringify(e[t])===JSON.stringify(this.value)},_get:function(e,t){this.value=e[t]}},m={add:function(e,t){return e.splice(t,0,this.value),!0},remove:function(e,t){return e.splice(t,1),!0},replace:function(e,t){return e[t]=this.value,!0},move:p.move,copy:p.copy,test:p.test,_get:p._get},w={add:function(e,o){var n={op:"add",path:o+t(this.name),value:this.object[this.name]};e.push(n)},"delete":function(e,o){var n={op:"remove",path:o+t(this.name)};e.push(n)},update:function(e,o){var n={op:"replace",path:o+t(this.name),value:this.object[this.name]};e.push(n)}},v=[];e.intervals;var b=function(){function e(e){this.observers=[],this.obj=e}return e}(),C=function(){function e(e,t){this.callback=e,this.observer=t}return e}();e.unobserve=a,e.observe=u,e.generate=h;var y;y=Object.keys?Object.keys:function(e){var t=[];for(var o in e)e.hasOwnProperty(o)&&t.push(o);return t};var R;R=Array.isArray?Array.isArray:function(e){return e.push&&"number"==typeof e.length},e.apply=g}(n||(n={})),"undefined"!=typeof o&&(o.apply=n.apply,o.observe=n.observe,o.unobserve=n.unobserve,o.generate=n.generate)},{}],numeral:[function(t,o,n){"use strict";(function(){function t(e){this._value=e}function n(e,t,o,n){var r,i,s=Math.pow(10,t);return i=(o(e*s)/s).toFixed(t),n&&(r=new RegExp("0{1,"+n+"}$"),i=i.replace(r,"")),i}function r(e,t,o){var n;return n=t.indexOf("$")>-1?s(e,t,o):t.indexOf("%")>-1?l(e,t,o):t.indexOf(":")>-1?a(e,t):c(e._value,t,o)}function i(e,t){var o,n,r,i,s,l=t,a=["KB","MB","GB","TB","PB","EB","ZB","YB"],c=!1;if(t.indexOf(":")>-1)e._value=u(t);else if(t===v)e._value=0;else{for("."!==m[w].delimiters.decimal&&(t=t.replace(/\./g,"").replace(m[w].delimiters.decimal,".")),o=new RegExp("[^a-zA-Z]"+m[w].abbreviations.thousand+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),n=new RegExp("[^a-zA-Z]"+m[w].abbreviations.million+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),r=new RegExp("[^a-zA-Z]"+m[w].abbreviations.billion+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),i=new RegExp("[^a-zA-Z]"+m[w].abbreviations.trillion+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),s=0;s<=a.length&&!(c=t.indexOf(a[s])>-1?Math.pow(1024,s+1):!1);s++);e._value=(c?c:1)*(l.match(o)?Math.pow(10,3):1)*(l.match(n)?Math.pow(10,6):1)*(l.match(r)?Math.pow(10,9):1)*(l.match(i)?Math.pow(10,12):1)*(t.indexOf("%")>-1?.01:1)*((t.split("-").length+Math.min(t.split("(").length-1,t.split(")").length-1))%2?1:-1)*Number(t.replace(/[^0-9\.]+/g,"")),e._value=c?Math.ceil(e._value):e._value}return e._value}function s(e,t,o){var n,r,i=t.indexOf("$"),s=t.indexOf("("),l=t.indexOf("-"),a="";return t.indexOf(" $")>-1?(a=" ",t=t.replace(" $","")):t.indexOf("$ ")>-1?(a=" ",t=t.replace("$ ","")):t=t.replace("$",""),r=c(e._value,t,o),1>=i?r.indexOf("(")>-1||r.indexOf("-")>-1?(r=r.split(""),n=1,(s>i||l>i)&&(n=0),r.splice(n,0,m[w].currency.symbol+a),r=r.join("")):r=m[w].currency.symbol+a+r:r.indexOf(")")>-1?(r=r.split(""),r.splice(-1,0,a+m[w].currency.symbol),r=r.join("")):r=r+a+m[w].currency.symbol,r}function l(e,t,o){var n,r="",i=100*e._value;return t.indexOf(" %")>-1?(r=" ",t=t.replace(" %","")):t=t.replace("%",""),n=c(i,t,o),n.indexOf(")")>-1?(n=n.split(""),n.splice(-1,0,r+"%"),n=n.join("")):n=n+r+"%",n}function a(e){var t=Math.floor(e._value/60/60),o=Math.floor((e._value-60*t*60)/60),n=Math.round(e._value-60*t*60-60*o);return t+":"+(10>o?"0"+o:o)+":"+(10>n?"0"+n:n)}function u(e){var t=e.split(":"),o=0;return 3===t.length?(o+=60*Number(t[0])*60,o+=60*Number(t[1]),o+=Number(t[2])):2===t.length&&(o+=60*Number(t[0]),o+=Number(t[1])),Number(o)}function c(e,t,o){var r,i,s,l,a,u,c=!1,d=!1,h=!1,f="",g=!1,p=!1,b=!1,C=!1,y=!1,R="",E="",S=Math.abs(e),T=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],O="",_=!1;if(0===e&&null!==v)return v;if(t.indexOf("(")>-1?(c=!0,t=t.slice(1,-1)):t.indexOf("+")>-1&&(d=!0,t=t.replace(/\+/g,"")),t.indexOf("a")>-1&&(g=t.indexOf("aK")>=0,p=t.indexOf("aM")>=0,b=t.indexOf("aB")>=0,C=t.indexOf("aT")>=0,y=g||p||b||C,t.indexOf(" a")>-1?(f=" ",t=t.replace(" a","")):t=t.replace("a",""),S>=Math.pow(10,12)&&!y||C?(f+=m[w].abbreviations.trillion,e/=Math.pow(10,12)):S=Math.pow(10,9)&&!y||b?(f+=m[w].abbreviations.billion,e/=Math.pow(10,9)):S=Math.pow(10,6)&&!y||p?(f+=m[w].abbreviations.million,e/=Math.pow(10,6)):(S=Math.pow(10,3)&&!y||g)&&(f+=m[w].abbreviations.thousand,e/=Math.pow(10,3))),t.indexOf("b")>-1)for(t.indexOf(" b")>-1?(R=" ",t=t.replace(" b","")):t=t.replace("b",""),s=0;s<=T.length;s++)if(r=Math.pow(1024,s),i=Math.pow(1024,s+1),e>=r&&i>e){R+=T[s],r>0&&(e/=r);break}return t.indexOf("o")>-1&&(t.indexOf(" o")>-1?(E=" ",t=t.replace(" o","")):t=t.replace("o",""),E+=m[w].ordinal(e)),t.indexOf("[.]")>-1&&(h=!0,t=t.replace("[.]",".")),l=e.toString().split(".")[0],a=t.split(".")[1],u=t.indexOf(","),a?(a.indexOf("[")>-1?(a=a.replace("]",""),a=a.split("["),O=n(e,a[0].length+a[1].length,o,a[1].length)):O=n(e,a.length,o),l=O.split(".")[0],O=O.split(".")[1].length?m[w].delimiters.decimal+O.split(".")[1]:"",h&&0===Number(O.slice(1))&&(O="")):l=n(e,null,o),l.indexOf("-")>-1&&(l=l.slice(1),_=!0),u>-1&&(l=l.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+m[w].delimiters.thousands)),0===t.indexOf(".")&&(l=""),(c&&_?"(":"")+(!c&&_?"-":"")+(!_&&d?"+":"")+l+O+(E?E:"")+(f?f:"")+(R?R:"")+(c&&_?")":"")}function d(e,t){m[e]=t}function h(e){var t=e.toString().split(".");return t.length<2?1:Math.pow(10,t[1].length)}function f(){var e=Array.prototype.slice.call(arguments);return e.reduce(function(e,t){var o=h(e),n=h(t);return o>n?o:n},-(1/0))}var g,p="1.5.3",m={},w="en",v=null,b="0,0",C="undefined"!=typeof o&&o.exports;g=function(e){return g.isNumeral(e)?e=e.value():0===e||"undefined"==typeof e?e=0:Number(e)||(e=g.fn.unformat(e)),new t(Number(e))},g.version=p,g.isNumeral=function(e){return e instanceof t},g.language=function(e,t){if(!e)return w;if(e&&!t){if(!m[e])throw new Error("Unknown language : "+e);w=e}return(t||!m[e])&&d(e,t),g},g.languageData=function(e){if(!e)return m[w];if(!m[e])throw new Error("Unknown language : "+e);return m[e]},g.language("en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var t=e%10;return 1===~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$"}}),g.zeroFormat=function(e){v="string"==typeof e?e:null},g.defaultFormat=function(e){b="string"==typeof e?e:"0.0"},g.validate=function(e,t){var o,n,r,i,s,l,a,u;if("string"!=typeof e&&(e+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",e)),e=e.trim(),""===e)return!1;e=e.replace(/^[+-]?/,"");try{a=g.languageData(t)}catch(c){a=g.languageData(g.language())}return r=a.currency.symbol,s=a.abbreviations,o=a.delimiters.decimal,n="."===a.delimiters.thousands?"\\.":a.delimiters.thousands,u=e.match(/^[^\d\.\,]+/),null!==u&&(e=e.substr(1),u[0]!==r)?!1:(u=e.match(/[^\d]+$/),null!==u&&(e=e.slice(0,-1),u[0]!==s.thousand&&u[0]!==s.million&&u[0]!==s.billion&&u[0]!==s.trillion)?!1:e.match(/^\d+$/)?!0:(l=new RegExp(n+"{2}"),e.match(/[^\d.,]/g)?!1:(i=e.split(o),i.length>2?!1:i.length<2?!!i[0].match(/^\d+.*\d$/)&&!i[0].match(l):""===i[0]?!i[0].match(l)&&!!i[1].match(/^\d+$/):1===i[0].length?!!i[0].match(/^\d+$/)&&!i[0].match(l)&&!!i[1].match(/^\d+$/):!!i[0].match(/^\d+.*\d$/)&&!i[0].match(l)&&!!i[1].match(/^\d+$/))))},"function"!=typeof Array.prototype.reduce&&(Array.prototype.reduce=function(e,t){if(null===this||"undefined"==typeof this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof e)throw new TypeError(e+" is not a function");var o,n,r=this.length>>>0,i=!1;for(1o;++o)this.hasOwnProperty(o)&&(i?n=e(n,this[o],o,this):(n=this[o],i=!0));if(!i)throw new TypeError("Reduce of empty array with no initial value");return n}),g.fn=t.prototype={clone:function(){return g(this)},format:function(e,t){return r(this,e?e:b,void 0!==t?t:Math.round)},unformat:function(e){return"[object Number]"===Object.prototype.toString.call(e)?e:i(this,e?e:b)},value:function(){return this._value},valueOf:function(){return this._value},set:function(e){return this._value=Number(e),this},add:function(e){function t(e,t,n,r){return e+o*t}var o=f.call(null,this._value,e);return this._value=[this._value,e].reduce(t,0)/o,this},subtract:function(e){function t(e,t,n,r){return e-o*t}var o=f.call(null,this._value,e);return this._value=[e].reduce(t,this._value*o)/o,this},multiply:function(e){function t(e,t,o,n){var r=f(e,t);return e*r*(t*r)/(r*r)}return this._value=[this._value,e].reduce(t,1),this},divide:function(e){function t(e,t,o,n){var r=f(e,t);return e*r/(t*r)}return this._value=[this._value,e].reduce(t),this},difference:function(e){return Math.abs(g(this._value).subtract(e).value())}},C&&(o.exports=g),"undefined"==typeof ender&&(this.numeral=g),"function"==typeof e&&e.amd&&e([],function(){return g})}).call(window)},{}]},{},[23,59,61,60,62,83,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,84,85,86,87,100,101,102,90,91,92,93,94,95,31,35,32,33,40,34,36,37,38,39])("numeral")}); \ No newline at end of file diff --git a/bower_components/handsontable/handsontable.jquery.json b/bower_components/handsontable/handsontable.jquery.json index 6823881..c74efae 100644 --- a/bower_components/handsontable/handsontable.jquery.json +++ b/bower_components/handsontable/handsontable.jquery.json @@ -1,7 +1,7 @@ { "name": "handsontable", "title": "Handsontable", - "version": "0.20.2", + "version": "0.20.3", "author": { "name": "Marcin Warpechowski", "email": "hello@handsontable.com", diff --git a/bower_components/handsontable/package.json b/bower_components/handsontable/package.json index 1ac5f97..3c09d8f 100644 --- a/bower_components/handsontable/package.json +++ b/bower_components/handsontable/package.json @@ -10,7 +10,7 @@ "url": "https://github.com/handsontable/handsontable/issues" }, "author": "Handsoncode ", - "version": "0.20.2", + "version": "0.20.3", "keywords": [ "data", "grid", @@ -35,14 +35,14 @@ "grunt": "~0.4.5", "grunt-contrib-connect": "~0.8.0", "grunt-contrib-jasmine": "~0.5.1", - "grunt-contrib-jshint": "~0.10.0", + "grunt-contrib-jshint": "^0.11.3", "grunt-contrib-watch": "~0.6.1", "grunt-gitinfo": "~0.1.6", - "grunt-jscs": "^2.1.0", + "grunt-jscs": "^2.5.0", "grunt-saucelabs": "~8.3.3", "hot-builder": "^0.4.0", - "load-grunt-tasks": "^3.0.0", - "time-grunt": "~1.0.0" + "load-grunt-tasks": "^3.3.0", + "time-grunt": "^1.2.2" }, "scripts": { "test": "grunt test -v" diff --git a/bower_components/handsontable/plugins/removeRow/handsontable.removeRow.css b/bower_components/handsontable/plugins/removeRow/handsontable.removeRow.css index 8395e9b..951b2c6 100644 --- a/bower_components/handsontable/plugins/removeRow/handsontable.removeRow.css +++ b/bower_components/handsontable/plugins/removeRow/handsontable.removeRow.css @@ -5,6 +5,10 @@ text-align: center; } +.handsontable.htRemoveRow tr:first-child th.htRemoveRow { + border-top: 1px solid #CCC; +} + .handsontable.htRemoveRow th.htRemoveRow .btn { background-color: #BBB; border-radius: 9px; diff --git a/bower_components/moment/.bower.json b/bower_components/moment/.bower.json index 5186ce5..09694ca 100644 --- a/bower_components/moment/.bower.json +++ b/bower_components/moment/.bower.json @@ -20,12 +20,12 @@ "package.json" ], "homepage": "https://github.com/moment/moment", - "version": "2.10.6", - "_release": "2.10.6", + "version": "2.11.1", + "_release": "2.11.1", "_resolution": { "type": "version", - "tag": "2.10.6", - "commit": "446ce77eb08c5c862d7b0b11ef1d2e884d12e3d7" + "tag": "2.11.1", + "commit": "92aa818d27db9ef891f383fa494d0be824af921d" }, "_source": "git://github.com/moment/moment.git", "_target": "^2.9.0", diff --git a/bower_components/moment/CHANGELOG.md b/bower_components/moment/CHANGELOG.md index 7da0b1f..e2b8467 100644 --- a/bower_components/moment/CHANGELOG.md +++ b/bower_components/moment/CHANGELOG.md @@ -1,6 +1,39 @@ Changelog ========= +### 2.11.1 [See full changelog](https://gist.github.com/ichernev/8ec3ee25b749b4cff3c2) + +## Bugfixes: +* [#2881](https://github.com/moment/moment/pull/2881) Revert "Merge pull request #2746 from mbad0la:develop" Sep->Sept +* [#2868](https://github.com/moment/moment/pull/2868) Add format and parse token Y, so it actually works +* [#2865](https://github.com/moment/moment/pull/2865) Use typeof checks for undefined for global variables +* [#2858](https://github.com/moment/moment/pull/2858) Fix Date mocking regression introduced in 2.11.0 +* [#2864](https://github.com/moment/moment/pull/2864) Include changelog in npm release +* [#2830](https://github.com/moment/moment/pull/2830) dep: add grunt-cli +* [#2869](https://github.com/moment/moment/pull/2869) Fix months parsing for some locales + +### 2.11.0 [See full changelog](https://gist.github.com/ichernev/6594bc29719dde6b2f66) + +* [#2624](https://github.com/moment/moment/pull/2624) Proper handling of invalid moments +* [#2634](https://github.com/moment/moment/pull/2634) Fix strict month parsing issue in cs,ru,sk +* [#2735](https://github.com/moment/moment/pull/2735) Reset the locale back to 'en' after defining all locales in min/locales.js +* [#2702](https://github.com/moment/moment/pull/2702) Week rework +* [#2746](https://github.com/moment/moment/pull/2746) Changed September Abbreviation to "Sept" in locale-specific english + files and default locale file +* [#2646](https://github.com/moment/moment/pull/2646) Fix [#2645](https://github.com/moment/moment/pull/2645) - invalid dates pre-1970 + +* [#2641](https://github.com/moment/moment/pull/2641) Implement basic format and comma as ms separator in ISO 8601 +* [#2665](https://github.com/moment/moment/pull/2665) Implement stricter weekday parsing +* [#2700](https://github.com/moment/moment/pull/2700) Add [Hh]mm and [Hh]mmss formatting tokens, so you can parse 123 with + hmm for example +* [#2565](https://github.com/moment/moment/pull/2565) [#2835](https://github.com/moment/moment/pull/2835) Expose arguments used for moment creation with creationData + (fix [#2443](https://github.com/moment/moment/pull/2443)) +* [#2648](https://github.com/moment/moment/pull/2648) fix issue [#2640](https://github.com/moment/moment/pull/2640): support instanceof operator +* [#2709](https://github.com/moment/moment/pull/2709) Add isSameOrAfter and isSameOrBefore comparison methods +* [#2721](https://github.com/moment/moment/pull/2721) Fix moment creation from object with strings values +* [#2740](https://github.com/moment/moment/pull/2740) Enable 'd hh:mm:ss.sss' format for durations +* [#2766](https://github.com/moment/moment/pull/2766) [#2833](https://github.com/moment/moment/pull/2833) Alternate Clock Source Support + ### 2.10.6 [#2515](https://github.com/moment/moment/pull/2515) Fix regression introduced @@ -44,7 +77,7 @@ languages: * [2097](https://github.com/moment/moment/issues/2097) add ar-tn locale deprecations: -* [2074](https://github.com/moment/moment/issues/2074) Implement `moment.fn.utcOffset`, deprecate `momen.fn.zone` +* [2074](https://github.com/moment/moment/issues/2074) Implement `moment.fn.utcOffset`, deprecate `moment.fn.zone` features: * [2088](https://github.com/moment/moment/issues/2088) add moment.fn.isBetween @@ -271,7 +304,7 @@ Bugfix: Fixed parsing of first century dates Bugfix: Parsing 10Sep2001 should work as expected -Bugfix: Fixed wierdness with `moment.utc()` parsing. +Bugfix: Fixed weirdness with `moment.utc()` parsing. Changed language ordinal method to return the number + ordinal instead of just the ordinal. diff --git a/bower_components/moment/LICENSE b/bower_components/moment/LICENSE index 34f5b37..9ee5374 100644 --- a/bower_components/moment/LICENSE +++ b/bower_components/moment/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2011-2015 Tim Wood, Iskren Chernev, Moment.js contributors +Copyright (c) 2011-2016 Tim Wood, Iskren Chernev, Moment.js contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff --git a/bower_components/moment/README.md b/bower_components/moment/README.md index d59f056..21cb48a 100644 --- a/bower_components/moment/README.md +++ b/bower_components/moment/README.md @@ -7,12 +7,12 @@ A lightweight JavaScript date library for parsing, validating, manipulating, and ## [Documentation](http://momentjs.com/docs/) -## Port to ES6 (version 2.10.0) +## Port to ECMAScript 6 (version 2.10.0) Moment 2.10.0 does not bring any new features, but the code is now written in -es6 modules and placed inside `src/`. Previously `moment.js`, `locale/*.js` and +ECMAScript 6 modules and placed inside `src/`. Previously `moment.js`, `locale/*.js` and `test/moment/*.js`, `test/locale/*.js` contained the source of the project. Now -the source is in `src/`, temporary build (es5) files are placed under +the source is in `src/`, temporary build (ECMAScript 5) files are placed under `build/umd/` (for running tests during development), and the `moment.js` and `locale/*.js` files are updated only on release. diff --git a/bower_components/moment/locale/af.js b/bower_components/moment/locale/af.js index f6329e8..1a96bf4 100644 --- a/bower_components/moment/locale/af.js +++ b/bower_components/moment/locale/af.js @@ -2,8 +2,9 @@ //! locale : afrikaans (af) //! author : Werner Mollentze : https://github.com/wernerm -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/ar-ma.js b/bower_components/moment/locale/ar-ma.js index f9f21b5..9bddd5a 100644 --- a/bower_components/moment/locale/ar-ma.js +++ b/bower_components/moment/locale/ar-ma.js @@ -3,8 +3,9 @@ //! author : ElFadili Yassine : https://github.com/ElFadiliY //! author : Abdel Said : https://github.com/abdelsaid -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/ar-sa.js b/bower_components/moment/locale/ar-sa.js index cdb0f64..7541c52 100644 --- a/bower_components/moment/locale/ar-sa.js +++ b/bower_components/moment/locale/ar-sa.js @@ -2,8 +2,9 @@ //! locale : Arabic Saudi Arabia (ar-sa) //! author : Suhail Alkowaileet : https://github.com/xsoh -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/ar-tn.js b/bower_components/moment/locale/ar-tn.js index 6f5a84f..b4ee8fc 100644 --- a/bower_components/moment/locale/ar-tn.js +++ b/bower_components/moment/locale/ar-tn.js @@ -1,8 +1,9 @@ //! moment.js locale configuration //! locale : Tunisian Arabic (ar-tn) -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/ar.js b/bower_components/moment/locale/ar.js index c42f5e6..3613c59 100644 --- a/bower_components/moment/locale/ar.js +++ b/bower_components/moment/locale/ar.js @@ -4,8 +4,9 @@ //! Changes in months, weekdays: Ahmed Elkhatib //! Native plural forms: forabi https://github.com/forabi -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/az.js b/bower_components/moment/locale/az.js index bd9830f..5ff9b08 100644 --- a/bower_components/moment/locale/az.js +++ b/bower_components/moment/locale/az.js @@ -2,8 +2,9 @@ //! locale : azerbaijani (az) //! author : topchiyev : https://github.com/topchiyev -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/be.js b/bower_components/moment/locale/be.js index 0fa37d7..c6294b3 100644 --- a/bower_components/moment/locale/be.js +++ b/bower_components/moment/locale/be.js @@ -4,8 +4,9 @@ //! author: Praleska: http://praleska.pro/ //! Author : Menelion Elensúle : https://github.com/Oire -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -33,31 +34,18 @@ return number + ' ' + plural(format[key], +number); } } - function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_'), - 'accusative': 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_') - }, - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return months[nounCase][m.month()]; - } - function weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'), - 'accusative': 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_') - }, - nounCase = (/\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/).test(format) ? - 'accusative' : - 'nominative'; - return weekdays[nounCase][m.day()]; - } var be = moment.defineLocale('be', { - months : monthsCaseReplace, + months : { + format: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_'), + standalone: 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_') + }, monthsShort : 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'), - weekdays : weekdaysCaseReplace, + weekdays : { + format: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_'), + standalone: 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'), + isFormat: /\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/ + }, weekdaysShort : 'нд_пн_ат_ср_чц_пт_сб'.split('_'), weekdaysMin : 'нд_пн_ат_ср_чц_пт_сб'.split('_'), longDateFormat : { diff --git a/bower_components/moment/locale/bg.js b/bower_components/moment/locale/bg.js index c6601c6..169e123 100644 --- a/bower_components/moment/locale/bg.js +++ b/bower_components/moment/locale/bg.js @@ -2,8 +2,9 @@ //! locale : bulgarian (bg) //! author : Krasen Borisov : https://github.com/kraz -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/bn.js b/bower_components/moment/locale/bn.js index 745e277..4eca5ee 100644 --- a/bower_components/moment/locale/bn.js +++ b/bower_components/moment/locale/bn.js @@ -2,8 +2,9 @@ //! locale : Bengali (bn) //! author : Kaushik Gandhi : https://github.com/kaushikgandhi -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -37,8 +38,8 @@ var bn = moment.defineLocale('bn', { months : 'জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split('_'), monthsShort : 'জানু_ফেব_মার্চ_এপর_মে_জুন_জুল_অগ_সেপ্ট_অক্টো_নভ_ডিসেম্'.split('_'), - weekdays : 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রুবার_শনিবার'.split('_'), - weekdaysShort : 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্রু_শনি'.split('_'), + weekdays : 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রবার_শনিবার'.split('_'), + weekdaysShort : 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্র_শনি'.split('_'), weekdaysMin : 'রব_সম_মঙ্গ_বু_ব্রিহ_শু_শনি'.split('_'), longDateFormat : { LT : 'A h:mm সময়', @@ -59,7 +60,7 @@ relativeTime : { future : '%s পরে', past : '%s আগে', - s : 'কএক সেকেন্ড', + s : 'কয়েক সেকেন্ড', m : 'এক মিনিট', mm : '%d মিনিট', h : 'এক ঘন্টা', @@ -81,9 +82,9 @@ return symbolMap[match]; }); }, - meridiemParse: /রাত|সকাল|দুপুর|বিকেল|রাত/, + meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/, isPM: function (input) { - return /^(দুপুর|বিকেল|রাত)$/.test(input); + return /^(দুপুর|বিকাল|রাত)$/.test(input); }, //Bengali is a vast language its spoken //in different forms in various parts of the world. @@ -96,7 +97,7 @@ } else if (hour < 17) { return 'দুপুর'; } else if (hour < 20) { - return 'বিকেল'; + return 'বিকাল'; } else { return 'রাত'; } diff --git a/bower_components/moment/locale/bo.js b/bower_components/moment/locale/bo.js index 4331f3b..3ab3389 100644 --- a/bower_components/moment/locale/bo.js +++ b/bower_components/moment/locale/bo.js @@ -2,8 +2,9 @@ //! locale : tibetan (bo) //! author : Thupten N. Chakrishar : https://github.com/vajradog -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/br.js b/bower_components/moment/locale/br.js index d565505..2896cfb 100644 --- a/bower_components/moment/locale/br.js +++ b/bower_components/moment/locale/br.js @@ -2,8 +2,9 @@ //! locale : breton (br) //! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/bs.js b/bower_components/moment/locale/bs.js index 8b452ab..e0b3dae 100644 --- a/bower_components/moment/locale/bs.js +++ b/bower_components/moment/locale/bs.js @@ -3,8 +3,9 @@ //! author : Nedim Cholich : https://github.com/frontyard //! based on (hr) translation by Bojan Marković -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/ca.js b/bower_components/moment/locale/ca.js index 6459d83..15f75fe 100644 --- a/bower_components/moment/locale/ca.js +++ b/bower_components/moment/locale/ca.js @@ -2,8 +2,9 @@ //! locale : catalan (ca) //! author : Juan G. Hurtado : https://github.com/juanghurtado -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -17,7 +18,7 @@ weekdaysMin : 'Dg_Dl_Dt_Dc_Dj_Dv_Ds'.split('_'), longDateFormat : { LT : 'H:mm', - LTS : 'LT:ss', + LTS : 'H:mm:ss', L : 'DD/MM/YYYY', LL : 'D MMMM YYYY', LLL : 'D MMMM YYYY H:mm', diff --git a/bower_components/moment/locale/cs.js b/bower_components/moment/locale/cs.js index 00aa126..5854f70 100644 --- a/bower_components/moment/locale/cs.js +++ b/bower_components/moment/locale/cs.js @@ -2,8 +2,9 @@ //! locale : czech (cs) //! author : petrbela : https://github.com/petrbela -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -78,6 +79,20 @@ } return _monthsParse; }(months, monthsShort)), + shortMonthsParse : (function (monthsShort) { + var i, _shortMonthsParse = []; + for (i = 0; i < 12; i++) { + _shortMonthsParse[i] = new RegExp('^' + monthsShort[i] + '$', 'i'); + } + return _shortMonthsParse; + }(monthsShort)), + longMonthsParse : (function (months) { + var i, _longMonthsParse = []; + for (i = 0; i < 12; i++) { + _longMonthsParse[i] = new RegExp('^' + months[i] + '$', 'i'); + } + return _longMonthsParse; + }(months)), weekdays : 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'), weekdaysShort : 'ne_po_út_st_čt_pá_so'.split('_'), weekdaysMin : 'ne_po_út_st_čt_pá_so'.split('_'), diff --git a/bower_components/moment/locale/cv.js b/bower_components/moment/locale/cv.js index 7055d12..a1d87e1 100644 --- a/bower_components/moment/locale/cv.js +++ b/bower_components/moment/locale/cv.js @@ -2,8 +2,9 @@ //! locale : chuvash (cv) //! author : Anatoly Mironov : https://github.com/mirontoli -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/cy.js b/bower_components/moment/locale/cy.js index a3c38a0..64dfe43 100644 --- a/bower_components/moment/locale/cy.js +++ b/bower_components/moment/locale/cy.js @@ -2,8 +2,9 @@ //! locale : Welsh (cy) //! author : Robert Allen -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/da.js b/bower_components/moment/locale/da.js index 2aff2bb..70b4c0d 100644 --- a/bower_components/moment/locale/da.js +++ b/bower_components/moment/locale/da.js @@ -2,8 +2,9 @@ //! locale : danish (da) //! author : Ulrik Nielsen : https://github.com/mrbase -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/de-at.js b/bower_components/moment/locale/de-at.js index a2071bb..20da9cf 100644 --- a/bower_components/moment/locale/de-at.js +++ b/bower_components/moment/locale/de-at.js @@ -3,9 +3,11 @@ //! author : lluchs : https://github.com/lluchs //! author: Menelion Elensúle: https://github.com/Oire //! author : Martin Groller : https://github.com/MadMG +//! author : Mikolaj Dadela : https://github.com/mik01aj -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -40,11 +42,11 @@ LLLL : 'dddd, D. MMMM YYYY HH:mm' }, calendar : { - sameDay: '[Heute um] LT [Uhr]', + sameDay: '[heute um] LT [Uhr]', sameElse: 'L', - nextDay: '[Morgen um] LT [Uhr]', + nextDay: '[morgen um] LT [Uhr]', nextWeek: 'dddd [um] LT [Uhr]', - lastDay: '[Gestern um] LT [Uhr]', + lastDay: '[gestern um] LT [Uhr]', lastWeek: '[letzten] dddd [um] LT [Uhr]' }, relativeTime : { diff --git a/bower_components/moment/locale/de.js b/bower_components/moment/locale/de.js index 81ffae4..41c81a1 100644 --- a/bower_components/moment/locale/de.js +++ b/bower_components/moment/locale/de.js @@ -2,9 +2,11 @@ //! locale : german (de) //! author : lluchs : https://github.com/lluchs //! author: Menelion Elensúle: https://github.com/Oire +//! author : Mikolaj Dadela : https://github.com/mik01aj -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -39,11 +41,11 @@ LLLL : 'dddd, D. MMMM YYYY HH:mm' }, calendar : { - sameDay: '[Heute um] LT [Uhr]', + sameDay: '[heute um] LT [Uhr]', sameElse: 'L', - nextDay: '[Morgen um] LT [Uhr]', + nextDay: '[morgen um] LT [Uhr]', nextWeek: 'dddd [um] LT [Uhr]', - lastDay: '[Gestern um] LT [Uhr]', + lastDay: '[gestern um] LT [Uhr]', lastWeek: '[letzten] dddd [um] LT [Uhr]' }, relativeTime : { diff --git a/bower_components/moment/locale/dv.js b/bower_components/moment/locale/dv.js new file mode 100644 index 0000000..5fc59b6 --- /dev/null +++ b/bower_components/moment/locale/dv.js @@ -0,0 +1,99 @@ +//! moment.js locale configuration +//! locale : dhivehi (dv) +//! author : Jawish Hameed : https://github.com/jawish + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var months = [ + 'ޖެނުއަރީ', + 'ފެބްރުއަރީ', + 'މާރިޗު', + 'އޭޕްރީލު', + 'މޭ', + 'ޖޫން', + 'ޖުލައި', + 'އޯގަސްޓު', + 'ސެޕްޓެމްބަރު', + 'އޮކްޓޯބަރު', + 'ނޮވެމްބަރު', + 'ޑިސެމްބަރު' + ], weekdays = [ + 'އާދިއްތަ', + 'ހޯމަ', + 'އަންގާރަ', + 'ބުދަ', + 'ބުރާސްފަތި', + 'ހުކުރު', + 'ހޮނިހިރު' + ]; + + var dv = moment.defineLocale('dv', { + months : months, + monthsShort : months, + weekdays : weekdays, + weekdaysShort : weekdays, + weekdaysMin : 'އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި'.split('_'), + longDateFormat : { + + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'D/M/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd D MMMM YYYY HH:mm' + }, + meridiemParse: /މކ|މފ/, + isPM : function (input) { + return '' === input; + }, + meridiem : function (hour, minute, isLower) { + if (hour < 12) { + return 'މކ'; + } else { + return 'މފ'; + } + }, + calendar : { + sameDay : '[މިއަދު] LT', + nextDay : '[މާދަމާ] LT', + nextWeek : 'dddd LT', + lastDay : '[އިއްޔެ] LT', + lastWeek : '[ފާއިތުވި] dddd LT', + sameElse : 'L' + }, + relativeTime : { + future : 'ތެރޭގައި %s', + past : 'ކުރިން %s', + s : 'ސިކުންތުކޮޅެއް', + m : 'މިނިޓެއް', + mm : 'މިނިޓު %d', + h : 'ގަޑިއިރެއް', + hh : 'ގަޑިއިރު %d', + d : 'ދުވަހެއް', + dd : 'ދުވަސް %d', + M : 'މަހެއް', + MM : 'މަސް %d', + y : 'އަހަރެއް', + yy : 'އަހަރު %d' + }, + preparse: function (string) { + return string.replace(/،/g, ','); + }, + postformat: function (string) { + return string.replace(/,/g, '،'); + }, + week : { + dow : 7, // Sunday is the first day of the week. + doy : 12 // The week that contains Jan 1st is the first week of the year. + } + }); + + return dv; + +})); \ No newline at end of file diff --git a/bower_components/moment/locale/el.js b/bower_components/moment/locale/el.js index ee580e7..d86666d 100644 --- a/bower_components/moment/locale/el.js +++ b/bower_components/moment/locale/el.js @@ -2,12 +2,17 @@ //! locale : modern greek (el) //! author : Aggelos Karalias : https://github.com/mehiel -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; + function isFunction(input) { + return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; + } + var el = moment.defineLocale('el', { monthsNominativeEl : 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split('_'), @@ -60,7 +65,7 @@ calendar : function (key, mom) { var output = this._calendarEl[key], hours = mom && mom.hours(); - if (typeof output === 'function') { + if (isFunction(output)) { output = output.apply(mom); } return output.replace('{}', (hours % 12 === 1 ? 'στη' : 'στις')); diff --git a/bower_components/moment/locale/en-au.js b/bower_components/moment/locale/en-au.js index ae1ee4f..58608c1 100644 --- a/bower_components/moment/locale/en-au.js +++ b/bower_components/moment/locale/en-au.js @@ -1,8 +1,9 @@ //! moment.js locale configuration //! locale : australian english (en-au) -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/en-ca.js b/bower_components/moment/locale/en-ca.js index 4526d89..f0ee032 100644 --- a/bower_components/moment/locale/en-ca.js +++ b/bower_components/moment/locale/en-ca.js @@ -2,8 +2,9 @@ //! locale : canadian english (en-ca) //! author : Jonathan Abourbih : https://github.com/jonbca -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/en-gb.js b/bower_components/moment/locale/en-gb.js index fb76283..47b2c20 100644 --- a/bower_components/moment/locale/en-gb.js +++ b/bower_components/moment/locale/en-gb.js @@ -2,8 +2,9 @@ //! locale : great britain english (en-gb) //! author : Chris Gedrim : https://github.com/chrisgedrim -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/en-ie.js b/bower_components/moment/locale/en-ie.js new file mode 100644 index 0000000..c0ff10c --- /dev/null +++ b/bower_components/moment/locale/en-ie.js @@ -0,0 +1,67 @@ +//! moment.js locale configuration +//! locale : Irish english (en-ie) +//! author : Chris Cartlidge : https://github.com/chriscartlidge + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var en_ie = moment.defineLocale('en-ie', { + months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), + monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), + weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), + weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD-MM-YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd D MMMM YYYY HH:mm' + }, + calendar : { + sameDay : '[Today at] LT', + nextDay : '[Tomorrow at] LT', + nextWeek : 'dddd [at] LT', + lastDay : '[Yesterday at] LT', + lastWeek : '[Last] dddd [at] LT', + sameElse : 'L' + }, + relativeTime : { + future : 'in %s', + past : '%s ago', + s : 'a few seconds', + m : 'a minute', + mm : '%d minutes', + h : 'an hour', + hh : '%d hours', + d : 'a day', + dd : '%d days', + M : 'a month', + MM : '%d months', + y : 'a year', + yy : '%d years' + }, + ordinalParse: /\d{1,2}(st|nd|rd|th)/, + ordinal : function (number) { + var b = number % 10, + output = (~~(number % 100 / 10) === 1) ? 'th' : + (b === 1) ? 'st' : + (b === 2) ? 'nd' : + (b === 3) ? 'rd' : 'th'; + return number + output; + }, + week : { + dow : 1, // Monday is the first day of the week. + doy : 4 // The week that contains Jan 4th is the first week of the year. + } + }); + + return en_ie; + +})); \ No newline at end of file diff --git a/bower_components/moment/locale/en-nz.js b/bower_components/moment/locale/en-nz.js new file mode 100644 index 0000000..14a50ea --- /dev/null +++ b/bower_components/moment/locale/en-nz.js @@ -0,0 +1,66 @@ +//! moment.js locale configuration +//! locale : New Zealand english (en-nz) + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var en_nz = moment.defineLocale('en-nz', { + months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), + monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), + weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), + weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), + longDateFormat : { + LT : 'h:mm A', + LTS : 'h:mm:ss A', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY h:mm A', + LLLL : 'dddd, D MMMM YYYY h:mm A' + }, + calendar : { + sameDay : '[Today at] LT', + nextDay : '[Tomorrow at] LT', + nextWeek : 'dddd [at] LT', + lastDay : '[Yesterday at] LT', + lastWeek : '[Last] dddd [at] LT', + sameElse : 'L' + }, + relativeTime : { + future : 'in %s', + past : '%s ago', + s : 'a few seconds', + m : 'a minute', + mm : '%d minutes', + h : 'an hour', + hh : '%d hours', + d : 'a day', + dd : '%d days', + M : 'a month', + MM : '%d months', + y : 'a year', + yy : '%d years' + }, + ordinalParse: /\d{1,2}(st|nd|rd|th)/, + ordinal : function (number) { + var b = number % 10, + output = (~~(number % 100 / 10) === 1) ? 'th' : + (b === 1) ? 'st' : + (b === 2) ? 'nd' : + (b === 3) ? 'rd' : 'th'; + return number + output; + }, + week : { + dow : 1, // Monday is the first day of the week. + doy : 4 // The week that contains Jan 4th is the first week of the year. + } + }); + + return en_nz; + +})); \ No newline at end of file diff --git a/bower_components/moment/locale/eo.js b/bower_components/moment/locale/eo.js index 4cb0e3a..92772df 100644 --- a/bower_components/moment/locale/eo.js +++ b/bower_components/moment/locale/eo.js @@ -4,8 +4,9 @@ //! komento: Mi estas malcerta se mi korekte traktis akuzativojn en tiu traduko. //! Se ne, bonvolu korekti kaj avizi min por ke mi povas lerni! -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/es.js b/bower_components/moment/locale/es.js index d910d50..efb51a3 100644 --- a/bower_components/moment/locale/es.js +++ b/bower_components/moment/locale/es.js @@ -2,18 +2,19 @@ //! locale : spanish (es) //! author : Julio Napurí : https://github.com/julionc -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; - var monthsShortDot = 'Ene._Feb._Mar._Abr._May._Jun._Jul._Ago._Sep._Oct._Nov._Dic.'.split('_'), - monthsShort = 'Ene_Feb_Mar_Abr_May_Jun_Jul_Ago_Sep_Oct_Nov_Dic'.split('_'); + var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'), + monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'); var es = moment.defineLocale('es', { - months : 'Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre'.split('_'), + months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'), monthsShort : function (m, format) { if (/-MMM-/.test(format)) { return monthsShort[m.month()]; @@ -21,9 +22,9 @@ return monthsShortDot[m.month()]; } }, - weekdays : 'Domingo_Lunes_Martes_Miércoles_Jueves_Viernes_Sábado'.split('_'), - weekdaysShort : 'Dom._Lun._Mar._Mié._Jue._Vie._Sáb.'.split('_'), - weekdaysMin : 'Do_Lu_Ma_Mi_Ju_Vi_Sá'.split('_'), + weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), + weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), + weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'), longDateFormat : { LT : 'H:mm', LTS : 'H:mm:ss', diff --git a/bower_components/moment/locale/et.js b/bower_components/moment/locale/et.js index 00207d4..09043bf 100644 --- a/bower_components/moment/locale/et.js +++ b/bower_components/moment/locale/et.js @@ -3,8 +3,9 @@ //! author : Henry Kehlmann : https://github.com/madhenry //! improvements : Illimar Tambek : https://github.com/ragulka -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/eu.js b/bower_components/moment/locale/eu.js index 6029f47..52db117 100644 --- a/bower_components/moment/locale/eu.js +++ b/bower_components/moment/locale/eu.js @@ -2,8 +2,9 @@ //! locale : euskara (eu) //! author : Eneko Illarramendi : https://github.com/eillarra -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/fa.js b/bower_components/moment/locale/fa.js index d9eb59d..de40e6f 100644 --- a/bower_components/moment/locale/fa.js +++ b/bower_components/moment/locale/fa.js @@ -2,8 +2,9 @@ //! locale : Persian (fa) //! author : Ebrahim Byagowi : https://github.com/ebraminio -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/fi.js b/bower_components/moment/locale/fi.js index d889ee7..4f9161b 100644 --- a/bower_components/moment/locale/fi.js +++ b/bower_components/moment/locale/fi.js @@ -2,8 +2,9 @@ //! locale : finnish (fi) //! author : Tarmo Aidantausta : https://github.com/bleadof -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/fo.js b/bower_components/moment/locale/fo.js index e5aa93b..460b6cd 100644 --- a/bower_components/moment/locale/fo.js +++ b/bower_components/moment/locale/fo.js @@ -2,8 +2,9 @@ //! locale : faroese (fo) //! author : Ragnar Johannesen : https://github.com/ragnar123 -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/fr-ca.js b/bower_components/moment/locale/fr-ca.js index db7fc1f..f15ec8d 100644 --- a/bower_components/moment/locale/fr-ca.js +++ b/bower_components/moment/locale/fr-ca.js @@ -2,8 +2,9 @@ //! locale : canadian french (fr-ca) //! author : Jonathan Abourbih : https://github.com/jonbca -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/fr-ch.js b/bower_components/moment/locale/fr-ch.js new file mode 100644 index 0000000..9503d80 --- /dev/null +++ b/bower_components/moment/locale/fr-ch.js @@ -0,0 +1,62 @@ +//! moment.js locale configuration +//! locale : swiss french (fr) +//! author : Gaspard Bucher : https://github.com/gaspard + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var fr_ch = moment.defineLocale('fr-ch', { + months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'), + monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'), + weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), + weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), + weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd D MMMM YYYY HH:mm' + }, + calendar : { + sameDay: '[Aujourd\'hui à] LT', + nextDay: '[Demain à] LT', + nextWeek: 'dddd [à] LT', + lastDay: '[Hier à] LT', + lastWeek: 'dddd [dernier à] LT', + sameElse: 'L' + }, + relativeTime : { + future : 'dans %s', + past : 'il y a %s', + s : 'quelques secondes', + m : 'une minute', + mm : '%d minutes', + h : 'une heure', + hh : '%d heures', + d : 'un jour', + dd : '%d jours', + M : 'un mois', + MM : '%d mois', + y : 'un an', + yy : '%d ans' + }, + ordinalParse: /\d{1,2}(er|e)/, + ordinal : function (number) { + return number + (number === 1 ? 'er' : 'e'); + }, + week : { + dow : 1, // Monday is the first day of the week. + doy : 4 // The week that contains Jan 4th is the first week of the year. + } + }); + + return fr_ch; + +})); \ No newline at end of file diff --git a/bower_components/moment/locale/fr.js b/bower_components/moment/locale/fr.js index 4f60e58..8ef95c9 100644 --- a/bower_components/moment/locale/fr.js +++ b/bower_components/moment/locale/fr.js @@ -2,8 +2,9 @@ //! locale : french (fr) //! author : John Fischer : https://github.com/jfroffice -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/fy.js b/bower_components/moment/locale/fy.js index 3a5971a..d1b709c 100644 --- a/bower_components/moment/locale/fy.js +++ b/bower_components/moment/locale/fy.js @@ -2,8 +2,9 @@ //! locale : frisian (fy) //! author : Robin van der Vliet : https://github.com/robin0van0der0v -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/gd.js b/bower_components/moment/locale/gd.js new file mode 100644 index 0000000..578e567 --- /dev/null +++ b/bower_components/moment/locale/gd.js @@ -0,0 +1,76 @@ +//! moment.js locale configuration +//! locale : great britain scottish gealic (gd) +//! author : Jon Ashdown : https://github.com/jonashdown + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var months = [ + 'Am Faoilleach', 'An Gearran', 'Am Màrt', 'An Giblean', 'An Cèitean', 'An t-Ògmhios', 'An t-Iuchar', 'An Lùnastal', 'An t-Sultain', 'An Dàmhair', 'An t-Samhain', 'An Dùbhlachd' + ]; + + var monthsShort = ['Faoi', 'Gear', 'Màrt', 'Gibl', 'Cèit', 'Ògmh', 'Iuch', 'Lùn', 'Sult', 'Dàmh', 'Samh', 'Dùbh']; + + var weekdays = ['Didòmhnaich', 'Diluain', 'Dimàirt', 'Diciadain', 'Diardaoin', 'Dihaoine', 'Disathairne']; + + var weekdaysShort = ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis']; + + var weekdaysMin = ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa']; + + var gd = moment.defineLocale('gd', { + months : months, + monthsShort : monthsShort, + monthsParseExact : true, + weekdays : weekdays, + weekdaysShort : weekdaysShort, + weekdaysMin : weekdaysMin, + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd, D MMMM YYYY HH:mm' + }, + calendar : { + sameDay : '[An-diugh aig] LT', + nextDay : '[A-màireach aig] LT', + nextWeek : 'dddd [aig] LT', + lastDay : '[An-dè aig] LT', + lastWeek : 'dddd [seo chaidh] [aig] LT', + sameElse : 'L' + }, + relativeTime : { + future : 'ann an %s', + past : 'bho chionn %s', + s : 'beagan diogan', + m : 'mionaid', + mm : '%d mionaidean', + h : 'uair', + hh : '%d uairean', + d : 'latha', + dd : '%d latha', + M : 'mìos', + MM : '%d mìosan', + y : 'bliadhna', + yy : '%d bliadhna' + }, + ordinalParse : /\d{1,2}(d|na|mh)/, + ordinal : function (number) { + var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh'; + return number + output; + }, + week : { + dow : 1, // Monday is the first day of the week. + doy : 4 // The week that contains Jan 4th is the first week of the year. + } + }); + + return gd; + +})); \ No newline at end of file diff --git a/bower_components/moment/locale/gl.js b/bower_components/moment/locale/gl.js index 91b35a2..ef8e704 100644 --- a/bower_components/moment/locale/gl.js +++ b/bower_components/moment/locale/gl.js @@ -2,8 +2,9 @@ //! locale : galician (gl) //! author : Juan G. Hurtado : https://github.com/juanghurtado -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/he.js b/bower_components/moment/locale/he.js index 35c3b46..6a259be 100644 --- a/bower_components/moment/locale/he.js +++ b/bower_components/moment/locale/he.js @@ -4,8 +4,9 @@ //! author : Moshe Simantov : https://github.com/DevelopmentIL //! author : Tal Ater : https://github.com/TalAter -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/hi.js b/bower_components/moment/locale/hi.js index f450c51..0542ef7 100644 --- a/bower_components/moment/locale/hi.js +++ b/bower_components/moment/locale/hi.js @@ -2,8 +2,9 @@ //! locale : hindi (hi) //! author : Mayank Singhal : https://github.com/mayanksinghal -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/hr.js b/bower_components/moment/locale/hr.js index 7b5b4d3..2692383 100644 --- a/bower_components/moment/locale/hr.js +++ b/bower_components/moment/locale/hr.js @@ -2,8 +2,9 @@ //! locale : hrvatski (hr) //! author : Bojan Marković : https://github.com/bmarkovic -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -63,7 +64,10 @@ } var hr = moment.defineLocale('hr', { - months : 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_'), + months : { + format: 'siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca'.split('_'), + standalone: 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_') + }, monthsShort : 'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split('_'), weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'), weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'), diff --git a/bower_components/moment/locale/hu.js b/bower_components/moment/locale/hu.js index 5fc432d..2708672 100644 --- a/bower_components/moment/locale/hu.js +++ b/bower_components/moment/locale/hu.js @@ -2,8 +2,9 @@ //! locale : hungarian (hu) //! author : Adam Brunner : https://github.com/adambrunner -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/hy-am.js b/bower_components/moment/locale/hy-am.js index a14737a..7350bfb 100644 --- a/bower_components/moment/locale/hy-am.js +++ b/bower_components/moment/locale/hy-am.js @@ -2,36 +2,21 @@ //! locale : Armenian (hy-am) //! author : Armendarabyan : https://github.com/armendarabyan -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; - function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_'), - 'accusative': 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_') - }, - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return months[nounCase][m.month()]; - } - function monthsShortCaseReplace(m, format) { - var monthsShort = 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'); - return monthsShort[m.month()]; - } - function weekdaysCaseReplace(m, format) { - var weekdays = 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_'); - return weekdays[m.day()]; - } - var hy_am = moment.defineLocale('hy-am', { - months : monthsCaseReplace, - monthsShort : monthsShortCaseReplace, - weekdays : weekdaysCaseReplace, + months : { + format: 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_'), + standalone: 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_') + }, + monthsShort : 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'), + weekdays : 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_'), weekdaysShort : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'), weekdaysMin : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'), longDateFormat : { diff --git a/bower_components/moment/locale/id.js b/bower_components/moment/locale/id.js index 2e7783b..09461a5 100644 --- a/bower_components/moment/locale/id.js +++ b/bower_components/moment/locale/id.js @@ -3,8 +3,9 @@ //! author : Mohammad Satrio Utomo : https://github.com/tyok //! reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/is.js b/bower_components/moment/locale/is.js index 98afb05..f1ed257 100644 --- a/bower_components/moment/locale/is.js +++ b/bower_components/moment/locale/is.js @@ -2,8 +2,9 @@ //! locale : icelandic (is) //! author : Hinrik Örn Sigurðsson : https://github.com/hinrik -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/it.js b/bower_components/moment/locale/it.js index ea277e0..e8b2c95 100644 --- a/bower_components/moment/locale/it.js +++ b/bower_components/moment/locale/it.js @@ -3,8 +3,9 @@ //! author : Lorenzo : https://github.com/aliem //! author: Mattia Larentis: https://github.com/nostalgiaz -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -15,7 +16,7 @@ monthsShort : 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'), weekdays : 'Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato'.split('_'), weekdaysShort : 'Dom_Lun_Mar_Mer_Gio_Ven_Sab'.split('_'), - weekdaysMin : 'D_L_Ma_Me_G_V_S'.split('_'), + weekdaysMin : 'Do_Lu_Ma_Me_Gi_Ve_Sa'.split('_'), longDateFormat : { LT : 'HH:mm', LTS : 'HH:mm:ss', diff --git a/bower_components/moment/locale/ja.js b/bower_components/moment/locale/ja.js index a2ec885..6c6e859 100644 --- a/bower_components/moment/locale/ja.js +++ b/bower_components/moment/locale/ja.js @@ -2,8 +2,9 @@ //! locale : japanese (ja) //! author : LI Long : https://github.com/baryon -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/jv.js b/bower_components/moment/locale/jv.js index e980ed4..d3b85a4 100644 --- a/bower_components/moment/locale/jv.js +++ b/bower_components/moment/locale/jv.js @@ -3,8 +3,9 @@ //! author : Rony Lantip : https://github.com/lantip //! reference: http://jv.wikipedia.org/wiki/Basa_Jawa -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/ka.js b/bower_components/moment/locale/ka.js index 4a28ae3..f052c3a 100644 --- a/bower_components/moment/locale/ka.js +++ b/bower_components/moment/locale/ka.js @@ -2,38 +2,25 @@ //! locale : Georgian (ka) //! author : Irakli Janiashvili : https://github.com/irakli-janiashvili -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; - function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'), - 'accusative': 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_') - }, - nounCase = (/D[oD] *MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return months[nounCase][m.month()]; - } - function weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'), - 'accusative': 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_') - }, - nounCase = (/(წინა|შემდეგ)/).test(format) ? - 'accusative' : - 'nominative'; - return weekdays[nounCase][m.day()]; - } - var ka = moment.defineLocale('ka', { - months : monthsCaseReplace, + months : { + standalone: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'), + format: 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_') + }, monthsShort : 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'), - weekdays : weekdaysCaseReplace, + weekdays : { + standalone: 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'), + format: 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_'), + isFormat: /(წინა|შემდეგ)/ + }, weekdaysShort : 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'), weekdaysMin : 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'), longDateFormat : { diff --git a/bower_components/moment/locale/kk.js b/bower_components/moment/locale/kk.js new file mode 100644 index 0000000..81acd0b --- /dev/null +++ b/bower_components/moment/locale/kk.js @@ -0,0 +1,87 @@ +//! moment.js locale configuration +//! locale : kazakh (kk) +//! authors : Nurlan Rakhimzhanov : https://github.com/nurlan + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var suffixes = { + 0: '-ші', + 1: '-ші', + 2: '-ші', + 3: '-ші', + 4: '-ші', + 5: '-ші', + 6: '-шы', + 7: '-ші', + 8: '-ші', + 9: '-шы', + 10: '-шы', + 20: '-шы', + 30: '-шы', + 40: '-шы', + 50: '-ші', + 60: '-шы', + 70: '-ші', + 80: '-ші', + 90: '-шы', + 100: '-ші' + }; + + var kk = moment.defineLocale('kk', { + months : 'Қаңтар_Ақпан_Наурыз_Сәуір_Мамыр_Маусым_Шілде_Тамыз_Қыркүйек_Қазан_Қараша_Желтоқсан'.split('_'), + monthsShort : 'Қаң_Ақп_Нау_Сәу_Мам_Мау_Шіл_Там_Қыр_Қаз_Қар_Жел'.split('_'), + weekdays : 'Жексенбі_Дүйсенбі_Сейсенбі_Сәрсенбі_Бейсенбі_Жұма_Сенбі'.split('_'), + weekdaysShort : 'Жек_Дүй_Сей_Сәр_Бей_Жұм_Сен'.split('_'), + weekdaysMin : 'Жк_Дй_Сй_Ср_Бй_Жм_Сн'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd, D MMMM YYYY HH:mm' + }, + calendar : { + sameDay : '[Бүгін сағат] LT', + nextDay : '[Ертең сағат] LT', + nextWeek : 'dddd [сағат] LT', + lastDay : '[Кеше сағат] LT', + lastWeek : '[Өткен аптаның] dddd [сағат] LT', + sameElse : 'L' + }, + relativeTime : { + future : '%s ішінде', + past : '%s бұрын', + s : 'бірнеше секунд', + m : 'бір минут', + mm : '%d минут', + h : 'бір сағат', + hh : '%d сағат', + d : 'бір күн', + dd : '%d күн', + M : 'бір ай', + MM : '%d ай', + y : 'бір жыл', + yy : '%d жыл' + }, + ordinalParse: /\d{1,2}-(ші|шы)/, + ordinal : function (number) { + var a = number % 10, + b = number >= 100 ? 100 : null; + return number + (suffixes[number] || suffixes[a] || suffixes[b]); + }, + week : { + dow : 1, // Monday is the first day of the week. + doy : 7 // The week that contains Jan 1st is the first week of the year. + } + }); + + return kk; + +})); \ No newline at end of file diff --git a/bower_components/moment/locale/km.js b/bower_components/moment/locale/km.js index ec92f25..56466c9 100644 --- a/bower_components/moment/locale/km.js +++ b/bower_components/moment/locale/km.js @@ -2,8 +2,9 @@ //! locale : khmer (km) //! author : Kruy Vanna : https://github.com/kruyvanna -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -24,7 +25,7 @@ LLLL: 'dddd, D MMMM YYYY HH:mm' }, calendar: { - sameDay: '[ថ្ងៃនៈ ម៉ោង] LT', + sameDay: '[ថ្ងៃនេះ ម៉ោង] LT', nextDay: '[ស្អែក ម៉ោង] LT', nextWeek: 'dddd [ម៉ោង] LT', lastDay: '[ម្សិលមិញ ម៉ោង] LT', diff --git a/bower_components/moment/locale/ko.js b/bower_components/moment/locale/ko.js index 11badbb..151554a 100644 --- a/bower_components/moment/locale/ko.js +++ b/bower_components/moment/locale/ko.js @@ -6,8 +6,9 @@ //! - Kyungwook, Park : https://github.com/kyungw00k //! - Jeeeyul Lee -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/lb.js b/bower_components/moment/locale/lb.js index fefe83f..6713c08 100644 --- a/bower_components/moment/locale/lb.js +++ b/bower_components/moment/locale/lb.js @@ -2,8 +2,9 @@ //! locale : Luxembourgish (lb) //! author : mweimerskirch : https://github.com/mweimerskirch, David Raison : https://github.com/kwisatz -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/lo.js b/bower_components/moment/locale/lo.js new file mode 100644 index 0000000..7475f27 --- /dev/null +++ b/bower_components/moment/locale/lo.js @@ -0,0 +1,69 @@ +//! moment.js locale configuration +//! locale : lao (lo) +//! author : Ryan Hart : https://github.com/ryanhart2 + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var lo = moment.defineLocale('lo', { + months : 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'), + monthsShort : 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'), + weekdays : 'ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'), + weekdaysShort : 'ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'), + weekdaysMin : 'ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'ວັນdddd D MMMM YYYY HH:mm' + }, + meridiemParse: /ຕອນເຊົ້າ|ຕອນແລງ/, + isPM: function (input) { + return input === 'ຕອນແລງ'; + }, + meridiem : function (hour, minute, isLower) { + if (hour < 12) { + return 'ຕອນເຊົ້າ'; + } else { + return 'ຕອນແລງ'; + } + }, + calendar : { + sameDay : '[ມື້ນີ້ເວລາ] LT', + nextDay : '[ມື້ອື່ນເວລາ] LT', + nextWeek : '[ວັນ]dddd[ໜ້າເວລາ] LT', + lastDay : '[ມື້ວານນີ້ເວລາ] LT', + lastWeek : '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT', + sameElse : 'L' + }, + relativeTime : { + future : 'ອີກ %s', + past : '%sຜ່ານມາ', + s : 'ບໍ່ເທົ່າໃດວິນາທີ', + m : '1 ນາທີ', + mm : '%d ນາທີ', + h : '1 ຊົ່ວໂມງ', + hh : '%d ຊົ່ວໂມງ', + d : '1 ມື້', + dd : '%d ມື້', + M : '1 ເດືອນ', + MM : '%d ເດືອນ', + y : '1 ປີ', + yy : '%d ປີ' + }, + ordinalParse: /(ທີ່)\d{1,2}/, + ordinal : function (number) { + return 'ທີ່' + number; + } + }); + + return lo; + +})); \ No newline at end of file diff --git a/bower_components/moment/locale/lt.js b/bower_components/moment/locale/lt.js index 303b850..72566bf 100644 --- a/bower_components/moment/locale/lt.js +++ b/bower_components/moment/locale/lt.js @@ -2,8 +2,9 @@ //! locale : Lithuanian (lt) //! author : Mindaugas Mozūras : https://github.com/mmozuras -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -20,8 +21,7 @@ 'MM': 'mėnesiai_mėnesių_mėnesius', 'y' : 'metai_metų_metus', 'yy': 'metai_metų_metus' - }, - weekDays = 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_'); + }; function translateSeconds(number, withoutSuffix, key, isFuture) { if (withoutSuffix) { return 'kelios sekundės'; @@ -29,16 +29,6 @@ return isFuture ? 'kelių sekundžių' : 'kelias sekundes'; } } - function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split('_'), - 'accusative': 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_') - }, - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return months[nounCase][m.month()]; - } function translateSingular(number, withoutSuffix, key, isFuture) { return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]); } @@ -62,16 +52,17 @@ } } } - function relativeWeekDay(moment, format) { - var nominative = format.indexOf('dddd HH:mm') === -1, - weekDay = weekDays[moment.day()]; - return nominative ? weekDay : weekDay.substring(0, weekDay.length - 2) + 'į'; - } - var lt = moment.defineLocale('lt', { - months : monthsCaseReplace, + months : { + format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_'), + standalone: 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split('_') + }, monthsShort : 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'), - weekdays : relativeWeekDay, + weekdays : { + format: 'sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį'.split('_'), + standalone: 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_'), + isFormat: /dddd HH:mm/ + }, weekdaysShort : 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'), weekdaysMin : 'S_P_A_T_K_Pn_Š'.split('_'), longDateFormat : { diff --git a/bower_components/moment/locale/lv.js b/bower_components/moment/locale/lv.js index 62f8091..d1864a1 100644 --- a/bower_components/moment/locale/lv.js +++ b/bower_components/moment/locale/lv.js @@ -3,8 +3,9 @@ //! author : Kristaps Karlsons : https://github.com/skakri //! author : Jānis Elmeris : https://github.com/JanisE -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/me.js b/bower_components/moment/locale/me.js index ea7ec91..e2c1f75 100644 --- a/bower_components/moment/locale/me.js +++ b/bower_components/moment/locale/me.js @@ -2,8 +2,9 @@ //! locale : Montenegrin (me) //! author : Miodrag Nikač : https://github.com/miodragnikac -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/mk.js b/bower_components/moment/locale/mk.js index b1f1e10..89b5414 100644 --- a/bower_components/moment/locale/mk.js +++ b/bower_components/moment/locale/mk.js @@ -2,8 +2,9 @@ //! locale : macedonian (mk) //! author : Borislav Mickov : https://github.com/B0k0 -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -26,19 +27,19 @@ calendar : { sameDay : '[Денес во] LT', nextDay : '[Утре во] LT', - nextWeek : 'dddd [во] LT', + nextWeek : '[Во] dddd [во] LT', lastDay : '[Вчера во] LT', lastWeek : function () { switch (this.day()) { case 0: case 3: case 6: - return '[Во изминатата] dddd [во] LT'; + return '[Изминатата] dddd [во] LT'; case 1: case 2: case 4: case 5: - return '[Во изминатиот] dddd [во] LT'; + return '[Изминатиот] dddd [во] LT'; } }, sameElse : 'L' diff --git a/bower_components/moment/locale/ml.js b/bower_components/moment/locale/ml.js index c7c93ca..9e241f2 100644 --- a/bower_components/moment/locale/ml.js +++ b/bower_components/moment/locale/ml.js @@ -2,8 +2,9 @@ //! locale : malayalam (ml) //! author : Floyd Pink : https://github.com/floydpink -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/mr.js b/bower_components/moment/locale/mr.js index 960d2f5..77a3fa2 100644 --- a/bower_components/moment/locale/mr.js +++ b/bower_components/moment/locale/mr.js @@ -1,9 +1,11 @@ //! moment.js locale configuration //! locale : Marathi (mr) //! author : Harshad Kale : https://github.com/kalehv +//! author : Vivek Athalye : https://github.com/vnathalye -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -34,6 +36,42 @@ '०': '0' }; + function relativeTimeMr(number, withoutSuffix, string, isFuture) + { + var output = ''; + if (withoutSuffix) { + switch (string) { + case 's': output = 'काही सेकंद'; break; + case 'm': output = 'एक मिनिट'; break; + case 'mm': output = '%d मिनिटे'; break; + case 'h': output = 'एक तास'; break; + case 'hh': output = '%d तास'; break; + case 'd': output = 'एक दिवस'; break; + case 'dd': output = '%d दिवस'; break; + case 'M': output = 'एक महिना'; break; + case 'MM': output = '%d महिने'; break; + case 'y': output = 'एक वर्ष'; break; + case 'yy': output = '%d वर्षे'; break; + } + } + else { + switch (string) { + case 's': output = 'काही सेकंदां'; break; + case 'm': output = 'एका मिनिटा'; break; + case 'mm': output = '%d मिनिटां'; break; + case 'h': output = 'एका तासा'; break; + case 'hh': output = '%d तासां'; break; + case 'd': output = 'एका दिवसा'; break; + case 'dd': output = '%d दिवसां'; break; + case 'M': output = 'एका महिन्या'; break; + case 'MM': output = '%d महिन्यां'; break; + case 'y': output = 'एका वर्षा'; break; + case 'yy': output = '%d वर्षां'; break; + } + } + return output.replace(/%d/i, number); + } + var mr = moment.defineLocale('mr', { months : 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split('_'), monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split('_'), @@ -57,19 +95,19 @@ sameElse : 'L' }, relativeTime : { - future : '%s नंतर', - past : '%s पूर्वी', - s : 'सेकंद', - m: 'एक मिनिट', - mm: '%d मिनिटे', - h : 'एक तास', - hh : '%d तास', - d : 'एक दिवस', - dd : '%d दिवस', - M : 'एक महिना', - MM : '%d महिने', - y : 'एक वर्ष', - yy : '%d वर्षे' + future: '%sमध्ये', + past: '%sपूर्वी', + s: relativeTimeMr, + m: relativeTimeMr, + mm: relativeTimeMr, + h: relativeTimeMr, + hh: relativeTimeMr, + d: relativeTimeMr, + dd: relativeTimeMr, + M: relativeTimeMr, + MM: relativeTimeMr, + y: relativeTimeMr, + yy: relativeTimeMr }, preparse: function (string) { return string.replace(/[१२३४५६७८९०]/g, function (match) { diff --git a/bower_components/moment/locale/ms-my.js b/bower_components/moment/locale/ms-my.js index 9c6fb56..38c3138 100644 --- a/bower_components/moment/locale/ms-my.js +++ b/bower_components/moment/locale/ms-my.js @@ -2,8 +2,9 @@ //! locale : Bahasa Malaysia (ms-MY) //! author : Weldan Jamili : https://github.com/weldan -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/ms.js b/bower_components/moment/locale/ms.js index cd710dc..fbbb734 100644 --- a/bower_components/moment/locale/ms.js +++ b/bower_components/moment/locale/ms.js @@ -2,8 +2,9 @@ //! locale : Bahasa Malaysia (ms-MY) //! author : Weldan Jamili : https://github.com/weldan -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/my.js b/bower_components/moment/locale/my.js index 72f65b5..71e99f0 100644 --- a/bower_components/moment/locale/my.js +++ b/bower_components/moment/locale/my.js @@ -2,8 +2,9 @@ //! locale : Burmese (my) //! author : Squar team, mysquar.com -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/nb.js b/bower_components/moment/locale/nb.js index 966619c..b8d76c6 100644 --- a/bower_components/moment/locale/nb.js +++ b/bower_components/moment/locale/nb.js @@ -3,8 +3,9 @@ //! authors : Espen Hovlandsdal : https://github.com/rexxars //! Sigurd Gartmann : https://github.com/sigurdga -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -12,17 +13,17 @@ var nb = moment.defineLocale('nb', { months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'), - monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'), + monthsShort : 'jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.'.split('_'), weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'), - weekdaysShort : 'søn_man_tirs_ons_tors_fre_lør'.split('_'), + weekdaysShort : 'sø._ma._ti._on._to._fr._lø.'.split('_'), weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'), longDateFormat : { - LT : 'H.mm', - LTS : 'H.mm.ss', + LT : 'HH:mm', + LTS : 'HH:mm:ss', L : 'DD.MM.YYYY', LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY [kl.] H.mm', - LLLL : 'dddd D. MMMM YYYY [kl.] H.mm' + LLL : 'D. MMMM YYYY [kl.] HH:mm', + LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm' }, calendar : { sameDay: '[i dag kl.] LT', diff --git a/bower_components/moment/locale/ne.js b/bower_components/moment/locale/ne.js index 257acf9..3476401 100644 --- a/bower_components/moment/locale/ne.js +++ b/bower_components/moment/locale/ne.js @@ -2,8 +2,9 @@ //! locale : nepali/nepalese //! author : suvash : https://github.com/suvash -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -39,7 +40,7 @@ monthsShort : 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split('_'), weekdays : 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split('_'), weekdaysShort : 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'), - weekdaysMin : 'आइ._सो._मङ्_बु._बि._शु._श.'.split('_'), + weekdaysMin : 'आ._सो._मं._बु._बि._शु._श.'.split('_'), longDateFormat : { LT : 'Aको h:mm बजे', LTS : 'Aको h:mm:ss बजे', @@ -58,39 +59,37 @@ return symbolMap[match]; }); }, - meridiemParse: /राती|बिहान|दिउँसो|बेलुका|साँझ|राती/, + meridiemParse: /राति|बिहान|दिउँसो|साँझ/, meridiemHour : function (hour, meridiem) { if (hour === 12) { hour = 0; } - if (meridiem === 'राती') { - return hour < 3 ? hour : hour + 12; + if (meridiem === 'राति') { + return hour < 4 ? hour : hour + 12; } else if (meridiem === 'बिहान') { return hour; } else if (meridiem === 'दिउँसो') { return hour >= 10 ? hour : hour + 12; - } else if (meridiem === 'बेलुका' || meridiem === 'साँझ') { + } else if (meridiem === 'साँझ') { return hour + 12; } }, meridiem : function (hour, minute, isLower) { if (hour < 3) { - return 'राती'; - } else if (hour < 10) { + return 'राति'; + } else if (hour < 12) { return 'बिहान'; - } else if (hour < 15) { + } else if (hour < 16) { return 'दिउँसो'; - } else if (hour < 18) { - return 'बेलुका'; } else if (hour < 20) { return 'साँझ'; } else { - return 'राती'; + return 'राति'; } }, calendar : { sameDay : '[आज] LT', - nextDay : '[भोली] LT', + nextDay : '[भोलि] LT', nextWeek : '[आउँदो] dddd[,] LT', lastDay : '[हिजो] LT', lastWeek : '[गएको] dddd[,] LT', @@ -98,8 +97,8 @@ }, relativeTime : { future : '%sमा', - past : '%s अगाडी', - s : 'केही समय', + past : '%s अगाडि', + s : 'केही क्षण', m : 'एक मिनेट', mm : '%d मिनेट', h : 'एक घण्टा', @@ -112,8 +111,8 @@ yy : '%d बर्ष' }, week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. + dow : 0, // Sunday is the first day of the week. + doy : 6 // The week that contains Jan 1st is the first week of the year. } }); diff --git a/bower_components/moment/locale/nl.js b/bower_components/moment/locale/nl.js index 60a3c43..1ae4700 100644 --- a/bower_components/moment/locale/nl.js +++ b/bower_components/moment/locale/nl.js @@ -2,8 +2,9 @@ //! locale : dutch (nl) //! author : Joris Röling : https://github.com/jjupiter -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/nn.js b/bower_components/moment/locale/nn.js index 83d301a..3910bb9 100644 --- a/bower_components/moment/locale/nn.js +++ b/bower_components/moment/locale/nn.js @@ -2,8 +2,9 @@ //! locale : norwegian nynorsk (nn) //! author : https://github.com/mechuwind -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -19,9 +20,9 @@ LT : 'HH:mm', LTS : 'HH:mm:ss', L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' + LL : 'D. MMMM YYYY', + LLL : 'D. MMMM YYYY [kl.] H:mm', + LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm' }, calendar : { sameDay: '[I dag klokka] LT', diff --git a/bower_components/moment/locale/pl.js b/bower_components/moment/locale/pl.js index 9c65c1f..fa81579 100644 --- a/bower_components/moment/locale/pl.js +++ b/bower_components/moment/locale/pl.js @@ -2,8 +2,9 @@ //! locale : polish (pl) //! author : Rafal Hirsz : https://github.com/evoL -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -48,7 +49,7 @@ monthsShort : 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'), weekdays : 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'), weekdaysShort : 'nie_pon_wt_śr_czw_pt_sb'.split('_'), - weekdaysMin : 'N_Pn_Wt_Śr_Cz_Pt_So'.split('_'), + weekdaysMin : 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'), longDateFormat : { LT : 'HH:mm', LTS : 'HH:mm:ss', diff --git a/bower_components/moment/locale/pt-br.js b/bower_components/moment/locale/pt-br.js index d2c9351..06747f6 100644 --- a/bower_components/moment/locale/pt-br.js +++ b/bower_components/moment/locale/pt-br.js @@ -2,8 +2,9 @@ //! locale : brazilian portuguese (pt-br) //! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/pt.js b/bower_components/moment/locale/pt.js index 6487bc9..bdb913f 100644 --- a/bower_components/moment/locale/pt.js +++ b/bower_components/moment/locale/pt.js @@ -2,8 +2,9 @@ //! locale : portuguese (pt) //! author : Jefferson : https://github.com/jalex79 -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/ro.js b/bower_components/moment/locale/ro.js index 92a89d1..fb92267 100644 --- a/bower_components/moment/locale/ro.js +++ b/bower_components/moment/locale/ro.js @@ -3,8 +3,9 @@ //! author : Vlad Gurdiga : https://github.com/gurdiga //! author : Valentin Agachi : https://github.com/avaly -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/ru.js b/bower_components/moment/locale/ru.js index 14e67c6..442ddf8 100644 --- a/bower_components/moment/locale/ru.js +++ b/bower_components/moment/locale/ru.js @@ -3,8 +3,9 @@ //! author : Viktorminator : https://github.com/Viktorminator //! Author : Menelion Elensúle : https://github.com/Oire -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -29,44 +30,27 @@ return number + ' ' + plural(format[key], +number); } } - function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'), - 'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_') + var monthsParse = [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[й|я]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i]; + + var ru = moment.defineLocale('ru', { + months : { + format: 'Января_Февраля_Марта_Апреля_Мая_Июня_Июля_Августа_Сентября_Октября_Ноября_Декабря'.split('_'), + standalone: 'Январь_Февраль_Март_Апрель_Май_Июнь_Июль_Август_Сентябрь_Октябрь_Ноябрь_Декабрь'.split('_') }, - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return months[nounCase][m.month()]; - } - function monthsShortCaseReplace(m, format) { - var monthsShort = { - 'nominative': 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'), - 'accusative': 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_') + monthsShort : { + format: 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_'), + standalone: 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_') }, - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return monthsShort[nounCase][m.month()]; - } - function weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'), - 'accusative': 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_') + weekdays : { + standalone: 'Воскресенье_Понедельник_Вторник_Среда_Четверг_Пятница_Суббота'.split('_'), + format: 'Воскресенье_Понедельник_Вторник_Среду_Четверг_Пятницу_Субботу'.split('_'), + isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/ }, - nounCase = (/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/).test(format) ? - 'accusative' : - 'nominative'; - return weekdays[nounCase][m.day()]; - } - - var ru = moment.defineLocale('ru', { - months : monthsCaseReplace, - monthsShort : monthsShortCaseReplace, - weekdays : weekdaysCaseReplace, - weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'), - weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'), - monthsParse : [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[й|я]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i], + weekdaysShort : 'Вс_Пн_Вт_Ср_Чт_Пт_Сб'.split('_'), + weekdaysMin : 'Вс_Пн_Вт_Ср_Чт_Пт_Сб'.split('_'), + monthsParse : monthsParse, + longMonthsParse : monthsParse, + shortMonthsParse : monthsParse, longDateFormat : { LT : 'HH:mm', LTS : 'HH:mm:ss', @@ -79,8 +63,27 @@ sameDay: '[Сегодня в] LT', nextDay: '[Завтра в] LT', lastDay: '[Вчера в] LT', - nextWeek: function () { - return this.day() === 2 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT'; + nextWeek: function (now) { + if (now.week() !== this.week()) { + switch (this.day()) { + case 0: + return '[В следующее] dddd [в] LT'; + case 1: + case 2: + case 4: + return '[В следующий] dddd [в] LT'; + case 3: + case 5: + case 6: + return '[В следующую] dddd [в] LT'; + } + } else { + if (this.day() === 2) { + return '[Во] dddd [в] LT'; + } else { + return '[В] dddd [в] LT'; + } + } }, lastWeek: function (now) { if (now.week() !== this.week()) { diff --git a/bower_components/moment/locale/se.js b/bower_components/moment/locale/se.js new file mode 100644 index 0000000..06be0d6 --- /dev/null +++ b/bower_components/moment/locale/se.js @@ -0,0 +1,61 @@ +//! moment.js locale configuration +//! locale : Northern Sami (se) +//! authors : Bård Rolstad Henriksen : https://github.com/karamell + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + + var se = moment.defineLocale('se', { + months : 'ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu'.split('_'), + monthsShort : 'ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov'.split('_'), + weekdays : 'sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat'.split('_'), + weekdaysShort : 'sotn_vuos_maŋ_gask_duor_bear_láv'.split('_'), + weekdaysMin : 's_v_m_g_d_b_L'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'MMMM D. [b.] YYYY', + LLL : 'MMMM D. [b.] YYYY [ti.] HH:mm', + LLLL : 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm' + }, + calendar : { + sameDay: '[otne ti] LT', + nextDay: '[ihttin ti] LT', + nextWeek: 'dddd [ti] LT', + lastDay: '[ikte ti] LT', + lastWeek: '[ovddit] dddd [ti] LT', + sameElse: 'L' + }, + relativeTime : { + future : '%s geažes', + past : 'maŋit %s', + s : 'moadde sekunddat', + m : 'okta minuhta', + mm : '%d minuhtat', + h : 'okta diimmu', + hh : '%d diimmut', + d : 'okta beaivi', + dd : '%d beaivvit', + M : 'okta mánnu', + MM : '%d mánut', + y : 'okta jahki', + yy : '%d jagit' + }, + ordinalParse: /\d{1,2}\./, + ordinal : '%d.', + week : { + dow : 1, // Monday is the first day of the week. + doy : 4 // The week that contains Jan 4th is the first week of the year. + } + }); + + return se; + +})); \ No newline at end of file diff --git a/bower_components/moment/locale/si.js b/bower_components/moment/locale/si.js index 40e4591..d86c9e3 100644 --- a/bower_components/moment/locale/si.js +++ b/bower_components/moment/locale/si.js @@ -2,13 +2,15 @@ //! locale : Sinhalese (si) //! author : Sampath Sitinamaluwa : https://github.com/sampathsris -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; + /*jshint -W100*/ var si = moment.defineLocale('si', { months : 'ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්'.split('_'), monthsShort : 'ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ'.split('_'), diff --git a/bower_components/moment/locale/sk.js b/bower_components/moment/locale/sk.js index d3084af..52838a3 100644 --- a/bower_components/moment/locale/sk.js +++ b/bower_components/moment/locale/sk.js @@ -3,8 +3,9 @@ //! author : Martin Minka : https://github.com/k2s //! based on work of petrbela : https://github.com/petrbela -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -71,14 +72,6 @@ var sk = moment.defineLocale('sk', { months : months, monthsShort : monthsShort, - monthsParse : (function (months, monthsShort) { - var i, _monthsParse = []; - for (i = 0; i < 12; i++) { - // use custom parser to solve problem with July (červenec) - _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i'); - } - return _monthsParse; - }(months, monthsShort)), weekdays : 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'), weekdaysShort : 'ne_po_ut_st_št_pi_so'.split('_'), weekdaysMin : 'ne_po_ut_st_št_pi_so'.split('_'), diff --git a/bower_components/moment/locale/sl.js b/bower_components/moment/locale/sl.js index a55062f..68d261e 100644 --- a/bower_components/moment/locale/sl.js +++ b/bower_components/moment/locale/sl.js @@ -2,8 +2,9 @@ //! locale : slovenian (sl) //! author : Robert Sedovšek : https://github.com/sedovsek -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/sq.js b/bower_components/moment/locale/sq.js index d5fcdb5..69dca20 100644 --- a/bower_components/moment/locale/sq.js +++ b/bower_components/moment/locale/sq.js @@ -4,8 +4,9 @@ //! author: Menelion Elensúle: https://github.com/Oire (tests) //! author : Oerd Cukalla : https://github.com/oerd (fixes) -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/sr-cyrl.js b/bower_components/moment/locale/sr-cyrl.js index a9c5c30..c72cca7 100644 --- a/bower_components/moment/locale/sr-cyrl.js +++ b/bower_components/moment/locale/sr-cyrl.js @@ -2,8 +2,9 @@ //! locale : Serbian-cyrillic (sr-cyrl) //! author : Milan Janačković : https://github.com/milan-j -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/sr.js b/bower_components/moment/locale/sr.js index 2d0125a..4dab6f4 100644 --- a/bower_components/moment/locale/sr.js +++ b/bower_components/moment/locale/sr.js @@ -2,8 +2,9 @@ //! locale : Serbian-latin (sr) //! author : Milan Janačković : https://github.com/milan-j -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/sv.js b/bower_components/moment/locale/sv.js index 3f6238e..5af3bb7 100644 --- a/bower_components/moment/locale/sv.js +++ b/bower_components/moment/locale/sv.js @@ -2,8 +2,9 @@ //! locale : swedish (sv) //! author : Jens Alm : https://github.com/ulmus -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/sw.js b/bower_components/moment/locale/sw.js new file mode 100644 index 0000000..8017f7d --- /dev/null +++ b/bower_components/moment/locale/sw.js @@ -0,0 +1,58 @@ +//! moment.js locale configuration +//! locale : swahili (sw) +//! author : Fahad Kassim : https://github.com/fadsel + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var sw = moment.defineLocale('sw', { + months : 'Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba'.split('_'), + monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des'.split('_'), + weekdays : 'Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi'.split('_'), + weekdaysShort : 'Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos'.split('_'), + weekdaysMin : 'J2_J3_J4_J5_Al_Ij_J1'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd, D MMMM YYYY HH:mm' + }, + calendar : { + sameDay : '[leo saa] LT', + nextDay : '[kesho saa] LT', + nextWeek : '[wiki ijayo] dddd [saat] LT', + lastDay : '[jana] LT', + lastWeek : '[wiki iliyopita] dddd [saat] LT', + sameElse : 'L' + }, + relativeTime : { + future : '%s baadaye', + past : 'tokea %s', + s : 'hivi punde', + m : 'dakika moja', + mm : 'dakika %d', + h : 'saa limoja', + hh : 'masaa %d', + d : 'siku moja', + dd : 'masiku %d', + M : 'mwezi mmoja', + MM : 'miezi %d', + y : 'mwaka mmoja', + yy : 'miaka %d' + }, + week : { + dow : 1, // Monday is the first day of the week. + doy : 7 // The week that contains Jan 1st is the first week of the year. + } + }); + + return sw; + +})); \ No newline at end of file diff --git a/bower_components/moment/locale/ta.js b/bower_components/moment/locale/ta.js index 2c67c7d..2766509 100644 --- a/bower_components/moment/locale/ta.js +++ b/bower_components/moment/locale/ta.js @@ -2,13 +2,38 @@ //! locale : tamil (ta) //! author : Arjunkumar Krishnamoorthy : https://github.com/tk120404 -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; + var symbolMap = { + '1': '௧', + '2': '௨', + '3': '௩', + '4': '௪', + '5': '௫', + '6': '௬', + '7': '௭', + '8': '௮', + '9': '௯', + '0': '௦' + }, numberMap = { + '௧': '1', + '௨': '2', + '௩': '3', + '௪': '4', + '௫': '5', + '௬': '6', + '௭': '7', + '௮': '8', + '௯': '9', + '௦': '0' + }; + var ta = moment.defineLocale('ta', { months : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'), monthsShort : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'), @@ -50,6 +75,16 @@ ordinal : function (number) { return number + 'வது'; }, + preparse: function (string) { + return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) { + return numberMap[match]; + }); + }, + postformat: function (string) { + return string.replace(/\d/g, function (match) { + return symbolMap[match]; + }); + }, // refer http://ta.wikipedia.org/s/1er1 meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/, meridiem : function (hour, minute, isLower) { diff --git a/bower_components/moment/locale/te.js b/bower_components/moment/locale/te.js new file mode 100644 index 0000000..775651d --- /dev/null +++ b/bower_components/moment/locale/te.js @@ -0,0 +1,88 @@ +//! moment.js locale configuration +//! locale : telugu (te) +//! author : Krishna Chaitanya Thota : https://github.com/kcthota + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var te = moment.defineLocale('te', { + months : 'జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జూలై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్'.split('_'), + monthsShort : 'జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జూలై_ఆగ._సెప్._అక్టో._నవ._డిసె.'.split('_'), + weekdays : 'ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం'.split('_'), + weekdaysShort : 'ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని'.split('_'), + weekdaysMin : 'ఆ_సో_మం_బు_గు_శు_శ'.split('_'), + longDateFormat : { + LT : 'A h:mm', + LTS : 'A h:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY, A h:mm', + LLLL : 'dddd, D MMMM YYYY, A h:mm' + }, + calendar : { + sameDay : '[నేడు] LT', + nextDay : '[రేపు] LT', + nextWeek : 'dddd, LT', + lastDay : '[నిన్న] LT', + lastWeek : '[గత] dddd, LT', + sameElse : 'L' + }, + relativeTime : { + future : '%s లో', + past : '%s క్రితం', + s : 'కొన్ని క్షణాలు', + m : 'ఒక నిమిషం', + mm : '%d నిమిషాలు', + h : 'ఒక గంట', + hh : '%d గంటలు', + d : 'ఒక రోజు', + dd : '%d రోజులు', + M : 'ఒక నెల', + MM : '%d నెలలు', + y : 'ఒక సంవత్సరం', + yy : '%d సంవత్సరాలు' + }, + ordinalParse : /\d{1,2}వ/, + ordinal : '%dవ', + meridiemParse: /రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/, + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if (meridiem === 'రాత్రి') { + return hour < 4 ? hour : hour + 12; + } else if (meridiem === 'ఉదయం') { + return hour; + } else if (meridiem === 'మధ్యాహ్నం') { + return hour >= 10 ? hour : hour + 12; + } else if (meridiem === 'సాయంత్రం') { + return hour + 12; + } + }, + meridiem : function (hour, minute, isLower) { + if (hour < 4) { + return 'రాత్రి'; + } else if (hour < 10) { + return 'ఉదయం'; + } else if (hour < 17) { + return 'మధ్యాహ్నం'; + } else if (hour < 20) { + return 'సాయంత్రం'; + } else { + return 'రాత్రి'; + } + }, + week : { + dow : 0, // Sunday is the first day of the week. + doy : 6 // The week that contains Jan 1st is the first week of the year. + } + }); + + return te; + +})); \ No newline at end of file diff --git a/bower_components/moment/locale/th.js b/bower_components/moment/locale/th.js index 7805ebb..ac32542 100644 --- a/bower_components/moment/locale/th.js +++ b/bower_components/moment/locale/th.js @@ -2,8 +2,9 @@ //! locale : thai (th) //! author : Kridsada Thanabulpong : https://github.com/sirn -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/tl-ph.js b/bower_components/moment/locale/tl-ph.js index 06529ab..d101fd9 100644 --- a/bower_components/moment/locale/tl-ph.js +++ b/bower_components/moment/locale/tl-ph.js @@ -2,8 +2,9 @@ //! locale : Tagalog/Filipino (tl-ph) //! author : Dan Hagman -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/tlh.js b/bower_components/moment/locale/tlh.js new file mode 100644 index 0000000..4ae53ef --- /dev/null +++ b/bower_components/moment/locale/tlh.js @@ -0,0 +1,119 @@ +//! moment.js locale configuration +//! locale : Klingon (tlh) +//! author : Dominika Kruk : https://github.com/amaranthrose + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var numbersNouns = 'pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut'.split('_'); + + function translateFuture(output) { + var time = output; + time = (output.indexOf('jaj') !== -1) ? + time.slice(0, -3) + 'leS' : + (output.indexOf('jar') !== -1) ? + time.slice(0, -3) + 'waQ' : + (output.indexOf('DIS') !== -1) ? + time.slice(0, -3) + 'nem' : + time + ' pIq'; + return time; + } + + function translatePast(output) { + var time = output; + time = (output.indexOf('jaj') !== -1) ? + time.slice(0, -3) + 'Hu’' : + (output.indexOf('jar') !== -1) ? + time.slice(0, -3) + 'wen' : + (output.indexOf('DIS') !== -1) ? + time.slice(0, -3) + 'ben' : + time + ' ret'; + return time; + } + + function translate(number, withoutSuffix, string, isFuture) { + var numberNoun = numberAsNoun(number); + switch (string) { + case 'mm': + return numberNoun + ' tup'; + case 'hh': + return numberNoun + ' rep'; + case 'dd': + return numberNoun + ' jaj'; + case 'MM': + return numberNoun + ' jar'; + case 'yy': + return numberNoun + ' DIS'; + } + } + + function numberAsNoun(number) { + var hundred = Math.floor((number % 1000) / 100), + ten = Math.floor((number % 100) / 10), + one = number % 10, + word = ''; + if (hundred > 0) { + word += numbersNouns[hundred] + 'vatlh'; + } + if (ten > 0) { + word += ((word !== '') ? ' ' : '') + numbersNouns[ten] + 'maH'; + } + if (one > 0) { + word += ((word !== '') ? ' ' : '') + numbersNouns[one]; + } + return (word === '') ? 'pagh' : word; + } + + var tlh = moment.defineLocale('tlh', { + months : 'tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’'.split('_'), + monthsShort : 'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split('_'), + weekdays : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'), + weekdaysShort : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'), + weekdaysMin : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd, D MMMM YYYY HH:mm' + }, + calendar : { + sameDay: '[DaHjaj] LT', + nextDay: '[wa’leS] LT', + nextWeek: 'LLL', + lastDay: '[wa’Hu’] LT', + lastWeek: 'LLL', + sameElse: 'L' + }, + relativeTime : { + future : translateFuture, + past : translatePast, + s : 'puS lup', + m : 'wa’ tup', + mm : translate, + h : 'wa’ rep', + hh : translate, + d : 'wa’ jaj', + dd : translate, + M : 'wa’ jar', + MM : translate, + y : 'wa’ DIS', + yy : translate + }, + ordinalParse: /\d{1,2}\./, + ordinal : '%d.', + week : { + dow : 1, // Monday is the first day of the week. + doy : 4 // The week that contains Jan 4th is the first week of the year. + } + }); + + return tlh; + +})); \ No newline at end of file diff --git a/bower_components/moment/locale/tr.js b/bower_components/moment/locale/tr.js index 115905e..638edbb 100644 --- a/bower_components/moment/locale/tr.js +++ b/bower_components/moment/locale/tr.js @@ -3,8 +3,9 @@ //! authors : Erhan Gundogan : https://github.com/erhangundogan, //! Burak Yiğit Kaya: https://github.com/BYK -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/tzl.js b/bower_components/moment/locale/tzl.js index b932848..498f7c0 100644 --- a/bower_components/moment/locale/tzl.js +++ b/bower_components/moment/locale/tzl.js @@ -2,14 +2,17 @@ //! locale : talossan (tzl) //! author : Robin van der Vliet : https://github.com/robin0van0der0v with the help of Iustì Canun -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; + // After the year there should be a slash and the amount of years since December 26, 1979 in Roman numerals. + // This is currently too difficult (maybe even impossible) to add. var tzl = moment.defineLocale('tzl', { months : 'Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar'.split('_'), monthsShort : 'Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec'.split('_'), @@ -18,11 +21,11 @@ weekdaysMin : 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'), longDateFormat : { LT : 'HH.mm', - LTS : 'LT.ss', + LTS : 'HH.mm.ss', L : 'DD.MM.YYYY', LL : 'D. MMMM [dallas] YYYY', - LLL : 'D. MMMM [dallas] YYYY LT', - LLLL : 'dddd, [li] D. MMMM [dallas] YYYY LT' + LLL : 'D. MMMM [dallas] YYYY HH.mm', + LLLL : 'dddd, [li] D. MMMM [dallas] YYYY HH.mm' }, meridiem : function (hours, minutes, isLower) { if (hours > 11) { @@ -66,17 +69,17 @@ var format = { 's': ['viensas secunds', '\'iensas secunds'], 'm': ['\'n míut', '\'iens míut'], - 'mm': [number + ' míuts', ' ' + number + ' míuts'], + 'mm': [number + ' míuts', '' + number + ' míuts'], 'h': ['\'n þora', '\'iensa þora'], - 'hh': [number + ' þoras', ' ' + number + ' þoras'], + 'hh': [number + ' þoras', '' + number + ' þoras'], 'd': ['\'n ziua', '\'iensa ziua'], - 'dd': [number + ' ziuas', ' ' + number + ' ziuas'], + 'dd': [number + ' ziuas', '' + number + ' ziuas'], 'M': ['\'n mes', '\'iens mes'], - 'MM': [number + ' mesen', ' ' + number + ' mesen'], + 'MM': [number + ' mesen', '' + number + ' mesen'], 'y': ['\'n ar', '\'iens ar'], - 'yy': [number + ' ars', ' ' + number + ' ars'] + 'yy': [number + ' ars', '' + number + ' ars'] }; - return isFuture ? format[key][0] : (withoutSuffix ? format[key][0] : format[key][1].trim()); + return isFuture ? format[key][0] : (withoutSuffix ? format[key][0] : format[key][1]); } return tzl; diff --git a/bower_components/moment/locale/tzm-latn.js b/bower_components/moment/locale/tzm-latn.js index 7323f43..712f5f5 100644 --- a/bower_components/moment/locale/tzm-latn.js +++ b/bower_components/moment/locale/tzm-latn.js @@ -2,8 +2,9 @@ //! locale : Morocco Central Atlas Tamaziɣt in Latin (tzm-latn) //! author : Abdel Said : https://github.com/abdelsaid -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/tzm.js b/bower_components/moment/locale/tzm.js index 810d274..6b8acc0 100644 --- a/bower_components/moment/locale/tzm.js +++ b/bower_components/moment/locale/tzm.js @@ -2,8 +2,9 @@ //! locale : Morocco Central Atlas Tamaziɣt (tzm) //! author : Abdel Said : https://github.com/abdelsaid -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/uk.js b/bower_components/moment/locale/uk.js index 8c2edad..80c3497 100644 --- a/bower_components/moment/locale/uk.js +++ b/bower_components/moment/locale/uk.js @@ -3,8 +3,9 @@ //! author : zemlanin : https://github.com/zemlanin //! Author : Menelion Elensúle : https://github.com/Oire -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -16,8 +17,8 @@ } function relativeTimeWithPlural(number, withoutSuffix, key) { var format = { - 'mm': 'хвилина_хвилини_хвилин', - 'hh': 'година_години_годин', + 'mm': withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин', + 'hh': withoutSuffix ? 'година_години_годин' : 'годину_години_годин', 'dd': 'день_дні_днів', 'MM': 'місяць_місяці_місяців', 'yy': 'рік_роки_років' @@ -32,16 +33,6 @@ return number + ' ' + plural(format[key], +number); } } - function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_'), - 'accusative': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_') - }, - nounCase = (/D[oD]? *MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return months[nounCase][m.month()]; - } function weekdaysCaseReplace(m, format) { var weekdays = { 'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'), @@ -62,7 +53,10 @@ } var uk = moment.defineLocale('uk', { - months : monthsCaseReplace, + months : { + 'format': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_'), + 'standalone': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_') + }, monthsShort : 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'), weekdays : weekdaysCaseReplace, weekdaysShort : 'нд_пн_вт_ср_чт_пт_сб'.split('_'), diff --git a/bower_components/moment/locale/uz.js b/bower_components/moment/locale/uz.js index d75360c..fcf594e 100644 --- a/bower_components/moment/locale/uz.js +++ b/bower_components/moment/locale/uz.js @@ -2,15 +2,16 @@ //! locale : uzbek (uz) //! author : Sardor Muminov : https://github.com/muminoff -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; var uz = moment.defineLocale('uz', { - months : 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'), + months : 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split('_'), monthsShort : 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'), weekdays : 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'), weekdaysShort : 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'), diff --git a/bower_components/moment/locale/vi.js b/bower_components/moment/locale/vi.js index 2756a37..0e7ba8c 100644 --- a/bower_components/moment/locale/vi.js +++ b/bower_components/moment/locale/vi.js @@ -2,8 +2,9 @@ //! locale : vietnamese (vi) //! author : Bang Nguyen : https://github.com/bangnk -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/zh-cn.js b/bower_components/moment/locale/zh-cn.js index 283c4ba..aec5ede 100644 --- a/bower_components/moment/locale/zh-cn.js +++ b/bower_components/moment/locale/zh-cn.js @@ -3,8 +3,9 @@ //! author : suupic : https://github.com/suupic //! author : Zeno Zeng : https://github.com/zenozeng -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/locale/zh-tw.js b/bower_components/moment/locale/zh-tw.js index e2f3075..bf3a333 100644 --- a/bower_components/moment/locale/zh-tw.js +++ b/bower_components/moment/locale/zh-tw.js @@ -2,8 +2,9 @@ //! locale : traditional chinese (zh-tw) //! author : Ben : https://github.com/ben-lin -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/min/locales.js b/bower_components/moment/min/locales.js index adc3e47..94ae713 100644 --- a/bower_components/moment/min/locales.js +++ b/bower_components/moment/min/locales.js @@ -1,5 +1,6 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -498,31 +499,18 @@ return number + ' ' + be__plural(format[key], +number); } } - function be__monthsCaseReplace(m, format) { - var months = { - 'nominative': 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_'), - 'accusative': 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_') - }, - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return months[nounCase][m.month()]; - } - function be__weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'), - 'accusative': 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_') - }, - nounCase = (/\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/).test(format) ? - 'accusative' : - 'nominative'; - return weekdays[nounCase][m.day()]; - } var be = moment.defineLocale('be', { - months : be__monthsCaseReplace, + months : { + format: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_'), + standalone: 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_') + }, monthsShort : 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'), - weekdays : be__weekdaysCaseReplace, + weekdays : { + format: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_'), + standalone: 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'), + isFormat: /\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/ + }, weekdaysShort : 'нд_пн_ат_ср_чц_пт_сб'.split('_'), weekdaysMin : 'нд_пн_ат_ср_чц_пт_сб'.split('_'), longDateFormat : { @@ -717,8 +705,8 @@ var bn = moment.defineLocale('bn', { months : 'জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split('_'), monthsShort : 'জানু_ফেব_মার্চ_এপর_মে_জুন_জুল_অগ_সেপ্ট_অক্টো_নভ_ডিসেম্'.split('_'), - weekdays : 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রুবার_শনিবার'.split('_'), - weekdaysShort : 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্রু_শনি'.split('_'), + weekdays : 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রবার_শনিবার'.split('_'), + weekdaysShort : 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্র_শনি'.split('_'), weekdaysMin : 'রব_সম_মঙ্গ_বু_ব্রিহ_শু_শনি'.split('_'), longDateFormat : { LT : 'A h:mm সময়', @@ -739,7 +727,7 @@ relativeTime : { future : '%s পরে', past : '%s আগে', - s : 'কএক সেকেন্ড', + s : 'কয়েক সেকেন্ড', m : 'এক মিনিট', mm : '%d মিনিট', h : 'এক ঘন্টা', @@ -761,9 +749,9 @@ return bn__symbolMap[match]; }); }, - meridiemParse: /রাত|সকাল|দুপুর|বিকেল|রাত/, + meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/, isPM: function (input) { - return /^(দুপুর|বিকেল|রাত)$/.test(input); + return /^(দুপুর|বিকাল|রাত)$/.test(input); }, //Bengali is a vast language its spoken //in different forms in various parts of the world. @@ -776,7 +764,7 @@ } else if (hour < 17) { return 'দুপুর'; } else if (hour < 20) { - return 'বিকেল'; + return 'বিকাল'; } else { return 'রাত'; } @@ -1124,7 +1112,7 @@ weekdaysMin : 'Dg_Dl_Dt_Dc_Dj_Dv_Ds'.split('_'), longDateFormat : { LT : 'H:mm', - LTS : 'LT:ss', + LTS : 'H:mm:ss', L : 'DD/MM/YYYY', LL : 'D MMMM YYYY', LLL : 'D MMMM YYYY H:mm', @@ -1253,6 +1241,20 @@ } return _monthsParse; }(cs__months, cs__monthsShort)), + shortMonthsParse : (function (monthsShort) { + var i, _shortMonthsParse = []; + for (i = 0; i < 12; i++) { + _shortMonthsParse[i] = new RegExp('^' + monthsShort[i] + '$', 'i'); + } + return _shortMonthsParse; + }(cs__monthsShort)), + longMonthsParse : (function (months) { + var i, _longMonthsParse = []; + for (i = 0; i < 12; i++) { + _longMonthsParse[i] = new RegExp('^' + months[i] + '$', 'i'); + } + return _longMonthsParse; + }(cs__months)), weekdays : 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'), weekdaysShort : 'ne_po_út_st_čt_pá_so'.split('_'), weekdaysMin : 'ne_po_út_st_čt_pá_so'.split('_'), @@ -1500,6 +1502,7 @@ //! author : lluchs : https://github.com/lluchs //! author: Menelion Elensúle: https://github.com/Oire //! author : Martin Groller : https://github.com/MadMG + //! author : Mikolaj Dadela : https://github.com/mik01aj function de_at__processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { @@ -1530,11 +1533,11 @@ LLLL : 'dddd, D. MMMM YYYY HH:mm' }, calendar : { - sameDay: '[Heute um] LT [Uhr]', + sameDay: '[heute um] LT [Uhr]', sameElse: 'L', - nextDay: '[Morgen um] LT [Uhr]', + nextDay: '[morgen um] LT [Uhr]', nextWeek: 'dddd [um] LT [Uhr]', - lastDay: '[Gestern um] LT [Uhr]', + lastDay: '[gestern um] LT [Uhr]', lastWeek: '[letzten] dddd [um] LT [Uhr]' }, relativeTime : { @@ -1564,6 +1567,7 @@ //! locale : german (de) //! author : lluchs : https://github.com/lluchs //! author: Menelion Elensúle: https://github.com/Oire + //! author : Mikolaj Dadela : https://github.com/mik01aj function de__processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { @@ -1594,11 +1598,11 @@ LLLL : 'dddd, D. MMMM YYYY HH:mm' }, calendar : { - sameDay: '[Heute um] LT [Uhr]', + sameDay: '[heute um] LT [Uhr]', sameElse: 'L', - nextDay: '[Morgen um] LT [Uhr]', + nextDay: '[morgen um] LT [Uhr]', nextWeek: 'dddd [um] LT [Uhr]', - lastDay: '[Gestern um] LT [Uhr]', + lastDay: '[gestern um] LT [Uhr]', lastWeek: '[letzten] dddd [um] LT [Uhr]' }, relativeTime : { @@ -1624,6 +1628,98 @@ } }); + //! moment.js locale configuration + //! locale : dhivehi (dv) + //! author : Jawish Hameed : https://github.com/jawish + + var dv__months = [ + 'ޖެނުއަރީ', + 'ފެބްރުއަރީ', + 'މާރިޗު', + 'އޭޕްރީލު', + 'މޭ', + 'ޖޫން', + 'ޖުލައި', + 'އޯގަސްޓު', + 'ސެޕްޓެމްބަރު', + 'އޮކްޓޯބަރު', + 'ނޮވެމްބަރު', + 'ޑިސެމްބަރު' + ], dv__weekdays = [ + 'އާދިއްތަ', + 'ހޯމަ', + 'އަންގާރަ', + 'ބުދަ', + 'ބުރާސްފަތި', + 'ހުކުރު', + 'ހޮނިހިރު' + ]; + + var dv = moment.defineLocale('dv', { + months : dv__months, + monthsShort : dv__months, + weekdays : dv__weekdays, + weekdaysShort : dv__weekdays, + weekdaysMin : 'އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި'.split('_'), + longDateFormat : { + + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'D/M/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd D MMMM YYYY HH:mm' + }, + meridiemParse: /މކ|މފ/, + isPM : function (input) { + return '' === input; + }, + meridiem : function (hour, minute, isLower) { + if (hour < 12) { + return 'މކ'; + } else { + return 'މފ'; + } + }, + calendar : { + sameDay : '[މިއަދު] LT', + nextDay : '[މާދަމާ] LT', + nextWeek : 'dddd LT', + lastDay : '[އިއްޔެ] LT', + lastWeek : '[ފާއިތުވި] dddd LT', + sameElse : 'L' + }, + relativeTime : { + future : 'ތެރޭގައި %s', + past : 'ކުރިން %s', + s : 'ސިކުންތުކޮޅެއް', + m : 'މިނިޓެއް', + mm : 'މިނިޓު %d', + h : 'ގަޑިއިރެއް', + hh : 'ގަޑިއިރު %d', + d : 'ދުވަހެއް', + dd : 'ދުވަސް %d', + M : 'މަހެއް', + MM : 'މަސް %d', + y : 'އަހަރެއް', + yy : 'އަހަރު %d' + }, + preparse: function (string) { + return string.replace(/،/g, ','); + }, + postformat: function (string) { + return string.replace(/,/g, '،'); + }, + week : { + dow : 7, // Sunday is the first day of the week. + doy : 12 // The week that contains Jan 1st is the first week of the year. + } + }); + + function isFunction(input) { + return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; + } + //! moment.js locale configuration //! locale : modern greek (el) //! author : Aggelos Karalias : https://github.com/mehiel @@ -1679,7 +1775,7 @@ calendar : function (key, mom) { var output = this._calendarEl[key], hours = mom && mom.hours(); - if (typeof output === 'function') { + if (isFunction(output)) { output = output.apply(mom); } return output.replace('{}', (hours % 12 === 1 ? 'στη' : 'στις')); @@ -1870,6 +1966,117 @@ } }); + //! moment.js locale configuration + //! locale : Irish english (en-ie) + //! author : Chris Cartlidge : https://github.com/chriscartlidge + + var en_ie = moment.defineLocale('en-ie', { + months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), + monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), + weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), + weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD-MM-YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd D MMMM YYYY HH:mm' + }, + calendar : { + sameDay : '[Today at] LT', + nextDay : '[Tomorrow at] LT', + nextWeek : 'dddd [at] LT', + lastDay : '[Yesterday at] LT', + lastWeek : '[Last] dddd [at] LT', + sameElse : 'L' + }, + relativeTime : { + future : 'in %s', + past : '%s ago', + s : 'a few seconds', + m : 'a minute', + mm : '%d minutes', + h : 'an hour', + hh : '%d hours', + d : 'a day', + dd : '%d days', + M : 'a month', + MM : '%d months', + y : 'a year', + yy : '%d years' + }, + ordinalParse: /\d{1,2}(st|nd|rd|th)/, + ordinal : function (number) { + var b = number % 10, + output = (~~(number % 100 / 10) === 1) ? 'th' : + (b === 1) ? 'st' : + (b === 2) ? 'nd' : + (b === 3) ? 'rd' : 'th'; + return number + output; + }, + week : { + dow : 1, // Monday is the first day of the week. + doy : 4 // The week that contains Jan 4th is the first week of the year. + } + }); + + //! moment.js locale configuration + //! locale : New Zealand english (en-nz) + + var en_nz = moment.defineLocale('en-nz', { + months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), + monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), + weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), + weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), + longDateFormat : { + LT : 'h:mm A', + LTS : 'h:mm:ss A', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY h:mm A', + LLLL : 'dddd, D MMMM YYYY h:mm A' + }, + calendar : { + sameDay : '[Today at] LT', + nextDay : '[Tomorrow at] LT', + nextWeek : 'dddd [at] LT', + lastDay : '[Yesterday at] LT', + lastWeek : '[Last] dddd [at] LT', + sameElse : 'L' + }, + relativeTime : { + future : 'in %s', + past : '%s ago', + s : 'a few seconds', + m : 'a minute', + mm : '%d minutes', + h : 'an hour', + hh : '%d hours', + d : 'a day', + dd : '%d days', + M : 'a month', + MM : '%d months', + y : 'a year', + yy : '%d years' + }, + ordinalParse: /\d{1,2}(st|nd|rd|th)/, + ordinal : function (number) { + var b = number % 10, + output = (~~(number % 100 / 10) === 1) ? 'th' : + (b === 1) ? 'st' : + (b === 2) ? 'nd' : + (b === 3) ? 'rd' : 'th'; + return number + output; + }, + week : { + dow : 1, // Monday is the first day of the week. + doy : 4 // The week that contains Jan 4th is the first week of the year. + } + }); + //! moment.js locale configuration //! locale : esperanto (eo) //! author : Colin Dean : https://github.com/colindean @@ -1936,11 +2143,11 @@ //! locale : spanish (es) //! author : Julio Napurí : https://github.com/julionc - var monthsShortDot = 'Ene._Feb._Mar._Abr._May._Jun._Jul._Ago._Sep._Oct._Nov._Dic.'.split('_'), - es__monthsShort = 'Ene_Feb_Mar_Abr_May_Jun_Jul_Ago_Sep_Oct_Nov_Dic'.split('_'); + var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'), + es__monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'); var es = moment.defineLocale('es', { - months : 'Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre'.split('_'), + months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'), monthsShort : function (m, format) { if (/-MMM-/.test(format)) { return es__monthsShort[m.month()]; @@ -1948,9 +2155,9 @@ return monthsShortDot[m.month()]; } }, - weekdays : 'Domingo_Lunes_Martes_Miércoles_Jueves_Viernes_Sábado'.split('_'), - weekdaysShort : 'Dom._Lun._Mar._Mié._Jue._Vie._Sáb.'.split('_'), - weekdaysMin : 'Do_Lu_Ma_Mi_Ju_Vi_Sá'.split('_'), + weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), + weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), + weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'), longDateFormat : { LT : 'H:mm', LTS : 'H:mm:ss', @@ -2408,6 +2615,57 @@ } }); + //! moment.js locale configuration + //! locale : swiss french (fr) + //! author : Gaspard Bucher : https://github.com/gaspard + + var fr_ch = moment.defineLocale('fr-ch', { + months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'), + monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'), + weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), + weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), + weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd D MMMM YYYY HH:mm' + }, + calendar : { + sameDay: '[Aujourd\'hui à] LT', + nextDay: '[Demain à] LT', + nextWeek: 'dddd [à] LT', + lastDay: '[Hier à] LT', + lastWeek: 'dddd [dernier à] LT', + sameElse: 'L' + }, + relativeTime : { + future : 'dans %s', + past : 'il y a %s', + s : 'quelques secondes', + m : 'une minute', + mm : '%d minutes', + h : 'une heure', + hh : '%d heures', + d : 'un jour', + dd : '%d jours', + M : 'un mois', + MM : '%d mois', + y : 'un an', + yy : '%d ans' + }, + ordinalParse: /\d{1,2}(er|e)/, + ordinal : function (number) { + return number + (number === 1 ? 'er' : 'e'); + }, + week : { + dow : 1, // Monday is the first day of the week. + doy : 4 // The week that contains Jan 4th is the first week of the year. + } + }); + //! moment.js locale configuration //! locale : french (fr) //! author : John Fischer : https://github.com/jfroffice @@ -2519,6 +2777,71 @@ } }); + //! moment.js locale configuration + //! locale : great britain scottish gealic (gd) + //! author : Jon Ashdown : https://github.com/jonashdown + + var gd__months = [ + 'Am Faoilleach', 'An Gearran', 'Am Màrt', 'An Giblean', 'An Cèitean', 'An t-Ògmhios', 'An t-Iuchar', 'An Lùnastal', 'An t-Sultain', 'An Dàmhair', 'An t-Samhain', 'An Dùbhlachd' + ]; + + var gd__monthsShort = ['Faoi', 'Gear', 'Màrt', 'Gibl', 'Cèit', 'Ògmh', 'Iuch', 'Lùn', 'Sult', 'Dàmh', 'Samh', 'Dùbh']; + + var gd__weekdays = ['Didòmhnaich', 'Diluain', 'Dimàirt', 'Diciadain', 'Diardaoin', 'Dihaoine', 'Disathairne']; + + var weekdaysShort = ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis']; + + var weekdaysMin = ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa']; + + var gd = moment.defineLocale('gd', { + months : gd__months, + monthsShort : gd__monthsShort, + monthsParseExact : true, + weekdays : gd__weekdays, + weekdaysShort : weekdaysShort, + weekdaysMin : weekdaysMin, + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd, D MMMM YYYY HH:mm' + }, + calendar : { + sameDay : '[An-diugh aig] LT', + nextDay : '[A-màireach aig] LT', + nextWeek : 'dddd [aig] LT', + lastDay : '[An-dè aig] LT', + lastWeek : 'dddd [seo chaidh] [aig] LT', + sameElse : 'L' + }, + relativeTime : { + future : 'ann an %s', + past : 'bho chionn %s', + s : 'beagan diogan', + m : 'mionaid', + mm : '%d mionaidean', + h : 'uair', + hh : '%d uairean', + d : 'latha', + dd : '%d latha', + M : 'mìos', + MM : '%d mìosan', + y : 'bliadhna', + yy : '%d bliadhna' + }, + ordinalParse : /\d{1,2}(d|na|mh)/, + ordinal : function (number) { + var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh'; + return number + output; + }, + week : { + dow : 1, // Monday is the first day of the week. + doy : 4 // The week that contains Jan 4th is the first week of the year. + } + }); + //! moment.js locale configuration //! locale : galician (gl) //! author : Juan G. Hurtado : https://github.com/juanghurtado @@ -2824,7 +3147,10 @@ } var hr = moment.defineLocale('hr', { - months : 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_'), + months : { + format: 'siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca'.split('_'), + standalone: 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_') + }, monthsShort : 'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split('_'), weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'), weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'), @@ -2997,29 +3323,13 @@ //! locale : Armenian (hy-am) //! author : Armendarabyan : https://github.com/armendarabyan - function hy_am__monthsCaseReplace(m, format) { - var months = { - 'nominative': 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_'), - 'accusative': 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_') - }, - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return months[nounCase][m.month()]; - } - function hy_am__monthsShortCaseReplace(m, format) { - var monthsShort = 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'); - return monthsShort[m.month()]; - } - function hy_am__weekdaysCaseReplace(m, format) { - var weekdays = 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_'); - return weekdays[m.day()]; - } - var hy_am = moment.defineLocale('hy-am', { - months : hy_am__monthsCaseReplace, - monthsShort : hy_am__monthsShortCaseReplace, - weekdays : hy_am__weekdaysCaseReplace, + months : { + format: 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_'), + standalone: 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_') + }, + monthsShort : 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'), + weekdays : 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_'), weekdaysShort : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'), weekdaysMin : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'), longDateFormat : { @@ -3291,7 +3601,7 @@ monthsShort : 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'), weekdays : 'Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato'.split('_'), weekdaysShort : 'Dom_Lun_Mar_Mer_Gio_Ven_Sab'.split('_'), - weekdaysMin : 'D_L_Ma_Me_G_V_S'.split('_'), + weekdaysMin : 'Do_Lu_Ma_Me_Gi_Ve_Sa'.split('_'), longDateFormat : { LT : 'HH:mm', LTS : 'HH:mm:ss', @@ -3470,31 +3780,17 @@ //! locale : Georgian (ka) //! author : Irakli Janiashvili : https://github.com/irakli-janiashvili - function ka__monthsCaseReplace(m, format) { - var months = { - 'nominative': 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'), - 'accusative': 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_') - }, - nounCase = (/D[oD] *MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return months[nounCase][m.month()]; - } - function ka__weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'), - 'accusative': 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_') - }, - nounCase = (/(წინა|შემდეგ)/).test(format) ? - 'accusative' : - 'nominative'; - return weekdays[nounCase][m.day()]; - } - var ka = moment.defineLocale('ka', { - months : ka__monthsCaseReplace, + months : { + standalone: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'), + format: 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_') + }, monthsShort : 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'), - weekdays : ka__weekdaysCaseReplace, + weekdays : { + standalone: 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'), + format: 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_'), + isFormat: /(წინა|შემდეგ)/ + }, weekdaysShort : 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'), weekdaysMin : 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'), longDateFormat : { @@ -3558,6 +3854,82 @@ } }); + //! moment.js locale configuration + //! locale : kazakh (kk) + //! authors : Nurlan Rakhimzhanov : https://github.com/nurlan + + var kk__suffixes = { + 0: '-ші', + 1: '-ші', + 2: '-ші', + 3: '-ші', + 4: '-ші', + 5: '-ші', + 6: '-шы', + 7: '-ші', + 8: '-ші', + 9: '-шы', + 10: '-шы', + 20: '-шы', + 30: '-шы', + 40: '-шы', + 50: '-ші', + 60: '-шы', + 70: '-ші', + 80: '-ші', + 90: '-шы', + 100: '-ші' + }; + + var kk = moment.defineLocale('kk', { + months : 'Қаңтар_Ақпан_Наурыз_Сәуір_Мамыр_Маусым_Шілде_Тамыз_Қыркүйек_Қазан_Қараша_Желтоқсан'.split('_'), + monthsShort : 'Қаң_Ақп_Нау_Сәу_Мам_Мау_Шіл_Там_Қыр_Қаз_Қар_Жел'.split('_'), + weekdays : 'Жексенбі_Дүйсенбі_Сейсенбі_Сәрсенбі_Бейсенбі_Жұма_Сенбі'.split('_'), + weekdaysShort : 'Жек_Дүй_Сей_Сәр_Бей_Жұм_Сен'.split('_'), + weekdaysMin : 'Жк_Дй_Сй_Ср_Бй_Жм_Сн'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd, D MMMM YYYY HH:mm' + }, + calendar : { + sameDay : '[Бүгін сағат] LT', + nextDay : '[Ертең сағат] LT', + nextWeek : 'dddd [сағат] LT', + lastDay : '[Кеше сағат] LT', + lastWeek : '[Өткен аптаның] dddd [сағат] LT', + sameElse : 'L' + }, + relativeTime : { + future : '%s ішінде', + past : '%s бұрын', + s : 'бірнеше секунд', + m : 'бір минут', + mm : '%d минут', + h : 'бір сағат', + hh : '%d сағат', + d : 'бір күн', + dd : '%d күн', + M : 'бір ай', + MM : '%d ай', + y : 'бір жыл', + yy : '%d жыл' + }, + ordinalParse: /\d{1,2}-(ші|шы)/, + ordinal : function (number) { + var a = number % 10, + b = number >= 100 ? 100 : null; + return number + (kk__suffixes[number] || kk__suffixes[a] || kk__suffixes[b]); + }, + week : { + dow : 1, // Monday is the first day of the week. + doy : 7 // The week that contains Jan 1st is the first week of the year. + } + }); + //! moment.js locale configuration //! locale : khmer (km) //! author : Kruy Vanna : https://github.com/kruyvanna @@ -3577,7 +3949,7 @@ LLLL: 'dddd, D MMMM YYYY HH:mm' }, calendar: { - sameDay: '[ថ្ងៃនៈ ម៉ោង] LT', + sameDay: '[ថ្ងៃនេះ ម៉ោង] LT', nextDay: '[ស្អែក ម៉ោង] LT', nextWeek: 'dddd [ម៉ោង] LT', lastDay: '[ម្សិលមិញ ម៉ោង] LT', @@ -3785,6 +4157,64 @@ } }); + //! moment.js locale configuration + //! locale : lao (lo) + //! author : Ryan Hart : https://github.com/ryanhart2 + + var lo = moment.defineLocale('lo', { + months : 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'), + monthsShort : 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'), + weekdays : 'ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'), + weekdaysShort : 'ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'), + weekdaysMin : 'ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'ວັນdddd D MMMM YYYY HH:mm' + }, + meridiemParse: /ຕອນເຊົ້າ|ຕອນແລງ/, + isPM: function (input) { + return input === 'ຕອນແລງ'; + }, + meridiem : function (hour, minute, isLower) { + if (hour < 12) { + return 'ຕອນເຊົ້າ'; + } else { + return 'ຕອນແລງ'; + } + }, + calendar : { + sameDay : '[ມື້ນີ້ເວລາ] LT', + nextDay : '[ມື້ອື່ນເວລາ] LT', + nextWeek : '[ວັນ]dddd[ໜ້າເວລາ] LT', + lastDay : '[ມື້ວານນີ້ເວລາ] LT', + lastWeek : '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT', + sameElse : 'L' + }, + relativeTime : { + future : 'ອີກ %s', + past : '%sຜ່ານມາ', + s : 'ບໍ່ເທົ່າໃດວິນາທີ', + m : '1 ນາທີ', + mm : '%d ນາທີ', + h : '1 ຊົ່ວໂມງ', + hh : '%d ຊົ່ວໂມງ', + d : '1 ມື້', + dd : '%d ມື້', + M : '1 ເດືອນ', + MM : '%d ເດືອນ', + y : '1 ປີ', + yy : '%d ປີ' + }, + ordinalParse: /(ທີ່)\d{1,2}/, + ordinal : function (number) { + return 'ທີ່' + number; + } + }); + //! moment.js locale configuration //! locale : Lithuanian (lt) //! author : Mindaugas Mozūras : https://github.com/mmozuras @@ -3800,8 +4230,7 @@ 'MM': 'mėnesiai_mėnesių_mėnesius', 'y' : 'metai_metų_metus', 'yy': 'metai_metų_metus' - }, - weekDays = 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_'); + }; function translateSeconds(number, withoutSuffix, key, isFuture) { if (withoutSuffix) { return 'kelios sekundės'; @@ -3809,16 +4238,6 @@ return isFuture ? 'kelių sekundžių' : 'kelias sekundes'; } } - function lt__monthsCaseReplace(m, format) { - var months = { - 'nominative': 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split('_'), - 'accusative': 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_') - }, - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return months[nounCase][m.month()]; - } function translateSingular(number, withoutSuffix, key, isFuture) { return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]); } @@ -3842,16 +4261,17 @@ } } } - function relativeWeekDay(moment, format) { - var nominative = format.indexOf('dddd HH:mm') === -1, - weekDay = weekDays[moment.day()]; - return nominative ? weekDay : weekDay.substring(0, weekDay.length - 2) + 'į'; - } - var lt = moment.defineLocale('lt', { - months : lt__monthsCaseReplace, + months : { + format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_'), + standalone: 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split('_') + }, monthsShort : 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'), - weekdays : relativeWeekDay, + weekdays : { + format: 'sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį'.split('_'), + standalone: 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_'), + isFormat: /dddd HH:mm/ + }, weekdaysShort : 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'), weekdaysMin : 'S_P_A_T_K_Pn_Š'.split('_'), longDateFormat : { @@ -4103,19 +4523,19 @@ calendar : { sameDay : '[Денес во] LT', nextDay : '[Утре во] LT', - nextWeek : 'dddd [во] LT', + nextWeek : '[Во] dddd [во] LT', lastDay : '[Вчера во] LT', lastWeek : function () { switch (this.day()) { case 0: case 3: case 6: - return '[Во изминатата] dddd [во] LT'; + return '[Изминатата] dddd [во] LT'; case 1: case 2: case 4: case 5: - return '[Во изминатиот] dddd [во] LT'; + return '[Изминатиот] dddd [во] LT'; } }, sameElse : 'L' @@ -4224,6 +4644,7 @@ //! moment.js locale configuration //! locale : Marathi (mr) //! author : Harshad Kale : https://github.com/kalehv + //! author : Vivek Athalye : https://github.com/vnathalye var mr__symbolMap = { '1': '१', @@ -4250,6 +4671,42 @@ '०': '0' }; + function relativeTimeMr(number, withoutSuffix, string, isFuture) + { + var output = ''; + if (withoutSuffix) { + switch (string) { + case 's': output = 'काही सेकंद'; break; + case 'm': output = 'एक मिनिट'; break; + case 'mm': output = '%d मिनिटे'; break; + case 'h': output = 'एक तास'; break; + case 'hh': output = '%d तास'; break; + case 'd': output = 'एक दिवस'; break; + case 'dd': output = '%d दिवस'; break; + case 'M': output = 'एक महिना'; break; + case 'MM': output = '%d महिने'; break; + case 'y': output = 'एक वर्ष'; break; + case 'yy': output = '%d वर्षे'; break; + } + } + else { + switch (string) { + case 's': output = 'काही सेकंदां'; break; + case 'm': output = 'एका मिनिटा'; break; + case 'mm': output = '%d मिनिटां'; break; + case 'h': output = 'एका तासा'; break; + case 'hh': output = '%d तासां'; break; + case 'd': output = 'एका दिवसा'; break; + case 'dd': output = '%d दिवसां'; break; + case 'M': output = 'एका महिन्या'; break; + case 'MM': output = '%d महिन्यां'; break; + case 'y': output = 'एका वर्षा'; break; + case 'yy': output = '%d वर्षां'; break; + } + } + return output.replace(/%d/i, number); + } + var mr = moment.defineLocale('mr', { months : 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split('_'), monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split('_'), @@ -4273,19 +4730,19 @@ sameElse : 'L' }, relativeTime : { - future : '%s नंतर', - past : '%s पूर्वी', - s : 'सेकंद', - m: 'एक मिनिट', - mm: '%d मिनिटे', - h : 'एक तास', - hh : '%d तास', - d : 'एक दिवस', - dd : '%d दिवस', - M : 'एक महिना', - MM : '%d महिने', - y : 'एक वर्ष', - yy : '%d वर्षे' + future: '%sमध्ये', + past: '%sपूर्वी', + s: relativeTimeMr, + m: relativeTimeMr, + mm: relativeTimeMr, + h: relativeTimeMr, + hh: relativeTimeMr, + d: relativeTimeMr, + dd: relativeTimeMr, + M: relativeTimeMr, + MM: relativeTimeMr, + y: relativeTimeMr, + yy: relativeTimeMr }, preparse: function (string) { return string.replace(/[१२३४५६७८९०]/g, function (match) { @@ -4562,17 +5019,17 @@ var nb = moment.defineLocale('nb', { months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'), - monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'), + monthsShort : 'jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.'.split('_'), weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'), - weekdaysShort : 'søn_man_tirs_ons_tors_fre_lør'.split('_'), + weekdaysShort : 'sø._ma._ti._on._to._fr._lø.'.split('_'), weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'), longDateFormat : { - LT : 'H.mm', - LTS : 'H.mm.ss', + LT : 'HH:mm', + LTS : 'HH:mm:ss', L : 'DD.MM.YYYY', LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY [kl.] H.mm', - LLLL : 'dddd D. MMMM YYYY [kl.] H.mm' + LLL : 'D. MMMM YYYY [kl.] HH:mm', + LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm' }, calendar : { sameDay: '[i dag kl.] LT', @@ -4639,7 +5096,7 @@ monthsShort : 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split('_'), weekdays : 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split('_'), weekdaysShort : 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'), - weekdaysMin : 'आइ._सो._मङ्_बु._बि._शु._श.'.split('_'), + weekdaysMin : 'आ._सो._मं._बु._बि._शु._श.'.split('_'), longDateFormat : { LT : 'Aको h:mm बजे', LTS : 'Aको h:mm:ss बजे', @@ -4658,39 +5115,37 @@ return ne__symbolMap[match]; }); }, - meridiemParse: /राती|बिहान|दिउँसो|बेलुका|साँझ|राती/, + meridiemParse: /राति|बिहान|दिउँसो|साँझ/, meridiemHour : function (hour, meridiem) { if (hour === 12) { hour = 0; } - if (meridiem === 'राती') { - return hour < 3 ? hour : hour + 12; + if (meridiem === 'राति') { + return hour < 4 ? hour : hour + 12; } else if (meridiem === 'बिहान') { return hour; } else if (meridiem === 'दिउँसो') { return hour >= 10 ? hour : hour + 12; - } else if (meridiem === 'बेलुका' || meridiem === 'साँझ') { + } else if (meridiem === 'साँझ') { return hour + 12; } }, meridiem : function (hour, minute, isLower) { if (hour < 3) { - return 'राती'; - } else if (hour < 10) { + return 'राति'; + } else if (hour < 12) { return 'बिहान'; - } else if (hour < 15) { + } else if (hour < 16) { return 'दिउँसो'; - } else if (hour < 18) { - return 'बेलुका'; } else if (hour < 20) { return 'साँझ'; } else { - return 'राती'; + return 'राति'; } }, calendar : { sameDay : '[आज] LT', - nextDay : '[भोली] LT', + nextDay : '[भोलि] LT', nextWeek : '[आउँदो] dddd[,] LT', lastDay : '[हिजो] LT', lastWeek : '[गएको] dddd[,] LT', @@ -4698,8 +5153,8 @@ }, relativeTime : { future : '%sमा', - past : '%s अगाडी', - s : 'केही समय', + past : '%s अगाडि', + s : 'केही क्षण', m : 'एक मिनेट', mm : '%d मिनेट', h : 'एक घण्टा', @@ -4712,8 +5167,8 @@ yy : '%d बर्ष' }, week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. + dow : 0, // Sunday is the first day of the week. + doy : 6 // The week that contains Jan 1st is the first week of the year. } }); @@ -4791,9 +5246,9 @@ LT : 'HH:mm', LTS : 'HH:mm:ss', L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' + LL : 'D. MMMM YYYY', + LLL : 'D. MMMM YYYY [kl.] H:mm', + LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm' }, calendar : { sameDay: '[I dag klokka] LT', @@ -4869,7 +5324,7 @@ monthsShort : 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'), weekdays : 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'), weekdaysShort : 'nie_pon_wt_śr_czw_pt_sb'.split('_'), - weekdaysMin : 'N_Pn_Wt_Śr_Cz_Pt_So'.split('_'), + weekdaysMin : 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'), longDateFormat : { LT : 'HH:mm', LTS : 'HH:mm:ss', @@ -5109,44 +5564,27 @@ return number + ' ' + ru__plural(format[key], +number); } } - function ru__monthsCaseReplace(m, format) { - var months = { - 'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'), - 'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_') - }, - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return months[nounCase][m.month()]; - } - function ru__monthsShortCaseReplace(m, format) { - var monthsShort = { - 'nominative': 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'), - 'accusative': 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_') - }, - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return monthsShort[nounCase][m.month()]; - } - function ru__weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'), - 'accusative': 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_') - }, - nounCase = (/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/).test(format) ? - 'accusative' : - 'nominative'; - return weekdays[nounCase][m.day()]; - } + var monthsParse = [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[й|я]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i]; var ru = moment.defineLocale('ru', { - months : ru__monthsCaseReplace, - monthsShort : ru__monthsShortCaseReplace, - weekdays : ru__weekdaysCaseReplace, - weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'), - weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'), - monthsParse : [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[й|я]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i], + months : { + format: 'Января_Февраля_Марта_Апреля_Мая_Июня_Июля_Августа_Сентября_Октября_Ноября_Декабря'.split('_'), + standalone: 'Январь_Февраль_Март_Апрель_Май_Июнь_Июль_Август_Сентябрь_Октябрь_Ноябрь_Декабрь'.split('_') + }, + monthsShort : { + format: 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_'), + standalone: 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_') + }, + weekdays : { + standalone: 'Воскресенье_Понедельник_Вторник_Среда_Четверг_Пятница_Суббота'.split('_'), + format: 'Воскресенье_Понедельник_Вторник_Среду_Четверг_Пятницу_Субботу'.split('_'), + isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/ + }, + weekdaysShort : 'Вс_Пн_Вт_Ср_Чт_Пт_Сб'.split('_'), + weekdaysMin : 'Вс_Пн_Вт_Ср_Чт_Пт_Сб'.split('_'), + monthsParse : monthsParse, + longMonthsParse : monthsParse, + shortMonthsParse : monthsParse, longDateFormat : { LT : 'HH:mm', LTS : 'HH:mm:ss', @@ -5159,8 +5597,27 @@ sameDay: '[Сегодня в] LT', nextDay: '[Завтра в] LT', lastDay: '[Вчера в] LT', - nextWeek: function () { - return this.day() === 2 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT'; + nextWeek: function (now) { + if (now.week() !== this.week()) { + switch (this.day()) { + case 0: + return '[В следующее] dddd [в] LT'; + case 1: + case 2: + case 4: + return '[В следующий] dddd [в] LT'; + case 3: + case 5: + case 6: + return '[В следующую] dddd [в] LT'; + } + } else { + if (this.day() === 2) { + return '[Во] dddd [в] LT'; + } else { + return '[В] dddd [в] LT'; + } + } }, lastWeek: function (now) { if (now.week() !== this.week()) { @@ -5238,10 +5695,61 @@ } }); + //! moment.js locale configuration + //! locale : Northern Sami (se) + //! authors : Bård Rolstad Henriksen : https://github.com/karamell + + + var se = moment.defineLocale('se', { + months : 'ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu'.split('_'), + monthsShort : 'ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov'.split('_'), + weekdays : 'sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat'.split('_'), + weekdaysShort : 'sotn_vuos_maŋ_gask_duor_bear_láv'.split('_'), + weekdaysMin : 's_v_m_g_d_b_L'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'MMMM D. [b.] YYYY', + LLL : 'MMMM D. [b.] YYYY [ti.] HH:mm', + LLLL : 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm' + }, + calendar : { + sameDay: '[otne ti] LT', + nextDay: '[ihttin ti] LT', + nextWeek: 'dddd [ti] LT', + lastDay: '[ikte ti] LT', + lastWeek: '[ovddit] dddd [ti] LT', + sameElse: 'L' + }, + relativeTime : { + future : '%s geažes', + past : 'maŋit %s', + s : 'moadde sekunddat', + m : 'okta minuhta', + mm : '%d minuhtat', + h : 'okta diimmu', + hh : '%d diimmut', + d : 'okta beaivi', + dd : '%d beaivvit', + M : 'okta mánnu', + MM : '%d mánut', + y : 'okta jahki', + yy : '%d jagit' + }, + ordinalParse: /\d{1,2}\./, + ordinal : '%d.', + week : { + dow : 1, // Monday is the first day of the week. + doy : 4 // The week that contains Jan 4th is the first week of the year. + } + }); + //! moment.js locale configuration //! locale : Sinhalese (si) //! author : Sampath Sitinamaluwa : https://github.com/sampathsris + /*jshint -W100*/ var si = moment.defineLocale('si', { months : 'ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්'.split('_'), monthsShort : 'ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ'.split('_'), @@ -5358,14 +5866,6 @@ var sk = moment.defineLocale('sk', { months : sk__months, monthsShort : sk__monthsShort, - monthsParse : (function (months, monthsShort) { - var i, _monthsParse = []; - for (i = 0; i < 12; i++) { - // use custom parser to solve problem with July (červenec) - _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i'); - } - return _monthsParse; - }(sk__months, sk__monthsShort)), weekdays : 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'), weekdaysShort : 'ne_po_ut_st_št_pi_so'.split('_'), weekdaysMin : 'ne_po_ut_st_št_pi_so'.split('_'), @@ -5896,10 +6396,81 @@ } }); + //! moment.js locale configuration + //! locale : swahili (sw) + //! author : Fahad Kassim : https://github.com/fadsel + + var sw = moment.defineLocale('sw', { + months : 'Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba'.split('_'), + monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des'.split('_'), + weekdays : 'Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi'.split('_'), + weekdaysShort : 'Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos'.split('_'), + weekdaysMin : 'J2_J3_J4_J5_Al_Ij_J1'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd, D MMMM YYYY HH:mm' + }, + calendar : { + sameDay : '[leo saa] LT', + nextDay : '[kesho saa] LT', + nextWeek : '[wiki ijayo] dddd [saat] LT', + lastDay : '[jana] LT', + lastWeek : '[wiki iliyopita] dddd [saat] LT', + sameElse : 'L' + }, + relativeTime : { + future : '%s baadaye', + past : 'tokea %s', + s : 'hivi punde', + m : 'dakika moja', + mm : 'dakika %d', + h : 'saa limoja', + hh : 'masaa %d', + d : 'siku moja', + dd : 'masiku %d', + M : 'mwezi mmoja', + MM : 'miezi %d', + y : 'mwaka mmoja', + yy : 'miaka %d' + }, + week : { + dow : 1, // Monday is the first day of the week. + doy : 7 // The week that contains Jan 1st is the first week of the year. + } + }); + //! moment.js locale configuration //! locale : tamil (ta) //! author : Arjunkumar Krishnamoorthy : https://github.com/tk120404 + var ta__symbolMap = { + '1': '௧', + '2': '௨', + '3': '௩', + '4': '௪', + '5': '௫', + '6': '௬', + '7': '௭', + '8': '௮', + '9': '௯', + '0': '௦' + }, ta__numberMap = { + '௧': '1', + '௨': '2', + '௩': '3', + '௪': '4', + '௫': '5', + '௬': '6', + '௭': '7', + '௮': '8', + '௯': '9', + '௦': '0' + }; + var ta = moment.defineLocale('ta', { months : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'), monthsShort : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'), @@ -5941,6 +6512,16 @@ ordinal : function (number) { return number + 'வது'; }, + preparse: function (string) { + return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) { + return ta__numberMap[match]; + }); + }, + postformat: function (string) { + return string.replace(/\d/g, function (match) { + return ta__symbolMap[match]; + }); + }, // refer http://ta.wikipedia.org/s/1er1 meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/, meridiem : function (hour, minute, isLower) { @@ -5980,6 +6561,83 @@ } }); + //! moment.js locale configuration + //! locale : telugu (te) + //! author : Krishna Chaitanya Thota : https://github.com/kcthota + + var te = moment.defineLocale('te', { + months : 'జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జూలై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్'.split('_'), + monthsShort : 'జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జూలై_ఆగ._సెప్._అక్టో._నవ._డిసె.'.split('_'), + weekdays : 'ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం'.split('_'), + weekdaysShort : 'ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని'.split('_'), + weekdaysMin : 'ఆ_సో_మం_బు_గు_శు_శ'.split('_'), + longDateFormat : { + LT : 'A h:mm', + LTS : 'A h:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY, A h:mm', + LLLL : 'dddd, D MMMM YYYY, A h:mm' + }, + calendar : { + sameDay : '[నేడు] LT', + nextDay : '[రేపు] LT', + nextWeek : 'dddd, LT', + lastDay : '[నిన్న] LT', + lastWeek : '[గత] dddd, LT', + sameElse : 'L' + }, + relativeTime : { + future : '%s లో', + past : '%s క్రితం', + s : 'కొన్ని క్షణాలు', + m : 'ఒక నిమిషం', + mm : '%d నిమిషాలు', + h : 'ఒక గంట', + hh : '%d గంటలు', + d : 'ఒక రోజు', + dd : '%d రోజులు', + M : 'ఒక నెల', + MM : '%d నెలలు', + y : 'ఒక సంవత్సరం', + yy : '%d సంవత్సరాలు' + }, + ordinalParse : /\d{1,2}వ/, + ordinal : '%dవ', + meridiemParse: /రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/, + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if (meridiem === 'రాత్రి') { + return hour < 4 ? hour : hour + 12; + } else if (meridiem === 'ఉదయం') { + return hour; + } else if (meridiem === 'మధ్యాహ్నం') { + return hour >= 10 ? hour : hour + 12; + } else if (meridiem === 'సాయంత్రం') { + return hour + 12; + } + }, + meridiem : function (hour, minute, isLower) { + if (hour < 4) { + return 'రాత్రి'; + } else if (hour < 10) { + return 'ఉదయం'; + } else if (hour < 17) { + return 'మధ్యాహ్నం'; + } else if (hour < 20) { + return 'సాయంత్రం'; + } else { + return 'రాత్రి'; + } + }, + week : { + dow : 0, // Sunday is the first day of the week. + doy : 6 // The week that contains Jan 1st is the first week of the year. + } + }); + //! moment.js locale configuration //! locale : thai (th) //! author : Kridsada Thanabulpong : https://github.com/sirn @@ -6085,6 +6743,114 @@ } }); + //! moment.js locale configuration + //! locale : Klingon (tlh) + //! author : Dominika Kruk : https://github.com/amaranthrose + + var numbersNouns = 'pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut'.split('_'); + + function translateFuture(output) { + var time = output; + time = (output.indexOf('jaj') !== -1) ? + time.slice(0, -3) + 'leS' : + (output.indexOf('jar') !== -1) ? + time.slice(0, -3) + 'waQ' : + (output.indexOf('DIS') !== -1) ? + time.slice(0, -3) + 'nem' : + time + ' pIq'; + return time; + } + + function translatePast(output) { + var time = output; + time = (output.indexOf('jaj') !== -1) ? + time.slice(0, -3) + 'Hu’' : + (output.indexOf('jar') !== -1) ? + time.slice(0, -3) + 'wen' : + (output.indexOf('DIS') !== -1) ? + time.slice(0, -3) + 'ben' : + time + ' ret'; + return time; + } + + function tlh__translate(number, withoutSuffix, string, isFuture) { + var numberNoun = numberAsNoun(number); + switch (string) { + case 'mm': + return numberNoun + ' tup'; + case 'hh': + return numberNoun + ' rep'; + case 'dd': + return numberNoun + ' jaj'; + case 'MM': + return numberNoun + ' jar'; + case 'yy': + return numberNoun + ' DIS'; + } + } + + function numberAsNoun(number) { + var hundred = Math.floor((number % 1000) / 100), + ten = Math.floor((number % 100) / 10), + one = number % 10, + word = ''; + if (hundred > 0) { + word += numbersNouns[hundred] + 'vatlh'; + } + if (ten > 0) { + word += ((word !== '') ? ' ' : '') + numbersNouns[ten] + 'maH'; + } + if (one > 0) { + word += ((word !== '') ? ' ' : '') + numbersNouns[one]; + } + return (word === '') ? 'pagh' : word; + } + + var tlh = moment.defineLocale('tlh', { + months : 'tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’'.split('_'), + monthsShort : 'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split('_'), + weekdays : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'), + weekdaysShort : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'), + weekdaysMin : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd, D MMMM YYYY HH:mm' + }, + calendar : { + sameDay: '[DaHjaj] LT', + nextDay: '[wa’leS] LT', + nextWeek: 'LLL', + lastDay: '[wa’Hu’] LT', + lastWeek: 'LLL', + sameElse: 'L' + }, + relativeTime : { + future : translateFuture, + past : translatePast, + s : 'puS lup', + m : 'wa’ tup', + mm : tlh__translate, + h : 'wa’ rep', + hh : tlh__translate, + d : 'wa’ jaj', + dd : tlh__translate, + M : 'wa’ jar', + MM : tlh__translate, + y : 'wa’ DIS', + yy : tlh__translate + }, + ordinalParse: /\d{1,2}\./, + ordinal : '%d.', + week : { + dow : 1, // Monday is the first day of the week. + doy : 4 // The week that contains Jan 4th is the first week of the year. + } + }); + //! moment.js locale configuration //! locale : turkish (tr) //! authors : Erhan Gundogan : https://github.com/erhangundogan, @@ -6169,6 +6935,8 @@ //! author : Robin van der Vliet : https://github.com/robin0van0der0v with the help of Iustì Canun + // After the year there should be a slash and the amount of years since December 26, 1979 in Roman numerals. + // This is currently too difficult (maybe even impossible) to add. var tzl = moment.defineLocale('tzl', { months : 'Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar'.split('_'), monthsShort : 'Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec'.split('_'), @@ -6177,11 +6945,11 @@ weekdaysMin : 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'), longDateFormat : { LT : 'HH.mm', - LTS : 'LT.ss', + LTS : 'HH.mm.ss', L : 'DD.MM.YYYY', LL : 'D. MMMM [dallas] YYYY', - LLL : 'D. MMMM [dallas] YYYY LT', - LLLL : 'dddd, [li] D. MMMM [dallas] YYYY LT' + LLL : 'D. MMMM [dallas] YYYY HH.mm', + LLLL : 'dddd, [li] D. MMMM [dallas] YYYY HH.mm' }, meridiem : function (hours, minutes, isLower) { if (hours > 11) { @@ -6225,17 +6993,17 @@ var format = { 's': ['viensas secunds', '\'iensas secunds'], 'm': ['\'n míut', '\'iens míut'], - 'mm': [number + ' míuts', ' ' + number + ' míuts'], + 'mm': [number + ' míuts', '' + number + ' míuts'], 'h': ['\'n þora', '\'iensa þora'], - 'hh': [number + ' þoras', ' ' + number + ' þoras'], + 'hh': [number + ' þoras', '' + number + ' þoras'], 'd': ['\'n ziua', '\'iensa ziua'], - 'dd': [number + ' ziuas', ' ' + number + ' ziuas'], + 'dd': [number + ' ziuas', '' + number + ' ziuas'], 'M': ['\'n mes', '\'iens mes'], - 'MM': [number + ' mesen', ' ' + number + ' mesen'], + 'MM': [number + ' mesen', '' + number + ' mesen'], 'y': ['\'n ar', '\'iens ar'], - 'yy': [number + ' ars', ' ' + number + ' ars'] + 'yy': [number + ' ars', '' + number + ' ars'] }; - return isFuture ? format[key][0] : (withoutSuffix ? format[key][0] : format[key][1].trim()); + return isFuture ? format[key][0] : (withoutSuffix ? format[key][0] : format[key][1]); } //! moment.js locale configuration @@ -6343,8 +7111,8 @@ } function uk__relativeTimeWithPlural(number, withoutSuffix, key) { var format = { - 'mm': 'хвилина_хвилини_хвилин', - 'hh': 'година_години_годин', + 'mm': withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин', + 'hh': withoutSuffix ? 'година_години_годин' : 'годину_години_годин', 'dd': 'день_дні_днів', 'MM': 'місяць_місяці_місяців', 'yy': 'рік_роки_років' @@ -6359,17 +7127,7 @@ return number + ' ' + uk__plural(format[key], +number); } } - function uk__monthsCaseReplace(m, format) { - var months = { - 'nominative': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_'), - 'accusative': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_') - }, - nounCase = (/D[oD]? *MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return months[nounCase][m.month()]; - } - function uk__weekdaysCaseReplace(m, format) { + function weekdaysCaseReplace(m, format) { var weekdays = { 'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'), 'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'), @@ -6389,9 +7147,12 @@ } var uk = moment.defineLocale('uk', { - months : uk__monthsCaseReplace, + months : { + 'format': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_'), + 'standalone': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_') + }, monthsShort : 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'), - weekdays : uk__weekdaysCaseReplace, + weekdays : weekdaysCaseReplace, weekdaysShort : 'нд_пн_вт_ср_чт_пт_сб'.split('_'), weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'), longDateFormat : { @@ -6479,7 +7240,7 @@ //! author : Sardor Muminov : https://github.com/muminoff var uz = moment.defineLocale('uz', { - months : 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'), + months : 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split('_'), monthsShort : 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'), weekdays : 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'), weekdaysShort : 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'), @@ -6782,6 +7543,6 @@ } }); - + moment.locale('en'); })); \ No newline at end of file diff --git a/bower_components/moment/min/locales.min.js b/bower_components/moment/min/locales.min.js index c758a07..3ccc1e3 100644 --- a/bower_components/moment/min/locales.min.js +++ b/bower_components/moment/min/locales.min.js @@ -1,78 +1,72 @@ -!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?b(require("../moment")):"function"==typeof define&&define.amd?define(["moment"],b):b(a.moment)}(this,function(a){"use strict"; +!function(a,b){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?b(require("../moment")):"function"==typeof define&&define.amd?define(["moment"],b):b(a.moment)}(this,function(a){"use strict"; //! moment.js locale configuration //! locale : belarusian (be) //! author : Dmitry Demidov : https://github.com/demidov91 //! author: Praleska: http://praleska.pro/ //! Author : Menelion Elensúle : https://github.com/Oire -function b(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function c(a,c,d){var e={mm:c?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:c?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"};return"m"===d?c?"хвіліна":"хвіліну":"h"===d?c?"гадзіна":"гадзіну":a+" "+b(e[d],+a)}function d(a,b){var c={nominative:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_"),accusative:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_")},d=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function e(a,b){var c={nominative:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),accusative:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_")},d=/\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/.test(b)?"accusative":"nominative";return c[d][a.day()]} +function b(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function c(a,c,d){var e={mm:c?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:c?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"};return"m"===d?c?"хвіліна":"хвіліну":"h"===d?c?"гадзіна":"гадзіну":a+" "+b(e[d],+a)} //! moment.js locale configuration //! locale : breton (br) //! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou -function f(a,b,c){var d={mm:"munutenn",MM:"miz",dd:"devezh"};return a+" "+i(d[c],a)}function g(a){switch(h(a)){case 1:case 3:case 4:case 5:case 9:return a+" bloaz";default:return a+" vloaz"}}function h(a){return a>9?h(a%10):a}function i(a,b){return 2===b?j(a):a}function j(a){var b={m:"v",b:"v",d:"z"};return void 0===b[a.charAt(0)]?a:b[a.charAt(0)]+a.substring(1)} +function d(a,b,c){var d={mm:"munutenn",MM:"miz",dd:"devezh"};return a+" "+g(d[c],a)}function e(a){switch(f(a)){case 1:case 3:case 4:case 5:case 9:return a+" bloaz";default:return a+" vloaz"}}function f(a){return a>9?f(a%10):a}function g(a,b){return 2===b?h(a):a}function h(a){var b={m:"v",b:"v",d:"z"};return void 0===b[a.charAt(0)]?a:b[a.charAt(0)]+a.substring(1)} //! moment.js locale configuration //! locale : bosnian (bs) //! author : Nedim Cholich : https://github.com/frontyard //! based on (hr) translation by Bojan Marković -function k(a,b,c){var d=a+" ";switch(c){case"m":return b?"jedna minuta":"jedne minute";case"mm":return d+=1===a?"minuta":2===a||3===a||4===a?"minute":"minuta";case"h":return b?"jedan sat":"jednog sata";case"hh":return d+=1===a?"sat":2===a||3===a||4===a?"sata":"sati";case"dd":return d+=1===a?"dan":"dana";case"MM":return d+=1===a?"mjesec":2===a||3===a||4===a?"mjeseca":"mjeseci";case"yy":return d+=1===a?"godina":2===a||3===a||4===a?"godine":"godina"}}function l(a){return a>1&&5>a&&1!==~~(a/10)}function m(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"pár sekund":"pár sekundami";case"m":return b?"minuta":d?"minutu":"minutou";case"mm":return b||d?e+(l(a)?"minuty":"minut"):e+"minutami";break;case"h":return b?"hodina":d?"hodinu":"hodinou";case"hh":return b||d?e+(l(a)?"hodiny":"hodin"):e+"hodinami";break;case"d":return b||d?"den":"dnem";case"dd":return b||d?e+(l(a)?"dny":"dní"):e+"dny";break;case"M":return b||d?"měsíc":"měsícem";case"MM":return b||d?e+(l(a)?"měsíce":"měsíců"):e+"měsíci";break;case"y":return b||d?"rok":"rokem";case"yy":return b||d?e+(l(a)?"roky":"let"):e+"lety"}} +function i(a,b,c){var d=a+" ";switch(c){case"m":return b?"jedna minuta":"jedne minute";case"mm":return d+=1===a?"minuta":2===a||3===a||4===a?"minute":"minuta";case"h":return b?"jedan sat":"jednog sata";case"hh":return d+=1===a?"sat":2===a||3===a||4===a?"sata":"sati";case"dd":return d+=1===a?"dan":"dana";case"MM":return d+=1===a?"mjesec":2===a||3===a||4===a?"mjeseca":"mjeseci";case"yy":return d+=1===a?"godina":2===a||3===a||4===a?"godine":"godina"}}function j(a){return a>1&&5>a&&1!==~~(a/10)}function k(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"pár sekund":"pár sekundami";case"m":return b?"minuta":d?"minutu":"minutou";case"mm":return b||d?e+(j(a)?"minuty":"minut"):e+"minutami";break;case"h":return b?"hodina":d?"hodinu":"hodinou";case"hh":return b||d?e+(j(a)?"hodiny":"hodin"):e+"hodinami";break;case"d":return b||d?"den":"dnem";case"dd":return b||d?e+(j(a)?"dny":"dní"):e+"dny";break;case"M":return b||d?"měsíc":"měsícem";case"MM":return b||d?e+(j(a)?"měsíce":"měsíců"):e+"měsíci";break;case"y":return b||d?"rok":"rokem";case"yy":return b||d?e+(j(a)?"roky":"let"):e+"lety"}} //! moment.js locale configuration //! locale : austrian german (de-at) //! author : lluchs : https://github.com/lluchs //! author: Menelion Elensúle: https://github.com/Oire //! author : Martin Groller : https://github.com/MadMG -function n(a,b,c,d){var e={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[a+" Tage",a+" Tagen"],M:["ein Monat","einem Monat"],MM:[a+" Monate",a+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[a+" Jahre",a+" Jahren"]};return b?e[c][0]:e[c][1]} +//! author : Mikolaj Dadela : https://github.com/mik01aj +function l(a,b,c,d){var e={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[a+" Tage",a+" Tagen"],M:["ein Monat","einem Monat"],MM:[a+" Monate",a+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[a+" Jahre",a+" Jahren"]};return b?e[c][0]:e[c][1]} //! moment.js locale configuration //! locale : german (de) //! author : lluchs : https://github.com/lluchs //! author: Menelion Elensúle: https://github.com/Oire -function o(a,b,c,d){var e={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[a+" Tage",a+" Tagen"],M:["ein Monat","einem Monat"],MM:[a+" Monate",a+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[a+" Jahre",a+" Jahren"]};return b?e[c][0]:e[c][1]} +//! author : Mikolaj Dadela : https://github.com/mik01aj +function m(a,b,c,d){var e={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[a+" Tage",a+" Tagen"],M:["ein Monat","einem Monat"],MM:[a+" Monate",a+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[a+" Jahre",a+" Jahren"]};return b?e[c][0]:e[c][1]}function n(a){return a instanceof Function||"[object Function]"===Object.prototype.toString.call(a)} //! moment.js locale configuration //! locale : estonian (et) //! author : Henry Kehlmann : https://github.com/madhenry //! improvements : Illimar Tambek : https://github.com/ragulka -function p(a,b,c,d){var e={s:["mõne sekundi","mõni sekund","paar sekundit"],m:["ühe minuti","üks minut"],mm:[a+" minuti",a+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[a+" tunni",a+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[a+" kuu",a+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[a+" aasta",a+" aastat"]};return b?e[c][2]?e[c][2]:e[c][1]:d?e[c][0]:e[c][1]}function q(a,b,c,d){var e="";switch(c){case"s":return d?"muutaman sekunnin":"muutama sekunti";case"m":return d?"minuutin":"minuutti";case"mm":e=d?"minuutin":"minuuttia";break;case"h":return d?"tunnin":"tunti";case"hh":e=d?"tunnin":"tuntia";break;case"d":return d?"päivän":"päivä";case"dd":e=d?"päivän":"päivää";break;case"M":return d?"kuukauden":"kuukausi";case"MM":e=d?"kuukauden":"kuukautta";break;case"y":return d?"vuoden":"vuosi";case"yy":e=d?"vuoden":"vuotta"}return e=r(a,d)+" "+e}function r(a,b){return 10>a?b?Aa[a]:za[a]:a} +function o(a,b,c,d){var e={s:["mõne sekundi","mõni sekund","paar sekundit"],m:["ühe minuti","üks minut"],mm:[a+" minuti",a+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[a+" tunni",a+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[a+" kuu",a+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[a+" aasta",a+" aastat"]};return b?e[c][2]?e[c][2]:e[c][1]:d?e[c][0]:e[c][1]}function p(a,b,c,d){var e="";switch(c){case"s":return d?"muutaman sekunnin":"muutama sekunti";case"m":return d?"minuutin":"minuutti";case"mm":e=d?"minuutin":"minuuttia";break;case"h":return d?"tunnin":"tunti";case"hh":e=d?"tunnin":"tuntia";break;case"d":return d?"päivän":"päivä";case"dd":e=d?"päivän":"päivää";break;case"M":return d?"kuukauden":"kuukausi";case"MM":e=d?"kuukauden":"kuukautta";break;case"y":return d?"vuoden":"vuosi";case"yy":e=d?"vuoden":"vuotta"}return e=q(a,d)+" "+e}function q(a,b){return 10>a?b?va[a]:ua[a]:a} //! moment.js locale configuration //! locale : hrvatski (hr) //! author : Bojan Marković : https://github.com/bmarkovic -function s(a,b,c){var d=a+" ";switch(c){case"m":return b?"jedna minuta":"jedne minute";case"mm":return d+=1===a?"minuta":2===a||3===a||4===a?"minute":"minuta";case"h":return b?"jedan sat":"jednog sata";case"hh":return d+=1===a?"sat":2===a||3===a||4===a?"sata":"sati";case"dd":return d+=1===a?"dan":"dana";case"MM":return d+=1===a?"mjesec":2===a||3===a||4===a?"mjeseca":"mjeseci";case"yy":return d+=1===a?"godina":2===a||3===a||4===a?"godine":"godina"}}function t(a,b,c,d){var e=a;switch(c){case"s":return d||b?"néhány másodperc":"néhány másodperce";case"m":return"egy"+(d||b?" perc":" perce");case"mm":return e+(d||b?" perc":" perce");case"h":return"egy"+(d||b?" óra":" órája");case"hh":return e+(d||b?" óra":" órája");case"d":return"egy"+(d||b?" nap":" napja");case"dd":return e+(d||b?" nap":" napja");case"M":return"egy"+(d||b?" hónap":" hónapja");case"MM":return e+(d||b?" hónap":" hónapja");case"y":return"egy"+(d||b?" év":" éve");case"yy":return e+(d||b?" év":" éve")}return""}function u(a){return(a?"":"[múlt] ")+"["+Fa[this.day()]+"] LT[-kor]"} -//! moment.js locale configuration -//! locale : Armenian (hy-am) -//! author : Armendarabyan : https://github.com/armendarabyan -function v(a,b){var c={nominative:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_"),accusative:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_")},d=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function w(a,b){var c="հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_");return c[a.month()]}function x(a,b){var c="կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_");return c[a.day()]} +function r(a,b,c){var d=a+" ";switch(c){case"m":return b?"jedna minuta":"jedne minute";case"mm":return d+=1===a?"minuta":2===a||3===a||4===a?"minute":"minuta";case"h":return b?"jedan sat":"jednog sata";case"hh":return d+=1===a?"sat":2===a||3===a||4===a?"sata":"sati";case"dd":return d+=1===a?"dan":"dana";case"MM":return d+=1===a?"mjesec":2===a||3===a||4===a?"mjeseca":"mjeseci";case"yy":return d+=1===a?"godina":2===a||3===a||4===a?"godine":"godina"}}function s(a,b,c,d){var e=a;switch(c){case"s":return d||b?"néhány másodperc":"néhány másodperce";case"m":return"egy"+(d||b?" perc":" perce");case"mm":return e+(d||b?" perc":" perce");case"h":return"egy"+(d||b?" óra":" órája");case"hh":return e+(d||b?" óra":" órája");case"d":return"egy"+(d||b?" nap":" napja");case"dd":return e+(d||b?" nap":" napja");case"M":return"egy"+(d||b?" hónap":" hónapja");case"MM":return e+(d||b?" hónap":" hónapja");case"y":return"egy"+(d||b?" év":" éve");case"yy":return e+(d||b?" év":" éve")}return""}function t(a){return(a?"":"[múlt] ")+"["+Fa[this.day()]+"] LT[-kor]"} //! moment.js locale configuration //! locale : icelandic (is) //! author : Hinrik Örn Sigurðsson : https://github.com/hinrik -function y(a){return a%100===11?!0:a%10===1?!1:!0}function z(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"nokkrar sekúndur":"nokkrum sekúndum";case"m":return b?"mínúta":"mínútu";case"mm":return y(a)?e+(b||d?"mínútur":"mínútum"):b?e+"mínúta":e+"mínútu";case"hh":return y(a)?e+(b||d?"klukkustundir":"klukkustundum"):e+"klukkustund";case"d":return b?"dagur":d?"dag":"degi";case"dd":return y(a)?b?e+"dagar":e+(d?"daga":"dögum"):b?e+"dagur":e+(d?"dag":"degi");case"M":return b?"mánuður":d?"mánuð":"mánuði";case"MM":return y(a)?b?e+"mánuðir":e+(d?"mánuði":"mánuðum"):b?e+"mánuður":e+(d?"mánuð":"mánuði");case"y":return b||d?"ár":"ári";case"yy":return y(a)?e+(b||d?"ár":"árum"):e+(b||d?"ár":"ári")}} -//! moment.js locale configuration -//! locale : Georgian (ka) -//! author : Irakli Janiashvili : https://github.com/irakli-janiashvili -function A(a,b){var c={nominative:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),accusative:"იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს".split("_")},d=/D[oD] *MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function B(a,b){var c={nominative:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),accusative:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_")},d=/(წინა|შემდეგ)/.test(b)?"accusative":"nominative";return c[d][a.day()]} +function u(a){return a%100===11?!0:a%10===1?!1:!0}function v(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"nokkrar sekúndur":"nokkrum sekúndum";case"m":return b?"mínúta":"mínútu";case"mm":return u(a)?e+(b||d?"mínútur":"mínútum"):b?e+"mínúta":e+"mínútu";case"hh":return u(a)?e+(b||d?"klukkustundir":"klukkustundum"):e+"klukkustund";case"d":return b?"dagur":d?"dag":"degi";case"dd":return u(a)?b?e+"dagar":e+(d?"daga":"dögum"):b?e+"dagur":e+(d?"dag":"degi");case"M":return b?"mánuður":d?"mánuð":"mánuði";case"MM":return u(a)?b?e+"mánuðir":e+(d?"mánuði":"mánuðum"):b?e+"mánuður":e+(d?"mánuð":"mánuði");case"y":return b||d?"ár":"ári";case"yy":return u(a)?e+(b||d?"ár":"árum"):e+(b||d?"ár":"ári")}} //! moment.js locale configuration //! locale : Luxembourgish (lb) //! author : mweimerskirch : https://github.com/mweimerskirch, David Raison : https://github.com/kwisatz -function C(a,b,c,d){var e={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return b?e[c][0]:e[c][1]}function D(a){var b=a.substr(0,a.indexOf(" "));return F(b)?"a "+a:"an "+a}function E(a){var b=a.substr(0,a.indexOf(" "));return F(b)?"viru "+a:"virun "+a}function F(a){if(a=parseInt(a,10),isNaN(a))return!1;if(0>a)return!0;if(10>a)return a>=4&&7>=a?!0:!1;if(100>a){var b=a%10,c=a/10;return F(0===b?c:b)}if(1e4>a){for(;a>=10;)a/=10;return F(a)}return a/=1e3,F(a)}function G(a,b,c,d){return b?"kelios sekundės":d?"kelių sekundžių":"kelias sekundes"}function H(a,b){var c={nominative:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),accusative:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_")},d=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function I(a,b,c,d){return b?K(c)[0]:d?K(c)[1]:K(c)[2]}function J(a){return a%10===0||a>10&&20>a}function K(a){return Ga[a].split("_")}function L(a,b,c,d){var e=a+" ";return 1===a?e+I(a,b,c[0],d):b?e+(J(a)?K(c)[1]:K(c)[0]):d?e+K(c)[1]:e+(J(a)?K(c)[1]:K(c)[2])}function M(a,b){var c=-1===b.indexOf("dddd HH:mm"),d=Ha[a.day()];return c?d:d.substring(0,d.length-2)+"į"}function N(a,b,c){return c?b%10===1&&11!==b?a[2]:a[3]:b%10===1&&11!==b?a[0]:a[1]}function O(a,b,c){return a+" "+N(Ia[c],a,b)}function P(a,b,c){return N(Ia[c],a,b)}function Q(a,b){return b?"dažas sekundes":"dažām sekundēm"}function R(a){return 5>a%10&&a%10>1&&~~(a/10)%10!==1}function S(a,b,c){var d=a+" ";switch(c){case"m":return b?"minuta":"minutę";case"mm":return d+(R(a)?"minuty":"minut");case"h":return b?"godzina":"godzinę";case"hh":return d+(R(a)?"godziny":"godzin");case"MM":return d+(R(a)?"miesiące":"miesięcy");case"yy":return d+(R(a)?"lata":"lat")}} +function w(a,b,c,d){var e={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return b?e[c][0]:e[c][1]}function x(a){var b=a.substr(0,a.indexOf(" "));return z(b)?"a "+a:"an "+a}function y(a){var b=a.substr(0,a.indexOf(" "));return z(b)?"viru "+a:"virun "+a}function z(a){if(a=parseInt(a,10),isNaN(a))return!1;if(0>a)return!0;if(10>a)return a>=4&&7>=a?!0:!1;if(100>a){var b=a%10,c=a/10;return z(0===b?c:b)}if(1e4>a){for(;a>=10;)a/=10;return z(a)}return a/=1e3,z(a)}function A(a,b,c,d){return b?"kelios sekundės":d?"kelių sekundžių":"kelias sekundes"}function B(a,b,c,d){return b?D(c)[0]:d?D(c)[1]:D(c)[2]}function C(a){return a%10===0||a>10&&20>a}function D(a){return Ha[a].split("_")}function E(a,b,c,d){var e=a+" ";return 1===a?e+B(a,b,c[0],d):b?e+(C(a)?D(c)[1]:D(c)[0]):d?e+D(c)[1]:e+(C(a)?D(c)[1]:D(c)[2])}function F(a,b,c){return c?b%10===1&&11!==b?a[2]:a[3]:b%10===1&&11!==b?a[0]:a[1]}function G(a,b,c){return a+" "+F(Ia[c],a,b)}function H(a,b,c){return F(Ia[c],a,b)}function I(a,b){return b?"dažas sekundes":"dažām sekundēm"}function J(a,b,c,d){var e="";if(b)switch(c){case"s":e="काही सेकंद";break;case"m":e="एक मिनिट";break;case"mm":e="%d मिनिटे";break;case"h":e="एक तास";break;case"hh":e="%d तास";break;case"d":e="एक दिवस";break;case"dd":e="%d दिवस";break;case"M":e="एक महिना";break;case"MM":e="%d महिने";break;case"y":e="एक वर्ष";break;case"yy":e="%d वर्षे"}else switch(c){case"s":e="काही सेकंदां";break;case"m":e="एका मिनिटा";break;case"mm":e="%d मिनिटां";break;case"h":e="एका तासा";break;case"hh":e="%d तासां";break;case"d":e="एका दिवसा";break;case"dd":e="%d दिवसां";break;case"M":e="एका महिन्या";break;case"MM":e="%d महिन्यां";break;case"y":e="एका वर्षा";break;case"yy":e="%d वर्षां"}return e.replace(/%d/i,a)}function K(a){return 5>a%10&&a%10>1&&~~(a/10)%10!==1}function L(a,b,c){var d=a+" ";switch(c){case"m":return b?"minuta":"minutę";case"mm":return d+(K(a)?"minuty":"minut");case"h":return b?"godzina":"godzinę";case"hh":return d+(K(a)?"godziny":"godzin");case"MM":return d+(K(a)?"miesiące":"miesięcy");case"yy":return d+(K(a)?"lata":"lat")}} //! moment.js locale configuration //! locale : romanian (ro) //! author : Vlad Gurdiga : https://github.com/gurdiga //! author : Valentin Agachi : https://github.com/avaly -function T(a,b,c){var d={mm:"minute",hh:"ore",dd:"zile",MM:"luni",yy:"ani"},e=" ";return(a%100>=20||a>=100&&a%100===0)&&(e=" de "),a+e+d[c]} +function M(a,b,c){var d={mm:"minute",hh:"ore",dd:"zile",MM:"luni",yy:"ani"},e=" ";return(a%100>=20||a>=100&&a%100===0)&&(e=" de "),a+e+d[c]} //! moment.js locale configuration //! locale : russian (ru) //! author : Viktorminator : https://github.com/Viktorminator //! Author : Menelion Elensúle : https://github.com/Oire -function U(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function V(a,b,c){var d={mm:b?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"};return"m"===c?b?"минута":"минуту":a+" "+U(d[c],+a)}function W(a,b){var c={nominative:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),accusative:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_")},d=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function X(a,b){var c={nominative:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),accusative:"янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек".split("_")},d=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function Y(a,b){var c={nominative:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),accusative:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_")},d=/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/.test(b)?"accusative":"nominative";return c[d][a.day()]}function Z(a){return a>1&&5>a}function $(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"pár sekúnd":"pár sekundami";case"m":return b?"minúta":d?"minútu":"minútou";case"mm":return b||d?e+(Z(a)?"minúty":"minút"):e+"minútami";break;case"h":return b?"hodina":d?"hodinu":"hodinou";case"hh":return b||d?e+(Z(a)?"hodiny":"hodín"):e+"hodinami";break;case"d":return b||d?"deň":"dňom";case"dd":return b||d?e+(Z(a)?"dni":"dní"):e+"dňami";break;case"M":return b||d?"mesiac":"mesiacom";case"MM":return b||d?e+(Z(a)?"mesiace":"mesiacov"):e+"mesiacmi";break;case"y":return b||d?"rok":"rokom";case"yy":return b||d?e+(Z(a)?"roky":"rokov"):e+"rokmi"}} +function N(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function O(a,b,c){var d={mm:b?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"};return"m"===c?b?"минута":"минуту":a+" "+N(d[c],+a)}function P(a){return a>1&&5>a}function Q(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"pár sekúnd":"pár sekundami";case"m":return b?"minúta":d?"minútu":"minútou";case"mm":return b||d?e+(P(a)?"minúty":"minút"):e+"minútami";break;case"h":return b?"hodina":d?"hodinu":"hodinou";case"hh":return b||d?e+(P(a)?"hodiny":"hodín"):e+"hodinami";break;case"d":return b||d?"deň":"dňom";case"dd":return b||d?e+(P(a)?"dni":"dní"):e+"dňami";break;case"M":return b||d?"mesiac":"mesiacom";case"MM":return b||d?e+(P(a)?"mesiace":"mesiacov"):e+"mesiacmi";break;case"y":return b||d?"rok":"rokom";case"yy":return b||d?e+(P(a)?"roky":"rokov"):e+"rokmi"}} //! moment.js locale configuration //! locale : slovenian (sl) //! author : Robert Sedovšek : https://github.com/sedovsek -function _(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"nekaj sekund":"nekaj sekundami";case"m":return b?"ena minuta":"eno minuto";case"mm":return e+=1===a?b?"minuta":"minuto":2===a?b||d?"minuti":"minutama":5>a?b||d?"minute":"minutami":b||d?"minut":"minutami";case"h":return b?"ena ura":"eno uro";case"hh":return e+=1===a?b?"ura":"uro":2===a?b||d?"uri":"urama":5>a?b||d?"ure":"urami":b||d?"ur":"urami";case"d":return b||d?"en dan":"enim dnem";case"dd":return e+=1===a?b||d?"dan":"dnem":2===a?b||d?"dni":"dnevoma":b||d?"dni":"dnevi";case"M":return b||d?"en mesec":"enim mesecem";case"MM":return e+=1===a?b||d?"mesec":"mesecem":2===a?b||d?"meseca":"mesecema":5>a?b||d?"mesece":"meseci":b||d?"mesecev":"meseci";case"y":return b||d?"eno leto":"enim letom";case"yy":return e+=1===a?b||d?"leto":"letom":2===a?b||d?"leti":"letoma":5>a?b||d?"leta":"leti":b||d?"let":"leti"}}function aa(a,b,c,d){var e={s:["viensas secunds","'iensas secunds"],m:["'n míut","'iens míut"],mm:[a+" míuts"," "+a+" míuts"],h:["'n þora","'iensa þora"],hh:[a+" þoras"," "+a+" þoras"],d:["'n ziua","'iensa ziua"],dd:[a+" ziuas"," "+a+" ziuas"],M:["'n mes","'iens mes"],MM:[a+" mesen"," "+a+" mesen"],y:["'n ar","'iens ar"],yy:[a+" ars"," "+a+" ars"]};return d?e[c][0]:b?e[c][0]:e[c][1].trim()} +function R(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"nekaj sekund":"nekaj sekundami";case"m":return b?"ena minuta":"eno minuto";case"mm":return e+=1===a?b?"minuta":"minuto":2===a?b||d?"minuti":"minutama":5>a?b||d?"minute":"minutami":b||d?"minut":"minutami";case"h":return b?"ena ura":"eno uro";case"hh":return e+=1===a?b?"ura":"uro":2===a?b||d?"uri":"urama":5>a?b||d?"ure":"urami":b||d?"ur":"urami";case"d":return b||d?"en dan":"enim dnem";case"dd":return e+=1===a?b||d?"dan":"dnem":2===a?b||d?"dni":"dnevoma":b||d?"dni":"dnevi";case"M":return b||d?"en mesec":"enim mesecem";case"MM":return e+=1===a?b||d?"mesec":"mesecem":2===a?b||d?"meseca":"mesecema":5>a?b||d?"mesece":"meseci":b||d?"mesecev":"meseci";case"y":return b||d?"eno leto":"enim letom";case"yy":return e+=1===a?b||d?"leto":"letom":2===a?b||d?"leti":"letoma":5>a?b||d?"leta":"leti":b||d?"let":"leti"}}function S(a){var b=a;return b=-1!==a.indexOf("jaj")?b.slice(0,-3)+"leS":-1!==a.indexOf("jar")?b.slice(0,-3)+"waQ":-1!==a.indexOf("DIS")?b.slice(0,-3)+"nem":b+" pIq"}function T(a){var b=a;return b=-1!==a.indexOf("jaj")?b.slice(0,-3)+"Hu’":-1!==a.indexOf("jar")?b.slice(0,-3)+"wen":-1!==a.indexOf("DIS")?b.slice(0,-3)+"ben":b+" ret"}function U(a,b,c,d){var e=V(a);switch(c){case"mm":return e+" tup";case"hh":return e+" rep";case"dd":return e+" jaj";case"MM":return e+" jar";case"yy":return e+" DIS"}}function V(a){var b=Math.floor(a%1e3/100),c=Math.floor(a%100/10),d=a%10,e="";return b>0&&(e+=_a[b]+"vatlh"),c>0&&(e+=(""!==e?" ":"")+_a[c]+"maH"),d>0&&(e+=(""!==e?" ":"")+_a[d]),""===e?"pagh":e}function W(a,b,c,d){var e={s:["viensas secunds","'iensas secunds"],m:["'n míut","'iens míut"],mm:[a+" míuts",""+a+" míuts"],h:["'n þora","'iensa þora"],hh:[a+" þoras",""+a+" þoras"],d:["'n ziua","'iensa ziua"],dd:[a+" ziuas",""+a+" ziuas"],M:["'n mes","'iens mes"],MM:[a+" mesen",""+a+" mesen"],y:["'n ar","'iens ar"],yy:[a+" ars",""+a+" ars"]};return d?e[c][0]:b?e[c][0]:e[c][1]} //! moment.js locale configuration //! locale : ukrainian (uk) //! author : zemlanin : https://github.com/zemlanin //! Author : Menelion Elensúle : https://github.com/Oire -function ba(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function ca(a,b,c){var d={mm:"хвилина_хвилини_хвилин",hh:"година_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"};return"m"===c?b?"хвилина":"хвилину":"h"===c?b?"година":"годину":a+" "+ba(d[c],+a)}function da(a,b){var c={nominative:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_"),accusative:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_")},d=/D[oD]? *MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function ea(a,b){var c={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")},d=/(\[[ВвУу]\]) ?dddd/.test(b)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(b)?"genitive":"nominative";return c[d][a.day()]}function fa(a){return function(){return a+"о"+(11===this.hours()?"б":"")+"] LT"}} +function X(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function Y(a,b,c){var d={mm:b?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:b?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"};return"m"===c?b?"хвилина":"хвилину":"h"===c?b?"година":"годину":a+" "+X(d[c],+a)}function Z(a,b){var c={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")},d=/(\[[ВвУу]\]) ?dddd/.test(b)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(b)?"genitive":"nominative";return c[d][a.day()]}function $(a){return function(){return a+"о"+(11===this.hours()?"б":"")+"] LT"}} //! moment.js locale configuration //! locale : afrikaans (af) //! author : Werner Mollentze : https://github.com/wernerm -var ga=(a.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(a){return/^nm$/i.test(a)},meridiem:function(a,b,c){return 12>a?c?"vm":"VM":c?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[Môre om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),a.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:6,doy:12}}),{1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"}),ha={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},ia=(a.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(a){return"م"===a},meridiem:function(a,b,c){return 12>a?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(a){return a.replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(a){return ha[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return ga[a]}).replace(/,/g,"،")},week:{dow:6,doy:12}}),a.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}}),{1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"}),ja={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},ka=function(a){return 0===a?0:1===a?1:2===a?2:a%100>=3&&10>=a%100?3:a%100>=11?4:5},la={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},ma=function(a){return function(b,c,d,e){var f=ka(b),g=la[a][ka(b)];return 2===f&&(g=g[c?0:1]),g.replace(/%d/i,b)}},na=["كانون الثاني يناير","شباط فبراير","آذار مارس","نيسان أبريل","أيار مايو","حزيران يونيو","تموز يوليو","آب أغسطس","أيلول سبتمبر","تشرين الأول أكتوبر","تشرين الثاني نوفمبر","كانون الأول ديسمبر"],oa=(a.defineLocale("ar",{months:na,monthsShort:na,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(a){return"م"===a},meridiem:function(a,b,c){return 12>a?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:ma("s"),m:ma("m"),mm:ma("m"),h:ma("h"),hh:ma("h"),d:ma("d"),dd:ma("d"),M:ma("M"),MM:ma("M"),y:ma("y"),yy:ma("y")},preparse:function(a){return a.replace(/\u200f/g,"").replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(a){return ja[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return ia[a]}).replace(/,/g,"،")},week:{dow:6,doy:12}}),{1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"}),pa=(a.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"birneçə saniyyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(a){return/^(gündüz|axşam)$/.test(a)},meridiem:function(a,b,c){return 4>a?"gecə":12>a?"səhər":17>a?"gündüz":"axşam"},ordinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(a){if(0===a)return a+"-ıncı";var b=a%10,c=a%100-b,d=a>=100?100:null;return a+(oa[b]||oa[c]||oa[d])},week:{dow:1,doy:7}}),a.defineLocale("be",{months:d,monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:e,weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:c,mm:c,h:c,hh:c,d:"дзень",dd:c,M:"месяц",MM:c,y:"год",yy:c},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(a){return/^(дня|вечара)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночы":12>a?"раніцы":17>a?"дня":"вечара"},ordinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":case"w":case"W":return a%10!==2&&a%10!==3||a%100===12||a%100===13?a+"-ы":a+"-і";case"D":return a+"-га";default:return a}},week:{dow:1,doy:7}}),a.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[В изминалата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[В изминалия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дни",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(a){var b=a%10,c=a%100;return 0===a?a+"-ев":0===c?a+"-ен":c>10&&20>c?a+"-ти":1===b?a+"-ви":2===b?a+"-ри":7===b||8===b?a+"-ми":a+"-ти"},week:{dow:1,doy:7}}),{1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"}),qa={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"},ra=(a.defineLocale("bn",{months:"জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব_মার্চ_এপর_মে_জুন_জুল_অগ_সেপ্ট_অক্টো_নভ_ডিসেম্".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রুবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্রু_শনি".split("_"),weekdaysMin:"রব_সম_মঙ্গ_বু_ব্রিহ_শু_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কএক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(a){return a.replace(/[১২৩৪৫৬৭৮৯০]/g,function(a){return qa[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return pa[a]})},meridiemParse:/রাত|সকাল|দুপুর|বিকেল|রাত/,isPM:function(a){return/^(দুপুর|বিকেল|রাত)$/.test(a)},meridiem:function(a,b,c){return 4>a?"রাত":10>a?"সকাল":17>a?"দুপুর":20>a?"বিকেল":"রাত"},week:{dow:0,doy:6}}),{1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"}),sa={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"},ta=(a.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(a){return a.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,function(a){return sa[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return ra[a]})},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,isPM:function(a){return/^(ཉིན་གུང|དགོང་དག|མཚན་མོ)$/.test(a)},meridiem:function(a,b,c){return 4>a?"མཚན་མོ":10>a?"ཞོགས་ཀས":17>a?"ཉིན་གུང":20>a?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}}),a.defineLocale("br",{months:"Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),longDateFormat:{LT:"h[e]mm A",LTS:"h[e]mm:ss A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY h[e]mm A",LLLL:"dddd, D [a viz] MMMM YYYY h[e]mm A"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warc'hoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Dec'h da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s 'zo",s:"un nebeud segondennoù",m:"ur vunutenn",mm:f,h:"un eur",hh:"%d eur",d:"un devezh",dd:f,M:"ur miz",MM:f,y:"ur bloaz",yy:g},ordinalParse:/\d{1,2}(añ|vet)/,ordinal:function(a){var b=1===a?"añ":"vet";return a+b},week:{dow:1,doy:4}}),a.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:k,mm:k,h:k,hh:k,d:"dan",dd:k,M:"mjesec",MM:k,y:"godinu",yy:k},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),a.defineLocale("ca",{months:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),monthsShort:"gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.".split("_"),weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),longDateFormat:{LT:"H:mm",LTS:"LT:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd D MMMM YYYY H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(a,b){var c=1===a?"r":2===a?"n":3===a?"r":4===a?"t":"è";return("w"===b||"W"===b)&&(c="a"),a+c},week:{dow:1,doy:4}}),"leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_")),ua="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),va=(a.defineLocale("cs",{months:ta,monthsShort:ua,monthsParse:function(a,b){var c,d=[];for(c=0;12>c;c++)d[c]=new RegExp("^"+a[c]+"$|^"+b[c]+"$","i");return d}(ta,ua),weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:m,m:m,mm:m,h:m,hh:m,d:m,dd:m,M:m,MM:m,y:m,yy:m},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(a){var b=/сехет$/i.exec(a)?"рен":/ҫул$/i.exec(a)?"тан":"ран";return a+b},past:"%s каялла",s:"пӗр-ик ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},ordinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}}),a.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},ordinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(a){var b=a,c="",d=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"];return b>20?c=40===b||50===b||60===b||80===b||100===b?"fed":"ain":b>0&&(c=d[b]),a+c},week:{dow:1,doy:4}}),a.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY HH:mm"},calendar:{sameDay:"[I dag kl.] LT",nextDay:"[I morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[I går kl.] LT",lastWeek:"[sidste] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[Heute um] LT [Uhr]",sameElse:"L",nextDay:"[Morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[Gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:n,mm:"%d Minuten",h:n,hh:"%d Stunden",d:n,dd:n,M:n,MM:n,y:n,yy:n},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[Heute um] LT [Uhr]",sameElse:"L",nextDay:"[Morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[Gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:o,mm:"%d Minuten",h:o,hh:"%d Stunden",d:o,dd:o,M:o,MM:o,y:o,yy:o},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(a,b){return/D/.test(b.substring(0,b.indexOf("MMMM")))?this._monthsGenitiveEl[a.month()]:this._monthsNominativeEl[a.month()]},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(a,b,c){return a>11?c?"μμ":"ΜΜ":c?"πμ":"ΠΜ"},isPM:function(a){return"μ"===(a+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(a,b){var c=this._calendarEl[a],d=b&&b.hours();return"function"==typeof c&&(c=c.apply(b)),c.replace("{}",d%12===1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},ordinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}}),a.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),a.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"D MMMM, YYYY",LLL:"D MMMM, YYYY h:mm A",LLLL:"dddd, D MMMM, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),a.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),weekdays:"Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato".split("_"),weekdaysShort:"Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Ĵa_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D[-an de] MMMM, YYYY",LLL:"D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd, [la] D[-an de] MMMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(a){return"p"===a.charAt(0).toLowerCase()},meridiem:function(a,b,c){return a>11?c?"p.t.m.":"P.T.M.":c?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd [je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasinta] dddd [je] LT",sameElse:"L"},relativeTime:{future:"je %s",past:"antaŭ %s",s:"sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"},ordinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}}),"Ene._Feb._Mar._Abr._May._Jun._Jul._Ago._Sep._Oct._Nov._Dic.".split("_")),wa="Ene_Feb_Mar_Abr_May_Jun_Jul_Ago_Sep_Oct_Nov_Dic".split("_"),xa=(a.defineLocale("es",{months:"Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?wa[a.month()]:va[a.month()]},weekdays:"Domingo_Lunes_Martes_Miércoles_Jueves_Viernes_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mié._Jue._Vie._Sáb.".split("_"),weekdaysMin:"Do_Lu_Ma_Mi_Ju_Vi_Sá".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),a.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:p,m:p,mm:p,h:p,hh:p,d:p,dd:"%d päeva",M:p,MM:p,y:p,yy:p},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),{1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷", -8:"۸",9:"۹",0:"۰"}),ya={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"},za=(a.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(a){return/بعد از ظهر/.test(a)},meridiem:function(a,b,c){return 12>a?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چندین ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(a){return a.replace(/[۰-۹]/g,function(a){return ya[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return xa[a]}).replace(/,/g,"،")},ordinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}}),"nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" ")),Aa=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",za[7],za[8],za[9]],Ba=(a.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:q,m:q,mm:q,h:q,hh:q,d:q,dd:q,M:q,MM:q,y:q,yy:q},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",m:"ein minutt",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaði",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|e)/,ordinal:function(a){return a+(1===a?"er":"e")}}),a.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|)/,ordinal:function(a){return a+(1===a?"er":"")},week:{dow:1,doy:4}}),"jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_")),Ca="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),Da=(a.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?Ca[a.month()]:Ba[a.month()]},weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),a.defineLocale("gl",{months:"Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro".split("_"),monthsShort:"Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.".split("_"),weekdays:"Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mér._Xov._Ven._Sáb.".split("_"),weekdaysMin:"Do_Lu_Ma_Mé_Xo_Ve_Sá".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd D MMMM YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(a){return"uns segundos"===a?"nuns segundos":"en "+a},past:"hai %s",s:"uns segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:7}}),a.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(a){return 2===a?"שעתיים":a+" שעות"},d:"יום",dd:function(a){return 2===a?"יומיים":a+" ימים"},M:"חודש",MM:function(a){return 2===a?"חודשיים":a+" חודשים"},y:"שנה",yy:function(a){return 2===a?"שנתיים":a%10===0&&10!==a?a+" שנה":a+" שנים"}}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),Ea={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},Fa=(a.defineLocale("hi",{months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return Ea[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Da[a]})},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(a,b){return 12===a&&(a=0),"रात"===b?4>a?a:a+12:"सुबह"===b?a:"दोपहर"===b?a>=10?a:a+12:"शाम"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"रात":10>a?"सुबह":17>a?"दोपहर":20>a?"शाम":"रात"},week:{dow:0,doy:6}}),a.defineLocale("hr",{months:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_"),monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:s,mm:s,h:s,hh:s,d:"dan",dd:s,M:"mjesec",MM:s,y:"godinu",yy:s},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),"vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ")),Ga=(a.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(a){return"u"===a.charAt(1).toLowerCase()},meridiem:function(a,b,c){return 12>a?c===!0?"de":"DE":c===!0?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return u.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return u.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),a.defineLocale("hy-am",{months:v,monthsShort:w,weekdays:x,weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(a){return/^(ցերեկվա|երեկոյան)$/.test(a)},meridiem:function(a){return 4>a?"գիշերվա":12>a?"առավոտվա":17>a?"ցերեկվա":"երեկոյան"},ordinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(a,b){switch(b){case"DDD":case"w":case"W":case"DDDo":return 1===a?a+"-ին":a+"-րդ";default:return a}},week:{dow:1,doy:7}}),a.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"siang"===b?a>=11?a:a+12:"sore"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"siang":19>a?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),a.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:z,m:z,mm:z,h:"klukkustund",hh:z,d:z,dd:z,M:z,MM:z,y:z,yy:z},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),weekdaysMin:"D_L_Ma_Me_G_V_S".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(a){return(/^[0-9].+$/.test(a)?"tra":"in")+" "+a},past:"%s fa",s:"alcuni secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),a.defineLocale("ja",{months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"Ah時m分",LTS:"Ah時m分s秒",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah時m分",LLLL:"YYYY年M月D日Ah時m分 dddd"},meridiemParse:/午前|午後/i,isPM:function(a){return"午後"===a},meridiem:function(a,b,c){return 12>a?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:"[来週]dddd LT",lastDay:"[昨日] LT",lastWeek:"[前週]dddd LT",sameElse:"L"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}}),a.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(a,b){return 12===a&&(a=0),"enjing"===b?a:"siyang"===b?a>=11?a:a+12:"sonten"===b||"ndalu"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"enjing":15>a?"siyang":19>a?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}}),a.defineLocale("ka",{months:A,monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:B,weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(a){return/(წამი|წუთი|საათი|წელი)/.test(a)?a.replace(/ი$/,"ში"):a+"ში"},past:function(a){return/(წამი|წუთი|საათი|დღე|თვე)/.test(a)?a.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(a)?a.replace(/წელი$/,"წლის წინ"):void 0},s:"რამდენიმე წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},ordinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(a){return 0===a?a:1===a?a+"-ლი":20>a||100>=a&&a%20===0||a%100===0?"მე-"+a:a+"-ე"},week:{dow:1,doy:7}}),a.defineLocale("km",{months:"មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysMin:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[ថ្ងៃនៈ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},week:{dow:1,doy:4}}),a.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h시 m분",LTS:"A h시 m분 s초",L:"YYYY.MM.DD",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h시 m분",LLLL:"YYYY년 MMMM D일 dddd A h시 m분"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇초",ss:"%d초",m:"일분",mm:"%d분",h:"한시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한달",MM:"%d달",y:"일년",yy:"%d년"},ordinalParse:/\d{1,2}일/,ordinal:"%d일",meridiemParse:/오전|오후/,isPM:function(a){return"오후"===a},meridiem:function(a,b,c){return 12>a?"오전":"오후"}}),a.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:D,past:E,s:"e puer Sekonnen",m:C,mm:"%d Minutten",h:C,hh:"%d Stonnen",d:C,dd:"%d Deeg",M:C,MM:"%d Méint",y:C,yy:"%d Joer"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"}),Ha="sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),Ia=(a.defineLocale("lt",{months:H,monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:M,weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:G,m:I,mm:L,h:I,hh:L,d:I,dd:L,M:I,MM:L,y:I,yy:L},ordinalParse:/\d{1,2}-oji/,ordinal:function(a){return a+"-oji"},week:{dow:1,doy:4}}),{m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")}),Ja=(a.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:Q,m:P,mm:O,h:P,hh:O,d:P,dd:O,M:P,MM:O,y:P,yy:O},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{words:{m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=Ja.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+Ja.correctGrammaticalCase(a,d)}}),Ka=(a.defineLocale("me",{months:["januar","februar","mart","april","maj","jun","jul","avgust","septembar","oktobar","novembar","decembar"],monthsShort:["jan.","feb.","mar.","apr.","maj","jun","jul","avg.","sep.","okt.","nov.","dec."],weekdays:["nedjelja","ponedjeljak","utorak","srijeda","četvrtak","petak","subota"],weekdaysShort:["ned.","pon.","uto.","sri.","čet.","pet.","sub."],weekdaysMin:["ne","po","ut","sr","če","pe","su"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){var a=["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",m:Ja.translate,mm:Ja.translate,h:Ja.translate,hh:Ja.translate,d:"dan",dd:Ja.translate,M:"mjesec",MM:Ja.translate,y:"godinu",yy:Ja.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),a.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Во изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Во изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(a){var b=a%10,c=a%100;return 0===a?a+"-ев":0===c?a+"-ен":c>10&&20>c?a+"-ти":1===b?a+"-ви":2===b?a+"-ри":7===b||8===b?a+"-ми":a+"-ти"},week:{dow:1,doy:7}}),a.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,isPM:function(a){return/^(ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി)$/.test(a)},meridiem:function(a,b,c){return 4>a?"രാത്രി":12>a?"രാവിലെ":17>a?"ഉച്ച കഴിഞ്ഞ്":20>a?"വൈകുന്നേരം":"രാത്രി"}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),La={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},Ma=(a.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%s नंतर",past:"%s पूर्वी",s:"सेकंद",m:"एक मिनिट",mm:"%d मिनिटे",h:"एक तास",hh:"%d तास",d:"एक दिवस",dd:"%d दिवस",M:"एक महिना",MM:"%d महिने",y:"एक वर्ष",yy:"%d वर्षे"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return La[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Ka[a]})},meridiemParse:/रात्री|सकाळी|दुपारी|सायंकाळी/,meridiemHour:function(a,b){return 12===a&&(a=0),"रात्री"===b?4>a?a:a+12:"सकाळी"===b?a:"दुपारी"===b?a>=10?a:a+12:"सायंकाळी"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"रात्री":10>a?"सकाळी":17>a?"दुपारी":20>a?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}}),a.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"tengahari"===b?a>=11?a:a+12:"petang"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"tengahari":19>a?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),a.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"), -weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"tengahari"===b?a>=11?a:a+12:"petang"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"tengahari":19>a?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),{1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"}),Na={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"},Oa=(a.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(a){return a.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,function(a){return Na[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Ma[a]})},week:{dow:1,doy:4}}),a.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tirs_ons_tors_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"H.mm",LTS:"H.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H.mm",LLLL:"dddd D. MMMM YYYY [kl.] H.mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),Pa={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},Qa=(a.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आइ._सो._मङ्_बु._बि._शु._श.".split("_"),longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return Pa[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Oa[a]})},meridiemParse:/राती|बिहान|दिउँसो|बेलुका|साँझ|राती/,meridiemHour:function(a,b){return 12===a&&(a=0),"राती"===b?3>a?a:a+12:"बिहान"===b?a:"दिउँसो"===b?a>=10?a:a+12:"बेलुका"===b||"साँझ"===b?a+12:void 0},meridiem:function(a,b,c){return 3>a?"राती":10>a?"बिहान":15>a?"दिउँसो":18>a?"बेलुका":20>a?"साँझ":"राती"},calendar:{sameDay:"[आज] LT",nextDay:"[भोली] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडी",s:"केही समय",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:1,doy:7}}),"jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_")),Ra="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),Sa=(a.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?Ra[a.month()]:Qa[a.month()]},weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"Zo_Ma_Di_Wo_Do_Vr_Za".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),a.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"sun_mån_tys_ons_tor_fre_lau".split("_"),weekdaysMin:"su_må_ty_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s sidan",s:"nokre sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),"styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_")),Ta="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),Ua=(a.defineLocale("pl",{months:function(a,b){return""===b?"("+Ta[a.month()]+"|"+Sa[a.month()]+")":/D MMMM/.test(b)?Ta[a.month()]:Sa[a.month()]},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"nie_pon_wt_śr_czw_pt_sb".split("_"),weekdaysMin:"N_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:S,mm:S,h:S,hh:S,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:S,y:"rok",yy:S},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("pt-br",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº"}),a.defineLocale("pt",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),a.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",m:"un minut",mm:T,h:"o oră",hh:T,d:"o zi",dd:T,M:"o lună",MM:T,y:"un an",yy:T},week:{dow:1,doy:7}}),a.defineLocale("ru",{months:W,monthsShort:X,weekdays:Y,weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[й|я]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(){return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT"},lastWeek:function(a){if(a.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:V,mm:V,h:"час",hh:V,d:"день",dd:V,M:"месяц",MM:V,y:"год",yy:V},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(a){return/^(дня|вечера)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночи":12>a?"утра":17>a?"дня":"вечера"},ordinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":return a+"-й";case"D":return a+"-го";case"w":case"W":return a+"-я";default:return a}},week:{dow:1,doy:7}}),a.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},ordinalParse:/\d{1,2} වැනි/,ordinal:function(a){return a+" වැනි"},meridiem:function(a,b,c){return a>11?c?"ප.ව.":"පස් වරු":c?"පෙ.ව.":"පෙර වරු"}}),"január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_")),Va="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_"),Wa=(a.defineLocale("sk",{months:Ua,monthsShort:Va,monthsParse:function(a,b){var c,d=[];for(c=0;12>c;c++)d[c]=new RegExp("^"+a[c]+"$|^"+b[c]+"$","i");return d}(Ua,Va),weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:$,m:$,mm:$,h:$,hh:$,d:$,dd:$,M:$,MM:$,y:$,yy:$},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:_,m:_,mm:_,h:_,hh:_,d:_,dd:_,M:_,MM:_,y:_,yy:_},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),a.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),meridiemParse:/PD|MD/,isPM:function(a){return"M"===a.charAt(0)},meridiem:function(a,b,c){return 12>a?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{words:{m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=Wa.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+Wa.correctGrammaticalCase(a,d)}}),Xa=(a.defineLocale("sr-cyrl",{months:["јануар","фебруар","март","април","мај","јун","јул","август","септембар","октобар","новембар","децембар"],monthsShort:["јан.","феб.","мар.","апр.","мај","јун","јул","авг.","сеп.","окт.","нов.","дец."],weekdays:["недеља","понедељак","уторак","среда","четвртак","петак","субота"],weekdaysShort:["нед.","пон.","уто.","сре.","чет.","пет.","суб."],weekdaysMin:["не","по","ут","ср","че","пе","су"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){var a=["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",m:Wa.translate,mm:Wa.translate,h:Wa.translate,hh:Wa.translate,d:"дан",dd:Wa.translate,M:"месец",MM:Wa.translate,y:"годину",yy:Wa.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),{words:{m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=Xa.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+Xa.correctGrammaticalCase(a,d)}}),Ya=(a.defineLocale("sr",{months:["januar","februar","mart","april","maj","jun","jul","avgust","septembar","oktobar","novembar","decembar"],monthsShort:["jan.","feb.","mar.","apr.","maj","jun","jul","avg.","sep.","okt.","nov.","dec."],weekdays:["nedelja","ponedeljak","utorak","sreda","četvrtak","petak","subota"],weekdaysShort:["ned.","pon.","uto.","sre.","čet.","pet.","sub."],weekdaysMin:["ne","po","ut","sr","če","pe","su"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){var a=["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",m:Xa.translate,mm:Xa.translate,h:Xa.translate,hh:Xa.translate,d:"dan",dd:Xa.translate,M:"mesec",MM:Xa.translate,y:"godinu",yy:Xa.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),a.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinalParse:/\d{1,2}(e|a)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"e":1===b?"a":2===b?"a":"e";return a+c},week:{dow:1,doy:4}}),a.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},ordinalParse:/\d{1,2}வது/,ordinal:function(a){return a+"வது"},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(a,b,c){return 2>a?" யாமம்":6>a?" வைகறை":10>a?" காலை":14>a?" நண்பகல்":18>a?" எற்பாடு":22>a?" மாலை":" யாமம்"},meridiemHour:function(a,b){return 12===a&&(a=0),"யாமம்"===b?2>a?a:a+12:"வைகறை"===b||"காலை"===b?a:"நண்பகல்"===b&&a>=10?a:a+12},week:{dow:0,doy:6}}),a.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"มกรา_กุมภา_มีนา_เมษา_พฤษภา_มิถุนา_กรกฎา_สิงหา_กันยา_ตุลา_พฤศจิกา_ธันวา".split("_"),weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),longDateFormat:{LT:"H นาฬิกา m นาที",LTS:"H นาฬิกา m นาที s วินาที",L:"YYYY/MM/DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H นาฬิกา m นาที",LLLL:"วันddddที่ D MMMM YYYY เวลา H นาฬิกา m นาที"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(a){return"หลังเที่ยง"===a},meridiem:function(a,b,c){return 12>a?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}}),a.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"[Ngayon sa] LT",nextDay:"[Bukas sa] LT",nextWeek:"dddd [sa] LT",lastDay:"[Kahapon sa] LT",lastWeek:"dddd [huling linggo] LT",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},ordinalParse:/\d{1,2}/,ordinal:function(a){return a},week:{dow:1,doy:4}}),{1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"});a.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinalParse:/\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,ordinal:function(a){if(0===a)return a+"'ıncı";var b=a%10,c=a%100-b,d=a>=100?100:null;return a+(Ya[b]||Ya[c]||Ya[d])},week:{dow:1,doy:7}}),a.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"LT.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY LT",LLLL:"dddd, [li] D. MMMM [dallas] YYYY LT"},meridiem:function(a,b,c){return a>11?c?"d'o":"D'O":c?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:aa,m:aa,mm:aa,h:aa,hh:aa,d:aa,dd:aa,M:aa,MM:aa,y:aa,yy:aa},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}}),a.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}}),a.defineLocale("uk",{months:da,monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:ea,weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:fa("[Сьогодні "),nextDay:fa("[Завтра "),lastDay:fa("[Вчора "),nextWeek:fa("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return fa("[Минулої] dddd [").call(this);case 1:case 2:case 4:return fa("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:ca,mm:ca,h:"годину",hh:ca,d:"день",dd:ca,M:"місяць",MM:ca,y:"рік",yy:ca},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(a){return/^(дня|вечора)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночі":12>a?"ранку":17>a?"дня":"вечора"},ordinalParse:/\d{1,2}-(й|го)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":case"w":case"W":return a+"-й";case"D":return a+"-го";default:return a}},week:{dow:1,doy:7}}),a.defineLocale("uz",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}}),a.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"),weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần rồi lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},ordinalParse:/\d{1,2}/,ordinal:function(a){return a},week:{dow:1,doy:4}}),a.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), -weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah点mm分",LTS:"Ah点m分s秒",L:"YYYY-MM-DD",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah点mm分",LLLL:"YYYY年MMMD日ddddAh点mm分",l:"YYYY-MM-DD",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah点mm分",llll:"YYYY年MMMD日ddddAh点mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(a,b){return 12===a&&(a=0),"凌晨"===b||"早上"===b||"上午"===b?a:"下午"===b||"晚上"===b?a+12:a>=11?a:a+12},meridiem:function(a,b,c){var d=100*a+b;return 600>d?"凌晨":900>d?"早上":1130>d?"上午":1230>d?"中午":1800>d?"下午":"晚上"},calendar:{sameDay:function(){return 0===this.minutes()?"[今天]Ah[点整]":"[今天]LT"},nextDay:function(){return 0===this.minutes()?"[明天]Ah[点整]":"[明天]LT"},lastDay:function(){return 0===this.minutes()?"[昨天]Ah[点整]":"[昨天]LT"},nextWeek:function(){var b,c;return b=a().startOf("week"),c=this.unix()-b.unix()>=604800?"[下]":"[本]",0===this.minutes()?c+"dddAh点整":c+"dddAh点mm"},lastWeek:function(){var b,c;return b=a().startOf("week"),c=this.unix()=11?a:a+12:"下午"===b||"晚上"===b?a+12:void 0},meridiem:function(a,b,c){var d=100*a+b;return 900>d?"早上":1130>d?"上午":1230>d?"中午":1800>d?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},ordinalParse:/\d{1,2}(日|月|週)/,ordinal:function(a,b){switch(b){case"d":case"D":case"DDD":return a+"日";case"M":return a+"月";case"w":case"W":return a+"週";default:return a}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"一分鐘",mm:"%d分鐘",h:"一小時",hh:"%d小時",d:"一天",dd:"%d天",M:"一個月",MM:"%d個月",y:"一年",yy:"%d年"}})}); \ No newline at end of file +var _=(a.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(a){return/^nm$/i.test(a)},meridiem:function(a,b,c){return 12>a?c?"vm":"VM":c?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[Môre om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),a.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:6,doy:12}}),{1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"}),aa={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},ba=(a.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(a){return"م"===a},meridiem:function(a,b,c){return 12>a?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(a){return a.replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(a){return aa[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return _[a]}).replace(/,/g,"،")},week:{dow:6,doy:12}}),a.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}}),{1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"}),ca={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},da=function(a){return 0===a?0:1===a?1:2===a?2:a%100>=3&&10>=a%100?3:a%100>=11?4:5},ea={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},fa=function(a){return function(b,c,d,e){var f=da(b),g=ea[a][da(b)];return 2===f&&(g=g[c?0:1]),g.replace(/%d/i,b)}},ga=["كانون الثاني يناير","شباط فبراير","آذار مارس","نيسان أبريل","أيار مايو","حزيران يونيو","تموز يوليو","آب أغسطس","أيلول سبتمبر","تشرين الأول أكتوبر","تشرين الثاني نوفمبر","كانون الأول ديسمبر"],ha=(a.defineLocale("ar",{months:ga,monthsShort:ga,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(a){return"م"===a},meridiem:function(a,b,c){return 12>a?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:fa("s"),m:fa("m"),mm:fa("m"),h:fa("h"),hh:fa("h"),d:fa("d"),dd:fa("d"),M:fa("M"),MM:fa("M"),y:fa("y"),yy:fa("y")},preparse:function(a){return a.replace(/\u200f/g,"").replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(a){return ca[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return ba[a]}).replace(/,/g,"،")},week:{dow:6,doy:12}}),{1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"}),ia=(a.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"birneçə saniyyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(a){return/^(gündüz|axşam)$/.test(a)},meridiem:function(a,b,c){return 4>a?"gecə":12>a?"səhər":17>a?"gündüz":"axşam"},ordinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(a){if(0===a)return a+"-ıncı";var b=a%10,c=a%100-b,d=a>=100?100:null;return a+(ha[b]||ha[c]||ha[d])},week:{dow:1,doy:7}}),a.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:c,mm:c,h:c,hh:c,d:"дзень",dd:c,M:"месяц",MM:c,y:"год",yy:c},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(a){return/^(дня|вечара)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночы":12>a?"раніцы":17>a?"дня":"вечара"},ordinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":case"w":case"W":return a%10!==2&&a%10!==3||a%100===12||a%100===13?a+"-ы":a+"-і";case"D":return a+"-га";default:return a}},week:{dow:1,doy:7}}),a.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[В изминалата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[В изминалия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дни",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(a){var b=a%10,c=a%100;return 0===a?a+"-ев":0===c?a+"-ен":c>10&&20>c?a+"-ти":1===b?a+"-ви":2===b?a+"-ри":7===b||8===b?a+"-ми":a+"-ти"},week:{dow:1,doy:7}}),{1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"}),ja={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"},ka=(a.defineLocale("bn",{months:"জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব_মার্চ_এপর_মে_জুন_জুল_অগ_সেপ্ট_অক্টো_নভ_ডিসেম্".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্র_শনি".split("_"),weekdaysMin:"রব_সম_মঙ্গ_বু_ব্রিহ_শু_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(a){return a.replace(/[১২৩৪৫৬৭৮৯০]/g,function(a){return ja[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return ia[a]})},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,isPM:function(a){return/^(দুপুর|বিকাল|রাত)$/.test(a)},meridiem:function(a,b,c){return 4>a?"রাত":10>a?"সকাল":17>a?"দুপুর":20>a?"বিকাল":"রাত"},week:{dow:0,doy:6}}),{1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"}),la={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"},ma=(a.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(a){return a.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,function(a){return la[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return ka[a]})},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,isPM:function(a){return/^(ཉིན་གུང|དགོང་དག|མཚན་མོ)$/.test(a)},meridiem:function(a,b,c){return 4>a?"མཚན་མོ":10>a?"ཞོགས་ཀས":17>a?"ཉིན་གུང":20>a?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}}),a.defineLocale("br",{months:"Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),longDateFormat:{LT:"h[e]mm A",LTS:"h[e]mm:ss A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY h[e]mm A",LLLL:"dddd, D [a viz] MMMM YYYY h[e]mm A"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warc'hoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Dec'h da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s 'zo",s:"un nebeud segondennoù",m:"ur vunutenn",mm:d,h:"un eur",hh:"%d eur",d:"un devezh",dd:d,M:"ur miz",MM:d,y:"ur bloaz",yy:e},ordinalParse:/\d{1,2}(añ|vet)/,ordinal:function(a){var b=1===a?"añ":"vet";return a+b},week:{dow:1,doy:4}}),a.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:i,mm:i,h:i,hh:i,d:"dan",dd:i,M:"mjesec",MM:i,y:"godinu",yy:i},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),a.defineLocale("ca",{months:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),monthsShort:"gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.".split("_"),weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd D MMMM YYYY H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(a,b){var c=1===a?"r":2===a?"n":3===a?"r":4===a?"t":"è";return("w"===b||"W"===b)&&(c="a"),a+c},week:{dow:1,doy:4}}),"leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_")),na="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),oa=(a.defineLocale("cs",{months:ma,monthsShort:na,monthsParse:function(a,b){var c,d=[];for(c=0;12>c;c++)d[c]=new RegExp("^"+a[c]+"$|^"+b[c]+"$","i");return d}(ma,na),shortMonthsParse:function(a){var b,c=[];for(b=0;12>b;b++)c[b]=new RegExp("^"+a[b]+"$","i");return c}(na),longMonthsParse:function(a){var b,c=[];for(b=0;12>b;b++)c[b]=new RegExp("^"+a[b]+"$","i");return c}(ma),weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:k,m:k,mm:k,h:k,hh:k,d:k,dd:k,M:k,MM:k,y:k,yy:k},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(a){var b=/сехет$/i.exec(a)?"рен":/ҫул$/i.exec(a)?"тан":"ран";return a+b},past:"%s каялла",s:"пӗр-ик ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},ordinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}}),a.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},ordinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(a){var b=a,c="",d=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"];return b>20?c=40===b||50===b||60===b||80===b||100===b?"fed":"ain":b>0&&(c=d[b]),a+c},week:{dow:1,doy:4}}),a.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY HH:mm"},calendar:{sameDay:"[I dag kl.] LT",nextDay:"[I morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[I går kl.] LT",lastWeek:"[sidste] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:l,mm:"%d Minuten",h:l,hh:"%d Stunden",d:l,dd:l,M:l,MM:l,y:l,yy:l},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:m,mm:"%d Minuten",h:m,hh:"%d Stunden",d:m,dd:m,M:m,MM:m,y:m,yy:m},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"]),pa=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"],qa=(a.defineLocale("dv",{months:oa,monthsShort:oa,weekdays:pa,weekdaysShort:pa,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(a){return""===a},meridiem:function(a,b,c){return 12>a?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(a){return a.replace(/،/g,",")},postformat:function(a){return a.replace(/,/g,"،")},week:{dow:7,doy:12}}),a.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(a,b){return/D/.test(b.substring(0,b.indexOf("MMMM")))?this._monthsGenitiveEl[a.month()]:this._monthsNominativeEl[a.month()]},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(a,b,c){return a>11?c?"μμ":"ΜΜ":c?"πμ":"ΠΜ"},isPM:function(a){return"μ"===(a+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(a,b){var c=this._calendarEl[a],d=b&&b.hours();return n(c)&&(c=c.apply(b)),c.replace("{}",d%12===1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},ordinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}}),a.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),a.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"D MMMM, YYYY",LLL:"D MMMM, YYYY h:mm A",LLLL:"dddd, D MMMM, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),a.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),a.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),a.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),weekdays:"Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato".split("_"),weekdaysShort:"Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Ĵa_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D[-an de] MMMM, YYYY",LLL:"D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd, [la] D[-an de] MMMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(a){return"p"===a.charAt(0).toLowerCase()},meridiem:function(a,b,c){return a>11?c?"p.t.m.":"P.T.M.":c?"a.t.m.":"A.T.M."; +},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd [je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasinta] dddd [je] LT",sameElse:"L"},relativeTime:{future:"je %s",past:"antaŭ %s",s:"sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"},ordinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}}),"ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_")),ra="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),sa=(a.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?ra[a.month()]:qa[a.month()]},weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),a.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:o,m:o,mm:o,h:o,hh:o,d:o,dd:"%d päeva",M:o,MM:o,y:o,yy:o},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),{1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"}),ta={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"},ua=(a.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(a){return/بعد از ظهر/.test(a)},meridiem:function(a,b,c){return 12>a?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چندین ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(a){return a.replace(/[۰-۹]/g,function(a){return ta[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return sa[a]}).replace(/,/g,"،")},ordinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}}),"nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" ")),va=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",ua[7],ua[8],ua[9]],wa=(a.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:p,m:p,mm:p,h:p,hh:p,d:p,dd:p,M:p,MM:p,y:p,yy:p},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",m:"ein minutt",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaði",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|e)/,ordinal:function(a){return a+(1===a?"er":"e")}}),a.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|e)/,ordinal:function(a){return a+(1===a?"er":"e")},week:{dow:1,doy:4}}),a.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|)/,ordinal:function(a){return a+(1===a?"er":"")},week:{dow:1,doy:4}}),"jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_")),xa="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),ya=(a.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?xa[a.month()]:wa[a.month()]},weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"]),za=["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],Aa=["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],Ba=["Did","Dil","Dim","Dic","Dia","Dih","Dis"],Ca=["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],Da=(a.defineLocale("gd",{months:ya,monthsShort:za,monthsParseExact:!0,weekdays:Aa,weekdaysShort:Ba,weekdaysMin:Ca,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},ordinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(a){var b=1===a?"d":a%10===2?"na":"mh";return a+b},week:{dow:1,doy:4}}),a.defineLocale("gl",{months:"Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro".split("_"),monthsShort:"Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.".split("_"),weekdays:"Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mér._Xov._Ven._Sáb.".split("_"),weekdaysMin:"Do_Lu_Ma_Mé_Xo_Ve_Sá".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd D MMMM YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(a){return"uns segundos"===a?"nuns segundos":"en "+a},past:"hai %s",s:"uns segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:7}}),a.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(a){return 2===a?"שעתיים":a+" שעות"},d:"יום",dd:function(a){return 2===a?"יומיים":a+" ימים"},M:"חודש",MM:function(a){return 2===a?"חודשיים":a+" חודשים"},y:"שנה",yy:function(a){return 2===a?"שנתיים":a%10===0&&10!==a?a+" שנה":a+" שנים"}}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),Ea={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},Fa=(a.defineLocale("hi",{months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return Ea[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Da[a]})},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(a,b){return 12===a&&(a=0),"रात"===b?4>a?a:a+12:"सुबह"===b?a:"दोपहर"===b?a>=10?a:a+12:"शाम"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"रात":10>a?"सुबह":17>a?"दोपहर":20>a?"शाम":"रात"},week:{dow:0,doy:6}}),a.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:r,mm:r,h:r,hh:r,d:"dan",dd:r,M:"mjesec",MM:r,y:"godinu",yy:r},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),"vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ")),Ga=(a.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(a){return"u"===a.charAt(1).toLowerCase()},meridiem:function(a,b,c){return 12>a?c===!0?"de":"DE":c===!0?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return t.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return t.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),a.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(a){return/^(ցերեկվա|երեկոյան)$/.test(a)},meridiem:function(a){return 4>a?"գիշերվա":12>a?"առավոտվա":17>a?"ցերեկվա":"երեկոյան"},ordinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(a,b){switch(b){case"DDD":case"w":case"W":case"DDDo":return 1===a?a+"-ին":a+"-րդ";default:return a}},week:{dow:1,doy:7}}),a.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"siang"===b?a>=11?a:a+12:"sore"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"siang":19>a?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),a.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:v,m:v,mm:v,h:"klukkustund",hh:v,d:v,dd:v,M:v,MM:v,y:v,yy:v},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),weekdaysMin:"Do_Lu_Ma_Me_Gi_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(a){return(/^[0-9].+$/.test(a)?"tra":"in")+" "+a},past:"%s fa",s:"alcuni secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),a.defineLocale("ja",{months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"Ah時m分",LTS:"Ah時m分s秒",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah時m分",LLLL:"YYYY年M月D日Ah時m分 dddd"},meridiemParse:/午前|午後/i,isPM:function(a){return"午後"===a},meridiem:function(a,b,c){return 12>a?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:"[来週]dddd LT",lastDay:"[昨日] LT",lastWeek:"[前週]dddd LT",sameElse:"L"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}}),a.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(a,b){return 12===a&&(a=0),"enjing"===b?a:"siyang"===b?a>=11?a:a+12:"sonten"===b||"ndalu"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"enjing":15>a?"siyang":19>a?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}}),a.defineLocale("ka",{months:{standalone:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),format:"იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს".split("_")},monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(a){return/(წამი|წუთი|საათი|წელი)/.test(a)?a.replace(/ი$/,"ში"):a+"ში"},past:function(a){return/(წამი|წუთი|საათი|დღე|თვე)/.test(a)?a.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(a)?a.replace(/წელი$/,"წლის წინ"):void 0},s:"რამდენიმე წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},ordinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(a){return 0===a?a:1===a?a+"-ლი":20>a||100>=a&&a%20===0||a%100===0?"მე-"+a:a+"-ე"},week:{dow:1,doy:7}}),{0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"}),Ha=(a.defineLocale("kk",{months:"Қаңтар_Ақпан_Наурыз_Сәуір_Мамыр_Маусым_Шілде_Тамыз_Қыркүйек_Қазан_Қараша_Желтоқсан".split("_"),monthsShort:"Қаң_Ақп_Нау_Сәу_Мам_Мау_Шіл_Там_Қыр_Қаз_Қар_Жел".split("_"),weekdays:"Жексенбі_Дүйсенбі_Сейсенбі_Сәрсенбі_Бейсенбі_Жұма_Сенбі".split("_"),weekdaysShort:"Жек_Дүй_Сей_Сәр_Бей_Жұм_Сен".split("_"),weekdaysMin:"Жк_Дй_Сй_Ср_Бй_Жм_Сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},ordinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(a){var b=a%10,c=a>=100?100:null;return a+(Ga[a]||Ga[b]||Ga[c])},week:{dow:1,doy:7}}),a.defineLocale("km",{months:"មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysMin:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},week:{dow:1,doy:4}}),a.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h시 m분",LTS:"A h시 m분 s초",L:"YYYY.MM.DD",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h시 m분",LLLL:"YYYY년 MMMM D일 dddd A h시 m분"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇초",ss:"%d초",m:"일분",mm:"%d분",h:"한시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한달",MM:"%d달",y:"일년",yy:"%d년"},ordinalParse:/\d{1,2}일/,ordinal:"%d일",meridiemParse:/오전|오후/,isPM:function(a){return"오후"===a},meridiem:function(a,b,c){return 12>a?"오전":"오후"}}),a.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:x,past:y,s:"e puer Sekonnen",m:w,mm:"%d Minutten",h:w,hh:"%d Stonnen",d:w,dd:"%d Deeg",M:w,MM:"%d Méint",y:w,yy:"%d Joer"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(a){return"ຕອນແລງ"===a},meridiem:function(a,b,c){return 12>a?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},ordinalParse:/(ທີ່)\d{1,2}/,ordinal:function(a){return"ທີ່"+a}}),{m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"}),Ia=(a.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_") +},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:A,m:B,mm:E,h:B,hh:E,d:B,dd:E,M:B,MM:E,y:B,yy:E},ordinalParse:/\d{1,2}-oji/,ordinal:function(a){return a+"-oji"},week:{dow:1,doy:4}}),{m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")}),Ja=(a.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:I,m:H,mm:G,h:H,hh:G,d:H,dd:G,M:H,MM:G,y:H,yy:G},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{words:{m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=Ja.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+Ja.correctGrammaticalCase(a,d)}}),Ka=(a.defineLocale("me",{months:["januar","februar","mart","april","maj","jun","jul","avgust","septembar","oktobar","novembar","decembar"],monthsShort:["jan.","feb.","mar.","apr.","maj","jun","jul","avg.","sep.","okt.","nov.","dec."],weekdays:["nedjelja","ponedjeljak","utorak","srijeda","četvrtak","petak","subota"],weekdaysShort:["ned.","pon.","uto.","sri.","čet.","pet.","sub."],weekdaysMin:["ne","po","ut","sr","če","pe","su"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){var a=["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",m:Ja.translate,mm:Ja.translate,h:Ja.translate,hh:Ja.translate,d:"dan",dd:Ja.translate,M:"mjesec",MM:Ja.translate,y:"godinu",yy:Ja.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),a.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(a){var b=a%10,c=a%100;return 0===a?a+"-ев":0===c?a+"-ен":c>10&&20>c?a+"-ти":1===b?a+"-ви":2===b?a+"-ри":7===b||8===b?a+"-ми":a+"-ти"},week:{dow:1,doy:7}}),a.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,isPM:function(a){return/^(ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി)$/.test(a)},meridiem:function(a,b,c){return 4>a?"രാത്രി":12>a?"രാവിലെ":17>a?"ഉച്ച കഴിഞ്ഞ്":20>a?"വൈകുന്നേരം":"രാത്രി"}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),La={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},Ma=(a.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:J,m:J,mm:J,h:J,hh:J,d:J,dd:J,M:J,MM:J,y:J,yy:J},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return La[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Ka[a]})},meridiemParse:/रात्री|सकाळी|दुपारी|सायंकाळी/,meridiemHour:function(a,b){return 12===a&&(a=0),"रात्री"===b?4>a?a:a+12:"सकाळी"===b?a:"दुपारी"===b?a>=10?a:a+12:"सायंकाळी"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"रात्री":10>a?"सकाळी":17>a?"दुपारी":20>a?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}}),a.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"tengahari"===b?a>=11?a:a+12:"petang"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"tengahari":19>a?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),a.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"tengahari"===b?a>=11?a:a+12:"petang"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"tengahari":19>a?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),{1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"}),Na={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"},Oa=(a.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(a){return a.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,function(a){return Na[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Ma[a]})},week:{dow:1,doy:4}}),a.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),Pa={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},Qa=(a.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return Pa[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Oa[a]})},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(a,b){return 12===a&&(a=0),"राति"===b?4>a?a:a+12:"बिहान"===b?a:"दिउँसो"===b?a>=10?a:a+12:"साँझ"===b?a+12:void 0},meridiem:function(a,b,c){return 3>a?"राति":12>a?"बिहान":16>a?"दिउँसो":20>a?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}}),"jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_")),Ra="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),Sa=(a.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?Ra[a.month()]:Qa[a.month()]},weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"Zo_Ma_Di_Wo_Do_Vr_Za".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),a.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"sun_mån_tys_ons_tor_fre_lau".split("_"),weekdaysMin:"su_må_ty_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s sidan",s:"nokre sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),"styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_")),Ta="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),Ua=(a.defineLocale("pl",{months:function(a,b){return""===b?"("+Ta[a.month()]+"|"+Sa[a.month()]+")":/D MMMM/.test(b)?Ta[a.month()]:Sa[a.month()]},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"nie_pon_wt_śr_czw_pt_sb".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:L,mm:L,h:L,hh:L,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:L,y:"rok",yy:L},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("pt-br",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº"}),a.defineLocale("pt",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),a.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",m:"un minut",mm:M,h:"o oră",hh:M,d:"o zi",dd:M,M:"o lună",MM:M,y:"un an",yy:M},week:{dow:1,doy:7}}),[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[й|я]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i]),Va=(a.defineLocale("ru",{months:{format:"Января_Февраля_Марта_Апреля_Мая_Июня_Июля_Августа_Сентября_Октября_Ноября_Декабря".split("_"),standalone:"Январь_Февраль_Март_Апрель_Май_Июнь_Июль_Август_Сентябрь_Октябрь_Ноябрь_Декабрь".split("_")},monthsShort:{format:"янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек".split("_"),standalone:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_")},weekdays:{standalone:"Воскресенье_Понедельник_Вторник_Среда_Четверг_Пятница_Суббота".split("_"),format:"Воскресенье_Понедельник_Вторник_Среду_Четверг_Пятницу_Субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/},weekdaysShort:"Вс_Пн_Вт_Ср_Чт_Пт_Сб".split("_"),weekdaysMin:"Вс_Пн_Вт_Ср_Чт_Пт_Сб".split("_"),monthsParse:Ua,longMonthsParse:Ua,shortMonthsParse:Ua,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(a){if(a.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В следующее] dddd [в] LT";case 1:case 2:case 4:return"[В следующий] dddd [в] LT";case 3:case 5:case 6:return"[В следующую] dddd [в] LT"}},lastWeek:function(a){if(a.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:O,mm:O,h:"час",hh:O,d:"день",dd:O,M:"месяц",MM:O,y:"год",yy:O},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(a){return/^(дня|вечера)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночи":12>a?"утра":17>a?"дня":"вечера"},ordinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":return a+"-й";case"D":return a+"-го";case"w":case"W":return a+"-я";default:return a}},week:{dow:1,doy:7}}),a.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},ordinalParse:/\d{1,2} වැනි/,ordinal:function(a){return a+" වැනි"},meridiem:function(a,b,c){return a>11?c?"ප.ව.":"පස් වරු":c?"පෙ.ව.":"පෙර වරු"}}),"január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_")),Wa="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_"),Xa=(a.defineLocale("sk",{months:Va,monthsShort:Wa,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:Q,m:Q,mm:Q,h:Q,hh:Q,d:Q,dd:Q,M:Q,MM:Q,y:Q,yy:Q},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:R,m:R,mm:R,h:R,hh:R,d:R,dd:R,M:R,MM:R,y:R,yy:R},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),a.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),meridiemParse:/PD|MD/,isPM:function(a){return"M"===a.charAt(0)},meridiem:function(a,b,c){return 12>a?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{words:{m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=Xa.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+Xa.correctGrammaticalCase(a,d)}}),Ya=(a.defineLocale("sr-cyrl",{months:["јануар","фебруар","март","април","мај","јун","јул","август","септембар","октобар","новембар","децембар"],monthsShort:["јан.","феб.","мар.","апр.","мај","јун","јул","авг.","сеп.","окт.","нов.","дец."],weekdays:["недеља","понедељак","уторак","среда","четвртак","петак","субота"],weekdaysShort:["нед.","пон.","уто.","сре.","чет.","пет.","суб."],weekdaysMin:["не","по","ут","ср","че","пе","су"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){var a=["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",m:Xa.translate,mm:Xa.translate,h:Xa.translate,hh:Xa.translate,d:"дан",dd:Xa.translate,M:"месец",MM:Xa.translate,y:"годину",yy:Xa.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),{words:{m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=Ya.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+Ya.correctGrammaticalCase(a,d)}}),Za=(a.defineLocale("sr",{months:["januar","februar","mart","april","maj","jun","jul","avgust","septembar","oktobar","novembar","decembar"],monthsShort:["jan.","feb.","mar.","apr.","maj","jun","jul","avg.","sep.","okt.","nov.","dec."],weekdays:["nedelja","ponedeljak","utorak","sreda","četvrtak","petak","subota"],weekdaysShort:["ned.","pon.","uto.","sre.","čet.","pet.","sub."],weekdaysMin:["ne","po","ut","sr","če","pe","su"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){var a=["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",m:Ya.translate,mm:Ya.translate,h:Ya.translate,hh:Ya.translate,d:"dan",dd:Ya.translate,M:"mesec",MM:Ya.translate,y:"godinu",yy:Ya.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),a.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT", +lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinalParse:/\d{1,2}(e|a)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"e":1===b?"a":2===b?"a":"e";return a+c},week:{dow:1,doy:4}}),a.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"masiku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}}),{1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"}),$a={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"},_a=(a.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},ordinalParse:/\d{1,2}வது/,ordinal:function(a){return a+"வது"},preparse:function(a){return a.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,function(a){return $a[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Za[a]})},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(a,b,c){return 2>a?" யாமம்":6>a?" வைகறை":10>a?" காலை":14>a?" நண்பகல்":18>a?" எற்பாடு":22>a?" மாலை":" யாமம்"},meridiemHour:function(a,b){return 12===a&&(a=0),"யாமம்"===b?2>a?a:a+12:"வைகறை"===b||"காலை"===b?a:"நண்பகல்"===b&&a>=10?a:a+12},week:{dow:0,doy:6}}),a.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జూలై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జూలై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},ordinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(a,b){return 12===a&&(a=0),"రాత్రి"===b?4>a?a:a+12:"ఉదయం"===b?a:"మధ్యాహ్నం"===b?a>=10?a:a+12:"సాయంత్రం"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"రాత్రి":10>a?"ఉదయం":17>a?"మధ్యాహ్నం":20>a?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}}),a.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"มกรา_กุมภา_มีนา_เมษา_พฤษภา_มิถุนา_กรกฎา_สิงหา_กันยา_ตุลา_พฤศจิกา_ธันวา".split("_"),weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),longDateFormat:{LT:"H นาฬิกา m นาที",LTS:"H นาฬิกา m นาที s วินาที",L:"YYYY/MM/DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H นาฬิกา m นาที",LLLL:"วันddddที่ D MMMM YYYY เวลา H นาฬิกา m นาที"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(a){return"หลังเที่ยง"===a},meridiem:function(a,b,c){return 12>a?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}}),a.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"[Ngayon sa] LT",nextDay:"[Bukas sa] LT",nextWeek:"dddd [sa] LT",lastDay:"[Kahapon sa] LT",lastWeek:"dddd [huling linggo] LT",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},ordinalParse:/\d{1,2}/,ordinal:function(a){return a},week:{dow:1,doy:4}}),"pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_")),ab=(a.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:S,past:T,s:"puS lup",m:"wa’ tup",mm:U,h:"wa’ rep",hh:U,d:"wa’ jaj",dd:U,M:"wa’ jar",MM:U,y:"wa’ DIS",yy:U},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"});a.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinalParse:/\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,ordinal:function(a){if(0===a)return a+"'ıncı";var b=a%10,c=a%100-b,d=a>=100?100:null;return a+(ab[b]||ab[c]||ab[d])},week:{dow:1,doy:7}}),a.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiem:function(a,b,c){return a>11?c?"d'o":"D'O":c?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:W,m:W,mm:W,h:W,hh:W,d:W,dd:W,M:W,MM:W,y:W,yy:W},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}}),a.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}}),a.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:Z,weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:$("[Сьогодні "),nextDay:$("[Завтра "),lastDay:$("[Вчора "),nextWeek:$("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return $("[Минулої] dddd [").call(this);case 1:case 2:case 4:return $("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:Y,mm:Y,h:"годину",hh:Y,d:"день",dd:Y,M:"місяць",MM:Y,y:"рік",yy:Y},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(a){return/^(дня|вечора)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночі":12>a?"ранку":17>a?"дня":"вечора"},ordinalParse:/\d{1,2}-(й|го)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":case"w":case"W":return a+"-й";case"D":return a+"-го";default:return a}},week:{dow:1,doy:7}}),a.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}}),a.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"),weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần rồi lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},ordinalParse:/\d{1,2}/,ordinal:function(a){return a},week:{dow:1,doy:4}}),a.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah点mm分",LTS:"Ah点m分s秒",L:"YYYY-MM-DD",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah点mm分",LLLL:"YYYY年MMMD日ddddAh点mm分",l:"YYYY-MM-DD",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah点mm分",llll:"YYYY年MMMD日ddddAh点mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(a,b){return 12===a&&(a=0),"凌晨"===b||"早上"===b||"上午"===b?a:"下午"===b||"晚上"===b?a+12:a>=11?a:a+12},meridiem:function(a,b,c){var d=100*a+b;return 600>d?"凌晨":900>d?"早上":1130>d?"上午":1230>d?"中午":1800>d?"下午":"晚上"},calendar:{sameDay:function(){return 0===this.minutes()?"[今天]Ah[点整]":"[今天]LT"},nextDay:function(){return 0===this.minutes()?"[明天]Ah[点整]":"[明天]LT"},lastDay:function(){return 0===this.minutes()?"[昨天]Ah[点整]":"[昨天]LT"},nextWeek:function(){var b,c;return b=a().startOf("week"),c=this.unix()-b.unix()>=604800?"[下]":"[本]",0===this.minutes()?c+"dddAh点整":c+"dddAh点mm"},lastWeek:function(){var b,c;return b=a().startOf("week"),c=this.unix()=11?a:a+12:"下午"===b||"晚上"===b?a+12:void 0},meridiem:function(a,b,c){var d=100*a+b;return 900>d?"早上":1130>d?"上午":1230>d?"中午":1800>d?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},ordinalParse:/\d{1,2}(日|月|週)/,ordinal:function(a,b){switch(b){case"d":case"D":case"DDD":return a+"日";case"M":return a+"月";case"w":case"W":return a+"週";default:return a}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"一分鐘",mm:"%d分鐘",h:"一小時",hh:"%d小時",d:"一天",dd:"%d天",M:"一個月",MM:"%d個月",y:"一年",yy:"%d年"}});a.locale("en")}); \ No newline at end of file diff --git a/bower_components/moment/min/moment-with-locales.js b/bower_components/moment/min/moment-with-locales.js index e2bc4a1..cf58c8e 100644 --- a/bower_components/moment/min/moment-with-locales.js +++ b/bower_components/moment/min/moment-with-locales.js @@ -1,4 +1,4 @@ -(function (global, factory) { +;(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.moment = factory() @@ -115,39 +115,45 @@ return m; } + function isUndefined(input) { + return input === void 0; + } + + // Plugins that add properties should also add the key here (null value), + // so we can properly clone ourselves. var momentProperties = utils_hooks__hooks.momentProperties = []; function copyConfig(to, from) { var i, prop, val; - if (typeof from._isAMomentObject !== 'undefined') { + if (!isUndefined(from._isAMomentObject)) { to._isAMomentObject = from._isAMomentObject; } - if (typeof from._i !== 'undefined') { + if (!isUndefined(from._i)) { to._i = from._i; } - if (typeof from._f !== 'undefined') { + if (!isUndefined(from._f)) { to._f = from._f; } - if (typeof from._l !== 'undefined') { + if (!isUndefined(from._l)) { to._l = from._l; } - if (typeof from._strict !== 'undefined') { + if (!isUndefined(from._strict)) { to._strict = from._strict; } - if (typeof from._tzm !== 'undefined') { + if (!isUndefined(from._tzm)) { to._tzm = from._tzm; } - if (typeof from._isUTC !== 'undefined') { + if (!isUndefined(from._isUTC)) { to._isUTC = from._isUTC; } - if (typeof from._offset !== 'undefined') { + if (!isUndefined(from._offset)) { to._offset = from._offset; } - if (typeof from._pf !== 'undefined') { + if (!isUndefined(from._pf)) { to._pf = getParsingFlags(from); } - if (typeof from._locale !== 'undefined') { + if (!isUndefined(from._locale)) { to._locale = from._locale; } @@ -155,7 +161,7 @@ for (i in momentProperties) { prop = momentProperties[i]; val = from[prop]; - if (typeof val !== 'undefined') { + if (!isUndefined(val)) { to[prop] = val; } } @@ -202,6 +208,7 @@ return value; } + // compare two arrays, return the number of differences function compareArrays(array1, array2, dontConvert) { var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), @@ -219,6 +226,7 @@ function Locale() { } + // internal storage for locale config files var locales = {}; var globalLocale; @@ -256,7 +264,7 @@ function loadLocale(name) { var oldLocale = null; // TODO: Find a better way to register and load all the locales in Node - if (!locales[name] && typeof module !== 'undefined' && + if (!locales[name] && (typeof module !== 'undefined') && module && module.exports) { try { oldLocale = globalLocale._abbr; @@ -275,7 +283,7 @@ function locale_locales__getSetGlobalLocale (key, values) { var data; if (key) { - if (typeof values === 'undefined') { + if (isUndefined(values)) { data = locale_locales__getLocale(key); } else { @@ -360,6 +368,10 @@ return normalizedInput; } + function isFunction(input) { + return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; + } + function makeGetSet (unit, keepTime) { return function (value) { if (value != null) { @@ -373,11 +385,14 @@ } function get_set__get (mom, unit) { - return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit](); + return mom.isValid() ? + mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN; } function get_set__set (mom, unit, value) { - return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); + if (mom.isValid()) { + mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); + } } // MOMENTS @@ -390,7 +405,7 @@ } } else { units = normalizeUnits(units); - if (typeof this[units] === 'function') { + if (isFunction(this[units])) { return this[units](value); } } @@ -405,7 +420,7 @@ Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; } - var formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; + var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g; @@ -501,6 +516,8 @@ var match4 = /\d{4}/; // 0000 - 9999 var match6 = /[+-]?\d{6}/; // -999999 - 999999 var match1to2 = /\d\d?/; // 0 - 99 + var match3to4 = /\d\d\d\d?/; // 999 - 9999 + var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999 var match1to3 = /\d{1,3}/; // 0 - 999 var match1to4 = /\d{1,4}/; // 0 - 9999 var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999 @@ -509,23 +526,19 @@ var matchSigned = /[+-]?\d+/; // -inf - inf var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z + var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123 // any word (or two) characters or numbers including two/three word month in arabic. + // includes scottish gaelic two word and hyphenated months var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i; - var regexes = {}; - - function isFunction (sth) { - // https://github.com/moment/moment/issues/2325 - return typeof sth === 'function' && - Object.prototype.toString.call(sth) === '[object Function]'; - } + var regexes = {}; function addRegexToken (token, regex, strictRegex) { - regexes[token] = isFunction(regex) ? regex : function (isStrict) { + regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) { return (isStrict && strictRegex) ? strictRegex : regex; }; } @@ -540,9 +553,13 @@ // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript function unescapeFormat(s) { - return s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { + return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { return p1 || p2 || p3 || p4; - }).replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); + })); + } + + function regexEscape(s) { + return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); } var tokens = {}; @@ -582,6 +599,8 @@ var MINUTE = 4; var SECOND = 5; var MILLISECOND = 6; + var WEEK = 7; + var WEEKDAY = 8; function daysInMonth(year, month) { return new Date(Date.UTC(year, month + 1, 0)).getUTCDate(); @@ -609,8 +628,12 @@ addRegexToken('M', match1to2); addRegexToken('MM', match1to2, match2); - addRegexToken('MMM', matchWord); - addRegexToken('MMMM', matchWord); + addRegexToken('MMM', function (isStrict, locale) { + return locale.monthsShortRegex(isStrict); + }); + addRegexToken('MMMM', function (isStrict, locale) { + return locale.monthsRegex(isStrict); + }); addParseToken(['M', 'MM'], function (input, array) { array[MONTH] = toInt(input) - 1; @@ -628,14 +651,17 @@ // LOCALES + var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/; var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'); - function localeMonths (m) { - return this._months[m.month()]; + function localeMonths (m, format) { + return isArray(this._months) ? this._months[m.month()] : + this._months[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; } var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'); - function localeMonthsShort (m) { - return this._monthsShort[m.month()]; + function localeMonthsShort (m, format) { + return isArray(this._monthsShort) ? this._monthsShort[m.month()] : + this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; } function localeMonthsParse (monthName, format, strict) { @@ -674,6 +700,11 @@ function setMonth (mom, value) { var dayOfMonth; + if (!mom.isValid()) { + // No op + return mom; + } + // TODO: Move this out of here! if (typeof value === 'string') { value = mom.localeData().monthsParse(value); @@ -702,6 +733,72 @@ return daysInMonth(this.year(), this.month()); } + var defaultMonthsShortRegex = matchWord; + function monthsShortRegex (isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, '_monthsRegex')) { + computeMonthsParse.call(this); + } + if (isStrict) { + return this._monthsShortStrictRegex; + } else { + return this._monthsShortRegex; + } + } else { + return this._monthsShortStrictRegex && isStrict ? + this._monthsShortStrictRegex : this._monthsShortRegex; + } + } + + var defaultMonthsRegex = matchWord; + function monthsRegex (isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, '_monthsRegex')) { + computeMonthsParse.call(this); + } + if (isStrict) { + return this._monthsStrictRegex; + } else { + return this._monthsRegex; + } + } else { + return this._monthsStrictRegex && isStrict ? + this._monthsStrictRegex : this._monthsRegex; + } + } + + function computeMonthsParse () { + function cmpLenRev(a, b) { + return b.length - a.length; + } + + var shortPieces = [], longPieces = [], mixedPieces = [], + i, mom; + for (i = 0; i < 12; i++) { + // make the regex if we don't have it already + mom = create_utc__createUTC([2000, i]); + shortPieces.push(this.monthsShort(mom, '')); + longPieces.push(this.months(mom, '')); + mixedPieces.push(this.months(mom, '')); + mixedPieces.push(this.monthsShort(mom, '')); + } + // Sorting makes sure if one month (or abbr) is a prefix of another it + // will match the longer piece. + shortPieces.sort(cmpLenRev); + longPieces.sort(cmpLenRev); + mixedPieces.sort(cmpLenRev); + for (i = 0; i < 12; i++) { + shortPieces[i] = regexEscape(shortPieces[i]); + longPieces[i] = regexEscape(longPieces[i]); + mixedPieces[i] = regexEscape(mixedPieces[i]); + } + + this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); + this._monthsShortRegex = this._monthsRegex; + this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')$', 'i'); + this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')$', 'i'); + } + function checkOverflow (m) { var overflow; var a = m._a; @@ -719,6 +816,12 @@ if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { overflow = DATE; } + if (getParsingFlags(m)._overflowWeeks && overflow === -1) { + overflow = WEEK; + } + if (getParsingFlags(m)._overflowWeekday && overflow === -1) { + overflow = WEEKDAY; + } getParsingFlags(m).overflow = overflow; } @@ -727,7 +830,8 @@ } function warn(msg) { - if (utils_hooks__hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) { + if (utils_hooks__hooks.suppressDeprecationWarnings === false && + (typeof console !== 'undefined') && console.warn) { console.warn('Deprecation warning: ' + msg); } } @@ -737,7 +841,7 @@ return extend(function () { if (firstTime) { - warn(msg + '\n' + (new Error()).stack); + warn(msg + '\nArguments: ' + Array.prototype.slice.call(arguments).join(', ') + '\n' + (new Error()).stack); firstTime = false; } return fn.apply(this, arguments); @@ -755,22 +859,39 @@ utils_hooks__hooks.suppressDeprecationWarnings = false; - var from_string__isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/; + // iso 8601 regex + // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) + var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/; + var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/; + + var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/; var isoDates = [ - ['YYYYYY-MM-DD', /[+-]\d{6}-\d{2}-\d{2}/], - ['YYYY-MM-DD', /\d{4}-\d{2}-\d{2}/], - ['GGGG-[W]WW-E', /\d{4}-W\d{2}-\d/], - ['GGGG-[W]WW', /\d{4}-W\d{2}/], - ['YYYY-DDD', /\d{4}-\d{3}/] + ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], + ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], + ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], + ['GGGG-[W]WW', /\d{4}-W\d\d/, false], + ['YYYY-DDD', /\d{4}-\d{3}/], + ['YYYY-MM', /\d{4}-\d\d/, false], + ['YYYYYYMMDD', /[+-]\d{10}/], + ['YYYYMMDD', /\d{8}/], + // YYYYMM is NOT allowed by the standard + ['GGGG[W]WWE', /\d{4}W\d{3}/], + ['GGGG[W]WW', /\d{4}W\d{2}/, false], + ['YYYYDDD', /\d{7}/] ]; // iso time formats and regexes var isoTimes = [ - ['HH:mm:ss.SSSS', /(T| )\d\d:\d\d:\d\d\.\d+/], - ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/], - ['HH:mm', /(T| )\d\d:\d\d/], - ['HH', /(T| )\d\d/] + ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], + ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], + ['HH:mm:ss', /\d\d:\d\d:\d\d/], + ['HH:mm', /\d\d:\d\d/], + ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], + ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], + ['HHmmss', /\d\d\d\d\d\d/], + ['HHmm', /\d\d\d\d/], + ['HH', /\d\d/] ]; var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i; @@ -779,26 +900,49 @@ function configFromISO(config) { var i, l, string = config._i, - match = from_string__isoRegex.exec(string); + match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), + allowTime, dateFormat, timeFormat, tzFormat; if (match) { getParsingFlags(config).iso = true; + for (i = 0, l = isoDates.length; i < l; i++) { - if (isoDates[i][1].exec(string)) { - config._f = isoDates[i][0]; + if (isoDates[i][1].exec(match[1])) { + dateFormat = isoDates[i][0]; + allowTime = isoDates[i][2] !== false; break; } } - for (i = 0, l = isoTimes.length; i < l; i++) { - if (isoTimes[i][1].exec(string)) { - // match[6] should be 'T' or space - config._f += (match[6] || ' ') + isoTimes[i][0]; - break; + if (dateFormat == null) { + config._isValid = false; + return; + } + if (match[3]) { + for (i = 0, l = isoTimes.length; i < l; i++) { + if (isoTimes[i][1].exec(match[3])) { + // match[2] should be 'T' or space + timeFormat = (match[2] || ' ') + isoTimes[i][0]; + break; + } + } + if (timeFormat == null) { + config._isValid = false; + return; } } - if (string.match(matchOffset)) { - config._f += 'Z'; + if (!allowTime && timeFormat != null) { + config._isValid = false; + return; } + if (match[4]) { + if (tzRegex.exec(match[4])) { + tzFormat = 'Z'; + } else { + config._isValid = false; + return; + } + } + config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); configFromStringAndFormat(config); } else { config._isValid = false; @@ -836,8 +980,8 @@ //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply var date = new Date(y, m, d, h, M, s, ms); - //the date constructor doesn't accept years < 1970 - if (y < 1970) { + //the date constructor remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0 && isFinite(date.getFullYear())) { date.setFullYear(y); } return date; @@ -845,12 +989,21 @@ function createUTCDate (y) { var date = new Date(Date.UTC.apply(null, arguments)); - if (y < 1970) { + + //the Date.UTC function remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) { date.setUTCFullYear(y); } return date; } + // FORMATTING + + addFormatToken('Y', 0, 0, function () { + var y = this.year(); + return y <= 9999 ? '' + y : '+' + y; + }); + addFormatToken(0, ['YY', 2], 0, function () { return this.year() % 100; }); @@ -878,6 +1031,9 @@ addParseToken('YY', function (input, array) { array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input); }); + addParseToken('Y', function (input, array) { + array[YEAR] = parseInt(input, 10); + }); // HELPERS @@ -903,124 +1059,66 @@ return isLeapYear(this.year()); } - addFormatToken('w', ['ww', 2], 'wo', 'week'); - addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); - - // ALIASES - - addUnitAlias('week', 'w'); - addUnitAlias('isoWeek', 'W'); - - // PARSING - - addRegexToken('w', match1to2); - addRegexToken('ww', match1to2, match2); - addRegexToken('W', match1to2); - addRegexToken('WW', match1to2, match2); - - addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { - week[token.substr(0, 1)] = toInt(input); - }); - - // HELPERS - - // firstDayOfWeek 0 = sun, 6 = sat - // the day of the week that starts the week - // (usually sunday or monday) - // firstDayOfWeekOfYear 0 = sun, 6 = sat - // the first week is the week that contains the first - // of this day of the week - // (eg. ISO weeks use thursday (4)) - function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) { - var end = firstDayOfWeekOfYear - firstDayOfWeek, - daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(), - adjustedMoment; + // start-of-first-week - start-of-year + function firstWeekOffset(year, dow, doy) { + var // first-week day -- which january is always in the first week (4 for iso, 1 for other) + fwd = 7 + dow - doy, + // first-week day local weekday -- which local weekday is fwd + fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; + return -fwdlw + fwd - 1; + } - if (daysToDayOfWeek > end) { - daysToDayOfWeek -= 7; - } - - if (daysToDayOfWeek < end - 7) { - daysToDayOfWeek += 7; + //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday + function dayOfYearFromWeeks(year, week, weekday, dow, doy) { + var localWeekday = (7 + weekday - dow) % 7, + weekOffset = firstWeekOffset(year, dow, doy), + dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, + resYear, resDayOfYear; + + if (dayOfYear <= 0) { + resYear = year - 1; + resDayOfYear = daysInYear(resYear) + dayOfYear; + } else if (dayOfYear > daysInYear(year)) { + resYear = year + 1; + resDayOfYear = dayOfYear - daysInYear(year); + } else { + resYear = year; + resDayOfYear = dayOfYear; } - adjustedMoment = local__createLocal(mom).add(daysToDayOfWeek, 'd'); return { - week: Math.ceil(adjustedMoment.dayOfYear() / 7), - year: adjustedMoment.year() + year: resYear, + dayOfYear: resDayOfYear }; } - // LOCALES - - function localeWeek (mom) { - return weekOfYear(mom, this._week.dow, this._week.doy).week; - } - - var defaultLocaleWeek = { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - }; - - function localeFirstDayOfWeek () { - return this._week.dow; - } - - function localeFirstDayOfYear () { - return this._week.doy; - } - - // MOMENTS - - function getSetWeek (input) { - var week = this.localeData().week(this); - return input == null ? week : this.add((input - week) * 7, 'd'); - } - - function getSetISOWeek (input) { - var week = weekOfYear(this, 1, 4).week; - return input == null ? week : this.add((input - week) * 7, 'd'); - } - - addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); - - // ALIASES - - addUnitAlias('dayOfYear', 'DDD'); - - // PARSING + function weekOfYear(mom, dow, doy) { + var weekOffset = firstWeekOffset(mom.year(), dow, doy), + week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, + resWeek, resYear; - addRegexToken('DDD', match1to3); - addRegexToken('DDDD', match3); - addParseToken(['DDD', 'DDDD'], function (input, array, config) { - config._dayOfYear = toInt(input); - }); - - // HELPERS - - //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday - function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) { - var week1Jan = 6 + firstDayOfWeek - firstDayOfWeekOfYear, janX = createUTCDate(year, 0, 1 + week1Jan), d = janX.getUTCDay(), dayOfYear; - if (d < firstDayOfWeek) { - d += 7; + if (week < 1) { + resYear = mom.year() - 1; + resWeek = week + weeksInYear(resYear, dow, doy); + } else if (week > weeksInYear(mom.year(), dow, doy)) { + resWeek = week - weeksInYear(mom.year(), dow, doy); + resYear = mom.year() + 1; + } else { + resYear = mom.year(); + resWeek = week; } - weekday = weekday != null ? 1 * weekday : firstDayOfWeek; - - dayOfYear = 1 + week1Jan + 7 * (week - 1) - d + weekday; - return { - year: dayOfYear > 0 ? year : year - 1, - dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear + week: resWeek, + year: resYear }; } - // MOMENTS - - function getSetDayOfYear (input) { - var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; - return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); + function weeksInYear(year, dow, doy) { + var weekOffset = firstWeekOffset(year, dow, doy), + weekOffsetNext = firstWeekOffset(year + 1, dow, doy); + return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; } // Pick the first defined of two or three arguments. @@ -1035,11 +1133,12 @@ } function currentDateArray(config) { - var now = new Date(); + // hooks is actually the exported moment object + var nowValue = new Date(utils_hooks__hooks.now()); if (config._useUTC) { - return [now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()]; + return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()]; } - return [now.getFullYear(), now.getMonth(), now.getDate()]; + return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; } // convert an array to a date. @@ -1109,7 +1208,7 @@ } function dayOfYearFromWeekInfo(config) { - var w, weekYear, week, weekday, dow, doy, temp; + var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow; w = config._w; if (w.GG != null || w.W != null || w.E != null) { @@ -1123,6 +1222,9 @@ weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year); week = defaults(w.W, 1); weekday = defaults(w.E, 1); + if (weekday < 1 || weekday > 7) { + weekdayOverflow = true; + } } else { dow = config._locale._week.dow; doy = config._locale._week.doy; @@ -1133,23 +1235,32 @@ if (w.d != null) { // weekday -- low day numbers are considered next week weekday = w.d; - if (weekday < dow) { - ++week; + if (weekday < 0 || weekday > 6) { + weekdayOverflow = true; } } else if (w.e != null) { // local weekday -- counting starts from begining of week weekday = w.e + dow; + if (w.e < 0 || w.e > 6) { + weekdayOverflow = true; + } } else { // default to begining of week weekday = dow; } } - temp = dayOfYearFromWeeks(weekYear, week, weekday, doy, dow); - - config._a[YEAR] = temp.year; - config._dayOfYear = temp.dayOfYear; + if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { + getParsingFlags(config)._overflowWeeks = true; + } else if (weekdayOverflow != null) { + getParsingFlags(config)._overflowWeekday = true; + } else { + temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); + config._a[YEAR] = temp.year; + config._dayOfYear = temp.dayOfYear; + } } + // constant that refers to the ISO standard utils_hooks__hooks.ISO_8601 = function () {}; // date from string and format string @@ -1174,6 +1285,8 @@ for (i = 0; i < tokens.length; i++) { token = tokens[i]; parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; + // console.log('token', token, 'parsedInput', parsedInput, + // 'regex', getParseRegexForToken(token, config)); if (parsedInput) { skipped = string.substr(0, string.indexOf(parsedInput)); if (skipped.length > 0) { @@ -1242,6 +1355,7 @@ } } + // date from string and array of format strings function configFromStringAndArray(config) { var tempConfig, bestMoment, @@ -1292,7 +1406,9 @@ } var i = normalizeObjectUnits(config._i); - config._a = [i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond]; + config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) { + return obj && parseInt(obj, 10); + }); configFromArray(config); } @@ -1334,13 +1450,17 @@ configFromInput(config); } + if (!valid__isValid(config)) { + config._d = null; + } + return config; } function configFromInput(config) { var input = config._i; if (input === undefined) { - config._d = new Date(); + config._d = new Date(utils_hooks__hooks.now()); } else if (isDate(input)) { config._d = new Date(+input); } else if (typeof input === 'string') { @@ -1387,7 +1507,11 @@ 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', function () { var other = local__createLocal.apply(null, arguments); - return other < this ? this : other; + if (this.isValid() && other.isValid()) { + return other < this ? this : other; + } else { + return valid__createInvalid(); + } } ); @@ -1395,7 +1519,11 @@ 'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', function () { var other = local__createLocal.apply(null, arguments); - return other > this ? this : other; + if (this.isValid() && other.isValid()) { + return other > this ? this : other; + } else { + return valid__createInvalid(); + } } ); @@ -1434,6 +1562,10 @@ return pickBy('isAfter', args); } + var now = function () { + return Date.now ? Date.now() : +(new Date()); + }; + function Duration (duration) { var normalizedInput = normalizeObjectUnits(duration), years = normalizedInput.year || 0, @@ -1473,6 +1605,8 @@ return obj instanceof Duration; } + // FORMATTING + function offset (token, separator) { addFormatToken(token, 0, 0, function () { var offset = this.utcOffset(); @@ -1490,11 +1624,11 @@ // PARSING - addRegexToken('Z', matchOffset); - addRegexToken('ZZ', matchOffset); + addRegexToken('Z', matchShortOffset); + addRegexToken('ZZ', matchShortOffset); addParseToken(['Z', 'ZZ'], function (input, array, config) { config._useUTC = true; - config._tzm = offsetFromString(input); + config._tzm = offsetFromString(matchShortOffset, input); }); // HELPERS @@ -1504,8 +1638,8 @@ // '-1530' > ['-15', '30'] var chunkOffset = /([\+\-]|\d\d)/gi; - function offsetFromString(string) { - var matches = ((string || '').match(matchOffset) || []); + function offsetFromString(matcher, string) { + var matches = ((string || '').match(matcher) || []); var chunk = matches[matches.length - 1] || []; var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; var minutes = +(parts[1] * 60) + toInt(parts[2]); @@ -1555,11 +1689,13 @@ function getSetOffset (input, keepLocalTime) { var offset = this._offset || 0, localAdjust; + if (!this.isValid()) { + return input != null ? this : NaN; + } if (input != null) { if (typeof input === 'string') { - input = offsetFromString(input); - } - if (Math.abs(input) < 16) { + input = offsetFromString(matchShortOffset, input); + } else if (Math.abs(input) < 16) { input = input * 60; } if (!this._isUTC && keepLocalTime) { @@ -1619,12 +1755,15 @@ if (this._tzm) { this.utcOffset(this._tzm); } else if (typeof this._i === 'string') { - this.utcOffset(offsetFromString(this._i)); + this.utcOffset(offsetFromString(matchOffset, this._i)); } return this; } function hasAlignedHourOffset (input) { + if (!this.isValid()) { + return false; + } input = input ? local__createLocal(input).utcOffset() : 0; return (this.utcOffset() - input) % 60 === 0; @@ -1638,7 +1777,7 @@ } function isDaylightSavingTimeShifted () { - if (typeof this._isDSTShifted !== 'undefined') { + if (!isUndefined(this._isDSTShifted)) { return this._isDSTShifted; } @@ -1659,22 +1798,23 @@ } function isLocal () { - return !this._isUTC; + return this.isValid() ? !this._isUTC : false; } function isUtcOffset () { - return this._isUTC; + return this.isValid() ? this._isUTC : false; } function isUtc () { - return this._isUTC && this._offset === 0; + return this.isValid() ? this._isUTC && this._offset === 0 : false; } - var aspNetRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/; + // ASP.NET json date format regex + var aspNetRegex = /(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/; // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere - var create__isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/; + var isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/; function create__createDuration (input, key) { var duration = input, @@ -1707,7 +1847,7 @@ s : toInt(match[SECOND]) * sign, ms : toInt(match[MILLISECOND]) * sign }; - } else if (!!(match = create__isoRegex.exec(input))) { + } else if (!!(match = isoRegex.exec(input))) { sign = (match[1] === '-') ? -1 : 1; duration = { y : parseIso(match[2], sign), @@ -1764,6 +1904,10 @@ function momentsDifference(base, other) { var res; + if (!(base.isValid() && other.isValid())) { + return {milliseconds: 0, months: 0}; + } + other = cloneWithOffset(other, base); if (base.isBefore(other)) { res = positiveMomentsDifference(base, other); @@ -1776,6 +1920,7 @@ return res; } + // TODO: remove 'name' arg after deprecation is removed function createAdder(direction, name) { return function (val, period) { var dur, tmp; @@ -1796,6 +1941,12 @@ var milliseconds = duration._milliseconds, days = duration._days, months = duration._months; + + if (!mom.isValid()) { + // No op + return; + } + updateOffset = updateOffset == null ? true : updateOffset; if (milliseconds) { @@ -1827,7 +1978,10 @@ diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse'; - return this.format(formats && formats[format] || this.localeData().calendar(format, this, local__createLocal(now))); + + var output = formats && (isFunction(formats[format]) ? formats[format]() : formats[format]); + + return this.format(output || this.localeData().calendar(format, this, local__createLocal(now))); } function clone () { @@ -1835,26 +1989,28 @@ } function isAfter (input, units) { - var inputMs; - units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); + var localInput = isMoment(input) ? input : local__createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); if (units === 'millisecond') { - input = isMoment(input) ? input : local__createLocal(input); - return +this > +input; + return +this > +localInput; } else { - inputMs = isMoment(input) ? +input : +local__createLocal(input); - return inputMs < +this.clone().startOf(units); + return +localInput < +this.clone().startOf(units); } } function isBefore (input, units) { - var inputMs; - units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); + var localInput = isMoment(input) ? input : local__createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); if (units === 'millisecond') { - input = isMoment(input) ? input : local__createLocal(input); - return +this < +input; + return +this < +localInput; } else { - inputMs = isMoment(input) ? +input : +local__createLocal(input); - return +this.clone().endOf(units) < inputMs; + return +this.clone().endOf(units) < +localInput; } } @@ -1863,22 +2019,45 @@ } function isSame (input, units) { - var inputMs; + var localInput = isMoment(input) ? input : local__createLocal(input), + inputMs; + if (!(this.isValid() && localInput.isValid())) { + return false; + } units = normalizeUnits(units || 'millisecond'); if (units === 'millisecond') { - input = isMoment(input) ? input : local__createLocal(input); - return +this === +input; + return +this === +localInput; } else { - inputMs = +local__createLocal(input); + inputMs = +localInput; return +(this.clone().startOf(units)) <= inputMs && inputMs <= +(this.clone().endOf(units)); } } + function isSameOrAfter (input, units) { + return this.isSame(input, units) || this.isAfter(input,units); + } + + function isSameOrBefore (input, units) { + return this.isSame(input, units) || this.isBefore(input,units); + } + function diff (input, units, asFloat) { - var that = cloneWithOffset(input, this), - zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4, + var that, + zoneDelta, delta, output; + if (!this.isValid()) { + return NaN; + } + + that = cloneWithOffset(input, this); + + if (!that.isValid()) { + return NaN; + } + + zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; + units = normalizeUnits(units); if (units === 'year' || units === 'month' || units === 'quarter') { @@ -1929,7 +2108,7 @@ function moment_format__toISOString () { var m = this.clone().utc(); if (0 < m.year() && m.year() <= 9999) { - if ('function' === typeof Date.prototype.toISOString) { + if (isFunction(Date.prototype.toISOString)) { // native implementation is ~50x faster, use it when we can return this.toDate().toISOString(); } else { @@ -1946,10 +2125,13 @@ } function from (time, withoutSuffix) { - if (!this.isValid()) { + if (this.isValid() && + ((isMoment(time) && time.isValid()) || + local__createLocal(time).isValid())) { + return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); + } else { return this.localeData().invalidDate(); } - return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); } function fromNow (withoutSuffix) { @@ -1957,16 +2139,22 @@ } function to (time, withoutSuffix) { - if (!this.isValid()) { + if (this.isValid() && + ((isMoment(time) && time.isValid()) || + local__createLocal(time).isValid())) { + return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); + } else { return this.localeData().invalidDate(); } - return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); } function toNow (withoutSuffix) { return this.to(local__createLocal(), withoutSuffix); } + // If passed a locale key, it will set the locale for this + // instance. Otherwise, it will return the locale configuration + // variables for this instance. function locale (key) { var newLocaleData; @@ -2077,6 +2265,11 @@ }; } + function toJSON () { + // JSON.stringify(new Date(NaN)) === 'null' + return this.isValid() ? this.toISOString() : 'null'; + } + function moment_valid__isValid () { return valid__isValid(this); } @@ -2089,6 +2282,18 @@ return getParsingFlags(this).overflow; } + function creationData() { + return { + input: this._i, + format: this._f, + locale: this._locale, + isUTC: this._isUTC, + strict: this._strict + }; + } + + // FORMATTING + addFormatToken(0, ['gg', 2], 0, function () { return this.weekYear() % 100; }); @@ -2130,22 +2335,20 @@ week[token] = utils_hooks__hooks.parseTwoDigitYear(input); }); - // HELPERS - - function weeksInYear(year, dow, doy) { - return weekOfYear(local__createLocal([year, 11, 31 + dow - doy]), dow, doy).week; - } - // MOMENTS function getSetWeekYear (input) { - var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year; - return input == null ? year : this.add((input - year), 'y'); + return getSetWeekYearHelper.call(this, + input, + this.week(), + this.weekday(), + this.localeData()._week.dow, + this.localeData()._week.doy); } function getSetISOWeekYear (input) { - var year = weekOfYear(this, 1, 4).year; - return input == null ? year : this.add((input - year), 'y'); + return getSetWeekYearHelper.call(this, + input, this.isoWeek(), this.isoWeekday(), 1, 4); } function getISOWeeksInYear () { @@ -2157,7 +2360,33 @@ return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); } - addFormatToken('Q', 0, 0, 'quarter'); + function getSetWeekYearHelper(input, week, weekday, dow, doy) { + var weeksTarget; + if (input == null) { + return weekOfYear(this, dow, doy).year; + } else { + weeksTarget = weeksInYear(input, dow, doy); + if (week > weeksTarget) { + week = weeksTarget; + } + return setWeekAll.call(this, input, week, weekday, dow, doy); + } + } + + function setWeekAll(weekYear, week, weekday, dow, doy) { + var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), + date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); + + // console.log("got", weekYear, week, weekday, "set", date.toISOString()); + this.year(date.getUTCFullYear()); + this.month(date.getUTCMonth()); + this.date(date.getUTCDate()); + return this; + } + + // FORMATTING + + addFormatToken('Q', 0, 'Qo', 'quarter'); // ALIASES @@ -2176,6 +2405,62 @@ return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); } + // FORMATTING + + addFormatToken('w', ['ww', 2], 'wo', 'week'); + addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); + + // ALIASES + + addUnitAlias('week', 'w'); + addUnitAlias('isoWeek', 'W'); + + // PARSING + + addRegexToken('w', match1to2); + addRegexToken('ww', match1to2, match2); + addRegexToken('W', match1to2); + addRegexToken('WW', match1to2, match2); + + addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { + week[token.substr(0, 1)] = toInt(input); + }); + + // HELPERS + + // LOCALES + + function localeWeek (mom) { + return weekOfYear(mom, this._week.dow, this._week.doy).week; + } + + var defaultLocaleWeek = { + dow : 0, // Sunday is the first day of the week. + doy : 6 // The week that contains Jan 1st is the first week of the year. + }; + + function localeFirstDayOfWeek () { + return this._week.dow; + } + + function localeFirstDayOfYear () { + return this._week.doy; + } + + // MOMENTS + + function getSetWeek (input) { + var week = this.localeData().week(this); + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + function getSetISOWeek (input) { + var week = weekOfYear(this, 1, 4).week; + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + // FORMATTING + addFormatToken('D', ['DD', 2], 'Do', 'date'); // ALIASES @@ -2199,6 +2484,8 @@ var getSetDayOfMonth = makeGetSet('Date', true); + // FORMATTING + addFormatToken('d', 0, 'do', 'day'); addFormatToken('dd', 0, 0, function (format) { @@ -2231,8 +2518,8 @@ addRegexToken('ddd', matchWord); addRegexToken('dddd', matchWord); - addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config) { - var weekday = config._locale.weekdaysParse(input); + addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { + var weekday = config._locale.weekdaysParse(input, token, config._strict); // if we didn't get a weekday name, mark the date as invalid if (weekday != null) { week.d = weekday; @@ -2267,8 +2554,9 @@ // LOCALES var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'); - function localeWeekdays (m) { - return this._weekdays[m.day()]; + function localeWeekdays (m, format) { + return isArray(this._weekdays) ? this._weekdays[m.day()] : + this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()]; } var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'); @@ -2281,20 +2569,37 @@ return this._weekdaysMin[m.day()]; } - function localeWeekdaysParse (weekdayName) { + function localeWeekdaysParse (weekdayName, format, strict) { var i, mom, regex; - this._weekdaysParse = this._weekdaysParse || []; + if (!this._weekdaysParse) { + this._weekdaysParse = []; + this._minWeekdaysParse = []; + this._shortWeekdaysParse = []; + this._fullWeekdaysParse = []; + } for (i = 0; i < 7; i++) { // make the regex if we don't have it already + + mom = local__createLocal([2000, 1]).day(i); + if (strict && !this._fullWeekdaysParse[i]) { + this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i'); + this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i'); + this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i'); + } if (!this._weekdaysParse[i]) { - mom = local__createLocal([2000, 1]).day(i); regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex - if (this._weekdaysParse[i].test(weekdayName)) { + if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { return i; } } @@ -2303,6 +2608,9 @@ // MOMENTS function getSetDayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); if (input != null) { input = parseWeekday(input, this.localeData()); @@ -2313,20 +2621,73 @@ } function getSetLocaleDayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; return input == null ? weekday : this.add(input - weekday, 'd'); } function getSetISODayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } // behaves the same as moment#day except // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) // as a setter, sunday should belong to the previous week. return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7); } - addFormatToken('H', ['HH', 2], 0, 'hour'); - addFormatToken('h', ['hh', 2], 0, function () { + // FORMATTING + + addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); + + // ALIASES + + addUnitAlias('dayOfYear', 'DDD'); + + // PARSING + + addRegexToken('DDD', match1to3); + addRegexToken('DDDD', match3); + addParseToken(['DDD', 'DDDD'], function (input, array, config) { + config._dayOfYear = toInt(input); + }); + + // HELPERS + + // MOMENTS + + function getSetDayOfYear (input) { + var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; + return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); + } + + // FORMATTING + + function hFormat() { return this.hours() % 12 || 12; + } + + addFormatToken('H', ['HH', 2], 0, 'hour'); + addFormatToken('h', ['hh', 2], 0, hFormat); + + addFormatToken('hmm', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); + }); + + addFormatToken('hmmss', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + + zeroFill(this.seconds(), 2); + }); + + addFormatToken('Hmm', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2); + }); + + addFormatToken('Hmmss', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2) + + zeroFill(this.seconds(), 2); }); function meridiem (token, lowercase) { @@ -2355,6 +2716,11 @@ addRegexToken('HH', match1to2, match2); addRegexToken('hh', match1to2, match2); + addRegexToken('hmm', match3to4); + addRegexToken('hmmss', match5to6); + addRegexToken('Hmm', match3to4); + addRegexToken('Hmmss', match5to6); + addParseToken(['H', 'HH'], HOUR); addParseToken(['a', 'A'], function (input, array, config) { config._isPm = config._locale.isPM(input); @@ -2364,6 +2730,32 @@ array[HOUR] = toInt(input); getParsingFlags(config).bigHour = true; }); + addParseToken('hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); + getParsingFlags(config).bigHour = true; + }); + addParseToken('hmmss', function (input, array, config) { + var pos1 = input.length - 4; + var pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); + getParsingFlags(config).bigHour = true; + }); + addParseToken('Hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); + }); + addParseToken('Hmmss', function (input, array, config) { + var pos1 = input.length - 4; + var pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); + }); // LOCALES @@ -2391,6 +2783,8 @@ // this rule. var getSetHour = makeGetSet('Hours', true); + // FORMATTING + addFormatToken('m', ['mm', 2], 0, 'minute'); // ALIASES @@ -2407,6 +2801,8 @@ var getSetMinute = makeGetSet('Minutes', false); + // FORMATTING + addFormatToken('s', ['ss', 2], 0, 'second'); // ALIASES @@ -2423,6 +2819,8 @@ var getSetSecond = makeGetSet('Seconds', false); + // FORMATTING + addFormatToken('S', 0, 0, function () { return ~~(this.millisecond() / 100); }); @@ -2478,6 +2876,8 @@ var getSetMillisecond = makeGetSet('Milliseconds', false); + // FORMATTING + addFormatToken('z', 0, 0, 'zoneAbbr'); addFormatToken('zz', 0, 0, 'zoneName'); @@ -2493,40 +2893,43 @@ var momentPrototype__proto = Moment.prototype; - momentPrototype__proto.add = add_subtract__add; - momentPrototype__proto.calendar = moment_calendar__calendar; - momentPrototype__proto.clone = clone; - momentPrototype__proto.diff = diff; - momentPrototype__proto.endOf = endOf; - momentPrototype__proto.format = moment_format__format; - momentPrototype__proto.from = from; - momentPrototype__proto.fromNow = fromNow; - momentPrototype__proto.to = to; - momentPrototype__proto.toNow = toNow; - momentPrototype__proto.get = getSet; - momentPrototype__proto.invalidAt = invalidAt; - momentPrototype__proto.isAfter = isAfter; - momentPrototype__proto.isBefore = isBefore; - momentPrototype__proto.isBetween = isBetween; - momentPrototype__proto.isSame = isSame; - momentPrototype__proto.isValid = moment_valid__isValid; - momentPrototype__proto.lang = lang; - momentPrototype__proto.locale = locale; - momentPrototype__proto.localeData = localeData; - momentPrototype__proto.max = prototypeMax; - momentPrototype__proto.min = prototypeMin; - momentPrototype__proto.parsingFlags = parsingFlags; - momentPrototype__proto.set = getSet; - momentPrototype__proto.startOf = startOf; - momentPrototype__proto.subtract = add_subtract__subtract; - momentPrototype__proto.toArray = toArray; - momentPrototype__proto.toObject = toObject; - momentPrototype__proto.toDate = toDate; - momentPrototype__proto.toISOString = moment_format__toISOString; - momentPrototype__proto.toJSON = moment_format__toISOString; - momentPrototype__proto.toString = toString; - momentPrototype__proto.unix = unix; - momentPrototype__proto.valueOf = to_type__valueOf; + momentPrototype__proto.add = add_subtract__add; + momentPrototype__proto.calendar = moment_calendar__calendar; + momentPrototype__proto.clone = clone; + momentPrototype__proto.diff = diff; + momentPrototype__proto.endOf = endOf; + momentPrototype__proto.format = moment_format__format; + momentPrototype__proto.from = from; + momentPrototype__proto.fromNow = fromNow; + momentPrototype__proto.to = to; + momentPrototype__proto.toNow = toNow; + momentPrototype__proto.get = getSet; + momentPrototype__proto.invalidAt = invalidAt; + momentPrototype__proto.isAfter = isAfter; + momentPrototype__proto.isBefore = isBefore; + momentPrototype__proto.isBetween = isBetween; + momentPrototype__proto.isSame = isSame; + momentPrototype__proto.isSameOrAfter = isSameOrAfter; + momentPrototype__proto.isSameOrBefore = isSameOrBefore; + momentPrototype__proto.isValid = moment_valid__isValid; + momentPrototype__proto.lang = lang; + momentPrototype__proto.locale = locale; + momentPrototype__proto.localeData = localeData; + momentPrototype__proto.max = prototypeMax; + momentPrototype__proto.min = prototypeMin; + momentPrototype__proto.parsingFlags = parsingFlags; + momentPrototype__proto.set = getSet; + momentPrototype__proto.startOf = startOf; + momentPrototype__proto.subtract = add_subtract__subtract; + momentPrototype__proto.toArray = toArray; + momentPrototype__proto.toObject = toObject; + momentPrototype__proto.toDate = toDate; + momentPrototype__proto.toISOString = moment_format__toISOString; + momentPrototype__proto.toJSON = toJSON; + momentPrototype__proto.toString = toString; + momentPrototype__proto.unix = unix; + momentPrototype__proto.valueOf = to_type__valueOf; + momentPrototype__proto.creationData = creationData; // Year momentPrototype__proto.year = getSetYear; @@ -2612,7 +3015,7 @@ function locale_calendar__calendar (key, mom, now) { var output = this._calendar[key]; - return typeof output === 'function' ? output.call(mom, now) : output; + return isFunction(output) ? output.call(mom, now) : output; } var defaultLongDateFormat = { @@ -2674,21 +3077,21 @@ function relative__relativeTime (number, withoutSuffix, string, isFuture) { var output = this._relativeTime[string]; - return (typeof output === 'function') ? + return (isFunction(output)) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number); } function pastFuture (diff, output) { var format = this._relativeTime[diff > 0 ? 'future' : 'past']; - return typeof format === 'function' ? format(output) : format.replace(/%s/i, output); + return isFunction(format) ? format(output) : format.replace(/%s/i, output); } function locale_set__set (config) { var prop, i; for (i in config) { prop = config[i]; - if (typeof prop === 'function') { + if (isFunction(prop)) { this[i] = prop; } else { this['_' + i] = prop; @@ -2718,11 +3121,15 @@ prototype__proto.set = locale_set__set; // Month - prototype__proto.months = localeMonths; - prototype__proto._months = defaultLocaleMonths; - prototype__proto.monthsShort = localeMonthsShort; - prototype__proto._monthsShort = defaultLocaleMonthsShort; - prototype__proto.monthsParse = localeMonthsParse; + prototype__proto.months = localeMonths; + prototype__proto._months = defaultLocaleMonths; + prototype__proto.monthsShort = localeMonthsShort; + prototype__proto._monthsShort = defaultLocaleMonthsShort; + prototype__proto.monthsParse = localeMonthsParse; + prototype__proto._monthsRegex = defaultMonthsRegex; + prototype__proto.monthsRegex = monthsRegex; + prototype__proto._monthsShortRegex = defaultMonthsShortRegex; + prototype__proto.monthsShortRegex = monthsShortRegex; // Week prototype__proto.week = localeWeek; @@ -3010,15 +3417,15 @@ var years = round(duration.as('y')); var a = seconds < thresholds.s && ['s', seconds] || - minutes === 1 && ['m'] || + minutes <= 1 && ['m'] || minutes < thresholds.m && ['mm', minutes] || - hours === 1 && ['h'] || + hours <= 1 && ['h'] || hours < thresholds.h && ['hh', hours] || - days === 1 && ['d'] || + days <= 1 && ['d'] || days < thresholds.d && ['dd', days] || - months === 1 && ['M'] || + months <= 1 && ['M'] || months < thresholds.M && ['MM', months] || - years === 1 && ['y'] || ['yy', years]; + years <= 1 && ['y'] || ['yy', years]; a[2] = withoutSuffix; a[3] = +posNegDuration > 0; @@ -3139,6 +3546,8 @@ // Side effect imports + // FORMATTING + addFormatToken('X', 0, 0, 'unix'); addFormatToken('x', 0, 0, 'valueOf'); @@ -3158,18 +3567,19 @@ ; //! moment.js - //! version : 2.10.6 + //! version : 2.11.1 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com - utils_hooks__hooks.version = '2.10.6'; + utils_hooks__hooks.version = '2.11.1'; setHookCallback(local__createLocal); utils_hooks__hooks.fn = momentPrototype; utils_hooks__hooks.min = min; utils_hooks__hooks.max = max; + utils_hooks__hooks.now = now; utils_hooks__hooks.utc = create_utc__createUTC; utils_hooks__hooks.unix = moment_moment__createUnix; utils_hooks__hooks.months = lists__listMonths; @@ -3188,14 +3598,15 @@ utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort; utils_hooks__hooks.normalizeUnits = normalizeUnits; utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold; + utils_hooks__hooks.prototype = momentPrototype; - var _moment__default = utils_hooks__hooks; + var moment__default = utils_hooks__hooks; //! moment.js locale configuration //! locale : afrikaans (af) //! author : Werner Mollentze : https://github.com/wernerm - var af = _moment__default.defineLocale('af', { + var af = moment__default.defineLocale('af', { months : 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split('_'), monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'), weekdays : 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split('_'), @@ -3258,7 +3669,7 @@ //! author : ElFadili Yassine : https://github.com/ElFadiliY //! author : Abdel Said : https://github.com/abdelsaid - var ar_ma = _moment__default.defineLocale('ar-ma', { + var ar_ma = moment__default.defineLocale('ar-ma', { months : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'), monthsShort : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'), weekdays : 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), @@ -3329,7 +3740,7 @@ '٠': '0' }; - var ar_sa = _moment__default.defineLocale('ar-sa', { + var ar_sa = moment__default.defineLocale('ar-sa', { months : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'), monthsShort : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'), weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), @@ -3396,7 +3807,7 @@ //! moment.js locale configuration //! locale : Tunisian Arabic (ar-tn) - var ar_tn = _moment__default.defineLocale('ar-tn', { + var ar_tn = moment__default.defineLocale('ar-tn', { months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'), monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'), weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), @@ -3500,7 +3911,7 @@ 'كانون الأول ديسمبر' ]; - var ar = _moment__default.defineLocale('ar', { + var ar = moment__default.defineLocale('ar', { months : ar__months, monthsShort : ar__months, weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), @@ -3589,7 +4000,7 @@ 90: '-ıncı' }; - var az = _moment__default.defineLocale('az', { + var az = moment__default.defineLocale('az', { months : 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split('_'), monthsShort : 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'), weekdays : 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split('_'), @@ -3685,31 +4096,18 @@ return number + ' ' + be__plural(format[key], +number); } } - function be__monthsCaseReplace(m, format) { - var months = { - 'nominative': 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_'), - 'accusative': 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_') - }, - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return months[nounCase][m.month()]; - } - function be__weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'), - 'accusative': 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_') - }, - nounCase = (/\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/).test(format) ? - 'accusative' : - 'nominative'; - return weekdays[nounCase][m.day()]; - } - var be = _moment__default.defineLocale('be', { - months : be__monthsCaseReplace, + var be = moment__default.defineLocale('be', { + months : { + format: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_'), + standalone: 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_') + }, monthsShort : 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'), - weekdays : be__weekdaysCaseReplace, + weekdays : { + format: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_'), + standalone: 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'), + isFormat: /\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/ + }, weekdaysShort : 'нд_пн_ат_ср_чц_пт_сб'.split('_'), weekdaysMin : 'нд_пн_ат_ср_чц_пт_сб'.split('_'), longDateFormat : { @@ -3797,7 +4195,7 @@ //! locale : bulgarian (bg) //! author : Krasen Borisov : https://github.com/kraz - var bg = _moment__default.defineLocale('bg', { + var bg = moment__default.defineLocale('bg', { months : 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'), monthsShort : 'янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'), weekdays : 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split('_'), @@ -3901,11 +4299,11 @@ '০': '0' }; - var bn = _moment__default.defineLocale('bn', { + var bn = moment__default.defineLocale('bn', { months : 'জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split('_'), monthsShort : 'জানু_ফেব_মার্চ_এপর_মে_জুন_জুল_অগ_সেপ্ট_অক্টো_নভ_ডিসেম্'.split('_'), - weekdays : 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রুবার_শনিবার'.split('_'), - weekdaysShort : 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্রু_শনি'.split('_'), + weekdays : 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রবার_শনিবার'.split('_'), + weekdaysShort : 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্র_শনি'.split('_'), weekdaysMin : 'রব_সম_মঙ্গ_বু_ব্রিহ_শু_শনি'.split('_'), longDateFormat : { LT : 'A h:mm সময়', @@ -3926,7 +4324,7 @@ relativeTime : { future : '%s পরে', past : '%s আগে', - s : 'কএক সেকেন্ড', + s : 'কয়েক সেকেন্ড', m : 'এক মিনিট', mm : '%d মিনিট', h : 'এক ঘন্টা', @@ -3948,9 +4346,9 @@ return bn__symbolMap[match]; }); }, - meridiemParse: /রাত|সকাল|দুপুর|বিকেল|রাত/, + meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/, isPM: function (input) { - return /^(দুপুর|বিকেল|রাত)$/.test(input); + return /^(দুপুর|বিকাল|রাত)$/.test(input); }, //Bengali is a vast language its spoken //in different forms in various parts of the world. @@ -3963,7 +4361,7 @@ } else if (hour < 17) { return 'দুপুর'; } else if (hour < 20) { - return 'বিকেল'; + return 'বিকাল'; } else { return 'রাত'; } @@ -4003,7 +4401,7 @@ '༠': '0' }; - var bo = _moment__default.defineLocale('bo', { + var bo = moment__default.defineLocale('bo', { months : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'), monthsShort : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'), weekdays : 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split('_'), @@ -4121,7 +4519,7 @@ return mutationTable[text.charAt(0)] + text.substring(1); } - var br = _moment__default.defineLocale('br', { + var br = moment__default.defineLocale('br', { months : 'Genver_C\'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split('_'), monthsShort : 'Gen_C\'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'), weekdays : 'Sul_Lun_Meurzh_Merc\'her_Yaou_Gwener_Sadorn'.split('_'), @@ -4227,7 +4625,7 @@ } } - var bs = _moment__default.defineLocale('bs', { + var bs = moment__default.defineLocale('bs', { months : 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split('_'), monthsShort : 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split('_'), weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'), @@ -4303,7 +4701,7 @@ //! locale : catalan (ca) //! author : Juan G. Hurtado : https://github.com/juanghurtado - var ca = _moment__default.defineLocale('ca', { + var ca = moment__default.defineLocale('ca', { months : 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split('_'), monthsShort : 'gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.'.split('_'), weekdays : 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split('_'), @@ -4311,7 +4709,7 @@ weekdaysMin : 'Dg_Dl_Dt_Dc_Dj_Dv_Ds'.split('_'), longDateFormat : { LT : 'H:mm', - LTS : 'LT:ss', + LTS : 'H:mm:ss', L : 'DD/MM/YYYY', LL : 'D MMMM YYYY', LLL : 'D MMMM YYYY H:mm', @@ -4429,7 +4827,7 @@ } } - var cs = _moment__default.defineLocale('cs', { + var cs = moment__default.defineLocale('cs', { months : cs__months, monthsShort : cs__monthsShort, monthsParse : (function (months, monthsShort) { @@ -4440,6 +4838,20 @@ } return _monthsParse; }(cs__months, cs__monthsShort)), + shortMonthsParse : (function (monthsShort) { + var i, _shortMonthsParse = []; + for (i = 0; i < 12; i++) { + _shortMonthsParse[i] = new RegExp('^' + monthsShort[i] + '$', 'i'); + } + return _shortMonthsParse; + }(cs__monthsShort)), + longMonthsParse : (function (months) { + var i, _longMonthsParse = []; + for (i = 0; i < 12; i++) { + _longMonthsParse[i] = new RegExp('^' + months[i] + '$', 'i'); + } + return _longMonthsParse; + }(cs__months)), weekdays : 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'), weekdaysShort : 'ne_po_út_st_čt_pá_so'.split('_'), weekdaysMin : 'ne_po_út_st_čt_pá_so'.split('_'), @@ -4517,7 +4929,7 @@ //! locale : chuvash (cv) //! author : Anatoly Mironov : https://github.com/mirontoli - var cv = _moment__default.defineLocale('cv', { + var cv = moment__default.defineLocale('cv', { months : 'кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав'.split('_'), monthsShort : 'кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш'.split('_'), weekdays : 'вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун'.split('_'), @@ -4569,7 +4981,7 @@ //! locale : Welsh (cy) //! author : Robert Allen - var cy = _moment__default.defineLocale('cy', { + var cy = moment__default.defineLocale('cy', { months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split('_'), monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split('_'), weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split('_'), @@ -4637,7 +5049,7 @@ //! locale : danish (da) //! author : Ulrik Nielsen : https://github.com/mrbase - var da = _moment__default.defineLocale('da', { + var da = moment__default.defineLocale('da', { months : 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split('_'), monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'), weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'), @@ -4687,6 +5099,7 @@ //! author : lluchs : https://github.com/lluchs //! author: Menelion Elensúle: https://github.com/Oire //! author : Martin Groller : https://github.com/MadMG + //! author : Mikolaj Dadela : https://github.com/mik01aj function de_at__processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { @@ -4702,7 +5115,7 @@ return withoutSuffix ? format[key][0] : format[key][1]; } - var de_at = _moment__default.defineLocale('de-at', { + var de_at = moment__default.defineLocale('de-at', { months : 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'), monthsShort : 'Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'), weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'), @@ -4717,11 +5130,11 @@ LLLL : 'dddd, D. MMMM YYYY HH:mm' }, calendar : { - sameDay: '[Heute um] LT [Uhr]', + sameDay: '[heute um] LT [Uhr]', sameElse: 'L', - nextDay: '[Morgen um] LT [Uhr]', + nextDay: '[morgen um] LT [Uhr]', nextWeek: 'dddd [um] LT [Uhr]', - lastDay: '[Gestern um] LT [Uhr]', + lastDay: '[gestern um] LT [Uhr]', lastWeek: '[letzten] dddd [um] LT [Uhr]' }, relativeTime : { @@ -4751,6 +5164,7 @@ //! locale : german (de) //! author : lluchs : https://github.com/lluchs //! author: Menelion Elensúle: https://github.com/Oire + //! author : Mikolaj Dadela : https://github.com/mik01aj function de__processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { @@ -4766,7 +5180,7 @@ return withoutSuffix ? format[key][0] : format[key][1]; } - var de = _moment__default.defineLocale('de', { + var de = moment__default.defineLocale('de', { months : 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'), monthsShort : 'Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'), weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'), @@ -4781,11 +5195,11 @@ LLLL : 'dddd, D. MMMM YYYY HH:mm' }, calendar : { - sameDay: '[Heute um] LT [Uhr]', + sameDay: '[heute um] LT [Uhr]', sameElse: 'L', - nextDay: '[Morgen um] LT [Uhr]', + nextDay: '[morgen um] LT [Uhr]', nextWeek: 'dddd [um] LT [Uhr]', - lastDay: '[Gestern um] LT [Uhr]', + lastDay: '[gestern um] LT [Uhr]', lastWeek: '[letzten] dddd [um] LT [Uhr]' }, relativeTime : { @@ -4811,11 +5225,99 @@ } }); + //! moment.js locale configuration + //! locale : dhivehi (dv) + //! author : Jawish Hameed : https://github.com/jawish + + var dv__months = [ + 'ޖެނުއަރީ', + 'ފެބްރުއަރީ', + 'މާރިޗު', + 'އޭޕްރީލު', + 'މޭ', + 'ޖޫން', + 'ޖުލައި', + 'އޯގަސްޓު', + 'ސެޕްޓެމްބަރު', + 'އޮކްޓޯބަރު', + 'ނޮވެމްބަރު', + 'ޑިސެމްބަރު' + ], dv__weekdays = [ + 'އާދިއްތަ', + 'ހޯމަ', + 'އަންގާރަ', + 'ބުދަ', + 'ބުރާސްފަތި', + 'ހުކުރު', + 'ހޮނިހިރު' + ]; + + var dv = moment__default.defineLocale('dv', { + months : dv__months, + monthsShort : dv__months, + weekdays : dv__weekdays, + weekdaysShort : dv__weekdays, + weekdaysMin : 'އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި'.split('_'), + longDateFormat : { + + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'D/M/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd D MMMM YYYY HH:mm' + }, + meridiemParse: /މކ|މފ/, + isPM : function (input) { + return '' === input; + }, + meridiem : function (hour, minute, isLower) { + if (hour < 12) { + return 'މކ'; + } else { + return 'މފ'; + } + }, + calendar : { + sameDay : '[މިއަދު] LT', + nextDay : '[މާދަމާ] LT', + nextWeek : 'dddd LT', + lastDay : '[އިއްޔެ] LT', + lastWeek : '[ފާއިތުވި] dddd LT', + sameElse : 'L' + }, + relativeTime : { + future : 'ތެރޭގައި %s', + past : 'ކުރިން %s', + s : 'ސިކުންތުކޮޅެއް', + m : 'މިނިޓެއް', + mm : 'މިނިޓު %d', + h : 'ގަޑިއިރެއް', + hh : 'ގަޑިއިރު %d', + d : 'ދުވަހެއް', + dd : 'ދުވަސް %d', + M : 'މަހެއް', + MM : 'މަސް %d', + y : 'އަހަރެއް', + yy : 'އަހަރު %d' + }, + preparse: function (string) { + return string.replace(/،/g, ','); + }, + postformat: function (string) { + return string.replace(/,/g, '،'); + }, + week : { + dow : 7, // Sunday is the first day of the week. + doy : 12 // The week that contains Jan 1st is the first week of the year. + } + }); + //! moment.js locale configuration //! locale : modern greek (el) //! author : Aggelos Karalias : https://github.com/mehiel - var el = _moment__default.defineLocale('el', { + var el = moment__default.defineLocale('el', { monthsNominativeEl : 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split('_'), monthsGenitiveEl : 'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split('_'), months : function (momentToFormat, format) { @@ -4866,7 +5368,7 @@ calendar : function (key, mom) { var output = this._calendarEl[key], hours = mom && mom.hours(); - if (typeof output === 'function') { + if (isFunction(output)) { output = output.apply(mom); } return output.replace('{}', (hours % 12 === 1 ? 'στη' : 'στις')); @@ -4897,7 +5399,7 @@ //! moment.js locale configuration //! locale : australian english (en-au) - var en_au = _moment__default.defineLocale('en-au', { + var en_au = moment__default.defineLocale('en-au', { months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), @@ -4953,7 +5455,7 @@ //! locale : canadian english (en-ca) //! author : Jonathan Abourbih : https://github.com/jonbca - var en_ca = _moment__default.defineLocale('en-ca', { + var en_ca = moment__default.defineLocale('en-ca', { months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), @@ -5005,7 +5507,7 @@ //! locale : great britain english (en-gb) //! author : Chris Gedrim : https://github.com/chrisgedrim - var en_gb = _moment__default.defineLocale('en-gb', { + var en_gb = moment__default.defineLocale('en-gb', { months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), @@ -5057,13 +5559,124 @@ } }); + //! moment.js locale configuration + //! locale : Irish english (en-ie) + //! author : Chris Cartlidge : https://github.com/chriscartlidge + + var en_ie = moment__default.defineLocale('en-ie', { + months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), + monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), + weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), + weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD-MM-YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd D MMMM YYYY HH:mm' + }, + calendar : { + sameDay : '[Today at] LT', + nextDay : '[Tomorrow at] LT', + nextWeek : 'dddd [at] LT', + lastDay : '[Yesterday at] LT', + lastWeek : '[Last] dddd [at] LT', + sameElse : 'L' + }, + relativeTime : { + future : 'in %s', + past : '%s ago', + s : 'a few seconds', + m : 'a minute', + mm : '%d minutes', + h : 'an hour', + hh : '%d hours', + d : 'a day', + dd : '%d days', + M : 'a month', + MM : '%d months', + y : 'a year', + yy : '%d years' + }, + ordinalParse: /\d{1,2}(st|nd|rd|th)/, + ordinal : function (number) { + var b = number % 10, + output = (~~(number % 100 / 10) === 1) ? 'th' : + (b === 1) ? 'st' : + (b === 2) ? 'nd' : + (b === 3) ? 'rd' : 'th'; + return number + output; + }, + week : { + dow : 1, // Monday is the first day of the week. + doy : 4 // The week that contains Jan 4th is the first week of the year. + } + }); + + //! moment.js locale configuration + //! locale : New Zealand english (en-nz) + + var en_nz = moment__default.defineLocale('en-nz', { + months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), + monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), + weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), + weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), + longDateFormat : { + LT : 'h:mm A', + LTS : 'h:mm:ss A', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY h:mm A', + LLLL : 'dddd, D MMMM YYYY h:mm A' + }, + calendar : { + sameDay : '[Today at] LT', + nextDay : '[Tomorrow at] LT', + nextWeek : 'dddd [at] LT', + lastDay : '[Yesterday at] LT', + lastWeek : '[Last] dddd [at] LT', + sameElse : 'L' + }, + relativeTime : { + future : 'in %s', + past : '%s ago', + s : 'a few seconds', + m : 'a minute', + mm : '%d minutes', + h : 'an hour', + hh : '%d hours', + d : 'a day', + dd : '%d days', + M : 'a month', + MM : '%d months', + y : 'a year', + yy : '%d years' + }, + ordinalParse: /\d{1,2}(st|nd|rd|th)/, + ordinal : function (number) { + var b = number % 10, + output = (~~(number % 100 / 10) === 1) ? 'th' : + (b === 1) ? 'st' : + (b === 2) ? 'nd' : + (b === 3) ? 'rd' : 'th'; + return number + output; + }, + week : { + dow : 1, // Monday is the first day of the week. + doy : 4 // The week that contains Jan 4th is the first week of the year. + } + }); + //! moment.js locale configuration //! locale : esperanto (eo) //! author : Colin Dean : https://github.com/colindean //! komento: Mi estas malcerta se mi korekte traktis akuzativojn en tiu traduko. //! Se ne, bonvolu korekti kaj avizi min por ke mi povas lerni! - var eo = _moment__default.defineLocale('eo', { + var eo = moment__default.defineLocale('eo', { months : 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split('_'), monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec'.split('_'), weekdays : 'Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato'.split('_'), @@ -5123,11 +5736,11 @@ //! locale : spanish (es) //! author : Julio Napurí : https://github.com/julionc - var monthsShortDot = 'Ene._Feb._Mar._Abr._May._Jun._Jul._Ago._Sep._Oct._Nov._Dic.'.split('_'), - es__monthsShort = 'Ene_Feb_Mar_Abr_May_Jun_Jul_Ago_Sep_Oct_Nov_Dic'.split('_'); + var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'), + es__monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'); - var es = _moment__default.defineLocale('es', { - months : 'Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre'.split('_'), + var es = moment__default.defineLocale('es', { + months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'), monthsShort : function (m, format) { if (/-MMM-/.test(format)) { return es__monthsShort[m.month()]; @@ -5135,9 +5748,9 @@ return monthsShortDot[m.month()]; } }, - weekdays : 'Domingo_Lunes_Martes_Miércoles_Jueves_Viernes_Sábado'.split('_'), - weekdaysShort : 'Dom._Lun._Mar._Mié._Jue._Vie._Sáb.'.split('_'), - weekdaysMin : 'Do_Lu_Ma_Mi_Ju_Vi_Sá'.split('_'), + weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), + weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), + weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'), longDateFormat : { LT : 'H:mm', LTS : 'H:mm:ss', @@ -5211,7 +5824,7 @@ return isFuture ? format[key][0] : format[key][1]; } - var et = _moment__default.defineLocale('et', { + var et = moment__default.defineLocale('et', { months : 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split('_'), monthsShort : 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split('_'), weekdays : 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split('_'), @@ -5260,7 +5873,7 @@ //! locale : euskara (eu) //! author : Eneko Illarramendi : https://github.com/eillarra - var eu = _moment__default.defineLocale('eu', { + var eu = moment__default.defineLocale('eu', { months : 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split('_'), monthsShort : 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split('_'), weekdays : 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split('_'), @@ -5337,7 +5950,7 @@ '۰': '0' }; - var fa = _moment__default.defineLocale('fa', { + var fa = moment__default.defineLocale('fa', { months : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'), monthsShort : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'), weekdays : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'), @@ -5450,7 +6063,7 @@ return number < 10 ? (isFuture ? numbersFuture[number] : numbersPast[number]) : number; } - var fi = _moment__default.defineLocale('fi', { + var fi = moment__default.defineLocale('fi', { months : 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split('_'), monthsShort : 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split('_'), weekdays : 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split('_'), @@ -5503,7 +6116,7 @@ //! locale : faroese (fo) //! author : Ragnar Johannesen : https://github.com/ragnar123 - var fo = _moment__default.defineLocale('fo', { + var fo = moment__default.defineLocale('fo', { months : 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split('_'), monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'), weekdays : 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split('_'), @@ -5552,7 +6165,7 @@ //! locale : canadian french (fr-ca) //! author : Jonathan Abourbih : https://github.com/jonbca - var fr_ca = _moment__default.defineLocale('fr-ca', { + var fr_ca = moment__default.defineLocale('fr-ca', { months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'), monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'), weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), @@ -5595,11 +6208,62 @@ } }); + //! moment.js locale configuration + //! locale : swiss french (fr) + //! author : Gaspard Bucher : https://github.com/gaspard + + var fr_ch = moment__default.defineLocale('fr-ch', { + months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'), + monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'), + weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), + weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), + weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd D MMMM YYYY HH:mm' + }, + calendar : { + sameDay: '[Aujourd\'hui à] LT', + nextDay: '[Demain à] LT', + nextWeek: 'dddd [à] LT', + lastDay: '[Hier à] LT', + lastWeek: 'dddd [dernier à] LT', + sameElse: 'L' + }, + relativeTime : { + future : 'dans %s', + past : 'il y a %s', + s : 'quelques secondes', + m : 'une minute', + mm : '%d minutes', + h : 'une heure', + hh : '%d heures', + d : 'un jour', + dd : '%d jours', + M : 'un mois', + MM : '%d mois', + y : 'un an', + yy : '%d ans' + }, + ordinalParse: /\d{1,2}(er|e)/, + ordinal : function (number) { + return number + (number === 1 ? 'er' : 'e'); + }, + week : { + dow : 1, // Monday is the first day of the week. + doy : 4 // The week that contains Jan 4th is the first week of the year. + } + }); + //! moment.js locale configuration //! locale : french (fr) //! author : John Fischer : https://github.com/jfroffice - var fr = _moment__default.defineLocale('fr', { + var fr = moment__default.defineLocale('fr', { months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'), monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'), weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), @@ -5653,7 +6317,7 @@ var fy__monthsShortWithDots = 'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split('_'), fy__monthsShortWithoutDots = 'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'); - var fy = _moment__default.defineLocale('fy', { + var fy = moment__default.defineLocale('fy', { months : 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split('_'), monthsShort : function (m, format) { if (/-MMM-/.test(format)) { @@ -5696,9 +6360,74 @@ y : 'ien jier', yy : '%d jierren' }, - ordinalParse: /\d{1,2}(ste|de)/, + ordinalParse: /\d{1,2}(ste|de)/, + ordinal : function (number) { + return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); + }, + week : { + dow : 1, // Monday is the first day of the week. + doy : 4 // The week that contains Jan 4th is the first week of the year. + } + }); + + //! moment.js locale configuration + //! locale : great britain scottish gealic (gd) + //! author : Jon Ashdown : https://github.com/jonashdown + + var gd__months = [ + 'Am Faoilleach', 'An Gearran', 'Am Màrt', 'An Giblean', 'An Cèitean', 'An t-Ògmhios', 'An t-Iuchar', 'An Lùnastal', 'An t-Sultain', 'An Dàmhair', 'An t-Samhain', 'An Dùbhlachd' + ]; + + var gd__monthsShort = ['Faoi', 'Gear', 'Màrt', 'Gibl', 'Cèit', 'Ògmh', 'Iuch', 'Lùn', 'Sult', 'Dàmh', 'Samh', 'Dùbh']; + + var gd__weekdays = ['Didòmhnaich', 'Diluain', 'Dimàirt', 'Diciadain', 'Diardaoin', 'Dihaoine', 'Disathairne']; + + var weekdaysShort = ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis']; + + var weekdaysMin = ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa']; + + var gd = moment__default.defineLocale('gd', { + months : gd__months, + monthsShort : gd__monthsShort, + monthsParseExact : true, + weekdays : gd__weekdays, + weekdaysShort : weekdaysShort, + weekdaysMin : weekdaysMin, + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd, D MMMM YYYY HH:mm' + }, + calendar : { + sameDay : '[An-diugh aig] LT', + nextDay : '[A-màireach aig] LT', + nextWeek : 'dddd [aig] LT', + lastDay : '[An-dè aig] LT', + lastWeek : 'dddd [seo chaidh] [aig] LT', + sameElse : 'L' + }, + relativeTime : { + future : 'ann an %s', + past : 'bho chionn %s', + s : 'beagan diogan', + m : 'mionaid', + mm : '%d mionaidean', + h : 'uair', + hh : '%d uairean', + d : 'latha', + dd : '%d latha', + M : 'mìos', + MM : '%d mìosan', + y : 'bliadhna', + yy : '%d bliadhna' + }, + ordinalParse : /\d{1,2}(d|na|mh)/, ordinal : function (number) { - return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); + var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh'; + return number + output; }, week : { dow : 1, // Monday is the first day of the week. @@ -5710,7 +6439,7 @@ //! locale : galician (gl) //! author : Juan G. Hurtado : https://github.com/juanghurtado - var gl = _moment__default.defineLocale('gl', { + var gl = moment__default.defineLocale('gl', { months : 'Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro'.split('_'), monthsShort : 'Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.'.split('_'), weekdays : 'Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado'.split('_'), @@ -5776,7 +6505,7 @@ //! author : Moshe Simantov : https://github.com/DevelopmentIL //! author : Tal Ater : https://github.com/TalAter - var he = _moment__default.defineLocale('he', { + var he = moment__default.defineLocale('he', { months : 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split('_'), monthsShort : 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split('_'), weekdays : 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'), @@ -5870,7 +6599,7 @@ '०': '0' }; - var hi = _moment__default.defineLocale('hi', { + var hi = moment__default.defineLocale('hi', { months : 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split('_'), monthsShort : 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'), weekdays : 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'), @@ -6010,8 +6739,11 @@ } } - var hr = _moment__default.defineLocale('hr', { - months : 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_'), + var hr = moment__default.defineLocale('hr', { + months : { + format: 'siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca'.split('_'), + standalone: 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_') + }, monthsShort : 'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split('_'), weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'), weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'), @@ -6120,7 +6852,7 @@ return (isFuture ? '' : '[múlt] ') + '[' + weekEndings[this.day()] + '] LT[-kor]'; } - var hu = _moment__default.defineLocale('hu', { + var hu = moment__default.defineLocale('hu', { months : 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split('_'), monthsShort : 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split('_'), weekdays : 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'), @@ -6184,29 +6916,13 @@ //! locale : Armenian (hy-am) //! author : Armendarabyan : https://github.com/armendarabyan - function hy_am__monthsCaseReplace(m, format) { - var months = { - 'nominative': 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_'), - 'accusative': 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_') + var hy_am = moment__default.defineLocale('hy-am', { + months : { + format: 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_'), + standalone: 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_') }, - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return months[nounCase][m.month()]; - } - function hy_am__monthsShortCaseReplace(m, format) { - var monthsShort = 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'); - return monthsShort[m.month()]; - } - function hy_am__weekdaysCaseReplace(m, format) { - var weekdays = 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_'); - return weekdays[m.day()]; - } - - var hy_am = _moment__default.defineLocale('hy-am', { - months : hy_am__monthsCaseReplace, - monthsShort : hy_am__monthsShortCaseReplace, - weekdays : hy_am__weekdaysCaseReplace, + monthsShort : 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'), + weekdays : 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_'), weekdaysShort : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'), weekdaysMin : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'), longDateFormat : { @@ -6285,7 +7001,7 @@ //! author : Mohammad Satrio Utomo : https://github.com/tyok //! reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan - var id = _moment__default.defineLocale('id', { + var id = moment__default.defineLocale('id', { months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'), monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des'.split('_'), weekdays : 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'), @@ -6423,7 +7139,7 @@ } } - var is = _moment__default.defineLocale('is', { + var is = moment__default.defineLocale('is', { months : 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split('_'), monthsShort : 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'), weekdays : 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split('_'), @@ -6473,12 +7189,12 @@ //! author : Lorenzo : https://github.com/aliem //! author: Mattia Larentis: https://github.com/nostalgiaz - var it = _moment__default.defineLocale('it', { + var it = moment__default.defineLocale('it', { months : 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'), monthsShort : 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'), weekdays : 'Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato'.split('_'), weekdaysShort : 'Dom_Lun_Mar_Mer_Gio_Ven_Sab'.split('_'), - weekdaysMin : 'D_L_Ma_Me_G_V_S'.split('_'), + weekdaysMin : 'Do_Lu_Ma_Me_Gi_Ve_Sa'.split('_'), longDateFormat : { LT : 'HH:mm', LTS : 'HH:mm:ss', @@ -6531,7 +7247,7 @@ //! locale : japanese (ja) //! author : LI Long : https://github.com/baryon - var ja = _moment__default.defineLocale('ja', { + var ja = moment__default.defineLocale('ja', { months : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), weekdays : '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'), @@ -6586,7 +7302,7 @@ //! author : Rony Lantip : https://github.com/lantip //! reference: http://jv.wikipedia.org/wiki/Basa_Jawa - var jv = _moment__default.defineLocale('jv', { + var jv = moment__default.defineLocale('jv', { months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember'.split('_'), monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des'.split('_'), weekdays : 'Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu'.split('_'), @@ -6657,31 +7373,17 @@ //! locale : Georgian (ka) //! author : Irakli Janiashvili : https://github.com/irakli-janiashvili - function ka__monthsCaseReplace(m, format) { - var months = { - 'nominative': 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'), - 'accusative': 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_') - }, - nounCase = (/D[oD] *MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return months[nounCase][m.month()]; - } - function ka__weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'), - 'accusative': 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_') + var ka = moment__default.defineLocale('ka', { + months : { + standalone: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'), + format: 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_') }, - nounCase = (/(წინა|შემდეგ)/).test(format) ? - 'accusative' : - 'nominative'; - return weekdays[nounCase][m.day()]; - } - - var ka = _moment__default.defineLocale('ka', { - months : ka__monthsCaseReplace, monthsShort : 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'), - weekdays : ka__weekdaysCaseReplace, + weekdays : { + standalone: 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'), + format: 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_'), + isFormat: /(წინა|შემდეგ)/ + }, weekdaysShort : 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'), weekdaysMin : 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'), longDateFormat : { @@ -6745,11 +7447,87 @@ } }); + //! moment.js locale configuration + //! locale : kazakh (kk) + //! authors : Nurlan Rakhimzhanov : https://github.com/nurlan + + var kk__suffixes = { + 0: '-ші', + 1: '-ші', + 2: '-ші', + 3: '-ші', + 4: '-ші', + 5: '-ші', + 6: '-шы', + 7: '-ші', + 8: '-ші', + 9: '-шы', + 10: '-шы', + 20: '-шы', + 30: '-шы', + 40: '-шы', + 50: '-ші', + 60: '-шы', + 70: '-ші', + 80: '-ші', + 90: '-шы', + 100: '-ші' + }; + + var kk = moment__default.defineLocale('kk', { + months : 'Қаңтар_Ақпан_Наурыз_Сәуір_Мамыр_Маусым_Шілде_Тамыз_Қыркүйек_Қазан_Қараша_Желтоқсан'.split('_'), + monthsShort : 'Қаң_Ақп_Нау_Сәу_Мам_Мау_Шіл_Там_Қыр_Қаз_Қар_Жел'.split('_'), + weekdays : 'Жексенбі_Дүйсенбі_Сейсенбі_Сәрсенбі_Бейсенбі_Жұма_Сенбі'.split('_'), + weekdaysShort : 'Жек_Дүй_Сей_Сәр_Бей_Жұм_Сен'.split('_'), + weekdaysMin : 'Жк_Дй_Сй_Ср_Бй_Жм_Сн'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd, D MMMM YYYY HH:mm' + }, + calendar : { + sameDay : '[Бүгін сағат] LT', + nextDay : '[Ертең сағат] LT', + nextWeek : 'dddd [сағат] LT', + lastDay : '[Кеше сағат] LT', + lastWeek : '[Өткен аптаның] dddd [сағат] LT', + sameElse : 'L' + }, + relativeTime : { + future : '%s ішінде', + past : '%s бұрын', + s : 'бірнеше секунд', + m : 'бір минут', + mm : '%d минут', + h : 'бір сағат', + hh : '%d сағат', + d : 'бір күн', + dd : '%d күн', + M : 'бір ай', + MM : '%d ай', + y : 'бір жыл', + yy : '%d жыл' + }, + ordinalParse: /\d{1,2}-(ші|шы)/, + ordinal : function (number) { + var a = number % 10, + b = number >= 100 ? 100 : null; + return number + (kk__suffixes[number] || kk__suffixes[a] || kk__suffixes[b]); + }, + week : { + dow : 1, // Monday is the first day of the week. + doy : 7 // The week that contains Jan 1st is the first week of the year. + } + }); + //! moment.js locale configuration //! locale : khmer (km) //! author : Kruy Vanna : https://github.com/kruyvanna - var km = _moment__default.defineLocale('km', { + var km = moment__default.defineLocale('km', { months: 'មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'), monthsShort: 'មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'), weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'), @@ -6764,7 +7542,7 @@ LLLL: 'dddd, D MMMM YYYY HH:mm' }, calendar: { - sameDay: '[ថ្ងៃនៈ ម៉ោង] LT', + sameDay: '[ថ្ងៃនេះ ម៉ោង] LT', nextDay: '[ស្អែក ម៉ោង] LT', nextWeek: 'dddd [ម៉ោង] LT', lastDay: '[ម្សិលមិញ ម៉ោង] LT', @@ -6800,7 +7578,7 @@ //! - Kyungwook, Park : https://github.com/kyungw00k //! - Jeeeyul Lee - var ko = _moment__default.defineLocale('ko', { + var ko = moment__default.defineLocale('ko', { months : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'), monthsShort : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'), weekdays : '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'), @@ -6918,7 +7696,7 @@ } } - var lb = _moment__default.defineLocale('lb', { + var lb = moment__default.defineLocale('lb', { months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'), monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'), weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split('_'), @@ -6972,6 +7750,64 @@ } }); + //! moment.js locale configuration + //! locale : lao (lo) + //! author : Ryan Hart : https://github.com/ryanhart2 + + var lo = moment__default.defineLocale('lo', { + months : 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'), + monthsShort : 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'), + weekdays : 'ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'), + weekdaysShort : 'ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'), + weekdaysMin : 'ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'ວັນdddd D MMMM YYYY HH:mm' + }, + meridiemParse: /ຕອນເຊົ້າ|ຕອນແລງ/, + isPM: function (input) { + return input === 'ຕອນແລງ'; + }, + meridiem : function (hour, minute, isLower) { + if (hour < 12) { + return 'ຕອນເຊົ້າ'; + } else { + return 'ຕອນແລງ'; + } + }, + calendar : { + sameDay : '[ມື້ນີ້ເວລາ] LT', + nextDay : '[ມື້ອື່ນເວລາ] LT', + nextWeek : '[ວັນ]dddd[ໜ້າເວລາ] LT', + lastDay : '[ມື້ວານນີ້ເວລາ] LT', + lastWeek : '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT', + sameElse : 'L' + }, + relativeTime : { + future : 'ອີກ %s', + past : '%sຜ່ານມາ', + s : 'ບໍ່ເທົ່າໃດວິນາທີ', + m : '1 ນາທີ', + mm : '%d ນາທີ', + h : '1 ຊົ່ວໂມງ', + hh : '%d ຊົ່ວໂມງ', + d : '1 ມື້', + dd : '%d ມື້', + M : '1 ເດືອນ', + MM : '%d ເດືອນ', + y : '1 ປີ', + yy : '%d ປີ' + }, + ordinalParse: /(ທີ່)\d{1,2}/, + ordinal : function (number) { + return 'ທີ່' + number; + } + }); + //! moment.js locale configuration //! locale : Lithuanian (lt) //! author : Mindaugas Mozūras : https://github.com/mmozuras @@ -6987,8 +7823,7 @@ 'MM': 'mėnesiai_mėnesių_mėnesius', 'y' : 'metai_metų_metus', 'yy': 'metai_metų_metus' - }, - weekDays = 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_'); + }; function translateSeconds(number, withoutSuffix, key, isFuture) { if (withoutSuffix) { return 'kelios sekundės'; @@ -6996,16 +7831,6 @@ return isFuture ? 'kelių sekundžių' : 'kelias sekundes'; } } - function lt__monthsCaseReplace(m, format) { - var months = { - 'nominative': 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split('_'), - 'accusative': 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_') - }, - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return months[nounCase][m.month()]; - } function translateSingular(number, withoutSuffix, key, isFuture) { return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]); } @@ -7029,16 +7854,17 @@ } } } - function relativeWeekDay(moment, format) { - var nominative = format.indexOf('dddd HH:mm') === -1, - weekDay = weekDays[moment.day()]; - return nominative ? weekDay : weekDay.substring(0, weekDay.length - 2) + 'į'; - } - - var lt = _moment__default.defineLocale('lt', { - months : lt__monthsCaseReplace, + var lt = moment__default.defineLocale('lt', { + months : { + format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_'), + standalone: 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split('_') + }, monthsShort : 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'), - weekdays : relativeWeekDay, + weekdays : { + format: 'sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį'.split('_'), + standalone: 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_'), + isFormat: /dddd HH:mm/ + }, weekdaysShort : 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'), weekdaysMin : 'S_P_A_T_K_Pn_Š'.split('_'), longDateFormat : { @@ -7126,7 +7952,7 @@ return withoutSuffix ? 'dažas sekundes' : 'dažām sekundēm'; } - var lv = _moment__default.defineLocale('lv', { + var lv = moment__default.defineLocale('lv', { months : 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split('_'), monthsShort : 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'), weekdays : 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split('_'), @@ -7198,7 +8024,7 @@ } }; - var me = _moment__default.defineLocale('me', { + var me = moment__default.defineLocale('me', { months: ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'], monthsShort: ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun', 'jul', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.'], weekdays: ['nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'], @@ -7273,7 +8099,7 @@ //! locale : macedonian (mk) //! author : Borislav Mickov : https://github.com/B0k0 - var mk = _moment__default.defineLocale('mk', { + var mk = moment__default.defineLocale('mk', { months : 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split('_'), monthsShort : 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'), weekdays : 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split('_'), @@ -7290,19 +8116,19 @@ calendar : { sameDay : '[Денес во] LT', nextDay : '[Утре во] LT', - nextWeek : 'dddd [во] LT', + nextWeek : '[Во] dddd [во] LT', lastDay : '[Вчера во] LT', lastWeek : function () { switch (this.day()) { case 0: case 3: case 6: - return '[Во изминатата] dddd [во] LT'; + return '[Изминатата] dddd [во] LT'; case 1: case 2: case 4: case 5: - return '[Во изминатиот] dddd [во] LT'; + return '[Изминатиот] dddd [во] LT'; } }, sameElse : 'L' @@ -7352,7 +8178,7 @@ //! locale : malayalam (ml) //! author : Floyd Pink : https://github.com/floydpink - var ml = _moment__default.defineLocale('ml', { + var ml = moment__default.defineLocale('ml', { months : 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split('_'), monthsShort : 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split('_'), weekdays : 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split('_'), @@ -7411,6 +8237,7 @@ //! moment.js locale configuration //! locale : Marathi (mr) //! author : Harshad Kale : https://github.com/kalehv + //! author : Vivek Athalye : https://github.com/vnathalye var mr__symbolMap = { '1': '१', @@ -7437,7 +8264,43 @@ '०': '0' }; - var mr = _moment__default.defineLocale('mr', { + function relativeTimeMr(number, withoutSuffix, string, isFuture) + { + var output = ''; + if (withoutSuffix) { + switch (string) { + case 's': output = 'काही सेकंद'; break; + case 'm': output = 'एक मिनिट'; break; + case 'mm': output = '%d मिनिटे'; break; + case 'h': output = 'एक तास'; break; + case 'hh': output = '%d तास'; break; + case 'd': output = 'एक दिवस'; break; + case 'dd': output = '%d दिवस'; break; + case 'M': output = 'एक महिना'; break; + case 'MM': output = '%d महिने'; break; + case 'y': output = 'एक वर्ष'; break; + case 'yy': output = '%d वर्षे'; break; + } + } + else { + switch (string) { + case 's': output = 'काही सेकंदां'; break; + case 'm': output = 'एका मिनिटा'; break; + case 'mm': output = '%d मिनिटां'; break; + case 'h': output = 'एका तासा'; break; + case 'hh': output = '%d तासां'; break; + case 'd': output = 'एका दिवसा'; break; + case 'dd': output = '%d दिवसां'; break; + case 'M': output = 'एका महिन्या'; break; + case 'MM': output = '%d महिन्यां'; break; + case 'y': output = 'एका वर्षा'; break; + case 'yy': output = '%d वर्षां'; break; + } + } + return output.replace(/%d/i, number); + } + + var mr = moment__default.defineLocale('mr', { months : 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split('_'), monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split('_'), weekdays : 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'), @@ -7460,19 +8323,19 @@ sameElse : 'L' }, relativeTime : { - future : '%s नंतर', - past : '%s पूर्वी', - s : 'सेकंद', - m: 'एक मिनिट', - mm: '%d मिनिटे', - h : 'एक तास', - hh : '%d तास', - d : 'एक दिवस', - dd : '%d दिवस', - M : 'एक महिना', - MM : '%d महिने', - y : 'एक वर्ष', - yy : '%d वर्षे' + future: '%sमध्ये', + past: '%sपूर्वी', + s: relativeTimeMr, + m: relativeTimeMr, + mm: relativeTimeMr, + h: relativeTimeMr, + hh: relativeTimeMr, + d: relativeTimeMr, + dd: relativeTimeMr, + M: relativeTimeMr, + MM: relativeTimeMr, + y: relativeTimeMr, + yy: relativeTimeMr }, preparse: function (string) { return string.replace(/[१२३४५६७८९०]/g, function (match) { @@ -7522,7 +8385,7 @@ //! locale : Bahasa Malaysia (ms-MY) //! author : Weldan Jamili : https://github.com/weldan - var ms_my = _moment__default.defineLocale('ms-my', { + var ms_my = moment__default.defineLocale('ms-my', { months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'), monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'), weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'), @@ -7593,7 +8456,7 @@ //! locale : Bahasa Malaysia (ms-MY) //! author : Weldan Jamili : https://github.com/weldan - var locale_ms = _moment__default.defineLocale('ms', { + var locale_ms = moment__default.defineLocale('ms', { months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'), monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'), weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'), @@ -7688,7 +8551,7 @@ '၀': '0' }; - var my = _moment__default.defineLocale('my', { + var my = moment__default.defineLocale('my', { months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split('_'), monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'), weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split('_'), @@ -7747,19 +8610,19 @@ //! authors : Espen Hovlandsdal : https://github.com/rexxars //! Sigurd Gartmann : https://github.com/sigurdga - var nb = _moment__default.defineLocale('nb', { + var nb = moment__default.defineLocale('nb', { months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'), - monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'), + monthsShort : 'jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.'.split('_'), weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'), - weekdaysShort : 'søn_man_tirs_ons_tors_fre_lør'.split('_'), + weekdaysShort : 'sø._ma._ti._on._to._fr._lø.'.split('_'), weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'), longDateFormat : { - LT : 'H.mm', - LTS : 'H.mm.ss', + LT : 'HH:mm', + LTS : 'HH:mm:ss', L : 'DD.MM.YYYY', LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY [kl.] H.mm', - LLLL : 'dddd D. MMMM YYYY [kl.] H.mm' + LLL : 'D. MMMM YYYY [kl.] HH:mm', + LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm' }, calendar : { sameDay: '[i dag kl.] LT', @@ -7821,12 +8684,12 @@ '०': '0' }; - var ne = _moment__default.defineLocale('ne', { + var ne = moment__default.defineLocale('ne', { months : 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split('_'), monthsShort : 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split('_'), weekdays : 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split('_'), weekdaysShort : 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'), - weekdaysMin : 'आइ._सो._मङ्_बु._बि._शु._श.'.split('_'), + weekdaysMin : 'आ._सो._मं._बु._बि._शु._श.'.split('_'), longDateFormat : { LT : 'Aको h:mm बजे', LTS : 'Aको h:mm:ss बजे', @@ -7845,39 +8708,37 @@ return ne__symbolMap[match]; }); }, - meridiemParse: /राती|बिहान|दिउँसो|बेलुका|साँझ|राती/, + meridiemParse: /राति|बिहान|दिउँसो|साँझ/, meridiemHour : function (hour, meridiem) { if (hour === 12) { hour = 0; } - if (meridiem === 'राती') { - return hour < 3 ? hour : hour + 12; + if (meridiem === 'राति') { + return hour < 4 ? hour : hour + 12; } else if (meridiem === 'बिहान') { return hour; } else if (meridiem === 'दिउँसो') { return hour >= 10 ? hour : hour + 12; - } else if (meridiem === 'बेलुका' || meridiem === 'साँझ') { + } else if (meridiem === 'साँझ') { return hour + 12; } }, meridiem : function (hour, minute, isLower) { if (hour < 3) { - return 'राती'; - } else if (hour < 10) { + return 'राति'; + } else if (hour < 12) { return 'बिहान'; - } else if (hour < 15) { + } else if (hour < 16) { return 'दिउँसो'; - } else if (hour < 18) { - return 'बेलुका'; } else if (hour < 20) { return 'साँझ'; } else { - return 'राती'; + return 'राति'; } }, calendar : { sameDay : '[आज] LT', - nextDay : '[भोली] LT', + nextDay : '[भोलि] LT', nextWeek : '[आउँदो] dddd[,] LT', lastDay : '[हिजो] LT', lastWeek : '[गएको] dddd[,] LT', @@ -7885,8 +8746,8 @@ }, relativeTime : { future : '%sमा', - past : '%s अगाडी', - s : 'केही समय', + past : '%s अगाडि', + s : 'केही क्षण', m : 'एक मिनेट', mm : '%d मिनेट', h : 'एक घण्टा', @@ -7899,8 +8760,8 @@ yy : '%d बर्ष' }, week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. + dow : 0, // Sunday is the first day of the week. + doy : 6 // The week that contains Jan 1st is the first week of the year. } }); @@ -7911,7 +8772,7 @@ var nl__monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'), nl__monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_'); - var nl = _moment__default.defineLocale('nl', { + var nl = moment__default.defineLocale('nl', { months : 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'), monthsShort : function (m, format) { if (/-MMM-/.test(format)) { @@ -7968,7 +8829,7 @@ //! locale : norwegian nynorsk (nn) //! author : https://github.com/mechuwind - var nn = _moment__default.defineLocale('nn', { + var nn = moment__default.defineLocale('nn', { months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'), monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'), weekdays : 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'), @@ -7978,9 +8839,9 @@ LT : 'HH:mm', LTS : 'HH:mm:ss', L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' + LL : 'D. MMMM YYYY', + LLL : 'D. MMMM YYYY [kl.] H:mm', + LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm' }, calendar : { sameDay: '[I dag klokka] LT', @@ -8040,7 +8901,7 @@ } } - var pl = _moment__default.defineLocale('pl', { + var pl = moment__default.defineLocale('pl', { months : function (momentToFormat, format) { if (format === '') { // Hack: if format empty we know this is used to generate @@ -8056,7 +8917,7 @@ monthsShort : 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'), weekdays : 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'), weekdaysShort : 'nie_pon_wt_śr_czw_pt_sb'.split('_'), - weekdaysMin : 'N_Pn_Wt_Śr_Cz_Pt_So'.split('_'), + weekdaysMin : 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'), longDateFormat : { LT : 'HH:mm', LTS : 'HH:mm:ss', @@ -8111,7 +8972,7 @@ //! locale : brazilian portuguese (pt-br) //! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira - var pt_br = _moment__default.defineLocale('pt-br', { + var pt_br = moment__default.defineLocale('pt-br', { months : 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'), monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'), weekdays : 'Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado'.split('_'), @@ -8160,7 +9021,7 @@ //! locale : portuguese (pt) //! author : Jefferson : https://github.com/jalex79 - var pt = _moment__default.defineLocale('pt', { + var pt = moment__default.defineLocale('pt', { months : 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'), monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'), weekdays : 'Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado'.split('_'), @@ -8229,7 +9090,7 @@ return number + separator + format[key]; } - var ro = _moment__default.defineLocale('ro', { + var ro = moment__default.defineLocale('ro', { months : 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split('_'), monthsShort : 'ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split('_'), weekdays : 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'), @@ -8296,44 +9157,27 @@ return number + ' ' + ru__plural(format[key], +number); } } - function ru__monthsCaseReplace(m, format) { - var months = { - 'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'), - 'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_') + var monthsParse = [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[й|я]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i]; + + var ru = moment__default.defineLocale('ru', { + months : { + format: 'Января_Февраля_Марта_Апреля_Мая_Июня_Июля_Августа_Сентября_Октября_Ноября_Декабря'.split('_'), + standalone: 'Январь_Февраль_Март_Апрель_Май_Июнь_Июль_Август_Сентябрь_Октябрь_Ноябрь_Декабрь'.split('_') }, - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return months[nounCase][m.month()]; - } - function ru__monthsShortCaseReplace(m, format) { - var monthsShort = { - 'nominative': 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'), - 'accusative': 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_') + monthsShort : { + format: 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_'), + standalone: 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_') }, - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return monthsShort[nounCase][m.month()]; - } - function ru__weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'), - 'accusative': 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_') + weekdays : { + standalone: 'Воскресенье_Понедельник_Вторник_Среда_Четверг_Пятница_Суббота'.split('_'), + format: 'Воскресенье_Понедельник_Вторник_Среду_Четверг_Пятницу_Субботу'.split('_'), + isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/ }, - nounCase = (/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/).test(format) ? - 'accusative' : - 'nominative'; - return weekdays[nounCase][m.day()]; - } - - var ru = _moment__default.defineLocale('ru', { - months : ru__monthsCaseReplace, - monthsShort : ru__monthsShortCaseReplace, - weekdays : ru__weekdaysCaseReplace, - weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'), - weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'), - monthsParse : [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[й|я]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i], + weekdaysShort : 'Вс_Пн_Вт_Ср_Чт_Пт_Сб'.split('_'), + weekdaysMin : 'Вс_Пн_Вт_Ср_Чт_Пт_Сб'.split('_'), + monthsParse : monthsParse, + longMonthsParse : monthsParse, + shortMonthsParse : monthsParse, longDateFormat : { LT : 'HH:mm', LTS : 'HH:mm:ss', @@ -8346,8 +9190,27 @@ sameDay: '[Сегодня в] LT', nextDay: '[Завтра в] LT', lastDay: '[Вчера в] LT', - nextWeek: function () { - return this.day() === 2 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT'; + nextWeek: function (now) { + if (now.week() !== this.week()) { + switch (this.day()) { + case 0: + return '[В следующее] dddd [в] LT'; + case 1: + case 2: + case 4: + return '[В следующий] dddd [в] LT'; + case 3: + case 5: + case 6: + return '[В следующую] dddd [в] LT'; + } + } else { + if (this.day() === 2) { + return '[Во] dddd [в] LT'; + } else { + return '[В] dddd [в] LT'; + } + } }, lastWeek: function (now) { if (now.week() !== this.week()) { @@ -8425,11 +9288,62 @@ } }); + //! moment.js locale configuration + //! locale : Northern Sami (se) + //! authors : Bård Rolstad Henriksen : https://github.com/karamell + + + var se = moment__default.defineLocale('se', { + months : 'ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu'.split('_'), + monthsShort : 'ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov'.split('_'), + weekdays : 'sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat'.split('_'), + weekdaysShort : 'sotn_vuos_maŋ_gask_duor_bear_láv'.split('_'), + weekdaysMin : 's_v_m_g_d_b_L'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'MMMM D. [b.] YYYY', + LLL : 'MMMM D. [b.] YYYY [ti.] HH:mm', + LLLL : 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm' + }, + calendar : { + sameDay: '[otne ti] LT', + nextDay: '[ihttin ti] LT', + nextWeek: 'dddd [ti] LT', + lastDay: '[ikte ti] LT', + lastWeek: '[ovddit] dddd [ti] LT', + sameElse: 'L' + }, + relativeTime : { + future : '%s geažes', + past : 'maŋit %s', + s : 'moadde sekunddat', + m : 'okta minuhta', + mm : '%d minuhtat', + h : 'okta diimmu', + hh : '%d diimmut', + d : 'okta beaivi', + dd : '%d beaivvit', + M : 'okta mánnu', + MM : '%d mánut', + y : 'okta jahki', + yy : '%d jagit' + }, + ordinalParse: /\d{1,2}\./, + ordinal : '%d.', + week : { + dow : 1, // Monday is the first day of the week. + doy : 4 // The week that contains Jan 4th is the first week of the year. + } + }); + //! moment.js locale configuration //! locale : Sinhalese (si) //! author : Sampath Sitinamaluwa : https://github.com/sampathsris - var si = _moment__default.defineLocale('si', { + /*jshint -W100*/ + var si = moment__default.defineLocale('si', { months : 'ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්'.split('_'), monthsShort : 'ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ'.split('_'), weekdays : 'ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා'.split('_'), @@ -8542,17 +9456,9 @@ } } - var sk = _moment__default.defineLocale('sk', { + var sk = moment__default.defineLocale('sk', { months : sk__months, monthsShort : sk__monthsShort, - monthsParse : (function (months, monthsShort) { - var i, _monthsParse = []; - for (i = 0; i < 12; i++) { - // use custom parser to solve problem with July (červenec) - _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i'); - } - return _monthsParse; - }(sk__months, sk__monthsShort)), weekdays : 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'), weekdaysShort : 'ne_po_ut_st_št_pi_so'.split('_'), weekdaysMin : 'ne_po_ut_st_št_pi_so'.split('_'), @@ -8701,7 +9607,7 @@ } } - var sl = _moment__default.defineLocale('sl', { + var sl = moment__default.defineLocale('sl', { months : 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split('_'), monthsShort : 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split('_'), weekdays : 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'), @@ -8781,7 +9687,7 @@ //! author: Menelion Elensúle: https://github.com/Oire (tests) //! author : Oerd Cukalla : https://github.com/oerd (fixes) - var sq = _moment__default.defineLocale('sq', { + var sq = moment__default.defineLocale('sq', { months : 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split('_'), monthsShort : 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'), weekdays : 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split('_'), @@ -8860,7 +9766,7 @@ } }; - var sr_cyrl = _moment__default.defineLocale('sr-cyrl', { + var sr_cyrl = moment__default.defineLocale('sr-cyrl', { months: ['јануар', 'фебруар', 'март', 'април', 'мај', 'јун', 'јул', 'август', 'септембар', 'октобар', 'новембар', 'децембар'], monthsShort: ['јан.', 'феб.', 'мар.', 'апр.', 'мај', 'јун', 'јул', 'авг.', 'сеп.', 'окт.', 'нов.', 'дец.'], weekdays: ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'], @@ -8957,7 +9863,7 @@ } }; - var sr = _moment__default.defineLocale('sr', { + var sr = moment__default.defineLocale('sr', { months: ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'], monthsShort: ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun', 'jul', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.'], weekdays: ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'], @@ -9031,7 +9937,7 @@ //! locale : swedish (sv) //! author : Jens Alm : https://github.com/ulmus - var sv = _moment__default.defineLocale('sv', { + var sv = moment__default.defineLocale('sv', { months : 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'), monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'), weekdays : 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'), @@ -9083,11 +9989,82 @@ } }); + //! moment.js locale configuration + //! locale : swahili (sw) + //! author : Fahad Kassim : https://github.com/fadsel + + var sw = moment__default.defineLocale('sw', { + months : 'Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba'.split('_'), + monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des'.split('_'), + weekdays : 'Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi'.split('_'), + weekdaysShort : 'Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos'.split('_'), + weekdaysMin : 'J2_J3_J4_J5_Al_Ij_J1'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd, D MMMM YYYY HH:mm' + }, + calendar : { + sameDay : '[leo saa] LT', + nextDay : '[kesho saa] LT', + nextWeek : '[wiki ijayo] dddd [saat] LT', + lastDay : '[jana] LT', + lastWeek : '[wiki iliyopita] dddd [saat] LT', + sameElse : 'L' + }, + relativeTime : { + future : '%s baadaye', + past : 'tokea %s', + s : 'hivi punde', + m : 'dakika moja', + mm : 'dakika %d', + h : 'saa limoja', + hh : 'masaa %d', + d : 'siku moja', + dd : 'masiku %d', + M : 'mwezi mmoja', + MM : 'miezi %d', + y : 'mwaka mmoja', + yy : 'miaka %d' + }, + week : { + dow : 1, // Monday is the first day of the week. + doy : 7 // The week that contains Jan 1st is the first week of the year. + } + }); + //! moment.js locale configuration //! locale : tamil (ta) //! author : Arjunkumar Krishnamoorthy : https://github.com/tk120404 - var ta = _moment__default.defineLocale('ta', { + var ta__symbolMap = { + '1': '௧', + '2': '௨', + '3': '௩', + '4': '௪', + '5': '௫', + '6': '௬', + '7': '௭', + '8': '௮', + '9': '௯', + '0': '௦' + }, ta__numberMap = { + '௧': '1', + '௨': '2', + '௩': '3', + '௪': '4', + '௫': '5', + '௬': '6', + '௭': '7', + '௮': '8', + '௯': '9', + '௦': '0' + }; + + var ta = moment__default.defineLocale('ta', { months : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'), monthsShort : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'), weekdays : 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split('_'), @@ -9128,6 +10105,16 @@ ordinal : function (number) { return number + 'வது'; }, + preparse: function (string) { + return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) { + return ta__numberMap[match]; + }); + }, + postformat: function (string) { + return string.replace(/\d/g, function (match) { + return ta__symbolMap[match]; + }); + }, // refer http://ta.wikipedia.org/s/1er1 meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/, meridiem : function (hour, minute, isLower) { @@ -9167,11 +10154,88 @@ } }); + //! moment.js locale configuration + //! locale : telugu (te) + //! author : Krishna Chaitanya Thota : https://github.com/kcthota + + var te = moment__default.defineLocale('te', { + months : 'జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జూలై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్'.split('_'), + monthsShort : 'జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జూలై_ఆగ._సెప్._అక్టో._నవ._డిసె.'.split('_'), + weekdays : 'ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం'.split('_'), + weekdaysShort : 'ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని'.split('_'), + weekdaysMin : 'ఆ_సో_మం_బు_గు_శు_శ'.split('_'), + longDateFormat : { + LT : 'A h:mm', + LTS : 'A h:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY, A h:mm', + LLLL : 'dddd, D MMMM YYYY, A h:mm' + }, + calendar : { + sameDay : '[నేడు] LT', + nextDay : '[రేపు] LT', + nextWeek : 'dddd, LT', + lastDay : '[నిన్న] LT', + lastWeek : '[గత] dddd, LT', + sameElse : 'L' + }, + relativeTime : { + future : '%s లో', + past : '%s క్రితం', + s : 'కొన్ని క్షణాలు', + m : 'ఒక నిమిషం', + mm : '%d నిమిషాలు', + h : 'ఒక గంట', + hh : '%d గంటలు', + d : 'ఒక రోజు', + dd : '%d రోజులు', + M : 'ఒక నెల', + MM : '%d నెలలు', + y : 'ఒక సంవత్సరం', + yy : '%d సంవత్సరాలు' + }, + ordinalParse : /\d{1,2}వ/, + ordinal : '%dవ', + meridiemParse: /రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/, + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if (meridiem === 'రాత్రి') { + return hour < 4 ? hour : hour + 12; + } else if (meridiem === 'ఉదయం') { + return hour; + } else if (meridiem === 'మధ్యాహ్నం') { + return hour >= 10 ? hour : hour + 12; + } else if (meridiem === 'సాయంత్రం') { + return hour + 12; + } + }, + meridiem : function (hour, minute, isLower) { + if (hour < 4) { + return 'రాత్రి'; + } else if (hour < 10) { + return 'ఉదయం'; + } else if (hour < 17) { + return 'మధ్యాహ్నం'; + } else if (hour < 20) { + return 'సాయంత్రం'; + } else { + return 'రాత్రి'; + } + }, + week : { + dow : 0, // Sunday is the first day of the week. + doy : 6 // The week that contains Jan 1st is the first week of the year. + } + }); + //! moment.js locale configuration //! locale : thai (th) //! author : Kridsada Thanabulpong : https://github.com/sirn - var th = _moment__default.defineLocale('th', { + var th = moment__default.defineLocale('th', { months : 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split('_'), monthsShort : 'มกรา_กุมภา_มีนา_เมษา_พฤษภา_มิถุนา_กรกฎา_สิงหา_กันยา_ตุลา_พฤศจิกา_ธันวา'.split('_'), weekdays : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'), @@ -9225,7 +10289,7 @@ //! locale : Tagalog/Filipino (tl-ph) //! author : Dan Hagman - var tl_ph = _moment__default.defineLocale('tl-ph', { + var tl_ph = moment__default.defineLocale('tl-ph', { months : 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split('_'), monthsShort : 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'), weekdays : 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split('_'), @@ -9272,6 +10336,114 @@ } }); + //! moment.js locale configuration + //! locale : Klingon (tlh) + //! author : Dominika Kruk : https://github.com/amaranthrose + + var numbersNouns = 'pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut'.split('_'); + + function translateFuture(output) { + var time = output; + time = (output.indexOf('jaj') !== -1) ? + time.slice(0, -3) + 'leS' : + (output.indexOf('jar') !== -1) ? + time.slice(0, -3) + 'waQ' : + (output.indexOf('DIS') !== -1) ? + time.slice(0, -3) + 'nem' : + time + ' pIq'; + return time; + } + + function translatePast(output) { + var time = output; + time = (output.indexOf('jaj') !== -1) ? + time.slice(0, -3) + 'Hu’' : + (output.indexOf('jar') !== -1) ? + time.slice(0, -3) + 'wen' : + (output.indexOf('DIS') !== -1) ? + time.slice(0, -3) + 'ben' : + time + ' ret'; + return time; + } + + function tlh__translate(number, withoutSuffix, string, isFuture) { + var numberNoun = numberAsNoun(number); + switch (string) { + case 'mm': + return numberNoun + ' tup'; + case 'hh': + return numberNoun + ' rep'; + case 'dd': + return numberNoun + ' jaj'; + case 'MM': + return numberNoun + ' jar'; + case 'yy': + return numberNoun + ' DIS'; + } + } + + function numberAsNoun(number) { + var hundred = Math.floor((number % 1000) / 100), + ten = Math.floor((number % 100) / 10), + one = number % 10, + word = ''; + if (hundred > 0) { + word += numbersNouns[hundred] + 'vatlh'; + } + if (ten > 0) { + word += ((word !== '') ? ' ' : '') + numbersNouns[ten] + 'maH'; + } + if (one > 0) { + word += ((word !== '') ? ' ' : '') + numbersNouns[one]; + } + return (word === '') ? 'pagh' : word; + } + + var tlh = moment__default.defineLocale('tlh', { + months : 'tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’'.split('_'), + monthsShort : 'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split('_'), + weekdays : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'), + weekdaysShort : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'), + weekdaysMin : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd, D MMMM YYYY HH:mm' + }, + calendar : { + sameDay: '[DaHjaj] LT', + nextDay: '[wa’leS] LT', + nextWeek: 'LLL', + lastDay: '[wa’Hu’] LT', + lastWeek: 'LLL', + sameElse: 'L' + }, + relativeTime : { + future : translateFuture, + past : translatePast, + s : 'puS lup', + m : 'wa’ tup', + mm : tlh__translate, + h : 'wa’ rep', + hh : tlh__translate, + d : 'wa’ jaj', + dd : tlh__translate, + M : 'wa’ jar', + MM : tlh__translate, + y : 'wa’ DIS', + yy : tlh__translate + }, + ordinalParse: /\d{1,2}\./, + ordinal : '%d.', + week : { + dow : 1, // Monday is the first day of the week. + doy : 4 // The week that contains Jan 4th is the first week of the year. + } + }); + //! moment.js locale configuration //! locale : turkish (tr) //! authors : Erhan Gundogan : https://github.com/erhangundogan, @@ -9298,7 +10470,7 @@ 90: '\'ıncı' }; - var tr = _moment__default.defineLocale('tr', { + var tr = moment__default.defineLocale('tr', { months : 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split('_'), monthsShort : 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'), weekdays : 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split('_'), @@ -9356,7 +10528,9 @@ //! author : Robin van der Vliet : https://github.com/robin0van0der0v with the help of Iustì Canun - var tzl = _moment__default.defineLocale('tzl', { + // After the year there should be a slash and the amount of years since December 26, 1979 in Roman numerals. + // This is currently too difficult (maybe even impossible) to add. + var tzl = moment__default.defineLocale('tzl', { months : 'Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar'.split('_'), monthsShort : 'Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec'.split('_'), weekdays : 'Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi'.split('_'), @@ -9364,11 +10538,11 @@ weekdaysMin : 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'), longDateFormat : { LT : 'HH.mm', - LTS : 'LT.ss', + LTS : 'HH.mm.ss', L : 'DD.MM.YYYY', LL : 'D. MMMM [dallas] YYYY', - LLL : 'D. MMMM [dallas] YYYY LT', - LLLL : 'dddd, [li] D. MMMM [dallas] YYYY LT' + LLL : 'D. MMMM [dallas] YYYY HH.mm', + LLLL : 'dddd, [li] D. MMMM [dallas] YYYY HH.mm' }, meridiem : function (hours, minutes, isLower) { if (hours > 11) { @@ -9412,24 +10586,24 @@ var format = { 's': ['viensas secunds', '\'iensas secunds'], 'm': ['\'n míut', '\'iens míut'], - 'mm': [number + ' míuts', ' ' + number + ' míuts'], + 'mm': [number + ' míuts', '' + number + ' míuts'], 'h': ['\'n þora', '\'iensa þora'], - 'hh': [number + ' þoras', ' ' + number + ' þoras'], + 'hh': [number + ' þoras', '' + number + ' þoras'], 'd': ['\'n ziua', '\'iensa ziua'], - 'dd': [number + ' ziuas', ' ' + number + ' ziuas'], + 'dd': [number + ' ziuas', '' + number + ' ziuas'], 'M': ['\'n mes', '\'iens mes'], - 'MM': [number + ' mesen', ' ' + number + ' mesen'], + 'MM': [number + ' mesen', '' + number + ' mesen'], 'y': ['\'n ar', '\'iens ar'], - 'yy': [number + ' ars', ' ' + number + ' ars'] + 'yy': [number + ' ars', '' + number + ' ars'] }; - return isFuture ? format[key][0] : (withoutSuffix ? format[key][0] : format[key][1].trim()); + return isFuture ? format[key][0] : (withoutSuffix ? format[key][0] : format[key][1]); } //! moment.js locale configuration //! locale : Morocco Central Atlas Tamaziɣt in Latin (tzm-latn) //! author : Abdel Said : https://github.com/abdelsaid - var tzm_latn = _moment__default.defineLocale('tzm-latn', { + var tzm_latn = moment__default.defineLocale('tzm-latn', { months : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'), monthsShort : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'), weekdays : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'), @@ -9476,7 +10650,7 @@ //! locale : Morocco Central Atlas Tamaziɣt (tzm) //! author : Abdel Said : https://github.com/abdelsaid - var tzm = _moment__default.defineLocale('tzm', { + var tzm = moment__default.defineLocale('tzm', { months : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'), monthsShort : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'), weekdays : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'), @@ -9530,8 +10704,8 @@ } function uk__relativeTimeWithPlural(number, withoutSuffix, key) { var format = { - 'mm': 'хвилина_хвилини_хвилин', - 'hh': 'година_години_годин', + 'mm': withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин', + 'hh': withoutSuffix ? 'година_години_годин' : 'годину_години_годин', 'dd': 'день_дні_днів', 'MM': 'місяць_місяці_місяців', 'yy': 'рік_роки_років' @@ -9546,17 +10720,7 @@ return number + ' ' + uk__plural(format[key], +number); } } - function uk__monthsCaseReplace(m, format) { - var months = { - 'nominative': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_'), - 'accusative': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_') - }, - nounCase = (/D[oD]? *MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return months[nounCase][m.month()]; - } - function uk__weekdaysCaseReplace(m, format) { + function weekdaysCaseReplace(m, format) { var weekdays = { 'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'), 'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'), @@ -9575,10 +10739,13 @@ }; } - var uk = _moment__default.defineLocale('uk', { - months : uk__monthsCaseReplace, + var uk = moment__default.defineLocale('uk', { + months : { + 'format': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_'), + 'standalone': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_') + }, monthsShort : 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'), - weekdays : uk__weekdaysCaseReplace, + weekdays : weekdaysCaseReplace, weekdaysShort : 'нд_пн_вт_ср_чт_пт_сб'.split('_'), weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'), longDateFormat : { @@ -9665,8 +10832,8 @@ //! locale : uzbek (uz) //! author : Sardor Muminov : https://github.com/muminoff - var uz = _moment__default.defineLocale('uz', { - months : 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'), + var uz = moment__default.defineLocale('uz', { + months : 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split('_'), monthsShort : 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'), weekdays : 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'), weekdaysShort : 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'), @@ -9712,7 +10879,7 @@ //! locale : vietnamese (vi) //! author : Bang Nguyen : https://github.com/bangnk - var vi = _moment__default.defineLocale('vi', { + var vi = moment__default.defineLocale('vi', { months : 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split('_'), monthsShort : 'Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12'.split('_'), weekdays : 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'), @@ -9768,7 +10935,7 @@ //! author : suupic : https://github.com/suupic //! author : Zeno Zeng : https://github.com/zenozeng - var zh_cn = _moment__default.defineLocale('zh-cn', { + var zh_cn = moment__default.defineLocale('zh-cn', { months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'), @@ -9829,13 +10996,13 @@ }, nextWeek : function () { var startOfWeek, prefix; - startOfWeek = _moment__default().startOf('week'); + startOfWeek = moment__default().startOf('week'); prefix = this.unix() - startOfWeek.unix() >= 7 * 24 * 3600 ? '[下]' : '[本]'; return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm'; }, lastWeek : function () { var startOfWeek, prefix; - startOfWeek = _moment__default().startOf('week'); + startOfWeek = moment__default().startOf('week'); prefix = this.unix() < startOfWeek.unix() ? '[上]' : '[本]'; return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm'; }, @@ -9883,7 +11050,7 @@ //! locale : traditional chinese (zh-tw) //! author : Ben : https://github.com/ben-lin - var zh_tw = _moment__default.defineLocale('zh-tw', { + var zh_tw = moment__default.defineLocale('zh-tw', { months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'), @@ -9969,7 +11136,7 @@ } }); - var moment_with_locales = _moment__default; + var moment_with_locales = moment__default; moment_with_locales.locale('en'); return moment_with_locales; diff --git a/bower_components/moment/min/moment-with-locales.min.js b/bower_components/moment/min/moment-with-locales.min.js index 90eb91b..edaaeb8 100644 --- a/bower_components/moment/min/moment-with-locales.min.js +++ b/bower_components/moment/min/moment-with-locales.min.js @@ -1,80 +1,74 @@ -!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return Md.apply(null,arguments)}function b(a){Md=a}function c(a){return"[object Array]"===Object.prototype.toString.call(a)}function d(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function e(a,b){var c,d=[];for(c=0;c0)for(c in Od)d=Od[c],e=b[d],"undefined"!=typeof e&&(a[d]=e);return a}function n(b){m(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),Pd===!1&&(Pd=!0,a.updateOffset(this),Pd=!1)}function o(a){return a instanceof n||null!=a&&null!=a._isAMomentObject}function p(a){return 0>a?Math.ceil(a):Math.floor(a)}function q(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=p(b)),c}function r(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&q(a[d])!==q(b[d]))&&g++;return g+f}function s(){}function t(a){return a?a.toLowerCase().replace("_","-"):a}function u(a){for(var b,c,d,e,f=0;f0;){if(d=v(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&r(e,c,!0)>=b-1)break;b--}f++}return null}function v(a){var b=null;if(!Qd[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=Nd._abbr,require("./locale/"+a),w(b)}catch(c){}return Qd[a]}function w(a,b){var c;return a&&(c="undefined"==typeof b?y(a):x(a,b),c&&(Nd=c)),Nd._abbr}function x(a,b){return null!==b?(b.abbr=a,Qd[a]=Qd[a]||new s,Qd[a].set(b),w(a),Qd[a]):(delete Qd[a],null)}function y(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return Nd;if(!c(a)){if(b=v(a))return b;a=[a]}return u(a)}function z(a,b){var c=a.toLowerCase();Rd[c]=Rd[c+"s"]=Rd[b]=a}function A(a){return"string"==typeof a?Rd[a]||Rd[a.toLowerCase()]:void 0}function B(a){var b,c,d={};for(c in a)f(a,c)&&(b=A(c),b&&(d[b]=a[c]));return d}function C(b,c){return function(d){return null!=d?(E(this,b,d),a.updateOffset(this,c),this):D(this,b)}}function D(a,b){return a._d["get"+(a._isUTC?"UTC":"")+b]()}function E(a,b,c){return a._d["set"+(a._isUTC?"UTC":"")+b](c)}function F(a,b){var c;if("object"==typeof a)for(c in a)this.set(c,a[c]);else if(a=A(a),"function"==typeof this[a])return this[a](b);return this}function G(a,b,c){var d=""+Math.abs(a),e=b-d.length,f=a>=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}function H(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(Vd[a]=e),b&&(Vd[b[0]]=function(){return G(e.apply(this,arguments),b[1],b[2])}),c&&(Vd[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function I(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function J(a){var b,c,d=a.match(Sd);for(b=0,c=d.length;c>b;b++)Vd[d[b]]?d[b]=Vd[d[b]]:d[b]=I(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function K(a,b){return a.isValid()?(b=L(b,a.localeData()),Ud[b]=Ud[b]||J(b),Ud[b](a)):a.localeData().invalidDate()}function L(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Td.lastIndex=0;d>=0&&Td.test(a);)a=a.replace(Td,c),Td.lastIndex=0,d-=1;return a}function M(a){return"function"==typeof a&&"[object Function]"===Object.prototype.toString.call(a)}function N(a,b,c){ie[a]=M(b)?b:function(a){return a&&c?c:b}}function O(a,b){return f(ie,a)?ie[a](b._strict,b._locale):new RegExp(P(a))}function P(a){return a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Q(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),"number"==typeof b&&(d=function(a,c){c[b]=q(a)}),c=0;cd;d++){if(e=h([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}function X(a,b){var c;return"string"==typeof b&&(b=a.localeData().monthsParse(b),"number"!=typeof b)?a:(c=Math.min(a.date(),T(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a)}function Y(b){return null!=b?(X(this,b),a.updateOffset(this,!0),this):D(this,"Month")}function Z(){return T(this.year(),this.month())}function $(a){var b,c=a._a;return c&&-2===j(a).overflow&&(b=c[le]<0||c[le]>11?le:c[me]<1||c[me]>T(c[ke],c[le])?me:c[ne]<0||c[ne]>24||24===c[ne]&&(0!==c[oe]||0!==c[pe]||0!==c[qe])?ne:c[oe]<0||c[oe]>59?oe:c[pe]<0||c[pe]>59?pe:c[qe]<0||c[qe]>999?qe:-1,j(a)._overflowDayOfYear&&(ke>b||b>me)&&(b=me),j(a).overflow=b),a}function _(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function aa(a,b){var c=!0;return g(function(){return c&&(_(a+"\n"+(new Error).stack),c=!1),b.apply(this,arguments)},b)}function ba(a,b){te[a]||(_(b),te[a]=!0)}function ca(a){var b,c,d=a._i,e=ue.exec(d);if(e){for(j(a).iso=!0,b=0,c=ve.length;c>b;b++)if(ve[b][1].exec(d)){a._f=ve[b][0];break}for(b=0,c=we.length;c>b;b++)if(we[b][1].exec(d)){a._f+=(e[6]||" ")+we[b][0];break}d.match(fe)&&(a._f+="Z"),va(a)}else a._isValid=!1}function da(b){var c=xe.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(ca(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}function ea(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 1970>a&&h.setFullYear(a),h}function fa(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function ga(a){return ha(a)?366:365}function ha(a){return a%4===0&&a%100!==0||a%400===0}function ia(){return ha(this.year())}function ja(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=Da(a).add(f,"d"),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function ka(a){return ja(a,this._week.dow,this._week.doy).week}function la(){return this._week.dow}function ma(){return this._week.doy}function na(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function oa(a){var b=ja(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function pa(a,b,c,d,e){var f,g=6+e-d,h=fa(a,0,1+g),i=h.getUTCDay();return e>i&&(i+=7),c=null!=c?1*c:e,f=1+g+7*(b-1)-i+c,{year:f>0?a:a-1,dayOfYear:f>0?f:ga(a-1)+f}}function qa(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function ra(a,b,c){return null!=a?a:null!=b?b:c}function sa(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function ta(a){var b,c,d,e,f=[];if(!a._d){for(d=sa(a),a._w&&null==a._a[me]&&null==a._a[le]&&ua(a),a._dayOfYear&&(e=ra(a._a[ke],d[ke]),a._dayOfYear>ga(e)&&(j(a)._overflowDayOfYear=!0),c=fa(e,0,a._dayOfYear),a._a[le]=c.getUTCMonth(),a._a[me]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[ne]&&0===a._a[oe]&&0===a._a[pe]&&0===a._a[qe]&&(a._nextDay=!0,a._a[ne]=0),a._d=(a._useUTC?fa:ea).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[ne]=24)}}function ua(a){var b,c,d,e,f,g,h;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(f=1,g=4,c=ra(b.GG,a._a[ke],ja(Da(),1,4).year),d=ra(b.W,1),e=ra(b.E,1)):(f=a._locale._week.dow,g=a._locale._week.doy,c=ra(b.gg,a._a[ke],ja(Da(),f,g).year),d=ra(b.w,1),null!=b.d?(e=b.d,f>e&&++d):e=null!=b.e?b.e+f:f),h=pa(c,d,e,g,f),a._a[ke]=h.year,a._dayOfYear=h.dayOfYear}function va(b){if(b._f===a.ISO_8601)return void ca(b);b._a=[],j(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,k=0;for(e=L(b._f,b._locale).match(Sd)||[],c=0;c0&&j(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),k+=d.length),Vd[f]?(d?j(b).empty=!1:j(b).unusedTokens.push(f),S(f,d,b)):b._strict&&!d&&j(b).unusedTokens.push(f);j(b).charsLeftOver=i-k,h.length>0&&j(b).unusedInput.push(h),j(b).bigHour===!0&&b._a[ne]<=12&&b._a[ne]>0&&(j(b).bigHour=void 0),b._a[ne]=wa(b._locale,b._a[ne],b._meridiem),ta(b),$(b)}function wa(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}function xa(a){var b,c,d,e,f;if(0===a._f.length)return j(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;ef)&&(d=f,c=b));g(a,c||b)}function ya(a){if(!a._d){var b=B(a._i);a._a=[b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],ta(a)}}function za(a){var b=new n($(Aa(a)));return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function Aa(a){var b=a._i,e=a._f;return a._locale=a._locale||y(a._l),null===b||void 0===e&&""===b?l({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),o(b)?new n($(b)):(c(e)?xa(a):e?va(a):d(b)?a._d=b:Ba(a),a))}function Ba(b){var f=b._i;void 0===f?b._d=new Date:d(f)?b._d=new Date(+f):"string"==typeof f?da(b):c(f)?(b._a=e(f.slice(0),function(a){return parseInt(a,10)}),ta(b)):"object"==typeof f?ya(b):"number"==typeof f?b._d=new Date(f):a.createFromInputFallback(b)}function Ca(a,b,c,d,e){var f={};return"boolean"==typeof c&&(d=c,c=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=e,f._l=c,f._i=a,f._f=b,f._strict=d,za(f)}function Da(a,b,c,d){return Ca(a,b,c,d,!1)}function Ea(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return Da();for(d=b[0],e=1;ea&&(a=-a,c="-"),c+G(~~(a/60),2)+b+G(~~a%60,2)})}function Ka(a){var b=(a||"").match(fe)||[],c=b[b.length-1]||[],d=(c+"").match(Ce)||["-",0,0],e=+(60*d[1])+q(d[2]);return"+"===d[0]?e:-e}function La(b,c){var e,f;return c._isUTC?(e=c.clone(),f=(o(b)||d(b)?+b:+Da(b))-+e,e._d.setTime(+e._d+f),a.updateOffset(e,!1),e):Da(b).local()}function Ma(a){return 15*-Math.round(a._d.getTimezoneOffset()/15)}function Na(b,c){var d,e=this._offset||0;return null!=b?("string"==typeof b&&(b=Ka(b)),Math.abs(b)<16&&(b=60*b),!this._isUTC&&c&&(d=Ma(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?bb(this,Ya(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?e:Ma(this)}function Oa(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Pa(a){return this.utcOffset(0,a)}function Qa(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Ma(this),"m")),this}function Ra(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Ka(this._i)),this}function Sa(a){return a=a?Da(a).utcOffset():0,(this.utcOffset()-a)%60===0}function Ta(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ua(){if("undefined"!=typeof this._isDSTShifted)return this._isDSTShifted;var a={};if(m(a,this),a=Aa(a),a._a){var b=a._isUTC?h(a._a):Da(a._a);this._isDSTShifted=this.isValid()&&r(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Va(){return!this._isUTC}function Wa(){return this._isUTC}function Xa(){return this._isUTC&&0===this._offset}function Ya(a,b){var c,d,e,g=a,h=null;return Ia(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(h=De.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:q(h[me])*c,h:q(h[ne])*c,m:q(h[oe])*c,s:q(h[pe])*c,ms:q(h[qe])*c}):(h=Ee.exec(a))?(c="-"===h[1]?-1:1,g={y:Za(h[2],c),M:Za(h[3],c),d:Za(h[4],c),h:Za(h[5],c),m:Za(h[6],c),s:Za(h[7],c),w:Za(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=_a(Da(g.from),Da(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new Ha(g),Ia(a)&&f(a,"_locale")&&(d._locale=a._locale),d}function Za(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function $a(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function _a(a,b){var c;return b=La(b,a),a.isBefore(b)?c=$a(a,b):(c=$a(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c}function ab(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(ba(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=Ya(c,d),bb(this,e,a),this}}function bb(b,c,d,e){var f=c._milliseconds,g=c._days,h=c._months;e=null==e?!0:e,f&&b._d.setTime(+b._d+f*d),g&&E(b,"Date",D(b,"Date")+g*d),h&&X(b,D(b,"Month")+h*d),e&&a.updateOffset(b,g||h)}function cb(a,b){var c=a||Da(),d=La(c,this).startOf("day"),e=this.diff(d,"days",!0),f=-6>e?"sameElse":-1>e?"lastWeek":0>e?"lastDay":1>e?"sameDay":2>e?"nextDay":7>e?"nextWeek":"sameElse";return this.format(b&&b[f]||this.localeData().calendar(f,this,Da(c)))}function db(){return new n(this)}function eb(a,b){var c;return b=A("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=o(a)?a:Da(a),+this>+a):(c=o(a)?+a:+Da(a),c<+this.clone().startOf(b))}function fb(a,b){var c;return b=A("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=o(a)?a:Da(a),+a>+this):(c=o(a)?+a:+Da(a),+this.clone().endOf(b)b-f?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)}function kb(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function lb(){var a=this.clone().utc();return 0b;b++)if(this._weekdaysParse[b]||(c=Da([2e3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b}function Pb(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=Kb(a,this.localeData()),this.add(a-b,"d")):b}function Qb(a){var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function Rb(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)}function Sb(a,b){H(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function Tb(a,b){return b._meridiemParse}function Ub(a){return"p"===(a+"").toLowerCase().charAt(0)}function Vb(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function Wb(a,b){b[qe]=q(1e3*("0."+a))}function Xb(){return this._isUTC?"UTC":""}function Yb(){return this._isUTC?"Coordinated Universal Time":""}function Zb(a){return Da(1e3*a)}function $b(){return Da.apply(null,arguments).parseZone()}function _b(a,b,c){var d=this._calendar[a];return"function"==typeof d?d.call(b,c):d}function ac(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function bc(){return this._invalidDate}function cc(a){return this._ordinal.replace("%d",a)}function dc(a){return a}function ec(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)}function fc(a,b){var c=this._relativeTime[a>0?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)}function gc(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function hc(a,b,c,d){var e=y(),f=h().set(d,b);return e[c](f,a)}function ic(a,b,c,d,e){if("number"==typeof a&&(b=a,a=void 0),a=a||"",null!=b)return hc(a,b,c,e);var f,g=[];for(f=0;d>f;f++)g[f]=hc(a,f,c,e);return g}function jc(a,b){return ic(a,b,"months",12,"month")}function kc(a,b){return ic(a,b,"monthsShort",12,"month")}function lc(a,b){return ic(a,b,"weekdays",7,"day")}function mc(a,b){return ic(a,b,"weekdaysShort",7,"day")}function nc(a,b){return ic(a,b,"weekdaysMin",7,"day")}function oc(){var a=this._data;return this._milliseconds=_e(this._milliseconds),this._days=_e(this._days),this._months=_e(this._months),a.milliseconds=_e(a.milliseconds),a.seconds=_e(a.seconds),a.minutes=_e(a.minutes),a.hours=_e(a.hours),a.months=_e(a.months),a.years=_e(a.years),this}function pc(a,b,c,d){var e=Ya(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function qc(a,b){return pc(this,a,b,1)}function rc(a,b){return pc(this,a,b,-1)}function sc(a){return 0>a?Math.floor(a):Math.ceil(a)}function tc(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data;return f>=0&&g>=0&&h>=0||0>=f&&0>=g&&0>=h||(f+=864e5*sc(vc(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=p(f/1e3),i.seconds=a%60,b=p(a/60),i.minutes=b%60,c=p(b/60),i.hours=c%24,g+=p(c/24),e=p(uc(g)),h+=e,g-=sc(vc(e)),d=p(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function uc(a){return 4800*a/146097}function vc(a){return 146097*a/4800}function wc(a){var b,c,d=this._milliseconds;if(a=A(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+uc(b),"month"===a?c:c/12;switch(b=this._days+Math.round(vc(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function xc(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*q(this._months/12)}function yc(a){return function(){return this.as(a)}}function zc(a){return a=A(a),this[a+"s"]()}function Ac(a){return function(){return this._data[a]}}function Bc(){return p(this.days()/7)}function Cc(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function Dc(a,b,c){var d=Ya(a).abs(),e=qf(d.as("s")),f=qf(d.as("m")),g=qf(d.as("h")),h=qf(d.as("d")),i=qf(d.as("M")),j=qf(d.as("y")),k=e0,k[4]=c,Cc.apply(null,k)}function Ec(a,b){return void 0===rf[a]?!1:void 0===b?rf[a]:(rf[a]=b,!0)}function Fc(a){var b=this.localeData(),c=Dc(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function Gc(){var a,b,c,d=sf(this._milliseconds)/1e3,e=sf(this._days),f=sf(this._months);a=p(d/60),b=p(a/60),d%=60,a%=60,c=p(f/12),f%=12;var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(0>m?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"} +!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return Rd.apply(null,arguments)}function b(a){Rd=a}function c(a){return"[object Array]"===Object.prototype.toString.call(a)}function d(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function e(a,b){var c,d=[];for(c=0;c0)for(c in Td)d=Td[c],e=b[d],m(e)||(a[d]=e);return a}function o(b){n(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),Ud===!1&&(Ud=!0,a.updateOffset(this),Ud=!1)}function p(a){return a instanceof o||null!=a&&null!=a._isAMomentObject}function q(a){return 0>a?Math.ceil(a):Math.floor(a)}function r(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=q(b)),c}function s(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&r(a[d])!==r(b[d]))&&g++;return g+f}function t(){}function u(a){return a?a.toLowerCase().replace("_","-"):a}function v(a){for(var b,c,d,e,f=0;f0;){if(d=w(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&s(e,c,!0)>=b-1)break;b--}f++}return null}function w(a){var b=null;if(!Vd[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=Sd._abbr,require("./locale/"+a),x(b)}catch(c){}return Vd[a]}function x(a,b){var c;return a&&(c=m(b)?z(a):y(a,b),c&&(Sd=c)),Sd._abbr}function y(a,b){return null!==b?(b.abbr=a,Vd[a]=Vd[a]||new t,Vd[a].set(b),x(a),Vd[a]):(delete Vd[a],null)}function z(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return Sd;if(!c(a)){if(b=w(a))return b;a=[a]}return v(a)}function A(a,b){var c=a.toLowerCase();Wd[c]=Wd[c+"s"]=Wd[b]=a}function B(a){return"string"==typeof a?Wd[a]||Wd[a.toLowerCase()]:void 0}function C(a){var b,c,d={};for(c in a)f(a,c)&&(b=B(c),b&&(d[b]=a[c]));return d}function D(a){return a instanceof Function||"[object Function]"===Object.prototype.toString.call(a)}function E(b,c){return function(d){return null!=d?(G(this,b,d),a.updateOffset(this,c),this):F(this,b)}}function F(a,b){return a.isValid()?a._d["get"+(a._isUTC?"UTC":"")+b]():NaN}function G(a,b,c){a.isValid()&&a._d["set"+(a._isUTC?"UTC":"")+b](c)}function H(a,b){var c;if("object"==typeof a)for(c in a)this.set(c,a[c]);else if(a=B(a),D(this[a]))return this[a](b);return this}function I(a,b,c){var d=""+Math.abs(a),e=b-d.length,f=a>=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}function J(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&($d[a]=e),b&&($d[b[0]]=function(){return I(e.apply(this,arguments),b[1],b[2])}),c&&($d[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function K(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function L(a){var b,c,d=a.match(Xd);for(b=0,c=d.length;c>b;b++)$d[d[b]]?d[b]=$d[d[b]]:d[b]=K(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function M(a,b){return a.isValid()?(b=N(b,a.localeData()),Zd[b]=Zd[b]||L(b),Zd[b](a)):a.localeData().invalidDate()}function N(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Yd.lastIndex=0;d>=0&&Yd.test(a);)a=a.replace(Yd,c),Yd.lastIndex=0,d-=1;return a}function O(a,b,c){qe[a]=D(b)?b:function(a,d){return a&&c?c:b}}function P(a,b){return f(qe,a)?qe[a](b._strict,b._locale):new RegExp(Q(a))}function Q(a){return R(a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}))}function R(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function S(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),"number"==typeof b&&(d=function(a,c){c[b]=r(a)}),c=0;cd;d++){if(e=h([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}function Z(a,b){var c;return a.isValid()?"string"==typeof b&&(b=a.localeData().monthsParse(b),"number"!=typeof b)?a:(c=Math.min(a.date(),V(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a):a}function $(b){return null!=b?(Z(this,b),a.updateOffset(this,!0),this):F(this,"Month")}function _(){return V(this.year(),this.month())}function aa(a){return this._monthsParseExact?(f(this,"_monthsRegex")||ca.call(this),a?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&a?this._monthsShortStrictRegex:this._monthsShortRegex}function ba(a){return this._monthsParseExact?(f(this,"_monthsRegex")||ca.call(this),a?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&a?this._monthsStrictRegex:this._monthsRegex}function ca(){function a(a,b){return b.length-a.length}var b,c,d=[],e=[],f=[];for(b=0;12>b;b++)c=h([2e3,b]),d.push(this.monthsShort(c,"")),e.push(this.months(c,"")),f.push(this.months(c,"")),f.push(this.monthsShort(c,""));for(d.sort(a),e.sort(a),f.sort(a),b=0;12>b;b++)d[b]=R(d[b]),e[b]=R(e[b]),f[b]=R(f[b]);this._monthsRegex=new RegExp("^("+f.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+d.join("|")+")$","i")}function da(a){var b,c=a._a;return c&&-2===j(a).overflow&&(b=c[te]<0||c[te]>11?te:c[ue]<1||c[ue]>V(c[se],c[te])?ue:c[ve]<0||c[ve]>24||24===c[ve]&&(0!==c[we]||0!==c[xe]||0!==c[ye])?ve:c[we]<0||c[we]>59?we:c[xe]<0||c[xe]>59?xe:c[ye]<0||c[ye]>999?ye:-1,j(a)._overflowDayOfYear&&(se>b||b>ue)&&(b=ue),j(a)._overflowWeeks&&-1===b&&(b=ze),j(a)._overflowWeekday&&-1===b&&(b=Ae),j(a).overflow=b),a}function ea(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function fa(a,b){var c=!0;return g(function(){return c&&(ea(a+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),c=!1),b.apply(this,arguments)},b)}function ga(a,b){Ge[a]||(ea(b),Ge[a]=!0)}function ha(a){var b,c,d,e,f,g,h=a._i,i=He.exec(h)||Ie.exec(h);if(i){for(j(a).iso=!0,b=0,c=Ke.length;c>b;b++)if(Ke[b][1].exec(i[1])){e=Ke[b][0],d=Ke[b][2]!==!1;break}if(null==e)return void(a._isValid=!1);if(i[3]){for(b=0,c=Le.length;c>b;b++)if(Le[b][1].exec(i[3])){f=(i[2]||" ")+Le[b][0];break}if(null==f)return void(a._isValid=!1)}if(!d&&null!=f)return void(a._isValid=!1);if(i[4]){if(!Je.exec(i[4]))return void(a._isValid=!1);g="Z"}a._f=e+(f||"")+(g||""),wa(a)}else a._isValid=!1}function ia(b){var c=Me.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(ha(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}function ja(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 100>a&&a>=0&&isFinite(h.getFullYear())&&h.setFullYear(a),h}function ka(a){var b=new Date(Date.UTC.apply(null,arguments));return 100>a&&a>=0&&isFinite(b.getUTCFullYear())&&b.setUTCFullYear(a),b}function la(a){return ma(a)?366:365}function ma(a){return a%4===0&&a%100!==0||a%400===0}function na(){return ma(this.year())}function oa(a,b,c){var d=7+b-c,e=(7+ka(a,0,d).getUTCDay()-b)%7;return-e+d-1}function pa(a,b,c,d,e){var f,g,h=(7+c-d)%7,i=oa(a,d,e),j=1+7*(b-1)+h+i;return 0>=j?(f=a-1,g=la(f)+j):j>la(a)?(f=a+1,g=j-la(a)):(f=a,g=j),{year:f,dayOfYear:g}}function qa(a,b,c){var d,e,f=oa(a.year(),b,c),g=Math.floor((a.dayOfYear()-f-1)/7)+1;return 1>g?(e=a.year()-1,d=g+ra(e,b,c)):g>ra(a.year(),b,c)?(d=g-ra(a.year(),b,c),e=a.year()+1):(e=a.year(),d=g),{week:d,year:e}}function ra(a,b,c){var d=oa(a,b,c),e=oa(a+1,b,c);return(la(a)-d+e)/7}function sa(a,b,c){return null!=a?a:null!=b?b:c}function ta(b){var c=new Date(a.now());return b._useUTC?[c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()]:[c.getFullYear(),c.getMonth(),c.getDate()]}function ua(a){var b,c,d,e,f=[];if(!a._d){for(d=ta(a),a._w&&null==a._a[ue]&&null==a._a[te]&&va(a),a._dayOfYear&&(e=sa(a._a[se],d[se]),a._dayOfYear>la(e)&&(j(a)._overflowDayOfYear=!0),c=ka(e,0,a._dayOfYear),a._a[te]=c.getUTCMonth(),a._a[ue]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[ve]&&0===a._a[we]&&0===a._a[xe]&&0===a._a[ye]&&(a._nextDay=!0,a._a[ve]=0),a._d=(a._useUTC?ka:ja).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[ve]=24)}}function va(a){var b,c,d,e,f,g,h,i;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(f=1,g=4,c=sa(b.GG,a._a[se],qa(Ea(),1,4).year),d=sa(b.W,1),e=sa(b.E,1),(1>e||e>7)&&(i=!0)):(f=a._locale._week.dow,g=a._locale._week.doy,c=sa(b.gg,a._a[se],qa(Ea(),f,g).year),d=sa(b.w,1),null!=b.d?(e=b.d,(0>e||e>6)&&(i=!0)):null!=b.e?(e=b.e+f,(b.e<0||b.e>6)&&(i=!0)):e=f),1>d||d>ra(c,f,g)?j(a)._overflowWeeks=!0:null!=i?j(a)._overflowWeekday=!0:(h=pa(c,d,e,f,g),a._a[se]=h.year,a._dayOfYear=h.dayOfYear)}function wa(b){if(b._f===a.ISO_8601)return void ha(b);b._a=[],j(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,k=0;for(e=N(b._f,b._locale).match(Xd)||[],c=0;c0&&j(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),k+=d.length),$d[f]?(d?j(b).empty=!1:j(b).unusedTokens.push(f),U(f,d,b)):b._strict&&!d&&j(b).unusedTokens.push(f);j(b).charsLeftOver=i-k,h.length>0&&j(b).unusedInput.push(h),j(b).bigHour===!0&&b._a[ve]<=12&&b._a[ve]>0&&(j(b).bigHour=void 0),b._a[ve]=xa(b._locale,b._a[ve],b._meridiem),ua(b),da(b)}function xa(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}function ya(a){var b,c,d,e,f;if(0===a._f.length)return j(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;ef)&&(d=f,c=b));g(a,c||b)}function za(a){if(!a._d){var b=C(a._i);a._a=e([b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],function(a){return a&&parseInt(a,10)}),ua(a)}}function Aa(a){var b=new o(da(Ba(a)));return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function Ba(a){var b=a._i,e=a._f;return a._locale=a._locale||z(a._l),null===b||void 0===e&&""===b?l({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),p(b)?new o(da(b)):(c(e)?ya(a):e?wa(a):d(b)?a._d=b:Ca(a),k(a)||(a._d=null),a))}function Ca(b){var f=b._i;void 0===f?b._d=new Date(a.now()):d(f)?b._d=new Date(+f):"string"==typeof f?ia(b):c(f)?(b._a=e(f.slice(0),function(a){return parseInt(a,10)}),ua(b)):"object"==typeof f?za(b):"number"==typeof f?b._d=new Date(f):a.createFromInputFallback(b)}function Da(a,b,c,d,e){var f={};return"boolean"==typeof c&&(d=c,c=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=e,f._l=c,f._i=a,f._f=b,f._strict=d,Aa(f)}function Ea(a,b,c,d){return Da(a,b,c,d,!1)}function Fa(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return Ea();for(d=b[0],e=1;ea&&(a=-a,c="-"),c+I(~~(a/60),2)+b+I(~~a%60,2)})}function La(a,b){var c=(b||"").match(a)||[],d=c[c.length-1]||[],e=(d+"").match(Re)||["-",0,0],f=+(60*e[1])+r(e[2]);return"+"===e[0]?f:-f}function Ma(b,c){var e,f;return c._isUTC?(e=c.clone(),f=(p(b)||d(b)?+b:+Ea(b))-+e,e._d.setTime(+e._d+f),a.updateOffset(e,!1),e):Ea(b).local()}function Na(a){return 15*-Math.round(a._d.getTimezoneOffset()/15)}function Oa(b,c){var d,e=this._offset||0;return this.isValid()?null!=b?("string"==typeof b?b=La(ne,b):Math.abs(b)<16&&(b=60*b),!this._isUTC&&c&&(d=Na(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?cb(this,Za(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?e:Na(this):null!=b?this:NaN}function Pa(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Qa(a){return this.utcOffset(0,a)}function Ra(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Na(this),"m")),this}function Sa(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(La(me,this._i)),this}function Ta(a){return this.isValid()?(a=a?Ea(a).utcOffset():0,(this.utcOffset()-a)%60===0):!1}function Ua(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Va(){if(!m(this._isDSTShifted))return this._isDSTShifted;var a={};if(n(a,this),a=Ba(a),a._a){var b=a._isUTC?h(a._a):Ea(a._a);this._isDSTShifted=this.isValid()&&s(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Wa(){return this.isValid()?!this._isUTC:!1}function Xa(){return this.isValid()?this._isUTC:!1}function Ya(){return this.isValid()?this._isUTC&&0===this._offset:!1}function Za(a,b){var c,d,e,g=a,h=null;return Ja(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(h=Se.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:r(h[ue])*c,h:r(h[ve])*c,m:r(h[we])*c,s:r(h[xe])*c,ms:r(h[ye])*c}):(h=Te.exec(a))?(c="-"===h[1]?-1:1,g={y:$a(h[2],c),M:$a(h[3],c),d:$a(h[4],c),h:$a(h[5],c),m:$a(h[6],c),s:$a(h[7],c),w:$a(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=ab(Ea(g.from),Ea(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new Ia(g),Ja(a)&&f(a,"_locale")&&(d._locale=a._locale),d}function $a(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function _a(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function ab(a,b){var c;return a.isValid()&&b.isValid()?(b=Ma(b,a),a.isBefore(b)?c=_a(a,b):(c=_a(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}function bb(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(ga(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=Za(c,d),cb(this,e,a),this}}function cb(b,c,d,e){var f=c._milliseconds,g=c._days,h=c._months;b.isValid()&&(e=null==e?!0:e,f&&b._d.setTime(+b._d+f*d),g&&G(b,"Date",F(b,"Date")+g*d),h&&Z(b,F(b,"Month")+h*d),e&&a.updateOffset(b,g||h))}function db(a,b){var c=a||Ea(),d=Ma(c,this).startOf("day"),e=this.diff(d,"days",!0),f=-6>e?"sameElse":-1>e?"lastWeek":0>e?"lastDay":1>e?"sameDay":2>e?"nextDay":7>e?"nextWeek":"sameElse",g=b&&(D(b[f])?b[f]():b[f]);return this.format(g||this.localeData().calendar(f,this,Ea(c)))}function eb(){return new o(this)}function fb(a,b){var c=p(a)?a:Ea(a);return this.isValid()&&c.isValid()?(b=B(m(b)?"millisecond":b),"millisecond"===b?+this>+c:+c<+this.clone().startOf(b)):!1}function gb(a,b){var c=p(a)?a:Ea(a);return this.isValid()&&c.isValid()?(b=B(m(b)?"millisecond":b),"millisecond"===b?+c>+this:+this.clone().endOf(b)<+c):!1}function hb(a,b,c){return this.isAfter(a,c)&&this.isBefore(b,c)}function ib(a,b){var c,d=p(a)?a:Ea(a);return this.isValid()&&d.isValid()?(b=B(b||"millisecond"),"millisecond"===b?+this===+d:(c=+d,+this.clone().startOf(b)<=c&&c<=+this.clone().endOf(b))):!1}function jb(a,b){return this.isSame(a,b)||this.isAfter(a,b)}function kb(a,b){return this.isSame(a,b)||this.isBefore(a,b)}function lb(a,b,c){var d,e,f,g;return this.isValid()?(d=Ma(a,this),d.isValid()?(e=6e4*(d.utcOffset()-this.utcOffset()),b=B(b),"year"===b||"month"===b||"quarter"===b?(g=mb(this,d),"quarter"===b?g/=3:"year"===b&&(g/=12)):(f=this-d,g="second"===b?f/1e3:"minute"===b?f/6e4:"hour"===b?f/36e5:"day"===b?(f-e)/864e5:"week"===b?(f-e)/6048e5:f),c?g:q(g)):NaN):NaN}function mb(a,b){var c,d,e=12*(b.year()-a.year())+(b.month()-a.month()),f=a.clone().add(e,"months");return 0>b-f?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)}function nb(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ob(){var a=this.clone().utc();return 0f&&(b=f),Ob.call(this,a,b,c,d,e))}function Ob(a,b,c,d,e){var f=pa(a,b,c,d,e),g=ka(f.year,0,f.dayOfYear);return this.year(g.getUTCFullYear()),this.month(g.getUTCMonth()),this.date(g.getUTCDate()),this}function Pb(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)}function Qb(a){return qa(a,this._week.dow,this._week.doy).week}function Rb(){return this._week.dow}function Sb(){return this._week.doy}function Tb(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function Ub(a){var b=qa(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function Vb(a,b){return"string"!=typeof a?a:isNaN(a)?(a=b.weekdaysParse(a),"number"==typeof a?a:null):parseInt(a,10)}function Wb(a,b){return c(this._weekdays)?this._weekdays[a.day()]:this._weekdays[this._weekdays.isFormat.test(b)?"format":"standalone"][a.day()]}function Xb(a){return this._weekdaysShort[a.day()]}function Yb(a){return this._weekdaysMin[a.day()]}function Zb(a,b,c){var d,e,f;for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;7>d;d++){if(e=Ea([2e3,1]).day(d),c&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(e,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(e,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(e,"").replace(".",".?")+"$","i")),this._weekdaysParse[d]||(f="^"+this.weekdays(e,"")+"|^"+this.weekdaysShort(e,"")+"|^"+this.weekdaysMin(e,""),this._weekdaysParse[d]=new RegExp(f.replace(".",""),"i")),c&&"dddd"===b&&this._fullWeekdaysParse[d].test(a))return d;if(c&&"ddd"===b&&this._shortWeekdaysParse[d].test(a))return d;if(c&&"dd"===b&&this._minWeekdaysParse[d].test(a))return d;if(!c&&this._weekdaysParse[d].test(a))return d}}function $b(a){if(!this.isValid())return null!=a?this:NaN;var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=Vb(a,this.localeData()),this.add(a-b,"d")):b}function _b(a){if(!this.isValid())return null!=a?this:NaN;var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function ac(a){return this.isValid()?null==a?this.day()||7:this.day(this.day()%7?a:a-7):null!=a?this:NaN}function bc(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function cc(){return this.hours()%12||12}function dc(a,b){J(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function ec(a,b){return b._meridiemParse}function fc(a){return"p"===(a+"").toLowerCase().charAt(0)}function gc(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function hc(a,b){b[ye]=r(1e3*("0."+a))}function ic(){return this._isUTC?"UTC":""}function jc(){return this._isUTC?"Coordinated Universal Time":""}function kc(a){return Ea(1e3*a)}function lc(){return Ea.apply(null,arguments).parseZone()}function mc(a,b,c){var d=this._calendar[a];return D(d)?d.call(b,c):d}function nc(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function oc(){return this._invalidDate}function pc(a){return this._ordinal.replace("%d",a)}function qc(a){return a}function rc(a,b,c,d){var e=this._relativeTime[c];return D(e)?e(a,b,c,d):e.replace(/%d/i,a)}function sc(a,b){var c=this._relativeTime[a>0?"future":"past"];return D(c)?c(b):c.replace(/%s/i,b)}function tc(a){var b,c;for(c in a)b=a[c],D(b)?this[c]=b:this["_"+c]=b;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function uc(a,b,c,d){var e=z(),f=h().set(d,b);return e[c](f,a)}function vc(a,b,c,d,e){if("number"==typeof a&&(b=a,a=void 0),a=a||"",null!=b)return uc(a,b,c,e);var f,g=[];for(f=0;d>f;f++)g[f]=uc(a,f,c,e);return g}function wc(a,b){return vc(a,b,"months",12,"month")}function xc(a,b){return vc(a,b,"monthsShort",12,"month")}function yc(a,b){return vc(a,b,"weekdays",7,"day")}function zc(a,b){return vc(a,b,"weekdaysShort",7,"day")}function Ac(a,b){return vc(a,b,"weekdaysMin",7,"day")}function Bc(){var a=this._data;return this._milliseconds=qf(this._milliseconds),this._days=qf(this._days),this._months=qf(this._months),a.milliseconds=qf(a.milliseconds),a.seconds=qf(a.seconds),a.minutes=qf(a.minutes),a.hours=qf(a.hours),a.months=qf(a.months),a.years=qf(a.years),this}function Cc(a,b,c,d){var e=Za(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function Dc(a,b){return Cc(this,a,b,1)}function Ec(a,b){return Cc(this,a,b,-1)}function Fc(a){return 0>a?Math.floor(a):Math.ceil(a)}function Gc(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data;return f>=0&&g>=0&&h>=0||0>=f&&0>=g&&0>=h||(f+=864e5*Fc(Ic(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=q(f/1e3),i.seconds=a%60,b=q(a/60),i.minutes=b%60,c=q(b/60),i.hours=c%24,g+=q(c/24),e=q(Hc(g)),h+=e,g-=Fc(Ic(e)),d=q(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function Hc(a){return 4800*a/146097}function Ic(a){return 146097*a/4800}function Jc(a){var b,c,d=this._milliseconds;if(a=B(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+Hc(b),"month"===a?c:c/12;switch(b=this._days+Math.round(Ic(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function Kc(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*r(this._months/12)}function Lc(a){return function(){return this.as(a)}}function Mc(a){return a=B(a),this[a+"s"]()}function Nc(a){return function(){return this._data[a]}}function Oc(){return q(this.days()/7)}function Pc(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function Qc(a,b,c){var d=Za(a).abs(),e=Gf(d.as("s")),f=Gf(d.as("m")),g=Gf(d.as("h")),h=Gf(d.as("d")),i=Gf(d.as("M")),j=Gf(d.as("y")),k=e=f&&["m"]||f=g&&["h"]||g=h&&["d"]||h=i&&["M"]||i=j&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,Pc.apply(null,k)}function Rc(a,b){return void 0===Hf[a]?!1:void 0===b?Hf[a]:(Hf[a]=b,!0)}function Sc(a){var b=this.localeData(),c=Qc(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function Tc(){var a,b,c,d=If(this._milliseconds)/1e3,e=If(this._days),f=If(this._months);a=q(d/60),b=q(a/60),d%=60,a%=60,c=q(f/12),f%=12;var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(0>m?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"} //! moment.js locale configuration //! locale : belarusian (be) //! author : Dmitry Demidov : https://github.com/demidov91 //! author: Praleska: http://praleska.pro/ //! Author : Menelion Elensúle : https://github.com/Oire -function Hc(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function Ic(a,b,c){var d={mm:b?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:b?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"};return"m"===c?b?"хвіліна":"хвіліну":"h"===c?b?"гадзіна":"гадзіну":a+" "+Hc(d[c],+a)}function Jc(a,b){var c={nominative:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_"),accusative:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_")},d=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function Kc(a,b){var c={nominative:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),accusative:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_")},d=/\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/.test(b)?"accusative":"nominative";return c[d][a.day()]} +function Uc(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function Vc(a,b,c){var d={mm:b?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:b?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"};return"m"===c?b?"хвіліна":"хвіліну":"h"===c?b?"гадзіна":"гадзіну":a+" "+Uc(d[c],+a)} //! moment.js locale configuration //! locale : breton (br) //! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou -function Lc(a,b,c){var d={mm:"munutenn",MM:"miz",dd:"devezh"};return a+" "+Oc(d[c],a)}function Mc(a){switch(Nc(a)){case 1:case 3:case 4:case 5:case 9:return a+" bloaz";default:return a+" vloaz"}}function Nc(a){return a>9?Nc(a%10):a}function Oc(a,b){return 2===b?Pc(a):a}function Pc(a){var b={m:"v",b:"v",d:"z"};return void 0===b[a.charAt(0)]?a:b[a.charAt(0)]+a.substring(1)} +function Wc(a,b,c){var d={mm:"munutenn",MM:"miz",dd:"devezh"};return a+" "+Zc(d[c],a)}function Xc(a){switch(Yc(a)){case 1:case 3:case 4:case 5:case 9:return a+" bloaz";default:return a+" vloaz"}}function Yc(a){return a>9?Yc(a%10):a}function Zc(a,b){return 2===b?$c(a):a}function $c(a){var b={m:"v",b:"v",d:"z"};return void 0===b[a.charAt(0)]?a:b[a.charAt(0)]+a.substring(1)} //! moment.js locale configuration //! locale : bosnian (bs) //! author : Nedim Cholich : https://github.com/frontyard //! based on (hr) translation by Bojan Marković -function Qc(a,b,c){var d=a+" ";switch(c){case"m":return b?"jedna minuta":"jedne minute";case"mm":return d+=1===a?"minuta":2===a||3===a||4===a?"minute":"minuta";case"h":return b?"jedan sat":"jednog sata";case"hh":return d+=1===a?"sat":2===a||3===a||4===a?"sata":"sati";case"dd":return d+=1===a?"dan":"dana";case"MM":return d+=1===a?"mjesec":2===a||3===a||4===a?"mjeseca":"mjeseci";case"yy":return d+=1===a?"godina":2===a||3===a||4===a?"godine":"godina"}}function Rc(a){return a>1&&5>a&&1!==~~(a/10)}function Sc(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"pár sekund":"pár sekundami";case"m":return b?"minuta":d?"minutu":"minutou";case"mm":return b||d?e+(Rc(a)?"minuty":"minut"):e+"minutami";break;case"h":return b?"hodina":d?"hodinu":"hodinou";case"hh":return b||d?e+(Rc(a)?"hodiny":"hodin"):e+"hodinami";break;case"d":return b||d?"den":"dnem";case"dd":return b||d?e+(Rc(a)?"dny":"dní"):e+"dny";break;case"M":return b||d?"měsíc":"měsícem";case"MM":return b||d?e+(Rc(a)?"měsíce":"měsíců"):e+"měsíci";break;case"y":return b||d?"rok":"rokem";case"yy":return b||d?e+(Rc(a)?"roky":"let"):e+"lety"}} +function _c(a,b,c){var d=a+" ";switch(c){case"m":return b?"jedna minuta":"jedne minute";case"mm":return d+=1===a?"minuta":2===a||3===a||4===a?"minute":"minuta";case"h":return b?"jedan sat":"jednog sata";case"hh":return d+=1===a?"sat":2===a||3===a||4===a?"sata":"sati";case"dd":return d+=1===a?"dan":"dana";case"MM":return d+=1===a?"mjesec":2===a||3===a||4===a?"mjeseca":"mjeseci";case"yy":return d+=1===a?"godina":2===a||3===a||4===a?"godine":"godina"}}function ad(a){return a>1&&5>a&&1!==~~(a/10)}function bd(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"pár sekund":"pár sekundami";case"m":return b?"minuta":d?"minutu":"minutou";case"mm":return b||d?e+(ad(a)?"minuty":"minut"):e+"minutami";break;case"h":return b?"hodina":d?"hodinu":"hodinou";case"hh":return b||d?e+(ad(a)?"hodiny":"hodin"):e+"hodinami";break;case"d":return b||d?"den":"dnem";case"dd":return b||d?e+(ad(a)?"dny":"dní"):e+"dny";break;case"M":return b||d?"měsíc":"měsícem";case"MM":return b||d?e+(ad(a)?"měsíce":"měsíců"):e+"měsíci";break;case"y":return b||d?"rok":"rokem";case"yy":return b||d?e+(ad(a)?"roky":"let"):e+"lety"}} //! moment.js locale configuration //! locale : austrian german (de-at) //! author : lluchs : https://github.com/lluchs //! author: Menelion Elensúle: https://github.com/Oire //! author : Martin Groller : https://github.com/MadMG -function Tc(a,b,c,d){var e={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[a+" Tage",a+" Tagen"],M:["ein Monat","einem Monat"],MM:[a+" Monate",a+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[a+" Jahre",a+" Jahren"]};return b?e[c][0]:e[c][1]} +//! author : Mikolaj Dadela : https://github.com/mik01aj +function cd(a,b,c,d){var e={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[a+" Tage",a+" Tagen"],M:["ein Monat","einem Monat"],MM:[a+" Monate",a+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[a+" Jahre",a+" Jahren"]};return b?e[c][0]:e[c][1]} //! moment.js locale configuration //! locale : german (de) //! author : lluchs : https://github.com/lluchs //! author: Menelion Elensúle: https://github.com/Oire -function Uc(a,b,c,d){var e={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[a+" Tage",a+" Tagen"],M:["ein Monat","einem Monat"],MM:[a+" Monate",a+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[a+" Jahre",a+" Jahren"]};return b?e[c][0]:e[c][1]} +//! author : Mikolaj Dadela : https://github.com/mik01aj +function dd(a,b,c,d){var e={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[a+" Tage",a+" Tagen"],M:["ein Monat","einem Monat"],MM:[a+" Monate",a+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[a+" Jahre",a+" Jahren"]};return b?e[c][0]:e[c][1]} //! moment.js locale configuration //! locale : estonian (et) //! author : Henry Kehlmann : https://github.com/madhenry //! improvements : Illimar Tambek : https://github.com/ragulka -function Vc(a,b,c,d){var e={s:["mõne sekundi","mõni sekund","paar sekundit"],m:["ühe minuti","üks minut"],mm:[a+" minuti",a+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[a+" tunni",a+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[a+" kuu",a+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[a+" aasta",a+" aastat"]};return b?e[c][2]?e[c][2]:e[c][1]:d?e[c][0]:e[c][1]}function Wc(a,b,c,d){var e="";switch(c){case"s":return d?"muutaman sekunnin":"muutama sekunti";case"m":return d?"minuutin":"minuutti";case"mm":e=d?"minuutin":"minuuttia";break;case"h":return d?"tunnin":"tunti";case"hh":e=d?"tunnin":"tuntia";break;case"d":return d?"päivän":"päivä";case"dd":e=d?"päivän":"päivää";break;case"M":return d?"kuukauden":"kuukausi";case"MM":e=d?"kuukauden":"kuukautta";break;case"y":return d?"vuoden":"vuosi";case"yy":e=d?"vuoden":"vuotta"}return e=Xc(a,d)+" "+e}function Xc(a,b){return 10>a?b?Pf[a]:Of[a]:a} +function ed(a,b,c,d){var e={s:["mõne sekundi","mõni sekund","paar sekundit"],m:["ühe minuti","üks minut"],mm:[a+" minuti",a+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[a+" tunni",a+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[a+" kuu",a+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[a+" aasta",a+" aastat"]};return b?e[c][2]?e[c][2]:e[c][1]:d?e[c][0]:e[c][1]}function fd(a,b,c,d){var e="";switch(c){case"s":return d?"muutaman sekunnin":"muutama sekunti";case"m":return d?"minuutin":"minuutti";case"mm":e=d?"minuutin":"minuuttia";break;case"h":return d?"tunnin":"tunti";case"hh":e=d?"tunnin":"tuntia";break;case"d":return d?"päivän":"päivä";case"dd":e=d?"päivän":"päivää";break;case"M":return d?"kuukauden":"kuukausi";case"MM":e=d?"kuukauden":"kuukautta";break;case"y":return d?"vuoden":"vuosi";case"yy":e=d?"vuoden":"vuotta"}return e=gd(a,d)+" "+e}function gd(a,b){return 10>a?b?fg[a]:eg[a]:a} //! moment.js locale configuration //! locale : hrvatski (hr) //! author : Bojan Marković : https://github.com/bmarkovic -function Yc(a,b,c){var d=a+" ";switch(c){case"m":return b?"jedna minuta":"jedne minute";case"mm":return d+=1===a?"minuta":2===a||3===a||4===a?"minute":"minuta";case"h":return b?"jedan sat":"jednog sata";case"hh":return d+=1===a?"sat":2===a||3===a||4===a?"sata":"sati";case"dd":return d+=1===a?"dan":"dana";case"MM":return d+=1===a?"mjesec":2===a||3===a||4===a?"mjeseca":"mjeseci";case"yy":return d+=1===a?"godina":2===a||3===a||4===a?"godine":"godina"}}function Zc(a,b,c,d){var e=a;switch(c){case"s":return d||b?"néhány másodperc":"néhány másodperce";case"m":return"egy"+(d||b?" perc":" perce");case"mm":return e+(d||b?" perc":" perce");case"h":return"egy"+(d||b?" óra":" órája");case"hh":return e+(d||b?" óra":" órája");case"d":return"egy"+(d||b?" nap":" napja");case"dd":return e+(d||b?" nap":" napja");case"M":return"egy"+(d||b?" hónap":" hónapja");case"MM":return e+(d||b?" hónap":" hónapja");case"y":return"egy"+(d||b?" év":" éve");case"yy":return e+(d||b?" év":" éve")}return""}function $c(a){return(a?"":"[múlt] ")+"["+Uf[this.day()]+"] LT[-kor]"} -//! moment.js locale configuration -//! locale : Armenian (hy-am) -//! author : Armendarabyan : https://github.com/armendarabyan -function _c(a,b){var c={nominative:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_"),accusative:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_")},d=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function ad(a,b){var c="հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_");return c[a.month()]}function bd(a,b){var c="կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_");return c[a.day()]} +function hd(a,b,c){var d=a+" ";switch(c){case"m":return b?"jedna minuta":"jedne minute";case"mm":return d+=1===a?"minuta":2===a||3===a||4===a?"minute":"minuta";case"h":return b?"jedan sat":"jednog sata";case"hh":return d+=1===a?"sat":2===a||3===a||4===a?"sata":"sati";case"dd":return d+=1===a?"dan":"dana";case"MM":return d+=1===a?"mjesec":2===a||3===a||4===a?"mjeseca":"mjeseci";case"yy":return d+=1===a?"godina":2===a||3===a||4===a?"godine":"godina"}}function id(a,b,c,d){var e=a;switch(c){case"s":return d||b?"néhány másodperc":"néhány másodperce";case"m":return"egy"+(d||b?" perc":" perce");case"mm":return e+(d||b?" perc":" perce");case"h":return"egy"+(d||b?" óra":" órája");case"hh":return e+(d||b?" óra":" órája");case"d":return"egy"+(d||b?" nap":" napja");case"dd":return e+(d||b?" nap":" napja");case"M":return"egy"+(d||b?" hónap":" hónapja");case"MM":return e+(d||b?" hónap":" hónapja");case"y":return"egy"+(d||b?" év":" éve");case"yy":return e+(d||b?" év":" éve")}return""}function jd(a){return(a?"":"[múlt] ")+"["+pg[this.day()]+"] LT[-kor]"} //! moment.js locale configuration //! locale : icelandic (is) //! author : Hinrik Örn Sigurðsson : https://github.com/hinrik -function cd(a){return a%100===11?!0:a%10===1?!1:!0}function dd(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"nokkrar sekúndur":"nokkrum sekúndum";case"m":return b?"mínúta":"mínútu";case"mm":return cd(a)?e+(b||d?"mínútur":"mínútum"):b?e+"mínúta":e+"mínútu";case"hh":return cd(a)?e+(b||d?"klukkustundir":"klukkustundum"):e+"klukkustund";case"d":return b?"dagur":d?"dag":"degi";case"dd":return cd(a)?b?e+"dagar":e+(d?"daga":"dögum"):b?e+"dagur":e+(d?"dag":"degi");case"M":return b?"mánuður":d?"mánuð":"mánuði";case"MM":return cd(a)?b?e+"mánuðir":e+(d?"mánuði":"mánuðum"):b?e+"mánuður":e+(d?"mánuð":"mánuði");case"y":return b||d?"ár":"ári";case"yy":return cd(a)?e+(b||d?"ár":"árum"):e+(b||d?"ár":"ári")}} -//! moment.js locale configuration -//! locale : Georgian (ka) -//! author : Irakli Janiashvili : https://github.com/irakli-janiashvili -function ed(a,b){var c={nominative:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),accusative:"იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს".split("_")},d=/D[oD] *MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function fd(a,b){var c={nominative:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),accusative:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_")},d=/(წინა|შემდეგ)/.test(b)?"accusative":"nominative";return c[d][a.day()]} +function kd(a){return a%100===11?!0:a%10===1?!1:!0}function ld(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"nokkrar sekúndur":"nokkrum sekúndum";case"m":return b?"mínúta":"mínútu";case"mm":return kd(a)?e+(b||d?"mínútur":"mínútum"):b?e+"mínúta":e+"mínútu";case"hh":return kd(a)?e+(b||d?"klukkustundir":"klukkustundum"):e+"klukkustund";case"d":return b?"dagur":d?"dag":"degi";case"dd":return kd(a)?b?e+"dagar":e+(d?"daga":"dögum"):b?e+"dagur":e+(d?"dag":"degi");case"M":return b?"mánuður":d?"mánuð":"mánuði";case"MM":return kd(a)?b?e+"mánuðir":e+(d?"mánuði":"mánuðum"):b?e+"mánuður":e+(d?"mánuð":"mánuði");case"y":return b||d?"ár":"ári";case"yy":return kd(a)?e+(b||d?"ár":"árum"):e+(b||d?"ár":"ári")}} //! moment.js locale configuration //! locale : Luxembourgish (lb) //! author : mweimerskirch : https://github.com/mweimerskirch, David Raison : https://github.com/kwisatz -function gd(a,b,c,d){var e={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return b?e[c][0]:e[c][1]}function hd(a){var b=a.substr(0,a.indexOf(" "));return jd(b)?"a "+a:"an "+a}function id(a){var b=a.substr(0,a.indexOf(" "));return jd(b)?"viru "+a:"virun "+a}function jd(a){if(a=parseInt(a,10),isNaN(a))return!1;if(0>a)return!0;if(10>a)return a>=4&&7>=a?!0:!1;if(100>a){var b=a%10,c=a/10;return jd(0===b?c:b)}if(1e4>a){for(;a>=10;)a/=10;return jd(a)}return a/=1e3,jd(a)}function kd(a,b,c,d){return b?"kelios sekundės":d?"kelių sekundžių":"kelias sekundes"}function ld(a,b){var c={nominative:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),accusative:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_")},d=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function md(a,b,c,d){return b?od(c)[0]:d?od(c)[1]:od(c)[2]}function nd(a){return a%10===0||a>10&&20>a}function od(a){return Vf[a].split("_")}function pd(a,b,c,d){var e=a+" ";return 1===a?e+md(a,b,c[0],d):b?e+(nd(a)?od(c)[1]:od(c)[0]):d?e+od(c)[1]:e+(nd(a)?od(c)[1]:od(c)[2])}function qd(a,b){var c=-1===b.indexOf("dddd HH:mm"),d=Wf[a.day()];return c?d:d.substring(0,d.length-2)+"į"}function rd(a,b,c){return c?b%10===1&&11!==b?a[2]:a[3]:b%10===1&&11!==b?a[0]:a[1]}function sd(a,b,c){return a+" "+rd(Xf[c],a,b)}function td(a,b,c){return rd(Xf[c],a,b)}function ud(a,b){return b?"dažas sekundes":"dažām sekundēm"}function vd(a){return 5>a%10&&a%10>1&&~~(a/10)%10!==1}function wd(a,b,c){var d=a+" ";switch(c){case"m":return b?"minuta":"minutę";case"mm":return d+(vd(a)?"minuty":"minut");case"h":return b?"godzina":"godzinę";case"hh":return d+(vd(a)?"godziny":"godzin");case"MM":return d+(vd(a)?"miesiące":"miesięcy");case"yy":return d+(vd(a)?"lata":"lat")}} +function md(a,b,c,d){var e={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return b?e[c][0]:e[c][1]}function nd(a){var b=a.substr(0,a.indexOf(" "));return pd(b)?"a "+a:"an "+a}function od(a){var b=a.substr(0,a.indexOf(" "));return pd(b)?"viru "+a:"virun "+a}function pd(a){if(a=parseInt(a,10),isNaN(a))return!1;if(0>a)return!0;if(10>a)return a>=4&&7>=a?!0:!1;if(100>a){var b=a%10,c=a/10;return pd(0===b?c:b)}if(1e4>a){for(;a>=10;)a/=10;return pd(a)}return a/=1e3,pd(a)}function qd(a,b,c,d){return b?"kelios sekundės":d?"kelių sekundžių":"kelias sekundes"}function rd(a,b,c,d){return b?td(c)[0]:d?td(c)[1]:td(c)[2]}function sd(a){return a%10===0||a>10&&20>a}function td(a){return rg[a].split("_")}function ud(a,b,c,d){var e=a+" ";return 1===a?e+rd(a,b,c[0],d):b?e+(sd(a)?td(c)[1]:td(c)[0]):d?e+td(c)[1]:e+(sd(a)?td(c)[1]:td(c)[2])}function vd(a,b,c){return c?b%10===1&&11!==b?a[2]:a[3]:b%10===1&&11!==b?a[0]:a[1]}function wd(a,b,c){return a+" "+vd(sg[c],a,b)}function xd(a,b,c){return vd(sg[c],a,b)}function yd(a,b){return b?"dažas sekundes":"dažām sekundēm"}function zd(a,b,c,d){var e="";if(b)switch(c){case"s":e="काही सेकंद";break;case"m":e="एक मिनिट";break;case"mm":e="%d मिनिटे";break;case"h":e="एक तास";break;case"hh":e="%d तास";break;case"d":e="एक दिवस";break;case"dd":e="%d दिवस";break;case"M":e="एक महिना";break;case"MM":e="%d महिने";break;case"y":e="एक वर्ष";break;case"yy":e="%d वर्षे"}else switch(c){case"s":e="काही सेकंदां";break;case"m":e="एका मिनिटा";break;case"mm":e="%d मिनिटां";break;case"h":e="एका तासा";break;case"hh":e="%d तासां";break;case"d":e="एका दिवसा";break;case"dd":e="%d दिवसां";break;case"M":e="एका महिन्या";break;case"MM":e="%d महिन्यां";break;case"y":e="एका वर्षा";break;case"yy":e="%d वर्षां"}return e.replace(/%d/i,a)}function Ad(a){return 5>a%10&&a%10>1&&~~(a/10)%10!==1}function Bd(a,b,c){var d=a+" ";switch(c){case"m":return b?"minuta":"minutę";case"mm":return d+(Ad(a)?"minuty":"minut");case"h":return b?"godzina":"godzinę";case"hh":return d+(Ad(a)?"godziny":"godzin");case"MM":return d+(Ad(a)?"miesiące":"miesięcy");case"yy":return d+(Ad(a)?"lata":"lat")}} //! moment.js locale configuration //! locale : romanian (ro) //! author : Vlad Gurdiga : https://github.com/gurdiga //! author : Valentin Agachi : https://github.com/avaly -function xd(a,b,c){var d={mm:"minute",hh:"ore",dd:"zile",MM:"luni",yy:"ani"},e=" ";return(a%100>=20||a>=100&&a%100===0)&&(e=" de "),a+e+d[c]} +function Cd(a,b,c){var d={mm:"minute",hh:"ore",dd:"zile",MM:"luni",yy:"ani"},e=" ";return(a%100>=20||a>=100&&a%100===0)&&(e=" de "),a+e+d[c]} //! moment.js locale configuration //! locale : russian (ru) //! author : Viktorminator : https://github.com/Viktorminator //! Author : Menelion Elensúle : https://github.com/Oire -function yd(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function zd(a,b,c){var d={mm:b?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"};return"m"===c?b?"минута":"минуту":a+" "+yd(d[c],+a)}function Ad(a,b){var c={nominative:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),accusative:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_")},d=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function Bd(a,b){var c={nominative:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),accusative:"янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек".split("_")},d=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function Cd(a,b){var c={nominative:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),accusative:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_")},d=/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/.test(b)?"accusative":"nominative";return c[d][a.day()]}function Dd(a){return a>1&&5>a}function Ed(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"pár sekúnd":"pár sekundami";case"m":return b?"minúta":d?"minútu":"minútou";case"mm":return b||d?e+(Dd(a)?"minúty":"minút"):e+"minútami";break;case"h":return b?"hodina":d?"hodinu":"hodinou";case"hh":return b||d?e+(Dd(a)?"hodiny":"hodín"):e+"hodinami";break;case"d":return b||d?"deň":"dňom";case"dd":return b||d?e+(Dd(a)?"dni":"dní"):e+"dňami";break;case"M":return b||d?"mesiac":"mesiacom";case"MM":return b||d?e+(Dd(a)?"mesiace":"mesiacov"):e+"mesiacmi";break;case"y":return b||d?"rok":"rokom";case"yy":return b||d?e+(Dd(a)?"roky":"rokov"):e+"rokmi"}} +function Dd(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function Ed(a,b,c){var d={mm:b?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"};return"m"===c?b?"минута":"минуту":a+" "+Dd(d[c],+a)}function Fd(a){return a>1&&5>a}function Gd(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"pár sekúnd":"pár sekundami";case"m":return b?"minúta":d?"minútu":"minútou";case"mm":return b||d?e+(Fd(a)?"minúty":"minút"):e+"minútami";break;case"h":return b?"hodina":d?"hodinu":"hodinou";case"hh":return b||d?e+(Fd(a)?"hodiny":"hodín"):e+"hodinami";break;case"d":return b||d?"deň":"dňom";case"dd":return b||d?e+(Fd(a)?"dni":"dní"):e+"dňami";break;case"M":return b||d?"mesiac":"mesiacom";case"MM":return b||d?e+(Fd(a)?"mesiace":"mesiacov"):e+"mesiacmi";break;case"y":return b||d?"rok":"rokom";case"yy":return b||d?e+(Fd(a)?"roky":"rokov"):e+"rokmi"}} //! moment.js locale configuration //! locale : slovenian (sl) //! author : Robert Sedovšek : https://github.com/sedovsek -function Fd(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"nekaj sekund":"nekaj sekundami";case"m":return b?"ena minuta":"eno minuto";case"mm":return e+=1===a?b?"minuta":"minuto":2===a?b||d?"minuti":"minutama":5>a?b||d?"minute":"minutami":b||d?"minut":"minutami";case"h":return b?"ena ura":"eno uro";case"hh":return e+=1===a?b?"ura":"uro":2===a?b||d?"uri":"urama":5>a?b||d?"ure":"urami":b||d?"ur":"urami";case"d":return b||d?"en dan":"enim dnem";case"dd":return e+=1===a?b||d?"dan":"dnem":2===a?b||d?"dni":"dnevoma":b||d?"dni":"dnevi";case"M":return b||d?"en mesec":"enim mesecem";case"MM":return e+=1===a?b||d?"mesec":"mesecem":2===a?b||d?"meseca":"mesecema":5>a?b||d?"mesece":"meseci":b||d?"mesecev":"meseci";case"y":return b||d?"eno leto":"enim letom";case"yy":return e+=1===a?b||d?"leto":"letom":2===a?b||d?"leti":"letoma":5>a?b||d?"leta":"leti":b||d?"let":"leti"}}function Gd(a,b,c,d){var e={s:["viensas secunds","'iensas secunds"],m:["'n míut","'iens míut"],mm:[a+" míuts"," "+a+" míuts"],h:["'n þora","'iensa þora"],hh:[a+" þoras"," "+a+" þoras"],d:["'n ziua","'iensa ziua"],dd:[a+" ziuas"," "+a+" ziuas"],M:["'n mes","'iens mes"],MM:[a+" mesen"," "+a+" mesen"],y:["'n ar","'iens ar"],yy:[a+" ars"," "+a+" ars"]};return d?e[c][0]:b?e[c][0]:e[c][1].trim()} +function Hd(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"nekaj sekund":"nekaj sekundami";case"m":return b?"ena minuta":"eno minuto";case"mm":return e+=1===a?b?"minuta":"minuto":2===a?b||d?"minuti":"minutama":5>a?b||d?"minute":"minutami":b||d?"minut":"minutami";case"h":return b?"ena ura":"eno uro";case"hh":return e+=1===a?b?"ura":"uro":2===a?b||d?"uri":"urama":5>a?b||d?"ure":"urami":b||d?"ur":"urami";case"d":return b||d?"en dan":"enim dnem";case"dd":return e+=1===a?b||d?"dan":"dnem":2===a?b||d?"dni":"dnevoma":b||d?"dni":"dnevi";case"M":return b||d?"en mesec":"enim mesecem";case"MM":return e+=1===a?b||d?"mesec":"mesecem":2===a?b||d?"meseca":"mesecema":5>a?b||d?"mesece":"meseci":b||d?"mesecev":"meseci";case"y":return b||d?"eno leto":"enim letom";case"yy":return e+=1===a?b||d?"leto":"letom":2===a?b||d?"leti":"letoma":5>a?b||d?"leta":"leti":b||d?"let":"leti"}}function Id(a){var b=a;return b=-1!==a.indexOf("jaj")?b.slice(0,-3)+"leS":-1!==a.indexOf("jar")?b.slice(0,-3)+"waQ":-1!==a.indexOf("DIS")?b.slice(0,-3)+"nem":b+" pIq"}function Jd(a){var b=a;return b=-1!==a.indexOf("jaj")?b.slice(0,-3)+"Hu’":-1!==a.indexOf("jar")?b.slice(0,-3)+"wen":-1!==a.indexOf("DIS")?b.slice(0,-3)+"ben":b+" ret"}function Kd(a,b,c,d){var e=Ld(a);switch(c){case"mm":return e+" tup";case"hh":return e+" rep";case"dd":return e+" jaj";case"MM":return e+" jar";case"yy":return e+" DIS"}}function Ld(a){var b=Math.floor(a%1e3/100),c=Math.floor(a%100/10),d=a%10,e="";return b>0&&(e+=Lg[b]+"vatlh"),c>0&&(e+=(""!==e?" ":"")+Lg[c]+"maH"),d>0&&(e+=(""!==e?" ":"")+Lg[d]),""===e?"pagh":e}function Md(a,b,c,d){var e={s:["viensas secunds","'iensas secunds"],m:["'n míut","'iens míut"],mm:[a+" míuts",""+a+" míuts"],h:["'n þora","'iensa þora"],hh:[a+" þoras",""+a+" þoras"],d:["'n ziua","'iensa ziua"],dd:[a+" ziuas",""+a+" ziuas"],M:["'n mes","'iens mes"],MM:[a+" mesen",""+a+" mesen"],y:["'n ar","'iens ar"],yy:[a+" ars",""+a+" ars"]};return d?e[c][0]:b?e[c][0]:e[c][1]} //! moment.js locale configuration //! locale : ukrainian (uk) //! author : zemlanin : https://github.com/zemlanin //! Author : Menelion Elensúle : https://github.com/Oire -function Hd(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function Id(a,b,c){var d={mm:"хвилина_хвилини_хвилин",hh:"година_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"};return"m"===c?b?"хвилина":"хвилину":"h"===c?b?"година":"годину":a+" "+Hd(d[c],+a)}function Jd(a,b){var c={nominative:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_"),accusative:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_")},d=/D[oD]? *MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function Kd(a,b){var c={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")},d=/(\[[ВвУу]\]) ?dddd/.test(b)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(b)?"genitive":"nominative";return c[d][a.day()]}function Ld(a){return function(){return a+"о"+(11===this.hours()?"б":"")+"] LT"}}var Md,Nd,Od=a.momentProperties=[],Pd=!1,Qd={},Rd={},Sd=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Td=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Ud={},Vd={},Wd=/\d/,Xd=/\d\d/,Yd=/\d{3}/,Zd=/\d{4}/,$d=/[+-]?\d{6}/,_d=/\d\d?/,ae=/\d{1,3}/,be=/\d{1,4}/,ce=/[+-]?\d{1,6}/,de=/\d+/,ee=/[+-]?\d+/,fe=/Z|[+-]\d\d:?\d\d/gi,ge=/[+-]?\d+(\.\d{1,3})?/,he=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,ie={},je={},ke=0,le=1,me=2,ne=3,oe=4,pe=5,qe=6;H("M",["MM",2],"Mo",function(){return this.month()+1}),H("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),H("MMMM",0,0,function(a){return this.localeData().months(this,a)}),z("month","M"),N("M",_d),N("MM",_d,Xd),N("MMM",he),N("MMMM",he),Q(["M","MM"],function(a,b){b[le]=q(a)-1}),Q(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict);null!=e?b[le]=e:j(c).invalidMonth=a});var re="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),se="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),te={};a.suppressDeprecationWarnings=!1;var ue=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ve=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],we=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],xe=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=aa("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),H(0,["YY",2],0,function(){return this.year()%100}),H(0,["YYYY",4],0,"year"),H(0,["YYYYY",5],0,"year"),H(0,["YYYYYY",6,!0],0,"year"),z("year","y"),N("Y",ee),N("YY",_d,Xd),N("YYYY",be,Zd),N("YYYYY",ce,$d),N("YYYYYY",ce,$d),Q(["YYYYY","YYYYYY"],ke),Q("YYYY",function(b,c){c[ke]=2===b.length?a.parseTwoDigitYear(b):q(b)}),Q("YY",function(b,c){c[ke]=a.parseTwoDigitYear(b)}),a.parseTwoDigitYear=function(a){return q(a)+(q(a)>68?1900:2e3)};var ye=C("FullYear",!1);H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),z("week","w"),z("isoWeek","W"),N("w",_d),N("ww",_d,Xd),N("W",_d),N("WW",_d,Xd),R(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=q(a)});var ze={dow:0,doy:6};H("DDD",["DDDD",3],"DDDo","dayOfYear"),z("dayOfYear","DDD"),N("DDD",ae),N("DDDD",Yd),Q(["DDD","DDDD"],function(a,b,c){c._dayOfYear=q(a)}),a.ISO_8601=function(){};var Ae=aa("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var a=Da.apply(null,arguments);return this>a?this:a}),Be=aa("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var a=Da.apply(null,arguments);return a>this?this:a});Ja("Z",":"),Ja("ZZ",""),N("Z",fe),N("ZZ",fe),Q(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=Ka(a)});var Ce=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var De=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Ee=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Ya.fn=Ha.prototype;var Fe=ab(1,"add"),Ge=ab(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var He=aa("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});H(0,["gg",2],0,function(){return this.weekYear()%100}),H(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Db("gggg","weekYear"),Db("ggggg","weekYear"),Db("GGGG","isoWeekYear"),Db("GGGGG","isoWeekYear"),z("weekYear","gg"),z("isoWeekYear","GG"),N("G",ee),N("g",ee),N("GG",_d,Xd),N("gg",_d,Xd),N("GGGG",be,Zd),N("gggg",be,Zd),N("GGGGG",ce,$d),N("ggggg",ce,$d),R(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=q(a)}),R(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),H("Q",0,0,"quarter"),z("quarter","Q"),N("Q",Wd),Q("Q",function(a,b){b[le]=3*(q(a)-1)}),H("D",["DD",2],"Do","date"),z("date","D"),N("D",_d),N("DD",_d,Xd),N("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),Q(["D","DD"],me),Q("Do",function(a,b){b[me]=q(a.match(_d)[0],10)});var Ie=C("Date",!0);H("d",0,"do","day"),H("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),H("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),H("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),z("day","d"),z("weekday","e"),z("isoWeekday","E"),N("d",_d),N("e",_d),N("E",_d),N("dd",he),N("ddd",he),N("dddd",he),R(["dd","ddd","dddd"],function(a,b,c){var d=c._locale.weekdaysParse(a);null!=d?b.d=d:j(c).invalidWeekday=a}),R(["d","e","E"],function(a,b,c,d){b[d]=q(a)});var Je="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ke="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Le="Su_Mo_Tu_We_Th_Fr_Sa".split("_");H("H",["HH",2],0,"hour"),H("h",["hh",2],0,function(){return this.hours()%12||12}),Sb("a",!0),Sb("A",!1),z("hour","h"),N("a",Tb),N("A",Tb),N("H",_d),N("h",_d),N("HH",_d,Xd),N("hh",_d,Xd),Q(["H","HH"],ne),Q(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),Q(["h","hh"],function(a,b,c){b[ne]=q(a),j(c).bigHour=!0});var Me=/[ap]\.?m?\.?/i,Ne=C("Hours",!0);H("m",["mm",2],0,"minute"),z("minute","m"),N("m",_d),N("mm",_d,Xd),Q(["m","mm"],oe);var Oe=C("Minutes",!1);H("s",["ss",2],0,"second"),z("second","s"),N("s",_d),N("ss",_d,Xd),Q(["s","ss"],pe);var Pe=C("Seconds",!1);H("S",0,0,function(){return~~(this.millisecond()/100)}),H(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,function(){return 10*this.millisecond()}),H(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),H(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),H(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),H(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),H(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),z("millisecond","ms"),N("S",ae,Wd),N("SS",ae,Xd),N("SSS",ae,Yd);var Qe;for(Qe="SSSS";Qe.length<=9;Qe+="S")N(Qe,de);for(Qe="S";Qe.length<=9;Qe+="S")Q(Qe,Wb);var Re=C("Milliseconds",!1);H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");var Se=n.prototype;Se.add=Fe,Se.calendar=cb,Se.clone=db,Se.diff=ib,Se.endOf=ub,Se.format=mb,Se.from=nb,Se.fromNow=ob,Se.to=pb,Se.toNow=qb,Se.get=F,Se.invalidAt=Cb,Se.isAfter=eb,Se.isBefore=fb,Se.isBetween=gb,Se.isSame=hb,Se.isValid=Ab,Se.lang=He,Se.locale=rb,Se.localeData=sb,Se.max=Be,Se.min=Ae,Se.parsingFlags=Bb,Se.set=F,Se.startOf=tb,Se.subtract=Ge,Se.toArray=yb,Se.toObject=zb,Se.toDate=xb,Se.toISOString=lb,Se.toJSON=lb,Se.toString=kb,Se.unix=wb,Se.valueOf=vb,Se.year=ye,Se.isLeapYear=ia,Se.weekYear=Fb,Se.isoWeekYear=Gb,Se.quarter=Se.quarters=Jb,Se.month=Y,Se.daysInMonth=Z,Se.week=Se.weeks=na,Se.isoWeek=Se.isoWeeks=oa,Se.weeksInYear=Ib,Se.isoWeeksInYear=Hb,Se.date=Ie,Se.day=Se.days=Pb,Se.weekday=Qb,Se.isoWeekday=Rb,Se.dayOfYear=qa,Se.hour=Se.hours=Ne,Se.minute=Se.minutes=Oe,Se.second=Se.seconds=Pe,Se.millisecond=Se.milliseconds=Re,Se.utcOffset=Na,Se.utc=Pa,Se.local=Qa,Se.parseZone=Ra,Se.hasAlignedHourOffset=Sa,Se.isDST=Ta,Se.isDSTShifted=Ua,Se.isLocal=Va,Se.isUtcOffset=Wa,Se.isUtc=Xa,Se.isUTC=Xa,Se.zoneAbbr=Xb,Se.zoneName=Yb,Se.dates=aa("dates accessor is deprecated. Use date instead.",Ie),Se.months=aa("months accessor is deprecated. Use month instead",Y),Se.years=aa("years accessor is deprecated. Use year instead",ye),Se.zone=aa("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Oa);var Te=Se,Ue={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Ve={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},We="Invalid date",Xe="%d",Ye=/\d{1,2}/,Ze={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},$e=s.prototype;$e._calendar=Ue,$e.calendar=_b,$e._longDateFormat=Ve,$e.longDateFormat=ac,$e._invalidDate=We,$e.invalidDate=bc,$e._ordinal=Xe,$e.ordinal=cc,$e._ordinalParse=Ye,$e.preparse=dc,$e.postformat=dc,$e._relativeTime=Ze,$e.relativeTime=ec,$e.pastFuture=fc,$e.set=gc,$e.months=U,$e._months=re,$e.monthsShort=V,$e._monthsShort=se,$e.monthsParse=W,$e.week=ka,$e._week=ze,$e.firstDayOfYear=ma,$e.firstDayOfWeek=la,$e.weekdays=Lb,$e._weekdays=Je,$e.weekdaysMin=Nb,$e._weekdaysMin=Le,$e.weekdaysShort=Mb,$e._weekdaysShort=Ke,$e.weekdaysParse=Ob,$e.isPM=Ub,$e._meridiemParse=Me,$e.meridiem=Vb,w("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===q(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.lang=aa("moment.lang is deprecated. Use moment.locale instead.",w),a.langData=aa("moment.langData is deprecated. Use moment.localeData instead.",y);var _e=Math.abs,af=yc("ms"),bf=yc("s"),cf=yc("m"),df=yc("h"),ef=yc("d"),ff=yc("w"),gf=yc("M"),hf=yc("y"),jf=Ac("milliseconds"),kf=Ac("seconds"),lf=Ac("minutes"),mf=Ac("hours"),nf=Ac("days"),of=Ac("months"),pf=Ac("years"),qf=Math.round,rf={s:45,m:45,h:22,d:26,M:11},sf=Math.abs,tf=Ha.prototype;tf.abs=oc,tf.add=qc,tf.subtract=rc,tf.as=wc,tf.asMilliseconds=af,tf.asSeconds=bf,tf.asMinutes=cf,tf.asHours=df,tf.asDays=ef,tf.asWeeks=ff,tf.asMonths=gf,tf.asYears=hf,tf.valueOf=xc,tf._bubble=tc,tf.get=zc,tf.milliseconds=jf,tf.seconds=kf,tf.minutes=lf,tf.hours=mf,tf.days=nf,tf.weeks=Bc,tf.months=of,tf.years=pf,tf.humanize=Fc,tf.toISOString=Gc,tf.toString=Gc,tf.toJSON=Gc,tf.locale=rb,tf.localeData=sb,tf.toIsoString=aa("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Gc),tf.lang=He,H("X",0,0,"unix"),H("x",0,0,"valueOf"),N("x",ee),N("X",ge),Q("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),Q("x",function(a,b,c){c._d=new Date(q(a))}), +function Nd(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function Od(a,b,c){var d={mm:b?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:b?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"};return"m"===c?b?"хвилина":"хвилину":"h"===c?b?"година":"годину":a+" "+Nd(d[c],+a)}function Pd(a,b){var c={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")},d=/(\[[ВвУу]\]) ?dddd/.test(b)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(b)?"genitive":"nominative";return c[d][a.day()]}function Qd(a){return function(){return a+"о"+(11===this.hours()?"б":"")+"] LT"}}var Rd,Sd,Td=a.momentProperties=[],Ud=!1,Vd={},Wd={},Xd=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Yd=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Zd={},$d={},_d=/\d/,ae=/\d\d/,be=/\d{3}/,ce=/\d{4}/,de=/[+-]?\d{6}/,ee=/\d\d?/,fe=/\d\d\d\d?/,ge=/\d\d\d\d\d\d?/,he=/\d{1,3}/,ie=/\d{1,4}/,je=/[+-]?\d{1,6}/,ke=/\d+/,le=/[+-]?\d+/,me=/Z|[+-]\d\d:?\d\d/gi,ne=/Z|[+-]\d\d(?::?\d\d)?/gi,oe=/[+-]?\d+(\.\d{1,3})?/,pe=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,qe={},re={},se=0,te=1,ue=2,ve=3,we=4,xe=5,ye=6,ze=7,Ae=8;J("M",["MM",2],"Mo",function(){return this.month()+1}),J("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),J("MMMM",0,0,function(a){return this.localeData().months(this,a)}),A("month","M"),O("M",ee),O("MM",ee,ae),O("MMM",function(a,b){return b.monthsShortRegex(a)}),O("MMMM",function(a,b){return b.monthsRegex(a)}),S(["M","MM"],function(a,b){b[te]=r(a)-1}),S(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict);null!=e?b[te]=e:j(c).invalidMonth=a});var Be=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Ce="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),De="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Ee=pe,Fe=pe,Ge={};a.suppressDeprecationWarnings=!1;var He=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Ie=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Je=/Z|[+-]\d\d(?::?\d\d)?/,Ke=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Le=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Me=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=fa("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),J("Y",0,0,function(){var a=this.year();return 9999>=a?""+a:"+"+a}),J(0,["YY",2],0,function(){return this.year()%100}),J(0,["YYYY",4],0,"year"),J(0,["YYYYY",5],0,"year"),J(0,["YYYYYY",6,!0],0,"year"),A("year","y"),O("Y",le),O("YY",ee,ae),O("YYYY",ie,ce),O("YYYYY",je,de),O("YYYYYY",je,de),S(["YYYYY","YYYYYY"],se),S("YYYY",function(b,c){c[se]=2===b.length?a.parseTwoDigitYear(b):r(b)}),S("YY",function(b,c){c[se]=a.parseTwoDigitYear(b)}),S("Y",function(a,b){b[se]=parseInt(a,10)}),a.parseTwoDigitYear=function(a){return r(a)+(r(a)>68?1900:2e3)};var Ne=E("FullYear",!1);a.ISO_8601=function(){};var Oe=fa("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var a=Ea.apply(null,arguments);return this.isValid()&&a.isValid()?this>a?this:a:l()}),Pe=fa("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var a=Ea.apply(null,arguments);return this.isValid()&&a.isValid()?a>this?this:a:l()}),Qe=function(){return Date.now?Date.now():+new Date};Ka("Z",":"),Ka("ZZ",""),O("Z",ne),O("ZZ",ne),S(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=La(ne,a)});var Re=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var Se=/(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Te=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Za.fn=Ia.prototype;var Ue=bb(1,"add"),Ve=bb(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var We=fa("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});J(0,["gg",2],0,function(){return this.weekYear()%100}),J(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ib("gggg","weekYear"),Ib("ggggg","weekYear"),Ib("GGGG","isoWeekYear"),Ib("GGGGG","isoWeekYear"),A("weekYear","gg"),A("isoWeekYear","GG"),O("G",le),O("g",le),O("GG",ee,ae),O("gg",ee,ae),O("GGGG",ie,ce),O("gggg",ie,ce),O("GGGGG",je,de),O("ggggg",je,de),T(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=r(a)}),T(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),J("Q",0,"Qo","quarter"),A("quarter","Q"),O("Q",_d),S("Q",function(a,b){b[te]=3*(r(a)-1)}),J("w",["ww",2],"wo","week"),J("W",["WW",2],"Wo","isoWeek"),A("week","w"),A("isoWeek","W"),O("w",ee),O("ww",ee,ae),O("W",ee),O("WW",ee,ae),T(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=r(a)});var Xe={dow:0,doy:6};J("D",["DD",2],"Do","date"),A("date","D"),O("D",ee),O("DD",ee,ae),O("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),S(["D","DD"],ue),S("Do",function(a,b){b[ue]=r(a.match(ee)[0],10)});var Ye=E("Date",!0);J("d",0,"do","day"),J("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),J("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),J("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),J("e",0,0,"weekday"),J("E",0,0,"isoWeekday"),A("day","d"),A("weekday","e"),A("isoWeekday","E"),O("d",ee),O("e",ee),O("E",ee),O("dd",pe),O("ddd",pe),O("dddd",pe),T(["dd","ddd","dddd"],function(a,b,c,d){var e=c._locale.weekdaysParse(a,d,c._strict);null!=e?b.d=e:j(c).invalidWeekday=a}),T(["d","e","E"],function(a,b,c,d){b[d]=r(a)});var Ze="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),$e="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),_e="Su_Mo_Tu_We_Th_Fr_Sa".split("_");J("DDD",["DDDD",3],"DDDo","dayOfYear"),A("dayOfYear","DDD"),O("DDD",he),O("DDDD",be),S(["DDD","DDDD"],function(a,b,c){c._dayOfYear=r(a)}),J("H",["HH",2],0,"hour"),J("h",["hh",2],0,cc),J("hmm",0,0,function(){return""+cc.apply(this)+I(this.minutes(),2)}),J("hmmss",0,0,function(){return""+cc.apply(this)+I(this.minutes(),2)+I(this.seconds(),2)}),J("Hmm",0,0,function(){return""+this.hours()+I(this.minutes(),2)}),J("Hmmss",0,0,function(){return""+this.hours()+I(this.minutes(),2)+I(this.seconds(),2)}),dc("a",!0),dc("A",!1),A("hour","h"),O("a",ec),O("A",ec),O("H",ee),O("h",ee),O("HH",ee,ae),O("hh",ee,ae),O("hmm",fe),O("hmmss",ge),O("Hmm",fe),O("Hmmss",ge),S(["H","HH"],ve),S(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),S(["h","hh"],function(a,b,c){b[ve]=r(a),j(c).bigHour=!0}),S("hmm",function(a,b,c){var d=a.length-2;b[ve]=r(a.substr(0,d)),b[we]=r(a.substr(d)),j(c).bigHour=!0}),S("hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[ve]=r(a.substr(0,d)),b[we]=r(a.substr(d,2)),b[xe]=r(a.substr(e)),j(c).bigHour=!0}),S("Hmm",function(a,b,c){var d=a.length-2;b[ve]=r(a.substr(0,d)),b[we]=r(a.substr(d))}),S("Hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[ve]=r(a.substr(0,d)),b[we]=r(a.substr(d,2)),b[xe]=r(a.substr(e))});var af=/[ap]\.?m?\.?/i,bf=E("Hours",!0);J("m",["mm",2],0,"minute"),A("minute","m"),O("m",ee),O("mm",ee,ae),S(["m","mm"],we);var cf=E("Minutes",!1);J("s",["ss",2],0,"second"),A("second","s"),O("s",ee),O("ss",ee,ae),S(["s","ss"],xe);var df=E("Seconds",!1);J("S",0,0,function(){return~~(this.millisecond()/100)}),J(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),J(0,["SSS",3],0,"millisecond"),J(0,["SSSS",4],0,function(){return 10*this.millisecond()}),J(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),J(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),J(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),J(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),J(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),A("millisecond","ms"),O("S",he,_d),O("SS",he,ae),O("SSS",he,be);var ef;for(ef="SSSS";ef.length<=9;ef+="S")O(ef,ke);for(ef="S";ef.length<=9;ef+="S")S(ef,hc);var ff=E("Milliseconds",!1);J("z",0,0,"zoneAbbr"),J("zz",0,0,"zoneName");var gf=o.prototype;gf.add=Ue,gf.calendar=db,gf.clone=eb,gf.diff=lb,gf.endOf=xb,gf.format=pb,gf.from=qb,gf.fromNow=rb,gf.to=sb,gf.toNow=tb,gf.get=H,gf.invalidAt=Gb,gf.isAfter=fb,gf.isBefore=gb,gf.isBetween=hb,gf.isSame=ib,gf.isSameOrAfter=jb,gf.isSameOrBefore=kb,gf.isValid=Eb,gf.lang=We,gf.locale=ub,gf.localeData=vb,gf.max=Pe,gf.min=Oe,gf.parsingFlags=Fb,gf.set=H,gf.startOf=wb,gf.subtract=Ve,gf.toArray=Bb,gf.toObject=Cb,gf.toDate=Ab,gf.toISOString=ob,gf.toJSON=Db,gf.toString=nb,gf.unix=zb,gf.valueOf=yb,gf.creationData=Hb,gf.year=Ne,gf.isLeapYear=na,gf.weekYear=Jb,gf.isoWeekYear=Kb,gf.quarter=gf.quarters=Pb,gf.month=$,gf.daysInMonth=_,gf.week=gf.weeks=Tb,gf.isoWeek=gf.isoWeeks=Ub,gf.weeksInYear=Mb,gf.isoWeeksInYear=Lb,gf.date=Ye,gf.day=gf.days=$b,gf.weekday=_b,gf.isoWeekday=ac,gf.dayOfYear=bc,gf.hour=gf.hours=bf,gf.minute=gf.minutes=cf,gf.second=gf.seconds=df,gf.millisecond=gf.milliseconds=ff,gf.utcOffset=Oa,gf.utc=Qa,gf.local=Ra,gf.parseZone=Sa,gf.hasAlignedHourOffset=Ta,gf.isDST=Ua,gf.isDSTShifted=Va,gf.isLocal=Wa,gf.isUtcOffset=Xa,gf.isUtc=Ya,gf.isUTC=Ya,gf.zoneAbbr=ic,gf.zoneName=jc,gf.dates=fa("dates accessor is deprecated. Use date instead.",Ye),gf.months=fa("months accessor is deprecated. Use month instead",$),gf.years=fa("years accessor is deprecated. Use year instead",Ne),gf.zone=fa("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Pa);var hf=gf,jf={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},kf={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},lf="Invalid date",mf="%d",nf=/\d{1,2}/,of={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},pf=t.prototype;pf._calendar=jf,pf.calendar=mc,pf._longDateFormat=kf,pf.longDateFormat=nc,pf._invalidDate=lf,pf.invalidDate=oc,pf._ordinal=mf,pf.ordinal=pc,pf._ordinalParse=nf,pf.preparse=qc,pf.postformat=qc,pf._relativeTime=of,pf.relativeTime=rc,pf.pastFuture=sc,pf.set=tc,pf.months=W,pf._months=Ce,pf.monthsShort=X,pf._monthsShort=De,pf.monthsParse=Y,pf._monthsRegex=Fe,pf.monthsRegex=ba,pf._monthsShortRegex=Ee,pf.monthsShortRegex=aa,pf.week=Qb,pf._week=Xe,pf.firstDayOfYear=Sb,pf.firstDayOfWeek=Rb,pf.weekdays=Wb,pf._weekdays=Ze,pf.weekdaysMin=Yb,pf._weekdaysMin=_e,pf.weekdaysShort=Xb,pf._weekdaysShort=$e,pf.weekdaysParse=Zb,pf.isPM=fc,pf._meridiemParse=af,pf.meridiem=gc,x("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===r(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.lang=fa("moment.lang is deprecated. Use moment.locale instead.",x),a.langData=fa("moment.langData is deprecated. Use moment.localeData instead.",z);var qf=Math.abs,rf=Lc("ms"),sf=Lc("s"),tf=Lc("m"),uf=Lc("h"),vf=Lc("d"),wf=Lc("w"),xf=Lc("M"),yf=Lc("y"),zf=Nc("milliseconds"),Af=Nc("seconds"),Bf=Nc("minutes"),Cf=Nc("hours"),Df=Nc("days"),Ef=Nc("months"),Ff=Nc("years"),Gf=Math.round,Hf={s:45,m:45,h:22,d:26,M:11},If=Math.abs,Jf=Ia.prototype;Jf.abs=Bc,Jf.add=Dc,Jf.subtract=Ec,Jf.as=Jc,Jf.asMilliseconds=rf,Jf.asSeconds=sf,Jf.asMinutes=tf,Jf.asHours=uf,Jf.asDays=vf,Jf.asWeeks=wf,Jf.asMonths=xf,Jf.asYears=yf,Jf.valueOf=Kc,Jf._bubble=Gc,Jf.get=Mc,Jf.milliseconds=zf,Jf.seconds=Af,Jf.minutes=Bf,Jf.hours=Cf,Jf.days=Df,Jf.weeks=Oc,Jf.months=Ef,Jf.years=Ff,Jf.humanize=Sc,Jf.toISOString=Tc,Jf.toString=Tc,Jf.toJSON=Tc,Jf.locale=ub,Jf.localeData=vb,Jf.toIsoString=fa("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Tc),Jf.lang=We,J("X",0,0,"unix"),J("x",0,0,"valueOf"),O("x",le),O("X",oe),S("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),S("x",function(a,b,c){c._d=new Date(r(a))}), //! moment.js -//! version : 2.10.6 +//! version : 2.11.1 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com -a.version="2.10.6",b(Da),a.fn=Te,a.min=Fa,a.max=Ga,a.utc=h,a.unix=Zb,a.months=jc,a.isDate=d,a.locale=w,a.invalid=l,a.duration=Ya,a.isMoment=o,a.weekdays=lc,a.parseZone=$b,a.localeData=y,a.isDuration=Ia,a.monthsShort=kc,a.weekdaysMin=nc,a.defineLocale=x,a.weekdaysShort=mc,a.normalizeUnits=A,a.relativeTimeThreshold=Ec;var uf=a,vf=(uf.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(a){return/^nm$/i.test(a)},meridiem:function(a,b,c){return 12>a?c?"vm":"VM":c?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[Môre om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),uf.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:6,doy:12}}),{1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"}),wf={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},xf=(uf.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(a){return"م"===a},meridiem:function(a,b,c){return 12>a?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(a){return a.replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(a){return wf[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return vf[a]}).replace(/,/g,"،")},week:{dow:6,doy:12}}),uf.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}}),{1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"}),yf={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},zf=function(a){return 0===a?0:1===a?1:2===a?2:a%100>=3&&10>=a%100?3:a%100>=11?4:5},Af={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},Bf=function(a){return function(b,c,d,e){var f=zf(b),g=Af[a][zf(b)];return 2===f&&(g=g[c?0:1]),g.replace(/%d/i,b)}},Cf=["كانون الثاني يناير","شباط فبراير","آذار مارس","نيسان أبريل","أيار مايو","حزيران يونيو","تموز يوليو","آب أغسطس","أيلول سبتمبر","تشرين الأول أكتوبر","تشرين الثاني نوفمبر","كانون الأول ديسمبر"],Df=(uf.defineLocale("ar",{months:Cf,monthsShort:Cf,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(a){return"م"===a},meridiem:function(a,b,c){return 12>a?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:Bf("s"),m:Bf("m"),mm:Bf("m"),h:Bf("h"),hh:Bf("h"),d:Bf("d"),dd:Bf("d"),M:Bf("M"),MM:Bf("M"),y:Bf("y"),yy:Bf("y")},preparse:function(a){return a.replace(/\u200f/g,"").replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(a){return yf[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return xf[a]}).replace(/,/g,"،")},week:{dow:6,doy:12}}),{1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"}),Ef=(uf.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"birneçə saniyyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(a){return/^(gündüz|axşam)$/.test(a)},meridiem:function(a,b,c){return 4>a?"gecə":12>a?"səhər":17>a?"gündüz":"axşam"},ordinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(a){if(0===a)return a+"-ıncı";var b=a%10,c=a%100-b,d=a>=100?100:null;return a+(Df[b]||Df[c]||Df[d])},week:{dow:1,doy:7}}),uf.defineLocale("be",{months:Jc,monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:Kc,weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:Ic,mm:Ic,h:Ic,hh:Ic,d:"дзень",dd:Ic,M:"месяц",MM:Ic,y:"год",yy:Ic},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(a){return/^(дня|вечара)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночы":12>a?"раніцы":17>a?"дня":"вечара"},ordinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":case"w":case"W":return a%10!==2&&a%10!==3||a%100===12||a%100===13?a+"-ы":a+"-і";case"D":return a+"-га";default:return a}},week:{dow:1,doy:7}}),uf.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[В изминалата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[В изминалия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дни",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(a){var b=a%10,c=a%100;return 0===a?a+"-ев":0===c?a+"-ен":c>10&&20>c?a+"-ти":1===b?a+"-ви":2===b?a+"-ри":7===b||8===b?a+"-ми":a+"-ти"},week:{dow:1,doy:7}}),{1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"}),Ff={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"},Gf=(uf.defineLocale("bn",{months:"জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব_মার্চ_এপর_মে_জুন_জুল_অগ_সেপ্ট_অক্টো_নভ_ডিসেম্".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রুবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্রু_শনি".split("_"),weekdaysMin:"রব_সম_মঙ্গ_বু_ব্রিহ_শু_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কএক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(a){return a.replace(/[১২৩৪৫৬৭৮৯০]/g,function(a){return Ff[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Ef[a]})},meridiemParse:/রাত|সকাল|দুপুর|বিকেল|রাত/,isPM:function(a){return/^(দুপুর|বিকেল|রাত)$/.test(a)},meridiem:function(a,b,c){return 4>a?"রাত":10>a?"সকাল":17>a?"দুপুর":20>a?"বিকেল":"রাত"},week:{dow:0,doy:6}}),{1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"}),Hf={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"},If=(uf.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(a){return a.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,function(a){return Hf[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Gf[a]})},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,isPM:function(a){return/^(ཉིན་གུང|དགོང་དག|མཚན་མོ)$/.test(a)},meridiem:function(a,b,c){return 4>a?"མཚན་མོ":10>a?"ཞོགས་ཀས":17>a?"ཉིན་གུང":20>a?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}}),uf.defineLocale("br",{months:"Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),longDateFormat:{LT:"h[e]mm A",LTS:"h[e]mm:ss A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY h[e]mm A",LLLL:"dddd, D [a viz] MMMM YYYY h[e]mm A"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warc'hoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Dec'h da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s 'zo",s:"un nebeud segondennoù",m:"ur vunutenn",mm:Lc,h:"un eur",hh:"%d eur",d:"un devezh",dd:Lc,M:"ur miz",MM:Lc,y:"ur bloaz",yy:Mc},ordinalParse:/\d{1,2}(añ|vet)/,ordinal:function(a){var b=1===a?"añ":"vet";return a+b},week:{dow:1,doy:4}}),uf.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:Qc,mm:Qc,h:Qc,hh:Qc,d:"dan",dd:Qc,M:"mjesec",MM:Qc,y:"godinu",yy:Qc},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),uf.defineLocale("ca",{months:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),monthsShort:"gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.".split("_"),weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),longDateFormat:{LT:"H:mm",LTS:"LT:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd D MMMM YYYY H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(a,b){var c=1===a?"r":2===a?"n":3===a?"r":4===a?"t":"è";return("w"===b||"W"===b)&&(c="a"),a+c},week:{dow:1,doy:4}}),"leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_")),Jf="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),Kf=(uf.defineLocale("cs",{months:If,monthsShort:Jf,monthsParse:function(a,b){var c,d=[];for(c=0;12>c;c++)d[c]=new RegExp("^"+a[c]+"$|^"+b[c]+"$","i");return d}(If,Jf),weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:Sc,m:Sc,mm:Sc,h:Sc,hh:Sc,d:Sc,dd:Sc,M:Sc,MM:Sc,y:Sc,yy:Sc},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),uf.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(a){var b=/сехет$/i.exec(a)?"рен":/ҫул$/i.exec(a)?"тан":"ран";return a+b},past:"%s каялла",s:"пӗр-ик ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},ordinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}}),uf.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},ordinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(a){var b=a,c="",d=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"];return b>20?c=40===b||50===b||60===b||80===b||100===b?"fed":"ain":b>0&&(c=d[b]),a+c},week:{dow:1,doy:4}}),uf.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY HH:mm"},calendar:{sameDay:"[I dag kl.] LT",nextDay:"[I morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[I går kl.] LT",lastWeek:"[sidste] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),uf.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[Heute um] LT [Uhr]",sameElse:"L",nextDay:"[Morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[Gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:Tc,mm:"%d Minuten",h:Tc,hh:"%d Stunden",d:Tc,dd:Tc,M:Tc,MM:Tc,y:Tc,yy:Tc},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),uf.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[Heute um] LT [Uhr]",sameElse:"L",nextDay:"[Morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[Gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:Uc,mm:"%d Minuten",h:Uc,hh:"%d Stunden",d:Uc,dd:Uc,M:Uc,MM:Uc,y:Uc,yy:Uc},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),uf.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(a,b){return/D/.test(b.substring(0,b.indexOf("MMMM")))?this._monthsGenitiveEl[a.month()]:this._monthsNominativeEl[a.month()]},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(a,b,c){return a>11?c?"μμ":"ΜΜ":c?"πμ":"ΠΜ"},isPM:function(a){return"μ"===(a+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(a,b){var c=this._calendarEl[a],d=b&&b.hours();return"function"==typeof c&&(c=c.apply(b)),c.replace("{}",d%12===1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},ordinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}}),uf.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),uf.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"D MMMM, YYYY",LLL:"D MMMM, YYYY h:mm A",LLLL:"dddd, D MMMM, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),uf.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),uf.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),weekdays:"Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato".split("_"),weekdaysShort:"Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Ĵa_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D[-an de] MMMM, YYYY",LLL:"D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd, [la] D[-an de] MMMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(a){return"p"===a.charAt(0).toLowerCase()},meridiem:function(a,b,c){return a>11?c?"p.t.m.":"P.T.M.":c?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd [je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasinta] dddd [je] LT",sameElse:"L"},relativeTime:{future:"je %s",past:"antaŭ %s",s:"sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"},ordinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}}),"Ene._Feb._Mar._Abr._May._Jun._Jul._Ago._Sep._Oct._Nov._Dic.".split("_")),Lf="Ene_Feb_Mar_Abr_May_Jun_Jul_Ago_Sep_Oct_Nov_Dic".split("_"),Mf=(uf.defineLocale("es",{months:"Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?Lf[a.month()]:Kf[a.month()]},weekdays:"Domingo_Lunes_Martes_Miércoles_Jueves_Viernes_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mié._Jue._Vie._Sáb.".split("_"),weekdaysMin:"Do_Lu_Ma_Mi_Ju_Vi_Sá".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),uf.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:Vc,m:Vc,mm:Vc,h:Vc,hh:Vc,d:Vc,dd:"%d päeva",M:Vc,MM:Vc,y:Vc,yy:Vc},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),uf.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]", -lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),{1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"}),Nf={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"},Of=(uf.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(a){return/بعد از ظهر/.test(a)},meridiem:function(a,b,c){return 12>a?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چندین ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(a){return a.replace(/[۰-۹]/g,function(a){return Nf[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return Mf[a]}).replace(/,/g,"،")},ordinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}}),"nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" ")),Pf=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",Of[7],Of[8],Of[9]],Qf=(uf.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:Wc,m:Wc,mm:Wc,h:Wc,hh:Wc,d:Wc,dd:Wc,M:Wc,MM:Wc,y:Wc,yy:Wc},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),uf.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",m:"ein minutt",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaði",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),uf.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|e)/,ordinal:function(a){return a+(1===a?"er":"e")}}),uf.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|)/,ordinal:function(a){return a+(1===a?"er":"")},week:{dow:1,doy:4}}),"jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_")),Rf="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),Sf=(uf.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?Rf[a.month()]:Qf[a.month()]},weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),uf.defineLocale("gl",{months:"Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro".split("_"),monthsShort:"Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.".split("_"),weekdays:"Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mér._Xov._Ven._Sáb.".split("_"),weekdaysMin:"Do_Lu_Ma_Mé_Xo_Ve_Sá".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd D MMMM YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(a){return"uns segundos"===a?"nuns segundos":"en "+a},past:"hai %s",s:"uns segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:7}}),uf.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(a){return 2===a?"שעתיים":a+" שעות"},d:"יום",dd:function(a){return 2===a?"יומיים":a+" ימים"},M:"חודש",MM:function(a){return 2===a?"חודשיים":a+" חודשים"},y:"שנה",yy:function(a){return 2===a?"שנתיים":a%10===0&&10!==a?a+" שנה":a+" שנים"}}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),Tf={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},Uf=(uf.defineLocale("hi",{months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return Tf[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Sf[a]})},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(a,b){return 12===a&&(a=0),"रात"===b?4>a?a:a+12:"सुबह"===b?a:"दोपहर"===b?a>=10?a:a+12:"शाम"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"रात":10>a?"सुबह":17>a?"दोपहर":20>a?"शाम":"रात"},week:{dow:0,doy:6}}),uf.defineLocale("hr",{months:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_"),monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:Yc,mm:Yc,h:Yc,hh:Yc,d:"dan",dd:Yc,M:"mjesec",MM:Yc,y:"godinu",yy:Yc},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),"vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ")),Vf=(uf.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(a){return"u"===a.charAt(1).toLowerCase()},meridiem:function(a,b,c){return 12>a?c===!0?"de":"DE":c===!0?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return $c.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return $c.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:Zc,m:Zc,mm:Zc,h:Zc,hh:Zc,d:Zc,dd:Zc,M:Zc,MM:Zc,y:Zc,yy:Zc},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),uf.defineLocale("hy-am",{months:_c,monthsShort:ad,weekdays:bd,weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(a){return/^(ցերեկվա|երեկոյան)$/.test(a)},meridiem:function(a){return 4>a?"գիշերվա":12>a?"առավոտվա":17>a?"ցերեկվա":"երեկոյան"},ordinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(a,b){switch(b){case"DDD":case"w":case"W":case"DDDo":return 1===a?a+"-ին":a+"-րդ";default:return a}},week:{dow:1,doy:7}}),uf.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"siang"===b?a>=11?a:a+12:"sore"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"siang":19>a?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),uf.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:dd,m:dd,mm:dd,h:"klukkustund",hh:dd,d:dd,dd:dd,M:dd,MM:dd,y:dd,yy:dd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),uf.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),weekdaysMin:"D_L_Ma_Me_G_V_S".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(a){return(/^[0-9].+$/.test(a)?"tra":"in")+" "+a},past:"%s fa",s:"alcuni secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),uf.defineLocale("ja",{months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"Ah時m分",LTS:"Ah時m分s秒",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah時m分",LLLL:"YYYY年M月D日Ah時m分 dddd"},meridiemParse:/午前|午後/i,isPM:function(a){return"午後"===a},meridiem:function(a,b,c){return 12>a?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:"[来週]dddd LT",lastDay:"[昨日] LT",lastWeek:"[前週]dddd LT",sameElse:"L"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}}),uf.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(a,b){return 12===a&&(a=0),"enjing"===b?a:"siyang"===b?a>=11?a:a+12:"sonten"===b||"ndalu"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"enjing":15>a?"siyang":19>a?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}}),uf.defineLocale("ka",{months:ed,monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:fd,weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(a){return/(წამი|წუთი|საათი|წელი)/.test(a)?a.replace(/ი$/,"ში"):a+"ში"},past:function(a){return/(წამი|წუთი|საათი|დღე|თვე)/.test(a)?a.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(a)?a.replace(/წელი$/,"წლის წინ"):void 0},s:"რამდენიმე წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},ordinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(a){return 0===a?a:1===a?a+"-ლი":20>a||100>=a&&a%20===0||a%100===0?"მე-"+a:a+"-ე"},week:{dow:1,doy:7}}),uf.defineLocale("km",{months:"មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysMin:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[ថ្ងៃនៈ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},week:{dow:1,doy:4}}),uf.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h시 m분",LTS:"A h시 m분 s초",L:"YYYY.MM.DD",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h시 m분",LLLL:"YYYY년 MMMM D일 dddd A h시 m분"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇초",ss:"%d초",m:"일분",mm:"%d분",h:"한시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한달",MM:"%d달",y:"일년",yy:"%d년"},ordinalParse:/\d{1,2}일/,ordinal:"%d일",meridiemParse:/오전|오후/,isPM:function(a){return"오후"===a},meridiem:function(a,b,c){return 12>a?"오전":"오후"}}),uf.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:hd,past:id,s:"e puer Sekonnen",m:gd,mm:"%d Minutten",h:gd,hh:"%d Stonnen",d:gd,dd:"%d Deeg",M:gd,MM:"%d Méint",y:gd,yy:"%d Joer"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"}),Wf="sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),Xf=(uf.defineLocale("lt",{months:ld,monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:qd,weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:kd,m:md,mm:pd,h:md,hh:pd,d:md,dd:pd,M:md,MM:pd,y:md,yy:pd},ordinalParse:/\d{1,2}-oji/,ordinal:function(a){return a+"-oji"},week:{dow:1,doy:4}}),{m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")}),Yf=(uf.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:ud,m:td,mm:sd,h:td,hh:sd,d:td,dd:sd,M:td,MM:sd,y:td,yy:sd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{words:{m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=Yf.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+Yf.correctGrammaticalCase(a,d)}}),Zf=(uf.defineLocale("me",{months:["januar","februar","mart","april","maj","jun","jul","avgust","septembar","oktobar","novembar","decembar"],monthsShort:["jan.","feb.","mar.","apr.","maj","jun","jul","avg.","sep.","okt.","nov.","dec."],weekdays:["nedjelja","ponedjeljak","utorak","srijeda","četvrtak","petak","subota"],weekdaysShort:["ned.","pon.","uto.","sri.","čet.","pet.","sub."],weekdaysMin:["ne","po","ut","sr","če","pe","su"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){var a=["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",m:Yf.translate,mm:Yf.translate,h:Yf.translate,hh:Yf.translate,d:"dan",dd:Yf.translate,M:"mjesec",MM:Yf.translate,y:"godinu",yy:Yf.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),uf.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Во изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Во изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(a){var b=a%10,c=a%100;return 0===a?a+"-ев":0===c?a+"-ен":c>10&&20>c?a+"-ти":1===b?a+"-ви":2===b?a+"-ри":7===b||8===b?a+"-ми":a+"-ти"},week:{dow:1,doy:7}}),uf.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,isPM:function(a){return/^(ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി)$/.test(a)},meridiem:function(a,b,c){return 4>a?"രാത്രി":12>a?"രാവിലെ":17>a?"ഉച്ച കഴിഞ്ഞ്":20>a?"വൈകുന്നേരം":"രാത്രി"}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),$f={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},_f=(uf.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%s नंतर",past:"%s पूर्वी",s:"सेकंद",m:"एक मिनिट",mm:"%d मिनिटे",h:"एक तास",hh:"%d तास",d:"एक दिवस",dd:"%d दिवस",M:"एक महिना",MM:"%d महिने",y:"एक वर्ष",yy:"%d वर्षे"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return $f[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Zf[a]})},meridiemParse:/रात्री|सकाळी|दुपारी|सायंकाळी/,meridiemHour:function(a,b){return 12===a&&(a=0),"रात्री"===b?4>a?a:a+12:"सकाळी"===b?a:"दुपारी"===b?a>=10?a:a+12:"सायंकाळी"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"रात्री":10>a?"सकाळी":17>a?"दुपारी":20>a?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}}),uf.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"tengahari"===b?a>=11?a:a+12:"petang"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"tengahari":19>a?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT", -lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),uf.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"tengahari"===b?a>=11?a:a+12:"petang"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"tengahari":19>a?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),{1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"}),ag={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"},bg=(uf.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(a){return a.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,function(a){return ag[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return _f[a]})},week:{dow:1,doy:4}}),uf.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tirs_ons_tors_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"H.mm",LTS:"H.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H.mm",LLLL:"dddd D. MMMM YYYY [kl.] H.mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),cg={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},dg=(uf.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आइ._सो._मङ्_बु._बि._शु._श.".split("_"),longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return cg[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return bg[a]})},meridiemParse:/राती|बिहान|दिउँसो|बेलुका|साँझ|राती/,meridiemHour:function(a,b){return 12===a&&(a=0),"राती"===b?3>a?a:a+12:"बिहान"===b?a:"दिउँसो"===b?a>=10?a:a+12:"बेलुका"===b||"साँझ"===b?a+12:void 0},meridiem:function(a,b,c){return 3>a?"राती":10>a?"बिहान":15>a?"दिउँसो":18>a?"बेलुका":20>a?"साँझ":"राती"},calendar:{sameDay:"[आज] LT",nextDay:"[भोली] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडी",s:"केही समय",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:1,doy:7}}),"jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_")),eg="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),fg=(uf.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?eg[a.month()]:dg[a.month()]},weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"Zo_Ma_Di_Wo_Do_Vr_Za".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),uf.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"sun_mån_tys_ons_tor_fre_lau".split("_"),weekdaysMin:"su_må_ty_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s sidan",s:"nokre sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),"styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_")),gg="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),hg=(uf.defineLocale("pl",{months:function(a,b){return""===b?"("+gg[a.month()]+"|"+fg[a.month()]+")":/D MMMM/.test(b)?gg[a.month()]:fg[a.month()]},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"nie_pon_wt_śr_czw_pt_sb".split("_"),weekdaysMin:"N_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:wd,mm:wd,h:wd,hh:wd,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:wd,y:"rok",yy:wd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),uf.defineLocale("pt-br",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº"}),uf.defineLocale("pt",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),uf.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",m:"un minut",mm:xd,h:"o oră",hh:xd,d:"o zi",dd:xd,M:"o lună",MM:xd,y:"un an",yy:xd},week:{dow:1,doy:7}}),uf.defineLocale("ru",{months:Ad,monthsShort:Bd,weekdays:Cd,weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[й|я]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(){return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT"},lastWeek:function(a){if(a.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:zd,mm:zd,h:"час",hh:zd,d:"день",dd:zd,M:"месяц",MM:zd,y:"год",yy:zd},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(a){return/^(дня|вечера)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночи":12>a?"утра":17>a?"дня":"вечера"},ordinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":return a+"-й";case"D":return a+"-го";case"w":case"W":return a+"-я";default:return a}},week:{dow:1,doy:7}}),uf.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},ordinalParse:/\d{1,2} වැනි/,ordinal:function(a){return a+" වැනි"},meridiem:function(a,b,c){return a>11?c?"ප.ව.":"පස් වරු":c?"පෙ.ව.":"පෙර වරු"}}),"január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_")),ig="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_"),jg=(uf.defineLocale("sk",{months:hg,monthsShort:ig,monthsParse:function(a,b){var c,d=[];for(c=0;12>c;c++)d[c]=new RegExp("^"+a[c]+"$|^"+b[c]+"$","i");return d}(hg,ig),weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:Ed,m:Ed,mm:Ed,h:Ed,hh:Ed,d:Ed,dd:Ed,M:Ed,MM:Ed,y:Ed,yy:Ed},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),uf.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:Fd,m:Fd,mm:Fd,h:Fd,hh:Fd,d:Fd,dd:Fd,M:Fd,MM:Fd,y:Fd,yy:Fd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),uf.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),meridiemParse:/PD|MD/,isPM:function(a){return"M"===a.charAt(0)},meridiem:function(a,b,c){return 12>a?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{words:{m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=jg.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+jg.correctGrammaticalCase(a,d)}}),kg=(uf.defineLocale("sr-cyrl",{months:["јануар","фебруар","март","април","мај","јун","јул","август","септембар","октобар","новембар","децембар"],monthsShort:["јан.","феб.","мар.","апр.","мај","јун","јул","авг.","сеп.","окт.","нов.","дец."],weekdays:["недеља","понедељак","уторак","среда","четвртак","петак","субота"],weekdaysShort:["нед.","пон.","уто.","сре.","чет.","пет.","суб."],weekdaysMin:["не","по","ут","ср","че","пе","су"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){var a=["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",m:jg.translate,mm:jg.translate,h:jg.translate,hh:jg.translate,d:"дан",dd:jg.translate,M:"месец",MM:jg.translate,y:"годину",yy:jg.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),{words:{m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=kg.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+kg.correctGrammaticalCase(a,d)}}),lg=(uf.defineLocale("sr",{months:["januar","februar","mart","april","maj","jun","jul","avgust","septembar","oktobar","novembar","decembar"],monthsShort:["jan.","feb.","mar.","apr.","maj","jun","jul","avg.","sep.","okt.","nov.","dec."],weekdays:["nedelja","ponedeljak","utorak","sreda","četvrtak","petak","subota"],weekdaysShort:["ned.","pon.","uto.","sre.","čet.","pet.","sub."],weekdaysMin:["ne","po","ut","sr","če","pe","su"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){var a=["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",m:kg.translate,mm:kg.translate,h:kg.translate,hh:kg.translate,d:"dan",dd:kg.translate,M:"mesec",MM:kg.translate,y:"godinu",yy:kg.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),uf.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinalParse:/\d{1,2}(e|a)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"e":1===b?"a":2===b?"a":"e";return a+c},week:{dow:1,doy:4}}),uf.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},ordinalParse:/\d{1,2}வது/,ordinal:function(a){return a+"வது"},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(a,b,c){return 2>a?" யாமம்":6>a?" வைகறை":10>a?" காலை":14>a?" நண்பகல்":18>a?" எற்பாடு":22>a?" மாலை":" யாமம்"},meridiemHour:function(a,b){return 12===a&&(a=0),"யாமம்"===b?2>a?a:a+12:"வைகறை"===b||"காலை"===b?a:"நண்பகல்"===b&&a>=10?a:a+12},week:{dow:0,doy:6}}),uf.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"มกรา_กุมภา_มีนา_เมษา_พฤษภา_มิถุนา_กรกฎา_สิงหา_กันยา_ตุลา_พฤศจิกา_ธันวา".split("_"),weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),longDateFormat:{LT:"H นาฬิกา m นาที",LTS:"H นาฬิกา m นาที s วินาที",L:"YYYY/MM/DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H นาฬิกา m นาที",LLLL:"วันddddที่ D MMMM YYYY เวลา H นาฬิกา m นาที"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(a){return"หลังเที่ยง"===a},meridiem:function(a,b,c){return 12>a?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}}),uf.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"[Ngayon sa] LT",nextDay:"[Bukas sa] LT",nextWeek:"dddd [sa] LT",lastDay:"[Kahapon sa] LT",lastWeek:"dddd [huling linggo] LT",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},ordinalParse:/\d{1,2}/,ordinal:function(a){return a},week:{dow:1,doy:4}}),{1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"}),mg=(uf.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinalParse:/\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,ordinal:function(a){if(0===a)return a+"'ıncı";var b=a%10,c=a%100-b,d=a>=100?100:null;return a+(lg[b]||lg[c]||lg[d])},week:{dow:1,doy:7}}),uf.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"LT.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY LT",LLLL:"dddd, [li] D. MMMM [dallas] YYYY LT"},meridiem:function(a,b,c){return a>11?c?"d'o":"D'O":c?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:Gd,m:Gd,mm:Gd,h:Gd,hh:Gd,d:Gd,dd:Gd,M:Gd,MM:Gd,y:Gd,yy:Gd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),uf.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}}),uf.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}}),uf.defineLocale("uk",{months:Jd,monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:Kd,weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:Ld("[Сьогодні "),nextDay:Ld("[Завтра "),lastDay:Ld("[Вчора "),nextWeek:Ld("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return Ld("[Минулої] dddd [").call(this);case 1:case 2:case 4:return Ld("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:Id,mm:Id,h:"годину",hh:Id,d:"день",dd:Id,M:"місяць",MM:Id,y:"рік",yy:Id},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(a){return/^(дня|вечора)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночі":12>a?"ранку":17>a?"дня":"вечора"},ordinalParse:/\d{1,2}-(й|го)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":case"w":case"W":return a+"-й";case"D":return a+"-го";default:return a}},week:{dow:1,doy:7}}),uf.defineLocale("uz",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}}),uf.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"),weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm", -llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần rồi lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},ordinalParse:/\d{1,2}/,ordinal:function(a){return a},week:{dow:1,doy:4}}),uf.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah点mm分",LTS:"Ah点m分s秒",L:"YYYY-MM-DD",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah点mm分",LLLL:"YYYY年MMMD日ddddAh点mm分",l:"YYYY-MM-DD",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah点mm分",llll:"YYYY年MMMD日ddddAh点mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(a,b){return 12===a&&(a=0),"凌晨"===b||"早上"===b||"上午"===b?a:"下午"===b||"晚上"===b?a+12:a>=11?a:a+12},meridiem:function(a,b,c){var d=100*a+b;return 600>d?"凌晨":900>d?"早上":1130>d?"上午":1230>d?"中午":1800>d?"下午":"晚上"},calendar:{sameDay:function(){return 0===this.minutes()?"[今天]Ah[点整]":"[今天]LT"},nextDay:function(){return 0===this.minutes()?"[明天]Ah[点整]":"[明天]LT"},lastDay:function(){return 0===this.minutes()?"[昨天]Ah[点整]":"[昨天]LT"},nextWeek:function(){var a,b;return a=uf().startOf("week"),b=this.unix()-a.unix()>=604800?"[下]":"[本]",0===this.minutes()?b+"dddAh点整":b+"dddAh点mm"},lastWeek:function(){var a,b;return a=uf().startOf("week"),b=this.unix()=11?a:a+12:"下午"===b||"晚上"===b?a+12:void 0},meridiem:function(a,b,c){var d=100*a+b;return 900>d?"早上":1130>d?"上午":1230>d?"中午":1800>d?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},ordinalParse:/\d{1,2}(日|月|週)/,ordinal:function(a,b){switch(b){case"d":case"D":case"DDD":return a+"日";case"M":return a+"月";case"w":case"W":return a+"週";default:return a}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"一分鐘",mm:"%d分鐘",h:"一小時",hh:"%d小時",d:"一天",dd:"%d天",M:"一個月",MM:"%d個月",y:"一年",yy:"%d年"}}),uf);return mg.locale("en"),mg}); \ No newline at end of file +a.version="2.11.1",b(Ea),a.fn=hf,a.min=Ga,a.max=Ha,a.now=Qe,a.utc=h,a.unix=kc,a.months=wc,a.isDate=d,a.locale=x,a.invalid=l,a.duration=Za,a.isMoment=p,a.weekdays=yc,a.parseZone=lc,a.localeData=z,a.isDuration=Ja,a.monthsShort=xc,a.weekdaysMin=Ac,a.defineLocale=y,a.weekdaysShort=zc,a.normalizeUnits=B,a.relativeTimeThreshold=Rc,a.prototype=hf;var Kf=a,Lf=(Kf.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(a){return/^nm$/i.test(a)},meridiem:function(a,b,c){return 12>a?c?"vm":"VM":c?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[Môre om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),Kf.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:6,doy:12}}),{1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"}),Mf={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},Nf=(Kf.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(a){return"م"===a},meridiem:function(a,b,c){return 12>a?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(a){return a.replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(a){return Mf[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return Lf[a]}).replace(/,/g,"،")},week:{dow:6,doy:12}}),Kf.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}}),{1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"}),Of={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},Pf=function(a){return 0===a?0:1===a?1:2===a?2:a%100>=3&&10>=a%100?3:a%100>=11?4:5},Qf={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},Rf=function(a){return function(b,c,d,e){var f=Pf(b),g=Qf[a][Pf(b)];return 2===f&&(g=g[c?0:1]),g.replace(/%d/i,b)}},Sf=["كانون الثاني يناير","شباط فبراير","آذار مارس","نيسان أبريل","أيار مايو","حزيران يونيو","تموز يوليو","آب أغسطس","أيلول سبتمبر","تشرين الأول أكتوبر","تشرين الثاني نوفمبر","كانون الأول ديسمبر"],Tf=(Kf.defineLocale("ar",{months:Sf,monthsShort:Sf,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(a){return"م"===a},meridiem:function(a,b,c){return 12>a?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:Rf("s"),m:Rf("m"),mm:Rf("m"),h:Rf("h"),hh:Rf("h"),d:Rf("d"),dd:Rf("d"),M:Rf("M"),MM:Rf("M"),y:Rf("y"),yy:Rf("y")},preparse:function(a){return a.replace(/\u200f/g,"").replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(a){return Of[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return Nf[a]}).replace(/,/g,"،")},week:{dow:6,doy:12}}),{1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"}),Uf=(Kf.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"birneçə saniyyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(a){return/^(gündüz|axşam)$/.test(a)},meridiem:function(a,b,c){return 4>a?"gecə":12>a?"səhər":17>a?"gündüz":"axşam"},ordinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(a){if(0===a)return a+"-ıncı";var b=a%10,c=a%100-b,d=a>=100?100:null;return a+(Tf[b]||Tf[c]||Tf[d])},week:{dow:1,doy:7}}),Kf.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:Vc,mm:Vc,h:Vc,hh:Vc,d:"дзень",dd:Vc,M:"месяц",MM:Vc,y:"год",yy:Vc},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(a){return/^(дня|вечара)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночы":12>a?"раніцы":17>a?"дня":"вечара"},ordinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":case"w":case"W":return a%10!==2&&a%10!==3||a%100===12||a%100===13?a+"-ы":a+"-і";case"D":return a+"-га";default:return a}},week:{dow:1,doy:7}}),Kf.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[В изминалата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[В изминалия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дни",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(a){var b=a%10,c=a%100;return 0===a?a+"-ев":0===c?a+"-ен":c>10&&20>c?a+"-ти":1===b?a+"-ви":2===b?a+"-ри":7===b||8===b?a+"-ми":a+"-ти"},week:{dow:1,doy:7}}),{1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"}),Vf={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"},Wf=(Kf.defineLocale("bn",{months:"জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব_মার্চ_এপর_মে_জুন_জুল_অগ_সেপ্ট_অক্টো_নভ_ডিসেম্".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্র_শনি".split("_"),weekdaysMin:"রব_সম_মঙ্গ_বু_ব্রিহ_শু_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(a){return a.replace(/[১২৩৪৫৬৭৮৯০]/g,function(a){return Vf[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Uf[a]})},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,isPM:function(a){return/^(দুপুর|বিকাল|রাত)$/.test(a)},meridiem:function(a,b,c){return 4>a?"রাত":10>a?"সকাল":17>a?"দুপুর":20>a?"বিকাল":"রাত"},week:{dow:0,doy:6}}),{1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"}),Xf={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"},Yf=(Kf.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(a){return a.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,function(a){return Xf[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Wf[a]})},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,isPM:function(a){return/^(ཉིན་གུང|དགོང་དག|མཚན་མོ)$/.test(a)},meridiem:function(a,b,c){return 4>a?"མཚན་མོ":10>a?"ཞོགས་ཀས":17>a?"ཉིན་གུང":20>a?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}}),Kf.defineLocale("br",{months:"Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),longDateFormat:{LT:"h[e]mm A",LTS:"h[e]mm:ss A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY h[e]mm A",LLLL:"dddd, D [a viz] MMMM YYYY h[e]mm A"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warc'hoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Dec'h da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s 'zo",s:"un nebeud segondennoù",m:"ur vunutenn",mm:Wc,h:"un eur",hh:"%d eur",d:"un devezh",dd:Wc,M:"ur miz",MM:Wc,y:"ur bloaz",yy:Xc},ordinalParse:/\d{1,2}(añ|vet)/,ordinal:function(a){var b=1===a?"añ":"vet";return a+b},week:{dow:1,doy:4}}),Kf.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:_c,mm:_c,h:_c,hh:_c,d:"dan",dd:_c,M:"mjesec",MM:_c,y:"godinu",yy:_c},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),Kf.defineLocale("ca",{months:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),monthsShort:"gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.".split("_"),weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd D MMMM YYYY H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(a,b){var c=1===a?"r":2===a?"n":3===a?"r":4===a?"t":"è";return("w"===b||"W"===b)&&(c="a"),a+c},week:{dow:1,doy:4}}),"leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_")),Zf="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),$f=(Kf.defineLocale("cs",{months:Yf,monthsShort:Zf,monthsParse:function(a,b){var c,d=[];for(c=0;12>c;c++)d[c]=new RegExp("^"+a[c]+"$|^"+b[c]+"$","i");return d}(Yf,Zf),shortMonthsParse:function(a){var b,c=[];for(b=0;12>b;b++)c[b]=new RegExp("^"+a[b]+"$","i");return c}(Zf),longMonthsParse:function(a){var b,c=[];for(b=0;12>b;b++)c[b]=new RegExp("^"+a[b]+"$","i");return c}(Yf),weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:bd,m:bd,mm:bd,h:bd,hh:bd,d:bd,dd:bd,M:bd,MM:bd,y:bd,yy:bd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Kf.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(a){var b=/сехет$/i.exec(a)?"рен":/ҫул$/i.exec(a)?"тан":"ран";return a+b},past:"%s каялла",s:"пӗр-ик ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},ordinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}}),Kf.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},ordinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(a){var b=a,c="",d=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"];return b>20?c=40===b||50===b||60===b||80===b||100===b?"fed":"ain":b>0&&(c=d[b]),a+c},week:{dow:1,doy:4}}),Kf.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY HH:mm"},calendar:{sameDay:"[I dag kl.] LT",nextDay:"[I morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[I går kl.] LT",lastWeek:"[sidste] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Kf.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:cd,mm:"%d Minuten",h:cd,hh:"%d Stunden",d:cd,dd:cd,M:cd,MM:cd,y:cd,yy:cd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Kf.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:dd,mm:"%d Minuten",h:dd,hh:"%d Stunden",d:dd,dd:dd,M:dd,MM:dd,y:dd,yy:dd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"]),_f=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"],ag=(Kf.defineLocale("dv",{months:$f,monthsShort:$f,weekdays:_f,weekdaysShort:_f,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(a){return""===a},meridiem:function(a,b,c){return 12>a?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(a){return a.replace(/،/g,",")},postformat:function(a){return a.replace(/,/g,"،")},week:{dow:7,doy:12}}),Kf.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(a,b){return/D/.test(b.substring(0,b.indexOf("MMMM")))?this._monthsGenitiveEl[a.month()]:this._monthsNominativeEl[a.month()]},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(a,b,c){return a>11?c?"μμ":"ΜΜ":c?"πμ":"ΠΜ"},isPM:function(a){return"μ"===(a+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(a,b){var c=this._calendarEl[a],d=b&&b.hours();return D(c)&&(c=c.apply(b)),c.replace("{}",d%12===1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},ordinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}}),Kf.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),Kf.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"D MMMM, YYYY",LLL:"D MMMM, YYYY h:mm A",LLLL:"dddd, D MMMM, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),Kf.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),Kf.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),Kf.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),Kf.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),weekdays:"Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato".split("_"), +weekdaysShort:"Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Ĵa_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D[-an de] MMMM, YYYY",LLL:"D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd, [la] D[-an de] MMMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(a){return"p"===a.charAt(0).toLowerCase()},meridiem:function(a,b,c){return a>11?c?"p.t.m.":"P.T.M.":c?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd [je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasinta] dddd [je] LT",sameElse:"L"},relativeTime:{future:"je %s",past:"antaŭ %s",s:"sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"},ordinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}}),"ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_")),bg="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),cg=(Kf.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?bg[a.month()]:ag[a.month()]},weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),Kf.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:ed,m:ed,mm:ed,h:ed,hh:ed,d:ed,dd:"%d päeva",M:ed,MM:ed,y:ed,yy:ed},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Kf.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),{1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"}),dg={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"},eg=(Kf.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(a){return/بعد از ظهر/.test(a)},meridiem:function(a,b,c){return 12>a?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چندین ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(a){return a.replace(/[۰-۹]/g,function(a){return dg[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return cg[a]}).replace(/,/g,"،")},ordinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}}),"nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" ")),fg=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",eg[7],eg[8],eg[9]],gg=(Kf.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:fd,m:fd,mm:fd,h:fd,hh:fd,d:fd,dd:fd,M:fd,MM:fd,y:fd,yy:fd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Kf.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",m:"ein minutt",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaði",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Kf.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|e)/,ordinal:function(a){return a+(1===a?"er":"e")}}),Kf.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|e)/,ordinal:function(a){return a+(1===a?"er":"e")},week:{dow:1,doy:4}}),Kf.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|)/,ordinal:function(a){return a+(1===a?"er":"")},week:{dow:1,doy:4}}),"jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_")),hg="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),ig=(Kf.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?hg[a.month()]:gg[a.month()]},weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"]),jg=["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],kg=["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],lg=["Did","Dil","Dim","Dic","Dia","Dih","Dis"],mg=["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],ng=(Kf.defineLocale("gd",{months:ig,monthsShort:jg,monthsParseExact:!0,weekdays:kg,weekdaysShort:lg,weekdaysMin:mg,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},ordinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(a){var b=1===a?"d":a%10===2?"na":"mh";return a+b},week:{dow:1,doy:4}}),Kf.defineLocale("gl",{months:"Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro".split("_"),monthsShort:"Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.".split("_"),weekdays:"Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mér._Xov._Ven._Sáb.".split("_"),weekdaysMin:"Do_Lu_Ma_Mé_Xo_Ve_Sá".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd D MMMM YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(a){return"uns segundos"===a?"nuns segundos":"en "+a},past:"hai %s",s:"uns segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:7}}),Kf.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(a){return 2===a?"שעתיים":a+" שעות"},d:"יום",dd:function(a){return 2===a?"יומיים":a+" ימים"},M:"חודש",MM:function(a){return 2===a?"חודשיים":a+" חודשים"},y:"שנה",yy:function(a){return 2===a?"שנתיים":a%10===0&&10!==a?a+" שנה":a+" שנים"}}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),og={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},pg=(Kf.defineLocale("hi",{months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return og[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return ng[a]})},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(a,b){return 12===a&&(a=0),"रात"===b?4>a?a:a+12:"सुबह"===b?a:"दोपहर"===b?a>=10?a:a+12:"शाम"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"रात":10>a?"सुबह":17>a?"दोपहर":20>a?"शाम":"रात"},week:{dow:0,doy:6}}),Kf.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:hd,mm:hd,h:hd,hh:hd,d:"dan",dd:hd,M:"mjesec",MM:hd,y:"godinu",yy:hd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),"vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ")),qg=(Kf.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(a){return"u"===a.charAt(1).toLowerCase()},meridiem:function(a,b,c){return 12>a?c===!0?"de":"DE":c===!0?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return jd.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return jd.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:id,m:id,mm:id,h:id,hh:id,d:id,dd:id,M:id,MM:id,y:id,yy:id},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),Kf.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(a){return/^(ցերեկվա|երեկոյան)$/.test(a)},meridiem:function(a){return 4>a?"գիշերվա":12>a?"առավոտվա":17>a?"ցերեկվա":"երեկոյան"},ordinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(a,b){switch(b){case"DDD":case"w":case"W":case"DDDo":return 1===a?a+"-ին":a+"-րդ";default:return a}},week:{dow:1,doy:7}}),Kf.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"siang"===b?a>=11?a:a+12:"sore"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"siang":19>a?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),Kf.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:ld,m:ld,mm:ld,h:"klukkustund",hh:ld,d:ld,dd:ld,M:ld,MM:ld,y:ld,yy:ld},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Kf.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),weekdaysMin:"Do_Lu_Ma_Me_Gi_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(a){return(/^[0-9].+$/.test(a)?"tra":"in")+" "+a},past:"%s fa",s:"alcuni secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),Kf.defineLocale("ja",{months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"Ah時m分",LTS:"Ah時m分s秒",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah時m分",LLLL:"YYYY年M月D日Ah時m分 dddd"},meridiemParse:/午前|午後/i,isPM:function(a){return"午後"===a},meridiem:function(a,b,c){return 12>a?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:"[来週]dddd LT",lastDay:"[昨日] LT",lastWeek:"[前週]dddd LT",sameElse:"L"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}}),Kf.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(a,b){return 12===a&&(a=0),"enjing"===b?a:"siyang"===b?a>=11?a:a+12:"sonten"===b||"ndalu"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"enjing":15>a?"siyang":19>a?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}}),Kf.defineLocale("ka",{months:{standalone:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),format:"იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს".split("_")},monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(a){return/(წამი|წუთი|საათი|წელი)/.test(a)?a.replace(/ი$/,"ში"):a+"ში"},past:function(a){return/(წამი|წუთი|საათი|დღე|თვე)/.test(a)?a.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(a)?a.replace(/წელი$/,"წლის წინ"):void 0},s:"რამდენიმე წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},ordinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(a){return 0===a?a:1===a?a+"-ლი":20>a||100>=a&&a%20===0||a%100===0?"მე-"+a:a+"-ე"},week:{dow:1,doy:7}}),{0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"}),rg=(Kf.defineLocale("kk",{months:"Қаңтар_Ақпан_Наурыз_Сәуір_Мамыр_Маусым_Шілде_Тамыз_Қыркүйек_Қазан_Қараша_Желтоқсан".split("_"),monthsShort:"Қаң_Ақп_Нау_Сәу_Мам_Мау_Шіл_Там_Қыр_Қаз_Қар_Жел".split("_"),weekdays:"Жексенбі_Дүйсенбі_Сейсенбі_Сәрсенбі_Бейсенбі_Жұма_Сенбі".split("_"),weekdaysShort:"Жек_Дүй_Сей_Сәр_Бей_Жұм_Сен".split("_"),weekdaysMin:"Жк_Дй_Сй_Ср_Бй_Жм_Сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},ordinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(a){var b=a%10,c=a>=100?100:null;return a+(qg[a]||qg[b]||qg[c])},week:{dow:1,doy:7}}),Kf.defineLocale("km",{months:"មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysMin:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},week:{dow:1,doy:4}}),Kf.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h시 m분",LTS:"A h시 m분 s초",L:"YYYY.MM.DD",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h시 m분",LLLL:"YYYY년 MMMM D일 dddd A h시 m분"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇초",ss:"%d초",m:"일분",mm:"%d분",h:"한시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한달",MM:"%d달",y:"일년",yy:"%d년"},ordinalParse:/\d{1,2}일/,ordinal:"%d일",meridiemParse:/오전|오후/,isPM:function(a){return"오후"===a},meridiem:function(a,b,c){return 12>a?"오전":"오후"}}),Kf.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:nd,past:od,s:"e puer Sekonnen",m:md,mm:"%d Minutten",h:md,hh:"%d Stonnen",d:md,dd:"%d Deeg",M:md,MM:"%d Méint",y:md,yy:"%d Joer"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Kf.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(a){return"ຕອນແລງ"===a},meridiem:function(a,b,c){return 12>a?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},ordinalParse:/(ທີ່)\d{1,2}/,ordinal:function(a){ +return"ທີ່"+a}}),{m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"}),sg=(Kf.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_")},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:qd,m:rd,mm:ud,h:rd,hh:ud,d:rd,dd:ud,M:rd,MM:ud,y:rd,yy:ud},ordinalParse:/\d{1,2}-oji/,ordinal:function(a){return a+"-oji"},week:{dow:1,doy:4}}),{m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")}),tg=(Kf.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:yd,m:xd,mm:wd,h:xd,hh:wd,d:xd,dd:wd,M:xd,MM:wd,y:xd,yy:wd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{words:{m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=tg.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+tg.correctGrammaticalCase(a,d)}}),ug=(Kf.defineLocale("me",{months:["januar","februar","mart","april","maj","jun","jul","avgust","septembar","oktobar","novembar","decembar"],monthsShort:["jan.","feb.","mar.","apr.","maj","jun","jul","avg.","sep.","okt.","nov.","dec."],weekdays:["nedjelja","ponedjeljak","utorak","srijeda","četvrtak","petak","subota"],weekdaysShort:["ned.","pon.","uto.","sri.","čet.","pet.","sub."],weekdaysMin:["ne","po","ut","sr","če","pe","su"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){var a=["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",m:tg.translate,mm:tg.translate,h:tg.translate,hh:tg.translate,d:"dan",dd:tg.translate,M:"mjesec",MM:tg.translate,y:"godinu",yy:tg.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),Kf.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(a){var b=a%10,c=a%100;return 0===a?a+"-ев":0===c?a+"-ен":c>10&&20>c?a+"-ти":1===b?a+"-ви":2===b?a+"-ри":7===b||8===b?a+"-ми":a+"-ти"},week:{dow:1,doy:7}}),Kf.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,isPM:function(a){return/^(ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി)$/.test(a)},meridiem:function(a,b,c){return 4>a?"രാത്രി":12>a?"രാവിലെ":17>a?"ഉച്ച കഴിഞ്ഞ്":20>a?"വൈകുന്നേരം":"രാത്രി"}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),vg={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},wg=(Kf.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:zd,m:zd,mm:zd,h:zd,hh:zd,d:zd,dd:zd,M:zd,MM:zd,y:zd,yy:zd},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return vg[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return ug[a]})},meridiemParse:/रात्री|सकाळी|दुपारी|सायंकाळी/,meridiemHour:function(a,b){return 12===a&&(a=0),"रात्री"===b?4>a?a:a+12:"सकाळी"===b?a:"दुपारी"===b?a>=10?a:a+12:"सायंकाळी"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"रात्री":10>a?"सकाळी":17>a?"दुपारी":20>a?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}}),Kf.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"tengahari"===b?a>=11?a:a+12:"petang"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"tengahari":19>a?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),Kf.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"tengahari"===b?a>=11?a:a+12:"petang"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"tengahari":19>a?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),{1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"}),xg={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"},yg=(Kf.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(a){return a.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,function(a){return xg[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return wg[a]})},week:{dow:1,doy:4}}),Kf.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),zg={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},Ag=(Kf.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return zg[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return yg[a]})},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(a,b){return 12===a&&(a=0),"राति"===b?4>a?a:a+12:"बिहान"===b?a:"दिउँसो"===b?a>=10?a:a+12:"साँझ"===b?a+12:void 0},meridiem:function(a,b,c){return 3>a?"राति":12>a?"बिहान":16>a?"दिउँसो":20>a?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}}),"jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_")),Bg="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),Cg=(Kf.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?Bg[a.month()]:Ag[a.month()]},weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"Zo_Ma_Di_Wo_Do_Vr_Za".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),Kf.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"sun_mån_tys_ons_tor_fre_lau".split("_"),weekdaysMin:"su_må_ty_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s sidan",s:"nokre sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),"styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_")),Dg="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),Eg=(Kf.defineLocale("pl",{months:function(a,b){return""===b?"("+Dg[a.month()]+"|"+Cg[a.month()]+")":/D MMMM/.test(b)?Dg[a.month()]:Cg[a.month()]},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"nie_pon_wt_śr_czw_pt_sb".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:Bd,mm:Bd,h:Bd,hh:Bd,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:Bd,y:"rok",yy:Bd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Kf.defineLocale("pt-br",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº"}),Kf.defineLocale("pt",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),Kf.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",m:"un minut",mm:Cd,h:"o oră",hh:Cd,d:"o zi",dd:Cd,M:"o lună",MM:Cd,y:"un an",yy:Cd},week:{dow:1,doy:7}}),[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[й|я]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i]),Fg=(Kf.defineLocale("ru",{months:{format:"Января_Февраля_Марта_Апреля_Мая_Июня_Июля_Августа_Сентября_Октября_Ноября_Декабря".split("_"),standalone:"Январь_Февраль_Март_Апрель_Май_Июнь_Июль_Август_Сентябрь_Октябрь_Ноябрь_Декабрь".split("_")},monthsShort:{format:"янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек".split("_"),standalone:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_")},weekdays:{standalone:"Воскресенье_Понедельник_Вторник_Среда_Четверг_Пятница_Суббота".split("_"),format:"Воскресенье_Понедельник_Вторник_Среду_Четверг_Пятницу_Субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/},weekdaysShort:"Вс_Пн_Вт_Ср_Чт_Пт_Сб".split("_"),weekdaysMin:"Вс_Пн_Вт_Ср_Чт_Пт_Сб".split("_"),monthsParse:Eg,longMonthsParse:Eg,shortMonthsParse:Eg,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(a){if(a.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В следующее] dddd [в] LT";case 1:case 2:case 4:return"[В следующий] dddd [в] LT";case 3:case 5:case 6:return"[В следующую] dddd [в] LT"}},lastWeek:function(a){if(a.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:Ed,mm:Ed,h:"час",hh:Ed,d:"день",dd:Ed,M:"месяц",MM:Ed,y:"год",yy:Ed},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(a){return/^(дня|вечера)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночи":12>a?"утра":17>a?"дня":"вечера"},ordinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":return a+"-й";case"D":return a+"-го";case"w":case"W":return a+"-я";default:return a}},week:{dow:1,doy:7}}),Kf.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Kf.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},ordinalParse:/\d{1,2} වැනි/,ordinal:function(a){return a+" වැනි"},meridiem:function(a,b,c){return a>11?c?"ප.ව.":"පස් වරු":c?"පෙ.ව.":"පෙර වරු"}}),"január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_")),Gg="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_"),Hg=(Kf.defineLocale("sk",{months:Fg,monthsShort:Gg,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:Gd,m:Gd,mm:Gd,h:Gd,hh:Gd,d:Gd,dd:Gd,M:Gd,MM:Gd,y:Gd,yy:Gd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Kf.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:Hd,m:Hd,mm:Hd,h:Hd,hh:Hd,d:Hd,dd:Hd,M:Hd,MM:Hd,y:Hd,yy:Hd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),Kf.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),meridiemParse:/PD|MD/,isPM:function(a){return"M"===a.charAt(0)},meridiem:function(a,b,c){return 12>a?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{words:{m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=Hg.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+Hg.correctGrammaticalCase(a,d)}}),Ig=(Kf.defineLocale("sr-cyrl",{months:["јануар","фебруар","март","април","мај","јун","јул","август","септембар","октобар","новембар","децембар"],monthsShort:["јан.","феб.","мар.","апр.","мај","јун","јул","авг.","сеп.","окт.","нов.","дец."],weekdays:["недеља","понедељак","уторак","среда","четвртак","петак","субота"],weekdaysShort:["нед.","пон.","уто.","сре.","чет.","пет.","суб."],weekdaysMin:["не","по","ут","ср","че","пе","су"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){var a=["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",m:Hg.translate,mm:Hg.translate,h:Hg.translate,hh:Hg.translate,d:"дан",dd:Hg.translate,M:"месец",MM:Hg.translate,y:"годину",yy:Hg.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),{words:{m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=Ig.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+Ig.correctGrammaticalCase(a,d)}}),Jg=(Kf.defineLocale("sr",{months:["januar","februar","mart","april","maj","jun","jul","avgust","septembar","oktobar","novembar","decembar"],monthsShort:["jan.","feb.","mar.","apr.","maj","jun","jul","avg.","sep.","okt.","nov.","dec."],weekdays:["nedelja","ponedeljak","utorak","sreda","četvrtak","petak","subota"],weekdaysShort:["ned.","pon.","uto.","sre.","čet.","pet.","sub."],weekdaysMin:["ne","po","ut","sr","če","pe","su"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){var a=["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",m:Ig.translate,mm:Ig.translate,h:Ig.translate,hh:Ig.translate,d:"dan",dd:Ig.translate,M:"mesec",MM:Ig.translate,y:"godinu",yy:Ig.translate +},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),Kf.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinalParse:/\d{1,2}(e|a)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"e":1===b?"a":2===b?"a":"e";return a+c},week:{dow:1,doy:4}}),Kf.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"masiku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}}),{1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"}),Kg={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"},Lg=(Kf.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},ordinalParse:/\d{1,2}வது/,ordinal:function(a){return a+"வது"},preparse:function(a){return a.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,function(a){return Kg[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Jg[a]})},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(a,b,c){return 2>a?" யாமம்":6>a?" வைகறை":10>a?" காலை":14>a?" நண்பகல்":18>a?" எற்பாடு":22>a?" மாலை":" யாமம்"},meridiemHour:function(a,b){return 12===a&&(a=0),"யாமம்"===b?2>a?a:a+12:"வைகறை"===b||"காலை"===b?a:"நண்பகல்"===b&&a>=10?a:a+12},week:{dow:0,doy:6}}),Kf.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జూలై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జూలై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},ordinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(a,b){return 12===a&&(a=0),"రాత్రి"===b?4>a?a:a+12:"ఉదయం"===b?a:"మధ్యాహ్నం"===b?a>=10?a:a+12:"సాయంత్రం"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"రాత్రి":10>a?"ఉదయం":17>a?"మధ్యాహ్నం":20>a?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}}),Kf.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"มกรา_กุมภา_มีนา_เมษา_พฤษภา_มิถุนา_กรกฎา_สิงหา_กันยา_ตุลา_พฤศจิกา_ธันวา".split("_"),weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),longDateFormat:{LT:"H นาฬิกา m นาที",LTS:"H นาฬิกา m นาที s วินาที",L:"YYYY/MM/DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H นาฬิกา m นาที",LLLL:"วันddddที่ D MMMM YYYY เวลา H นาฬิกา m นาที"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(a){return"หลังเที่ยง"===a},meridiem:function(a,b,c){return 12>a?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}}),Kf.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"[Ngayon sa] LT",nextDay:"[Bukas sa] LT",nextWeek:"dddd [sa] LT",lastDay:"[Kahapon sa] LT",lastWeek:"dddd [huling linggo] LT",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},ordinalParse:/\d{1,2}/,ordinal:function(a){return a},week:{dow:1,doy:4}}),"pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_")),Mg=(Kf.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:Id,past:Jd,s:"puS lup",m:"wa’ tup",mm:Kd,h:"wa’ rep",hh:Kd,d:"wa’ jaj",dd:Kd,M:"wa’ jar",MM:Kd,y:"wa’ DIS",yy:Kd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"}),Ng=(Kf.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinalParse:/\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,ordinal:function(a){if(0===a)return a+"'ıncı";var b=a%10,c=a%100-b,d=a>=100?100:null;return a+(Mg[b]||Mg[c]||Mg[d])},week:{dow:1,doy:7}}),Kf.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiem:function(a,b,c){return a>11?c?"d'o":"D'O":c?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:Md,m:Md,mm:Md,h:Md,hh:Md,d:Md,dd:Md,M:Md,MM:Md,y:Md,yy:Md},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Kf.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}}),Kf.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}}),Kf.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:Pd,weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:Qd("[Сьогодні "),nextDay:Qd("[Завтра "),lastDay:Qd("[Вчора "),nextWeek:Qd("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return Qd("[Минулої] dddd [").call(this);case 1:case 2:case 4:return Qd("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:Od,mm:Od,h:"годину",hh:Od,d:"день",dd:Od,M:"місяць",MM:Od,y:"рік",yy:Od},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(a){return/^(дня|вечора)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночі":12>a?"ранку":17>a?"дня":"вечора"},ordinalParse:/\d{1,2}-(й|го)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":case"w":case"W":return a+"-й";case"D":return a+"-го";default:return a}},week:{dow:1,doy:7}}),Kf.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}}),Kf.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"),weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần rồi lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},ordinalParse:/\d{1,2}/,ordinal:function(a){return a},week:{dow:1,doy:4}}),Kf.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah点mm分",LTS:"Ah点m分s秒",L:"YYYY-MM-DD",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah点mm分",LLLL:"YYYY年MMMD日ddddAh点mm分",l:"YYYY-MM-DD",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah点mm分",llll:"YYYY年MMMD日ddddAh点mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(a,b){return 12===a&&(a=0),"凌晨"===b||"早上"===b||"上午"===b?a:"下午"===b||"晚上"===b?a+12:a>=11?a:a+12},meridiem:function(a,b,c){var d=100*a+b;return 600>d?"凌晨":900>d?"早上":1130>d?"上午":1230>d?"中午":1800>d?"下午":"晚上"},calendar:{sameDay:function(){return 0===this.minutes()?"[今天]Ah[点整]":"[今天]LT"},nextDay:function(){return 0===this.minutes()?"[明天]Ah[点整]":"[明天]LT"},lastDay:function(){return 0===this.minutes()?"[昨天]Ah[点整]":"[昨天]LT"},nextWeek:function(){var a,b;return a=Kf().startOf("week"),b=this.unix()-a.unix()>=604800?"[下]":"[本]",0===this.minutes()?b+"dddAh点整":b+"dddAh点mm"},lastWeek:function(){var a,b;return a=Kf().startOf("week"),b=this.unix()=11?a:a+12:"下午"===b||"晚上"===b?a+12:void 0},meridiem:function(a,b,c){var d=100*a+b;return 900>d?"早上":1130>d?"上午":1230>d?"中午":1800>d?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},ordinalParse:/\d{1,2}(日|月|週)/,ordinal:function(a,b){switch(b){case"d":case"D":case"DDD":return a+"日";case"M":return a+"月";case"w":case"W":return a+"週";default:return a}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"一分鐘",mm:"%d分鐘",h:"一小時",hh:"%d小時",d:"一天",dd:"%d天",M:"一個月",MM:"%d個月",y:"一年",yy:"%d年"}}),Kf);return Ng.locale("en"),Ng}); \ No newline at end of file diff --git a/bower_components/moment/min/moment.min.js b/bower_components/moment/min/moment.min.js index 8e6866a..c63998f 100644 --- a/bower_components/moment/min/moment.min.js +++ b/bower_components/moment/min/moment.min.js @@ -1,7 +1,7 @@ //! moment.js -//! version : 2.10.6 +//! version : 2.11.1 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com -!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return Hc.apply(null,arguments)}function b(a){Hc=a}function c(a){return"[object Array]"===Object.prototype.toString.call(a)}function d(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function e(a,b){var c,d=[];for(c=0;c0)for(c in Jc)d=Jc[c],e=b[d],"undefined"!=typeof e&&(a[d]=e);return a}function n(b){m(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),Kc===!1&&(Kc=!0,a.updateOffset(this),Kc=!1)}function o(a){return a instanceof n||null!=a&&null!=a._isAMomentObject}function p(a){return 0>a?Math.ceil(a):Math.floor(a)}function q(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=p(b)),c}function r(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&q(a[d])!==q(b[d]))&&g++;return g+f}function s(){}function t(a){return a?a.toLowerCase().replace("_","-"):a}function u(a){for(var b,c,d,e,f=0;f0;){if(d=v(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&r(e,c,!0)>=b-1)break;b--}f++}return null}function v(a){var b=null;if(!Lc[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=Ic._abbr,require("./locale/"+a),w(b)}catch(c){}return Lc[a]}function w(a,b){var c;return a&&(c="undefined"==typeof b?y(a):x(a,b),c&&(Ic=c)),Ic._abbr}function x(a,b){return null!==b?(b.abbr=a,Lc[a]=Lc[a]||new s,Lc[a].set(b),w(a),Lc[a]):(delete Lc[a],null)}function y(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return Ic;if(!c(a)){if(b=v(a))return b;a=[a]}return u(a)}function z(a,b){var c=a.toLowerCase();Mc[c]=Mc[c+"s"]=Mc[b]=a}function A(a){return"string"==typeof a?Mc[a]||Mc[a.toLowerCase()]:void 0}function B(a){var b,c,d={};for(c in a)f(a,c)&&(b=A(c),b&&(d[b]=a[c]));return d}function C(b,c){return function(d){return null!=d?(E(this,b,d),a.updateOffset(this,c),this):D(this,b)}}function D(a,b){return a._d["get"+(a._isUTC?"UTC":"")+b]()}function E(a,b,c){return a._d["set"+(a._isUTC?"UTC":"")+b](c)}function F(a,b){var c;if("object"==typeof a)for(c in a)this.set(c,a[c]);else if(a=A(a),"function"==typeof this[a])return this[a](b);return this}function G(a,b,c){var d=""+Math.abs(a),e=b-d.length,f=a>=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}function H(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(Qc[a]=e),b&&(Qc[b[0]]=function(){return G(e.apply(this,arguments),b[1],b[2])}),c&&(Qc[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function I(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function J(a){var b,c,d=a.match(Nc);for(b=0,c=d.length;c>b;b++)Qc[d[b]]?d[b]=Qc[d[b]]:d[b]=I(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function K(a,b){return a.isValid()?(b=L(b,a.localeData()),Pc[b]=Pc[b]||J(b),Pc[b](a)):a.localeData().invalidDate()}function L(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Oc.lastIndex=0;d>=0&&Oc.test(a);)a=a.replace(Oc,c),Oc.lastIndex=0,d-=1;return a}function M(a){return"function"==typeof a&&"[object Function]"===Object.prototype.toString.call(a)}function N(a,b,c){dd[a]=M(b)?b:function(a){return a&&c?c:b}}function O(a,b){return f(dd,a)?dd[a](b._strict,b._locale):new RegExp(P(a))}function P(a){return a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Q(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),"number"==typeof b&&(d=function(a,c){c[b]=q(a)}),c=0;cd;d++){if(e=h([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}function X(a,b){var c;return"string"==typeof b&&(b=a.localeData().monthsParse(b),"number"!=typeof b)?a:(c=Math.min(a.date(),T(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a)}function Y(b){return null!=b?(X(this,b),a.updateOffset(this,!0),this):D(this,"Month")}function Z(){return T(this.year(),this.month())}function $(a){var b,c=a._a;return c&&-2===j(a).overflow&&(b=c[gd]<0||c[gd]>11?gd:c[hd]<1||c[hd]>T(c[fd],c[gd])?hd:c[id]<0||c[id]>24||24===c[id]&&(0!==c[jd]||0!==c[kd]||0!==c[ld])?id:c[jd]<0||c[jd]>59?jd:c[kd]<0||c[kd]>59?kd:c[ld]<0||c[ld]>999?ld:-1,j(a)._overflowDayOfYear&&(fd>b||b>hd)&&(b=hd),j(a).overflow=b),a}function _(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function aa(a,b){var c=!0;return g(function(){return c&&(_(a+"\n"+(new Error).stack),c=!1),b.apply(this,arguments)},b)}function ba(a,b){od[a]||(_(b),od[a]=!0)}function ca(a){var b,c,d=a._i,e=pd.exec(d);if(e){for(j(a).iso=!0,b=0,c=qd.length;c>b;b++)if(qd[b][1].exec(d)){a._f=qd[b][0];break}for(b=0,c=rd.length;c>b;b++)if(rd[b][1].exec(d)){a._f+=(e[6]||" ")+rd[b][0];break}d.match(ad)&&(a._f+="Z"),va(a)}else a._isValid=!1}function da(b){var c=sd.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(ca(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}function ea(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 1970>a&&h.setFullYear(a),h}function fa(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function ga(a){return ha(a)?366:365}function ha(a){return a%4===0&&a%100!==0||a%400===0}function ia(){return ha(this.year())}function ja(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=Da(a).add(f,"d"),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function ka(a){return ja(a,this._week.dow,this._week.doy).week}function la(){return this._week.dow}function ma(){return this._week.doy}function na(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function oa(a){var b=ja(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function pa(a,b,c,d,e){var f,g=6+e-d,h=fa(a,0,1+g),i=h.getUTCDay();return e>i&&(i+=7),c=null!=c?1*c:e,f=1+g+7*(b-1)-i+c,{year:f>0?a:a-1,dayOfYear:f>0?f:ga(a-1)+f}}function qa(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function ra(a,b,c){return null!=a?a:null!=b?b:c}function sa(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function ta(a){var b,c,d,e,f=[];if(!a._d){for(d=sa(a),a._w&&null==a._a[hd]&&null==a._a[gd]&&ua(a),a._dayOfYear&&(e=ra(a._a[fd],d[fd]),a._dayOfYear>ga(e)&&(j(a)._overflowDayOfYear=!0),c=fa(e,0,a._dayOfYear),a._a[gd]=c.getUTCMonth(),a._a[hd]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[id]&&0===a._a[jd]&&0===a._a[kd]&&0===a._a[ld]&&(a._nextDay=!0,a._a[id]=0),a._d=(a._useUTC?fa:ea).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[id]=24)}}function ua(a){var b,c,d,e,f,g,h;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(f=1,g=4,c=ra(b.GG,a._a[fd],ja(Da(),1,4).year),d=ra(b.W,1),e=ra(b.E,1)):(f=a._locale._week.dow,g=a._locale._week.doy,c=ra(b.gg,a._a[fd],ja(Da(),f,g).year),d=ra(b.w,1),null!=b.d?(e=b.d,f>e&&++d):e=null!=b.e?b.e+f:f),h=pa(c,d,e,g,f),a._a[fd]=h.year,a._dayOfYear=h.dayOfYear}function va(b){if(b._f===a.ISO_8601)return void ca(b);b._a=[],j(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,k=0;for(e=L(b._f,b._locale).match(Nc)||[],c=0;c0&&j(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),k+=d.length),Qc[f]?(d?j(b).empty=!1:j(b).unusedTokens.push(f),S(f,d,b)):b._strict&&!d&&j(b).unusedTokens.push(f);j(b).charsLeftOver=i-k,h.length>0&&j(b).unusedInput.push(h),j(b).bigHour===!0&&b._a[id]<=12&&b._a[id]>0&&(j(b).bigHour=void 0),b._a[id]=wa(b._locale,b._a[id],b._meridiem),ta(b),$(b)}function wa(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}function xa(a){var b,c,d,e,f;if(0===a._f.length)return j(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;ef)&&(d=f,c=b));g(a,c||b)}function ya(a){if(!a._d){var b=B(a._i);a._a=[b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],ta(a)}}function za(a){var b=new n($(Aa(a)));return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function Aa(a){var b=a._i,e=a._f;return a._locale=a._locale||y(a._l),null===b||void 0===e&&""===b?l({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),o(b)?new n($(b)):(c(e)?xa(a):e?va(a):d(b)?a._d=b:Ba(a),a))}function Ba(b){var f=b._i;void 0===f?b._d=new Date:d(f)?b._d=new Date(+f):"string"==typeof f?da(b):c(f)?(b._a=e(f.slice(0),function(a){return parseInt(a,10)}),ta(b)):"object"==typeof f?ya(b):"number"==typeof f?b._d=new Date(f):a.createFromInputFallback(b)}function Ca(a,b,c,d,e){var f={};return"boolean"==typeof c&&(d=c,c=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=e,f._l=c,f._i=a,f._f=b,f._strict=d,za(f)}function Da(a,b,c,d){return Ca(a,b,c,d,!1)}function Ea(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return Da();for(d=b[0],e=1;ea&&(a=-a,c="-"),c+G(~~(a/60),2)+b+G(~~a%60,2)})}function Ka(a){var b=(a||"").match(ad)||[],c=b[b.length-1]||[],d=(c+"").match(xd)||["-",0,0],e=+(60*d[1])+q(d[2]);return"+"===d[0]?e:-e}function La(b,c){var e,f;return c._isUTC?(e=c.clone(),f=(o(b)||d(b)?+b:+Da(b))-+e,e._d.setTime(+e._d+f),a.updateOffset(e,!1),e):Da(b).local()}function Ma(a){return 15*-Math.round(a._d.getTimezoneOffset()/15)}function Na(b,c){var d,e=this._offset||0;return null!=b?("string"==typeof b&&(b=Ka(b)),Math.abs(b)<16&&(b=60*b),!this._isUTC&&c&&(d=Ma(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?bb(this,Ya(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?e:Ma(this)}function Oa(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Pa(a){return this.utcOffset(0,a)}function Qa(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Ma(this),"m")),this}function Ra(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Ka(this._i)),this}function Sa(a){return a=a?Da(a).utcOffset():0,(this.utcOffset()-a)%60===0}function Ta(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ua(){if("undefined"!=typeof this._isDSTShifted)return this._isDSTShifted;var a={};if(m(a,this),a=Aa(a),a._a){var b=a._isUTC?h(a._a):Da(a._a);this._isDSTShifted=this.isValid()&&r(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Va(){return!this._isUTC}function Wa(){return this._isUTC}function Xa(){return this._isUTC&&0===this._offset}function Ya(a,b){var c,d,e,g=a,h=null;return Ia(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(h=yd.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:q(h[hd])*c,h:q(h[id])*c,m:q(h[jd])*c,s:q(h[kd])*c,ms:q(h[ld])*c}):(h=zd.exec(a))?(c="-"===h[1]?-1:1,g={y:Za(h[2],c),M:Za(h[3],c),d:Za(h[4],c),h:Za(h[5],c),m:Za(h[6],c),s:Za(h[7],c),w:Za(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=_a(Da(g.from),Da(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new Ha(g),Ia(a)&&f(a,"_locale")&&(d._locale=a._locale),d}function Za(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function $a(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function _a(a,b){var c;return b=La(b,a),a.isBefore(b)?c=$a(a,b):(c=$a(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c}function ab(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(ba(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=Ya(c,d),bb(this,e,a),this}}function bb(b,c,d,e){var f=c._milliseconds,g=c._days,h=c._months;e=null==e?!0:e,f&&b._d.setTime(+b._d+f*d),g&&E(b,"Date",D(b,"Date")+g*d),h&&X(b,D(b,"Month")+h*d),e&&a.updateOffset(b,g||h)}function cb(a,b){var c=a||Da(),d=La(c,this).startOf("day"),e=this.diff(d,"days",!0),f=-6>e?"sameElse":-1>e?"lastWeek":0>e?"lastDay":1>e?"sameDay":2>e?"nextDay":7>e?"nextWeek":"sameElse";return this.format(b&&b[f]||this.localeData().calendar(f,this,Da(c)))}function db(){return new n(this)}function eb(a,b){var c;return b=A("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=o(a)?a:Da(a),+this>+a):(c=o(a)?+a:+Da(a),c<+this.clone().startOf(b))}function fb(a,b){var c;return b=A("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=o(a)?a:Da(a),+a>+this):(c=o(a)?+a:+Da(a),+this.clone().endOf(b)b-f?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)}function kb(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function lb(){var a=this.clone().utc();return 0b;b++)if(this._weekdaysParse[b]||(c=Da([2e3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b}function Pb(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=Kb(a,this.localeData()),this.add(a-b,"d")):b}function Qb(a){var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function Rb(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)}function Sb(a,b){H(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function Tb(a,b){return b._meridiemParse}function Ub(a){return"p"===(a+"").toLowerCase().charAt(0)}function Vb(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function Wb(a,b){b[ld]=q(1e3*("0."+a))}function Xb(){return this._isUTC?"UTC":""}function Yb(){return this._isUTC?"Coordinated Universal Time":""}function Zb(a){return Da(1e3*a)}function $b(){return Da.apply(null,arguments).parseZone()}function _b(a,b,c){var d=this._calendar[a];return"function"==typeof d?d.call(b,c):d}function ac(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function bc(){return this._invalidDate}function cc(a){return this._ordinal.replace("%d",a)}function dc(a){return a}function ec(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)}function fc(a,b){var c=this._relativeTime[a>0?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)}function gc(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function hc(a,b,c,d){var e=y(),f=h().set(d,b);return e[c](f,a)}function ic(a,b,c,d,e){if("number"==typeof a&&(b=a,a=void 0),a=a||"",null!=b)return hc(a,b,c,e);var f,g=[];for(f=0;d>f;f++)g[f]=hc(a,f,c,e);return g}function jc(a,b){return ic(a,b,"months",12,"month")}function kc(a,b){return ic(a,b,"monthsShort",12,"month")}function lc(a,b){return ic(a,b,"weekdays",7,"day")}function mc(a,b){return ic(a,b,"weekdaysShort",7,"day")}function nc(a,b){return ic(a,b,"weekdaysMin",7,"day")}function oc(){var a=this._data;return this._milliseconds=Wd(this._milliseconds),this._days=Wd(this._days),this._months=Wd(this._months),a.milliseconds=Wd(a.milliseconds),a.seconds=Wd(a.seconds),a.minutes=Wd(a.minutes),a.hours=Wd(a.hours),a.months=Wd(a.months),a.years=Wd(a.years),this}function pc(a,b,c,d){var e=Ya(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function qc(a,b){return pc(this,a,b,1)}function rc(a,b){return pc(this,a,b,-1)}function sc(a){return 0>a?Math.floor(a):Math.ceil(a)}function tc(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data;return f>=0&&g>=0&&h>=0||0>=f&&0>=g&&0>=h||(f+=864e5*sc(vc(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=p(f/1e3),i.seconds=a%60,b=p(a/60),i.minutes=b%60,c=p(b/60),i.hours=c%24,g+=p(c/24),e=p(uc(g)),h+=e,g-=sc(vc(e)),d=p(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function uc(a){return 4800*a/146097}function vc(a){return 146097*a/4800}function wc(a){var b,c,d=this._milliseconds;if(a=A(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+uc(b),"month"===a?c:c/12;switch(b=this._days+Math.round(vc(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function xc(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*q(this._months/12)}function yc(a){return function(){return this.as(a)}}function zc(a){return a=A(a),this[a+"s"]()}function Ac(a){return function(){return this._data[a]}}function Bc(){return p(this.days()/7)}function Cc(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function Dc(a,b,c){var d=Ya(a).abs(),e=ke(d.as("s")),f=ke(d.as("m")),g=ke(d.as("h")),h=ke(d.as("d")),i=ke(d.as("M")),j=ke(d.as("y")),k=e0,k[4]=c,Cc.apply(null,k)}function Ec(a,b){return void 0===le[a]?!1:void 0===b?le[a]:(le[a]=b,!0)}function Fc(a){var b=this.localeData(),c=Dc(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function Gc(){var a,b,c,d=me(this._milliseconds)/1e3,e=me(this._days),f=me(this._months);a=p(d/60),b=p(a/60),d%=60,a%=60,c=p(f/12),f%=12;var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(0>m?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"}var Hc,Ic,Jc=a.momentProperties=[],Kc=!1,Lc={},Mc={},Nc=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Oc=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Pc={},Qc={},Rc=/\d/,Sc=/\d\d/,Tc=/\d{3}/,Uc=/\d{4}/,Vc=/[+-]?\d{6}/,Wc=/\d\d?/,Xc=/\d{1,3}/,Yc=/\d{1,4}/,Zc=/[+-]?\d{1,6}/,$c=/\d+/,_c=/[+-]?\d+/,ad=/Z|[+-]\d\d:?\d\d/gi,bd=/[+-]?\d+(\.\d{1,3})?/,cd=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,dd={},ed={},fd=0,gd=1,hd=2,id=3,jd=4,kd=5,ld=6;H("M",["MM",2],"Mo",function(){return this.month()+1}),H("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),H("MMMM",0,0,function(a){return this.localeData().months(this,a)}),z("month","M"),N("M",Wc),N("MM",Wc,Sc),N("MMM",cd),N("MMMM",cd),Q(["M","MM"],function(a,b){b[gd]=q(a)-1}),Q(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict);null!=e?b[gd]=e:j(c).invalidMonth=a});var md="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),nd="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),od={};a.suppressDeprecationWarnings=!1;var pd=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,qd=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],rd=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],sd=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=aa("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),H(0,["YY",2],0,function(){return this.year()%100}),H(0,["YYYY",4],0,"year"),H(0,["YYYYY",5],0,"year"),H(0,["YYYYYY",6,!0],0,"year"),z("year","y"),N("Y",_c),N("YY",Wc,Sc),N("YYYY",Yc,Uc),N("YYYYY",Zc,Vc),N("YYYYYY",Zc,Vc),Q(["YYYYY","YYYYYY"],fd),Q("YYYY",function(b,c){c[fd]=2===b.length?a.parseTwoDigitYear(b):q(b)}),Q("YY",function(b,c){c[fd]=a.parseTwoDigitYear(b)}),a.parseTwoDigitYear=function(a){return q(a)+(q(a)>68?1900:2e3)};var td=C("FullYear",!1);H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),z("week","w"),z("isoWeek","W"),N("w",Wc),N("ww",Wc,Sc),N("W",Wc),N("WW",Wc,Sc),R(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=q(a)});var ud={dow:0,doy:6};H("DDD",["DDDD",3],"DDDo","dayOfYear"),z("dayOfYear","DDD"),N("DDD",Xc),N("DDDD",Tc),Q(["DDD","DDDD"],function(a,b,c){c._dayOfYear=q(a)}),a.ISO_8601=function(){};var vd=aa("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var a=Da.apply(null,arguments);return this>a?this:a}),wd=aa("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var a=Da.apply(null,arguments);return a>this?this:a});Ja("Z",":"),Ja("ZZ",""),N("Z",ad),N("ZZ",ad),Q(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=Ka(a)});var xd=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var yd=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,zd=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Ya.fn=Ha.prototype;var Ad=ab(1,"add"),Bd=ab(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Cd=aa("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});H(0,["gg",2],0,function(){return this.weekYear()%100}),H(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Db("gggg","weekYear"),Db("ggggg","weekYear"),Db("GGGG","isoWeekYear"),Db("GGGGG","isoWeekYear"),z("weekYear","gg"),z("isoWeekYear","GG"),N("G",_c),N("g",_c),N("GG",Wc,Sc),N("gg",Wc,Sc),N("GGGG",Yc,Uc),N("gggg",Yc,Uc),N("GGGGG",Zc,Vc),N("ggggg",Zc,Vc),R(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=q(a)}),R(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),H("Q",0,0,"quarter"),z("quarter","Q"),N("Q",Rc),Q("Q",function(a,b){b[gd]=3*(q(a)-1)}),H("D",["DD",2],"Do","date"),z("date","D"),N("D",Wc),N("DD",Wc,Sc),N("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),Q(["D","DD"],hd),Q("Do",function(a,b){b[hd]=q(a.match(Wc)[0],10)});var Dd=C("Date",!0);H("d",0,"do","day"),H("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),H("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),H("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),z("day","d"),z("weekday","e"),z("isoWeekday","E"),N("d",Wc),N("e",Wc),N("E",Wc),N("dd",cd),N("ddd",cd),N("dddd",cd),R(["dd","ddd","dddd"],function(a,b,c){var d=c._locale.weekdaysParse(a);null!=d?b.d=d:j(c).invalidWeekday=a}),R(["d","e","E"],function(a,b,c,d){b[d]=q(a)});var Ed="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Fd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Gd="Su_Mo_Tu_We_Th_Fr_Sa".split("_");H("H",["HH",2],0,"hour"),H("h",["hh",2],0,function(){return this.hours()%12||12}),Sb("a",!0),Sb("A",!1),z("hour","h"),N("a",Tb),N("A",Tb),N("H",Wc),N("h",Wc),N("HH",Wc,Sc),N("hh",Wc,Sc),Q(["H","HH"],id),Q(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),Q(["h","hh"],function(a,b,c){b[id]=q(a),j(c).bigHour=!0});var Hd=/[ap]\.?m?\.?/i,Id=C("Hours",!0);H("m",["mm",2],0,"minute"),z("minute","m"),N("m",Wc),N("mm",Wc,Sc),Q(["m","mm"],jd);var Jd=C("Minutes",!1);H("s",["ss",2],0,"second"),z("second","s"),N("s",Wc),N("ss",Wc,Sc),Q(["s","ss"],kd);var Kd=C("Seconds",!1);H("S",0,0,function(){return~~(this.millisecond()/100)}),H(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,function(){return 10*this.millisecond()}),H(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),H(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),H(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),H(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),H(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),z("millisecond","ms"),N("S",Xc,Rc),N("SS",Xc,Sc),N("SSS",Xc,Tc);var Ld;for(Ld="SSSS";Ld.length<=9;Ld+="S")N(Ld,$c);for(Ld="S";Ld.length<=9;Ld+="S")Q(Ld,Wb);var Md=C("Milliseconds",!1);H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");var Nd=n.prototype;Nd.add=Ad,Nd.calendar=cb,Nd.clone=db,Nd.diff=ib,Nd.endOf=ub,Nd.format=mb,Nd.from=nb,Nd.fromNow=ob,Nd.to=pb,Nd.toNow=qb,Nd.get=F,Nd.invalidAt=Cb,Nd.isAfter=eb,Nd.isBefore=fb,Nd.isBetween=gb,Nd.isSame=hb,Nd.isValid=Ab,Nd.lang=Cd,Nd.locale=rb,Nd.localeData=sb,Nd.max=wd,Nd.min=vd,Nd.parsingFlags=Bb,Nd.set=F,Nd.startOf=tb,Nd.subtract=Bd,Nd.toArray=yb,Nd.toObject=zb,Nd.toDate=xb,Nd.toISOString=lb,Nd.toJSON=lb,Nd.toString=kb,Nd.unix=wb,Nd.valueOf=vb,Nd.year=td,Nd.isLeapYear=ia,Nd.weekYear=Fb,Nd.isoWeekYear=Gb,Nd.quarter=Nd.quarters=Jb,Nd.month=Y,Nd.daysInMonth=Z,Nd.week=Nd.weeks=na,Nd.isoWeek=Nd.isoWeeks=oa,Nd.weeksInYear=Ib,Nd.isoWeeksInYear=Hb,Nd.date=Dd,Nd.day=Nd.days=Pb,Nd.weekday=Qb,Nd.isoWeekday=Rb,Nd.dayOfYear=qa,Nd.hour=Nd.hours=Id,Nd.minute=Nd.minutes=Jd,Nd.second=Nd.seconds=Kd, -Nd.millisecond=Nd.milliseconds=Md,Nd.utcOffset=Na,Nd.utc=Pa,Nd.local=Qa,Nd.parseZone=Ra,Nd.hasAlignedHourOffset=Sa,Nd.isDST=Ta,Nd.isDSTShifted=Ua,Nd.isLocal=Va,Nd.isUtcOffset=Wa,Nd.isUtc=Xa,Nd.isUTC=Xa,Nd.zoneAbbr=Xb,Nd.zoneName=Yb,Nd.dates=aa("dates accessor is deprecated. Use date instead.",Dd),Nd.months=aa("months accessor is deprecated. Use month instead",Y),Nd.years=aa("years accessor is deprecated. Use year instead",td),Nd.zone=aa("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Oa);var Od=Nd,Pd={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Qd={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Rd="Invalid date",Sd="%d",Td=/\d{1,2}/,Ud={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Vd=s.prototype;Vd._calendar=Pd,Vd.calendar=_b,Vd._longDateFormat=Qd,Vd.longDateFormat=ac,Vd._invalidDate=Rd,Vd.invalidDate=bc,Vd._ordinal=Sd,Vd.ordinal=cc,Vd._ordinalParse=Td,Vd.preparse=dc,Vd.postformat=dc,Vd._relativeTime=Ud,Vd.relativeTime=ec,Vd.pastFuture=fc,Vd.set=gc,Vd.months=U,Vd._months=md,Vd.monthsShort=V,Vd._monthsShort=nd,Vd.monthsParse=W,Vd.week=ka,Vd._week=ud,Vd.firstDayOfYear=ma,Vd.firstDayOfWeek=la,Vd.weekdays=Lb,Vd._weekdays=Ed,Vd.weekdaysMin=Nb,Vd._weekdaysMin=Gd,Vd.weekdaysShort=Mb,Vd._weekdaysShort=Fd,Vd.weekdaysParse=Ob,Vd.isPM=Ub,Vd._meridiemParse=Hd,Vd.meridiem=Vb,w("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===q(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.lang=aa("moment.lang is deprecated. Use moment.locale instead.",w),a.langData=aa("moment.langData is deprecated. Use moment.localeData instead.",y);var Wd=Math.abs,Xd=yc("ms"),Yd=yc("s"),Zd=yc("m"),$d=yc("h"),_d=yc("d"),ae=yc("w"),be=yc("M"),ce=yc("y"),de=Ac("milliseconds"),ee=Ac("seconds"),fe=Ac("minutes"),ge=Ac("hours"),he=Ac("days"),ie=Ac("months"),je=Ac("years"),ke=Math.round,le={s:45,m:45,h:22,d:26,M:11},me=Math.abs,ne=Ha.prototype;ne.abs=oc,ne.add=qc,ne.subtract=rc,ne.as=wc,ne.asMilliseconds=Xd,ne.asSeconds=Yd,ne.asMinutes=Zd,ne.asHours=$d,ne.asDays=_d,ne.asWeeks=ae,ne.asMonths=be,ne.asYears=ce,ne.valueOf=xc,ne._bubble=tc,ne.get=zc,ne.milliseconds=de,ne.seconds=ee,ne.minutes=fe,ne.hours=ge,ne.days=he,ne.weeks=Bc,ne.months=ie,ne.years=je,ne.humanize=Fc,ne.toISOString=Gc,ne.toString=Gc,ne.toJSON=Gc,ne.locale=rb,ne.localeData=sb,ne.toIsoString=aa("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Gc),ne.lang=Cd,H("X",0,0,"unix"),H("x",0,0,"valueOf"),N("x",_c),N("X",bd),Q("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),Q("x",function(a,b,c){c._d=new Date(q(a))}),a.version="2.10.6",b(Da),a.fn=Od,a.min=Fa,a.max=Ga,a.utc=h,a.unix=Zb,a.months=jc,a.isDate=d,a.locale=w,a.invalid=l,a.duration=Ya,a.isMoment=o,a.weekdays=lc,a.parseZone=$b,a.localeData=y,a.isDuration=Ia,a.monthsShort=kc,a.weekdaysMin=nc,a.defineLocale=x,a.weekdaysShort=mc,a.normalizeUnits=A,a.relativeTimeThreshold=Ec;var oe=a;return oe}); \ No newline at end of file +!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return Uc.apply(null,arguments)}function b(a){Uc=a}function c(a){return"[object Array]"===Object.prototype.toString.call(a)}function d(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function e(a,b){var c,d=[];for(c=0;c0)for(c in Wc)d=Wc[c],e=b[d],m(e)||(a[d]=e);return a}function o(b){n(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),Xc===!1&&(Xc=!0,a.updateOffset(this),Xc=!1)}function p(a){return a instanceof o||null!=a&&null!=a._isAMomentObject}function q(a){return 0>a?Math.ceil(a):Math.floor(a)}function r(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=q(b)),c}function s(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&r(a[d])!==r(b[d]))&&g++;return g+f}function t(){}function u(a){return a?a.toLowerCase().replace("_","-"):a}function v(a){for(var b,c,d,e,f=0;f0;){if(d=w(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&s(e,c,!0)>=b-1)break;b--}f++}return null}function w(a){var b=null;if(!Yc[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=Vc._abbr,require("./locale/"+a),x(b)}catch(c){}return Yc[a]}function x(a,b){var c;return a&&(c=m(b)?z(a):y(a,b),c&&(Vc=c)),Vc._abbr}function y(a,b){return null!==b?(b.abbr=a,Yc[a]=Yc[a]||new t,Yc[a].set(b),x(a),Yc[a]):(delete Yc[a],null)}function z(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return Vc;if(!c(a)){if(b=w(a))return b;a=[a]}return v(a)}function A(a,b){var c=a.toLowerCase();Zc[c]=Zc[c+"s"]=Zc[b]=a}function B(a){return"string"==typeof a?Zc[a]||Zc[a.toLowerCase()]:void 0}function C(a){var b,c,d={};for(c in a)f(a,c)&&(b=B(c),b&&(d[b]=a[c]));return d}function D(a){return a instanceof Function||"[object Function]"===Object.prototype.toString.call(a)}function E(b,c){return function(d){return null!=d?(G(this,b,d),a.updateOffset(this,c),this):F(this,b)}}function F(a,b){return a.isValid()?a._d["get"+(a._isUTC?"UTC":"")+b]():NaN}function G(a,b,c){a.isValid()&&a._d["set"+(a._isUTC?"UTC":"")+b](c)}function H(a,b){var c;if("object"==typeof a)for(c in a)this.set(c,a[c]);else if(a=B(a),D(this[a]))return this[a](b);return this}function I(a,b,c){var d=""+Math.abs(a),e=b-d.length,f=a>=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}function J(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(bd[a]=e),b&&(bd[b[0]]=function(){return I(e.apply(this,arguments),b[1],b[2])}),c&&(bd[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function K(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function L(a){var b,c,d=a.match($c);for(b=0,c=d.length;c>b;b++)bd[d[b]]?d[b]=bd[d[b]]:d[b]=K(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function M(a,b){return a.isValid()?(b=N(b,a.localeData()),ad[b]=ad[b]||L(b),ad[b](a)):a.localeData().invalidDate()}function N(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(_c.lastIndex=0;d>=0&&_c.test(a);)a=a.replace(_c,c),_c.lastIndex=0,d-=1;return a}function O(a,b,c){td[a]=D(b)?b:function(a,d){return a&&c?c:b}}function P(a,b){return f(td,a)?td[a](b._strict,b._locale):new RegExp(Q(a))}function Q(a){return R(a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}))}function R(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function S(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),"number"==typeof b&&(d=function(a,c){c[b]=r(a)}),c=0;cd;d++){if(e=h([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}function Z(a,b){var c;return a.isValid()?"string"==typeof b&&(b=a.localeData().monthsParse(b),"number"!=typeof b)?a:(c=Math.min(a.date(),V(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a):a}function $(b){return null!=b?(Z(this,b),a.updateOffset(this,!0),this):F(this,"Month")}function _(){return V(this.year(),this.month())}function aa(a){return this._monthsParseExact?(f(this,"_monthsRegex")||ca.call(this),a?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&a?this._monthsShortStrictRegex:this._monthsShortRegex}function ba(a){return this._monthsParseExact?(f(this,"_monthsRegex")||ca.call(this),a?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&a?this._monthsStrictRegex:this._monthsRegex}function ca(){function a(a,b){return b.length-a.length}var b,c,d=[],e=[],f=[];for(b=0;12>b;b++)c=h([2e3,b]),d.push(this.monthsShort(c,"")),e.push(this.months(c,"")),f.push(this.months(c,"")),f.push(this.monthsShort(c,""));for(d.sort(a),e.sort(a),f.sort(a),b=0;12>b;b++)d[b]=R(d[b]),e[b]=R(e[b]),f[b]=R(f[b]);this._monthsRegex=new RegExp("^("+f.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+d.join("|")+")$","i")}function da(a){var b,c=a._a;return c&&-2===j(a).overflow&&(b=c[wd]<0||c[wd]>11?wd:c[xd]<1||c[xd]>V(c[vd],c[wd])?xd:c[yd]<0||c[yd]>24||24===c[yd]&&(0!==c[zd]||0!==c[Ad]||0!==c[Bd])?yd:c[zd]<0||c[zd]>59?zd:c[Ad]<0||c[Ad]>59?Ad:c[Bd]<0||c[Bd]>999?Bd:-1,j(a)._overflowDayOfYear&&(vd>b||b>xd)&&(b=xd),j(a)._overflowWeeks&&-1===b&&(b=Cd),j(a)._overflowWeekday&&-1===b&&(b=Dd),j(a).overflow=b),a}function ea(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function fa(a,b){var c=!0;return g(function(){return c&&(ea(a+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),c=!1),b.apply(this,arguments)},b)}function ga(a,b){Jd[a]||(ea(b),Jd[a]=!0)}function ha(a){var b,c,d,e,f,g,h=a._i,i=Kd.exec(h)||Ld.exec(h);if(i){for(j(a).iso=!0,b=0,c=Nd.length;c>b;b++)if(Nd[b][1].exec(i[1])){e=Nd[b][0],d=Nd[b][2]!==!1;break}if(null==e)return void(a._isValid=!1);if(i[3]){for(b=0,c=Od.length;c>b;b++)if(Od[b][1].exec(i[3])){f=(i[2]||" ")+Od[b][0];break}if(null==f)return void(a._isValid=!1)}if(!d&&null!=f)return void(a._isValid=!1);if(i[4]){if(!Md.exec(i[4]))return void(a._isValid=!1);g="Z"}a._f=e+(f||"")+(g||""),wa(a)}else a._isValid=!1}function ia(b){var c=Pd.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(ha(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}function ja(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 100>a&&a>=0&&isFinite(h.getFullYear())&&h.setFullYear(a),h}function ka(a){var b=new Date(Date.UTC.apply(null,arguments));return 100>a&&a>=0&&isFinite(b.getUTCFullYear())&&b.setUTCFullYear(a),b}function la(a){return ma(a)?366:365}function ma(a){return a%4===0&&a%100!==0||a%400===0}function na(){return ma(this.year())}function oa(a,b,c){var d=7+b-c,e=(7+ka(a,0,d).getUTCDay()-b)%7;return-e+d-1}function pa(a,b,c,d,e){var f,g,h=(7+c-d)%7,i=oa(a,d,e),j=1+7*(b-1)+h+i;return 0>=j?(f=a-1,g=la(f)+j):j>la(a)?(f=a+1,g=j-la(a)):(f=a,g=j),{year:f,dayOfYear:g}}function qa(a,b,c){var d,e,f=oa(a.year(),b,c),g=Math.floor((a.dayOfYear()-f-1)/7)+1;return 1>g?(e=a.year()-1,d=g+ra(e,b,c)):g>ra(a.year(),b,c)?(d=g-ra(a.year(),b,c),e=a.year()+1):(e=a.year(),d=g),{week:d,year:e}}function ra(a,b,c){var d=oa(a,b,c),e=oa(a+1,b,c);return(la(a)-d+e)/7}function sa(a,b,c){return null!=a?a:null!=b?b:c}function ta(b){var c=new Date(a.now());return b._useUTC?[c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()]:[c.getFullYear(),c.getMonth(),c.getDate()]}function ua(a){var b,c,d,e,f=[];if(!a._d){for(d=ta(a),a._w&&null==a._a[xd]&&null==a._a[wd]&&va(a),a._dayOfYear&&(e=sa(a._a[vd],d[vd]),a._dayOfYear>la(e)&&(j(a)._overflowDayOfYear=!0),c=ka(e,0,a._dayOfYear),a._a[wd]=c.getUTCMonth(),a._a[xd]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[yd]&&0===a._a[zd]&&0===a._a[Ad]&&0===a._a[Bd]&&(a._nextDay=!0,a._a[yd]=0),a._d=(a._useUTC?ka:ja).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[yd]=24)}}function va(a){var b,c,d,e,f,g,h,i;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(f=1,g=4,c=sa(b.GG,a._a[vd],qa(Ea(),1,4).year),d=sa(b.W,1),e=sa(b.E,1),(1>e||e>7)&&(i=!0)):(f=a._locale._week.dow,g=a._locale._week.doy,c=sa(b.gg,a._a[vd],qa(Ea(),f,g).year),d=sa(b.w,1),null!=b.d?(e=b.d,(0>e||e>6)&&(i=!0)):null!=b.e?(e=b.e+f,(b.e<0||b.e>6)&&(i=!0)):e=f),1>d||d>ra(c,f,g)?j(a)._overflowWeeks=!0:null!=i?j(a)._overflowWeekday=!0:(h=pa(c,d,e,f,g),a._a[vd]=h.year,a._dayOfYear=h.dayOfYear)}function wa(b){if(b._f===a.ISO_8601)return void ha(b);b._a=[],j(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,k=0;for(e=N(b._f,b._locale).match($c)||[],c=0;c0&&j(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),k+=d.length),bd[f]?(d?j(b).empty=!1:j(b).unusedTokens.push(f),U(f,d,b)):b._strict&&!d&&j(b).unusedTokens.push(f);j(b).charsLeftOver=i-k,h.length>0&&j(b).unusedInput.push(h),j(b).bigHour===!0&&b._a[yd]<=12&&b._a[yd]>0&&(j(b).bigHour=void 0),b._a[yd]=xa(b._locale,b._a[yd],b._meridiem),ua(b),da(b)}function xa(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}function ya(a){var b,c,d,e,f;if(0===a._f.length)return j(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;ef)&&(d=f,c=b));g(a,c||b)}function za(a){if(!a._d){var b=C(a._i);a._a=e([b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],function(a){return a&&parseInt(a,10)}),ua(a)}}function Aa(a){var b=new o(da(Ba(a)));return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function Ba(a){var b=a._i,e=a._f;return a._locale=a._locale||z(a._l),null===b||void 0===e&&""===b?l({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),p(b)?new o(da(b)):(c(e)?ya(a):e?wa(a):d(b)?a._d=b:Ca(a),k(a)||(a._d=null),a))}function Ca(b){var f=b._i;void 0===f?b._d=new Date(a.now()):d(f)?b._d=new Date(+f):"string"==typeof f?ia(b):c(f)?(b._a=e(f.slice(0),function(a){return parseInt(a,10)}),ua(b)):"object"==typeof f?za(b):"number"==typeof f?b._d=new Date(f):a.createFromInputFallback(b)}function Da(a,b,c,d,e){var f={};return"boolean"==typeof c&&(d=c,c=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=e,f._l=c,f._i=a,f._f=b,f._strict=d,Aa(f)}function Ea(a,b,c,d){return Da(a,b,c,d,!1)}function Fa(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return Ea();for(d=b[0],e=1;ea&&(a=-a,c="-"),c+I(~~(a/60),2)+b+I(~~a%60,2)})}function La(a,b){var c=(b||"").match(a)||[],d=c[c.length-1]||[],e=(d+"").match(Ud)||["-",0,0],f=+(60*e[1])+r(e[2]);return"+"===e[0]?f:-f}function Ma(b,c){var e,f;return c._isUTC?(e=c.clone(),f=(p(b)||d(b)?+b:+Ea(b))-+e,e._d.setTime(+e._d+f),a.updateOffset(e,!1),e):Ea(b).local()}function Na(a){return 15*-Math.round(a._d.getTimezoneOffset()/15)}function Oa(b,c){var d,e=this._offset||0;return this.isValid()?null!=b?("string"==typeof b?b=La(qd,b):Math.abs(b)<16&&(b=60*b),!this._isUTC&&c&&(d=Na(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?cb(this,Za(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?e:Na(this):null!=b?this:NaN}function Pa(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Qa(a){return this.utcOffset(0,a)}function Ra(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Na(this),"m")),this}function Sa(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(La(pd,this._i)),this}function Ta(a){return this.isValid()?(a=a?Ea(a).utcOffset():0,(this.utcOffset()-a)%60===0):!1}function Ua(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Va(){if(!m(this._isDSTShifted))return this._isDSTShifted;var a={};if(n(a,this),a=Ba(a),a._a){var b=a._isUTC?h(a._a):Ea(a._a);this._isDSTShifted=this.isValid()&&s(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Wa(){return this.isValid()?!this._isUTC:!1}function Xa(){return this.isValid()?this._isUTC:!1}function Ya(){return this.isValid()?this._isUTC&&0===this._offset:!1}function Za(a,b){var c,d,e,g=a,h=null;return Ja(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(h=Vd.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:r(h[xd])*c,h:r(h[yd])*c,m:r(h[zd])*c,s:r(h[Ad])*c,ms:r(h[Bd])*c}):(h=Wd.exec(a))?(c="-"===h[1]?-1:1,g={y:$a(h[2],c),M:$a(h[3],c),d:$a(h[4],c),h:$a(h[5],c),m:$a(h[6],c),s:$a(h[7],c),w:$a(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=ab(Ea(g.from),Ea(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new Ia(g),Ja(a)&&f(a,"_locale")&&(d._locale=a._locale),d}function $a(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function _a(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function ab(a,b){var c;return a.isValid()&&b.isValid()?(b=Ma(b,a),a.isBefore(b)?c=_a(a,b):(c=_a(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}function bb(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(ga(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=Za(c,d),cb(this,e,a),this}}function cb(b,c,d,e){var f=c._milliseconds,g=c._days,h=c._months;b.isValid()&&(e=null==e?!0:e,f&&b._d.setTime(+b._d+f*d),g&&G(b,"Date",F(b,"Date")+g*d),h&&Z(b,F(b,"Month")+h*d),e&&a.updateOffset(b,g||h))}function db(a,b){var c=a||Ea(),d=Ma(c,this).startOf("day"),e=this.diff(d,"days",!0),f=-6>e?"sameElse":-1>e?"lastWeek":0>e?"lastDay":1>e?"sameDay":2>e?"nextDay":7>e?"nextWeek":"sameElse",g=b&&(D(b[f])?b[f]():b[f]);return this.format(g||this.localeData().calendar(f,this,Ea(c)))}function eb(){return new o(this)}function fb(a,b){var c=p(a)?a:Ea(a);return this.isValid()&&c.isValid()?(b=B(m(b)?"millisecond":b),"millisecond"===b?+this>+c:+c<+this.clone().startOf(b)):!1}function gb(a,b){var c=p(a)?a:Ea(a);return this.isValid()&&c.isValid()?(b=B(m(b)?"millisecond":b),"millisecond"===b?+c>+this:+this.clone().endOf(b)<+c):!1}function hb(a,b,c){return this.isAfter(a,c)&&this.isBefore(b,c)}function ib(a,b){var c,d=p(a)?a:Ea(a);return this.isValid()&&d.isValid()?(b=B(b||"millisecond"),"millisecond"===b?+this===+d:(c=+d,+this.clone().startOf(b)<=c&&c<=+this.clone().endOf(b))):!1}function jb(a,b){return this.isSame(a,b)||this.isAfter(a,b)}function kb(a,b){return this.isSame(a,b)||this.isBefore(a,b)}function lb(a,b,c){var d,e,f,g;return this.isValid()?(d=Ma(a,this),d.isValid()?(e=6e4*(d.utcOffset()-this.utcOffset()),b=B(b),"year"===b||"month"===b||"quarter"===b?(g=mb(this,d),"quarter"===b?g/=3:"year"===b&&(g/=12)):(f=this-d,g="second"===b?f/1e3:"minute"===b?f/6e4:"hour"===b?f/36e5:"day"===b?(f-e)/864e5:"week"===b?(f-e)/6048e5:f),c?g:q(g)):NaN):NaN}function mb(a,b){var c,d,e=12*(b.year()-a.year())+(b.month()-a.month()),f=a.clone().add(e,"months");return 0>b-f?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)}function nb(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ob(){var a=this.clone().utc();return 0f&&(b=f),Ob.call(this,a,b,c,d,e))}function Ob(a,b,c,d,e){var f=pa(a,b,c,d,e),g=ka(f.year,0,f.dayOfYear);return this.year(g.getUTCFullYear()),this.month(g.getUTCMonth()),this.date(g.getUTCDate()),this}function Pb(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)}function Qb(a){return qa(a,this._week.dow,this._week.doy).week}function Rb(){return this._week.dow}function Sb(){return this._week.doy}function Tb(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function Ub(a){var b=qa(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function Vb(a,b){return"string"!=typeof a?a:isNaN(a)?(a=b.weekdaysParse(a),"number"==typeof a?a:null):parseInt(a,10)}function Wb(a,b){return c(this._weekdays)?this._weekdays[a.day()]:this._weekdays[this._weekdays.isFormat.test(b)?"format":"standalone"][a.day()]}function Xb(a){return this._weekdaysShort[a.day()]}function Yb(a){return this._weekdaysMin[a.day()]}function Zb(a,b,c){var d,e,f;for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;7>d;d++){if(e=Ea([2e3,1]).day(d),c&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(e,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(e,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(e,"").replace(".",".?")+"$","i")),this._weekdaysParse[d]||(f="^"+this.weekdays(e,"")+"|^"+this.weekdaysShort(e,"")+"|^"+this.weekdaysMin(e,""),this._weekdaysParse[d]=new RegExp(f.replace(".",""),"i")),c&&"dddd"===b&&this._fullWeekdaysParse[d].test(a))return d;if(c&&"ddd"===b&&this._shortWeekdaysParse[d].test(a))return d;if(c&&"dd"===b&&this._minWeekdaysParse[d].test(a))return d;if(!c&&this._weekdaysParse[d].test(a))return d}}function $b(a){if(!this.isValid())return null!=a?this:NaN;var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=Vb(a,this.localeData()),this.add(a-b,"d")):b}function _b(a){if(!this.isValid())return null!=a?this:NaN;var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function ac(a){return this.isValid()?null==a?this.day()||7:this.day(this.day()%7?a:a-7):null!=a?this:NaN}function bc(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function cc(){return this.hours()%12||12}function dc(a,b){J(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function ec(a,b){return b._meridiemParse}function fc(a){return"p"===(a+"").toLowerCase().charAt(0)}function gc(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function hc(a,b){b[Bd]=r(1e3*("0."+a))}function ic(){return this._isUTC?"UTC":""}function jc(){return this._isUTC?"Coordinated Universal Time":""}function kc(a){return Ea(1e3*a)}function lc(){return Ea.apply(null,arguments).parseZone()}function mc(a,b,c){var d=this._calendar[a];return D(d)?d.call(b,c):d}function nc(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function oc(){return this._invalidDate}function pc(a){return this._ordinal.replace("%d",a)}function qc(a){return a}function rc(a,b,c,d){var e=this._relativeTime[c];return D(e)?e(a,b,c,d):e.replace(/%d/i,a)}function sc(a,b){var c=this._relativeTime[a>0?"future":"past"];return D(c)?c(b):c.replace(/%s/i,b)}function tc(a){var b,c;for(c in a)b=a[c],D(b)?this[c]=b:this["_"+c]=b;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function uc(a,b,c,d){var e=z(),f=h().set(d,b);return e[c](f,a)}function vc(a,b,c,d,e){if("number"==typeof a&&(b=a,a=void 0),a=a||"",null!=b)return uc(a,b,c,e);var f,g=[];for(f=0;d>f;f++)g[f]=uc(a,f,c,e);return g}function wc(a,b){return vc(a,b,"months",12,"month")}function xc(a,b){return vc(a,b,"monthsShort",12,"month")}function yc(a,b){return vc(a,b,"weekdays",7,"day")}function zc(a,b){return vc(a,b,"weekdaysShort",7,"day")}function Ac(a,b){return vc(a,b,"weekdaysMin",7,"day")}function Bc(){var a=this._data;return this._milliseconds=se(this._milliseconds),this._days=se(this._days),this._months=se(this._months),a.milliseconds=se(a.milliseconds),a.seconds=se(a.seconds),a.minutes=se(a.minutes),a.hours=se(a.hours),a.months=se(a.months),a.years=se(a.years),this}function Cc(a,b,c,d){var e=Za(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function Dc(a,b){return Cc(this,a,b,1)}function Ec(a,b){return Cc(this,a,b,-1)}function Fc(a){return 0>a?Math.floor(a):Math.ceil(a)}function Gc(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data;return f>=0&&g>=0&&h>=0||0>=f&&0>=g&&0>=h||(f+=864e5*Fc(Ic(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=q(f/1e3),i.seconds=a%60,b=q(a/60),i.minutes=b%60,c=q(b/60),i.hours=c%24,g+=q(c/24),e=q(Hc(g)),h+=e,g-=Fc(Ic(e)),d=q(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function Hc(a){return 4800*a/146097}function Ic(a){return 146097*a/4800}function Jc(a){var b,c,d=this._milliseconds;if(a=B(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+Hc(b),"month"===a?c:c/12;switch(b=this._days+Math.round(Ic(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function Kc(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*r(this._months/12)}function Lc(a){return function(){return this.as(a)}}function Mc(a){return a=B(a),this[a+"s"]()}function Nc(a){return function(){return this._data[a]}}function Oc(){return q(this.days()/7)}function Pc(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function Qc(a,b,c){var d=Za(a).abs(),e=Ie(d.as("s")),f=Ie(d.as("m")),g=Ie(d.as("h")),h=Ie(d.as("d")),i=Ie(d.as("M")),j=Ie(d.as("y")),k=e=f&&["m"]||f=g&&["h"]||g=h&&["d"]||h=i&&["M"]||i=j&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,Pc.apply(null,k)}function Rc(a,b){return void 0===Je[a]?!1:void 0===b?Je[a]:(Je[a]=b,!0)}function Sc(a){var b=this.localeData(),c=Qc(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function Tc(){var a,b,c,d=Ke(this._milliseconds)/1e3,e=Ke(this._days),f=Ke(this._months);a=q(d/60),b=q(a/60),d%=60,a%=60,c=q(f/12),f%=12;var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(0>m?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"}var Uc,Vc,Wc=a.momentProperties=[],Xc=!1,Yc={},Zc={},$c=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,_c=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,ad={},bd={},cd=/\d/,dd=/\d\d/,ed=/\d{3}/,fd=/\d{4}/,gd=/[+-]?\d{6}/,hd=/\d\d?/,id=/\d\d\d\d?/,jd=/\d\d\d\d\d\d?/,kd=/\d{1,3}/,ld=/\d{1,4}/,md=/[+-]?\d{1,6}/,nd=/\d+/,od=/[+-]?\d+/,pd=/Z|[+-]\d\d:?\d\d/gi,qd=/Z|[+-]\d\d(?::?\d\d)?/gi,rd=/[+-]?\d+(\.\d{1,3})?/,sd=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,td={},ud={},vd=0,wd=1,xd=2,yd=3,zd=4,Ad=5,Bd=6,Cd=7,Dd=8;J("M",["MM",2],"Mo",function(){return this.month()+1}),J("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),J("MMMM",0,0,function(a){return this.localeData().months(this,a)}),A("month","M"),O("M",hd),O("MM",hd,dd),O("MMM",function(a,b){return b.monthsShortRegex(a)}),O("MMMM",function(a,b){return b.monthsRegex(a)}),S(["M","MM"],function(a,b){b[wd]=r(a)-1}),S(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict);null!=e?b[wd]=e:j(c).invalidMonth=a});var Ed=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Fd="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Gd="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Hd=sd,Id=sd,Jd={};a.suppressDeprecationWarnings=!1;var Kd=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Ld=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Md=/Z|[+-]\d\d(?::?\d\d)?/,Nd=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Od=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Pd=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=fa("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),J("Y",0,0,function(){var a=this.year();return 9999>=a?""+a:"+"+a}),J(0,["YY",2],0,function(){return this.year()%100}),J(0,["YYYY",4],0,"year"),J(0,["YYYYY",5],0,"year"),J(0,["YYYYYY",6,!0],0,"year"),A("year","y"),O("Y",od),O("YY",hd,dd),O("YYYY",ld,fd),O("YYYYY",md,gd),O("YYYYYY",md,gd),S(["YYYYY","YYYYYY"],vd),S("YYYY",function(b,c){c[vd]=2===b.length?a.parseTwoDigitYear(b):r(b)}),S("YY",function(b,c){c[vd]=a.parseTwoDigitYear(b)}),S("Y",function(a,b){b[vd]=parseInt(a,10)}),a.parseTwoDigitYear=function(a){return r(a)+(r(a)>68?1900:2e3)};var Qd=E("FullYear",!1);a.ISO_8601=function(){};var Rd=fa("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var a=Ea.apply(null,arguments);return this.isValid()&&a.isValid()?this>a?this:a:l()}),Sd=fa("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var a=Ea.apply(null,arguments);return this.isValid()&&a.isValid()?a>this?this:a:l()}),Td=function(){return Date.now?Date.now():+new Date};Ka("Z",":"),Ka("ZZ",""),O("Z",qd),O("ZZ",qd),S(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=La(qd,a)});var Ud=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var Vd=/(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Wd=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/; +Za.fn=Ia.prototype;var Xd=bb(1,"add"),Yd=bb(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Zd=fa("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});J(0,["gg",2],0,function(){return this.weekYear()%100}),J(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ib("gggg","weekYear"),Ib("ggggg","weekYear"),Ib("GGGG","isoWeekYear"),Ib("GGGGG","isoWeekYear"),A("weekYear","gg"),A("isoWeekYear","GG"),O("G",od),O("g",od),O("GG",hd,dd),O("gg",hd,dd),O("GGGG",ld,fd),O("gggg",ld,fd),O("GGGGG",md,gd),O("ggggg",md,gd),T(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=r(a)}),T(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),J("Q",0,"Qo","quarter"),A("quarter","Q"),O("Q",cd),S("Q",function(a,b){b[wd]=3*(r(a)-1)}),J("w",["ww",2],"wo","week"),J("W",["WW",2],"Wo","isoWeek"),A("week","w"),A("isoWeek","W"),O("w",hd),O("ww",hd,dd),O("W",hd),O("WW",hd,dd),T(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=r(a)});var $d={dow:0,doy:6};J("D",["DD",2],"Do","date"),A("date","D"),O("D",hd),O("DD",hd,dd),O("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),S(["D","DD"],xd),S("Do",function(a,b){b[xd]=r(a.match(hd)[0],10)});var _d=E("Date",!0);J("d",0,"do","day"),J("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),J("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),J("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),J("e",0,0,"weekday"),J("E",0,0,"isoWeekday"),A("day","d"),A("weekday","e"),A("isoWeekday","E"),O("d",hd),O("e",hd),O("E",hd),O("dd",sd),O("ddd",sd),O("dddd",sd),T(["dd","ddd","dddd"],function(a,b,c,d){var e=c._locale.weekdaysParse(a,d,c._strict);null!=e?b.d=e:j(c).invalidWeekday=a}),T(["d","e","E"],function(a,b,c,d){b[d]=r(a)});var ae="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),be="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),ce="Su_Mo_Tu_We_Th_Fr_Sa".split("_");J("DDD",["DDDD",3],"DDDo","dayOfYear"),A("dayOfYear","DDD"),O("DDD",kd),O("DDDD",ed),S(["DDD","DDDD"],function(a,b,c){c._dayOfYear=r(a)}),J("H",["HH",2],0,"hour"),J("h",["hh",2],0,cc),J("hmm",0,0,function(){return""+cc.apply(this)+I(this.minutes(),2)}),J("hmmss",0,0,function(){return""+cc.apply(this)+I(this.minutes(),2)+I(this.seconds(),2)}),J("Hmm",0,0,function(){return""+this.hours()+I(this.minutes(),2)}),J("Hmmss",0,0,function(){return""+this.hours()+I(this.minutes(),2)+I(this.seconds(),2)}),dc("a",!0),dc("A",!1),A("hour","h"),O("a",ec),O("A",ec),O("H",hd),O("h",hd),O("HH",hd,dd),O("hh",hd,dd),O("hmm",id),O("hmmss",jd),O("Hmm",id),O("Hmmss",jd),S(["H","HH"],yd),S(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),S(["h","hh"],function(a,b,c){b[yd]=r(a),j(c).bigHour=!0}),S("hmm",function(a,b,c){var d=a.length-2;b[yd]=r(a.substr(0,d)),b[zd]=r(a.substr(d)),j(c).bigHour=!0}),S("hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[yd]=r(a.substr(0,d)),b[zd]=r(a.substr(d,2)),b[Ad]=r(a.substr(e)),j(c).bigHour=!0}),S("Hmm",function(a,b,c){var d=a.length-2;b[yd]=r(a.substr(0,d)),b[zd]=r(a.substr(d))}),S("Hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[yd]=r(a.substr(0,d)),b[zd]=r(a.substr(d,2)),b[Ad]=r(a.substr(e))});var de=/[ap]\.?m?\.?/i,ee=E("Hours",!0);J("m",["mm",2],0,"minute"),A("minute","m"),O("m",hd),O("mm",hd,dd),S(["m","mm"],zd);var fe=E("Minutes",!1);J("s",["ss",2],0,"second"),A("second","s"),O("s",hd),O("ss",hd,dd),S(["s","ss"],Ad);var ge=E("Seconds",!1);J("S",0,0,function(){return~~(this.millisecond()/100)}),J(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),J(0,["SSS",3],0,"millisecond"),J(0,["SSSS",4],0,function(){return 10*this.millisecond()}),J(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),J(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),J(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),J(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),J(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),A("millisecond","ms"),O("S",kd,cd),O("SS",kd,dd),O("SSS",kd,ed);var he;for(he="SSSS";he.length<=9;he+="S")O(he,nd);for(he="S";he.length<=9;he+="S")S(he,hc);var ie=E("Milliseconds",!1);J("z",0,0,"zoneAbbr"),J("zz",0,0,"zoneName");var je=o.prototype;je.add=Xd,je.calendar=db,je.clone=eb,je.diff=lb,je.endOf=xb,je.format=pb,je.from=qb,je.fromNow=rb,je.to=sb,je.toNow=tb,je.get=H,je.invalidAt=Gb,je.isAfter=fb,je.isBefore=gb,je.isBetween=hb,je.isSame=ib,je.isSameOrAfter=jb,je.isSameOrBefore=kb,je.isValid=Eb,je.lang=Zd,je.locale=ub,je.localeData=vb,je.max=Sd,je.min=Rd,je.parsingFlags=Fb,je.set=H,je.startOf=wb,je.subtract=Yd,je.toArray=Bb,je.toObject=Cb,je.toDate=Ab,je.toISOString=ob,je.toJSON=Db,je.toString=nb,je.unix=zb,je.valueOf=yb,je.creationData=Hb,je.year=Qd,je.isLeapYear=na,je.weekYear=Jb,je.isoWeekYear=Kb,je.quarter=je.quarters=Pb,je.month=$,je.daysInMonth=_,je.week=je.weeks=Tb,je.isoWeek=je.isoWeeks=Ub,je.weeksInYear=Mb,je.isoWeeksInYear=Lb,je.date=_d,je.day=je.days=$b,je.weekday=_b,je.isoWeekday=ac,je.dayOfYear=bc,je.hour=je.hours=ee,je.minute=je.minutes=fe,je.second=je.seconds=ge,je.millisecond=je.milliseconds=ie,je.utcOffset=Oa,je.utc=Qa,je.local=Ra,je.parseZone=Sa,je.hasAlignedHourOffset=Ta,je.isDST=Ua,je.isDSTShifted=Va,je.isLocal=Wa,je.isUtcOffset=Xa,je.isUtc=Ya,je.isUTC=Ya,je.zoneAbbr=ic,je.zoneName=jc,je.dates=fa("dates accessor is deprecated. Use date instead.",_d),je.months=fa("months accessor is deprecated. Use month instead",$),je.years=fa("years accessor is deprecated. Use year instead",Qd),je.zone=fa("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Pa);var ke=je,le={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},me={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},ne="Invalid date",oe="%d",pe=/\d{1,2}/,qe={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},re=t.prototype;re._calendar=le,re.calendar=mc,re._longDateFormat=me,re.longDateFormat=nc,re._invalidDate=ne,re.invalidDate=oc,re._ordinal=oe,re.ordinal=pc,re._ordinalParse=pe,re.preparse=qc,re.postformat=qc,re._relativeTime=qe,re.relativeTime=rc,re.pastFuture=sc,re.set=tc,re.months=W,re._months=Fd,re.monthsShort=X,re._monthsShort=Gd,re.monthsParse=Y,re._monthsRegex=Id,re.monthsRegex=ba,re._monthsShortRegex=Hd,re.monthsShortRegex=aa,re.week=Qb,re._week=$d,re.firstDayOfYear=Sb,re.firstDayOfWeek=Rb,re.weekdays=Wb,re._weekdays=ae,re.weekdaysMin=Yb,re._weekdaysMin=ce,re.weekdaysShort=Xb,re._weekdaysShort=be,re.weekdaysParse=Zb,re.isPM=fc,re._meridiemParse=de,re.meridiem=gc,x("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===r(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.lang=fa("moment.lang is deprecated. Use moment.locale instead.",x),a.langData=fa("moment.langData is deprecated. Use moment.localeData instead.",z);var se=Math.abs,te=Lc("ms"),ue=Lc("s"),ve=Lc("m"),we=Lc("h"),xe=Lc("d"),ye=Lc("w"),ze=Lc("M"),Ae=Lc("y"),Be=Nc("milliseconds"),Ce=Nc("seconds"),De=Nc("minutes"),Ee=Nc("hours"),Fe=Nc("days"),Ge=Nc("months"),He=Nc("years"),Ie=Math.round,Je={s:45,m:45,h:22,d:26,M:11},Ke=Math.abs,Le=Ia.prototype;Le.abs=Bc,Le.add=Dc,Le.subtract=Ec,Le.as=Jc,Le.asMilliseconds=te,Le.asSeconds=ue,Le.asMinutes=ve,Le.asHours=we,Le.asDays=xe,Le.asWeeks=ye,Le.asMonths=ze,Le.asYears=Ae,Le.valueOf=Kc,Le._bubble=Gc,Le.get=Mc,Le.milliseconds=Be,Le.seconds=Ce,Le.minutes=De,Le.hours=Ee,Le.days=Fe,Le.weeks=Oc,Le.months=Ge,Le.years=He,Le.humanize=Sc,Le.toISOString=Tc,Le.toString=Tc,Le.toJSON=Tc,Le.locale=ub,Le.localeData=vb,Le.toIsoString=fa("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Tc),Le.lang=Zd,J("X",0,0,"unix"),J("x",0,0,"valueOf"),O("x",od),O("X",rd),S("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),S("x",function(a,b,c){c._d=new Date(r(a))}),a.version="2.11.1",b(Ea),a.fn=ke,a.min=Ga,a.max=Ha,a.now=Td,a.utc=h,a.unix=kc,a.months=wc,a.isDate=d,a.locale=x,a.invalid=l,a.duration=Za,a.isMoment=p,a.weekdays=yc,a.parseZone=lc,a.localeData=z,a.isDuration=Ja,a.monthsShort=xc,a.weekdaysMin=Ac,a.defineLocale=y,a.weekdaysShort=zc,a.normalizeUnits=B,a.relativeTimeThreshold=Rc,a.prototype=ke;var Me=a;return Me}); \ No newline at end of file diff --git a/bower_components/moment/min/tests.js b/bower_components/moment/min/tests.js index 596227c..7be8bc2 100644 --- a/bower_components/moment/min/tests.js +++ b/bower_components/moment/min/tests.js @@ -1,6 +1,7 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -9,12 +10,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -32,8 +35,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -355,8 +358,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -365,12 +369,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -388,8 +394,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -709,8 +715,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -719,12 +726,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -742,8 +751,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -1068,8 +1077,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -1078,12 +1088,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -1101,8 +1113,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -1510,8 +1522,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -1520,12 +1533,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -1543,8 +1558,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -1895,8 +1910,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -1905,12 +1921,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -1928,8 +1946,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -2261,8 +2279,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -2271,12 +2290,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -2294,8 +2315,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -2672,8 +2693,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -2682,12 +2704,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -2705,8 +2729,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -3043,8 +3067,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -3053,12 +3078,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -3076,8 +3103,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -3190,7 +3217,7 @@ }); test('format week', function (assert) { - var expected = 'রবিবার রবি রব_সোমবার সোম সম_মঙ্গলবার মঙ্গল মঙ্গ_বুধবার বুধ বু_বৃহস্পত্তিবার বৃহস্পত্তি ব্রিহ_শুক্রুবার শুক্রু শু_শনিবার শনি শনি'.split('_'), i; + var expected = 'রবিবার রবি রব_সোমবার সোম সম_মঙ্গলবার মঙ্গল মঙ্গ_বুধবার বুধ বু_বৃহস্পত্তিবার বৃহস্পত্তি ব্রিহ_শুক্রবার শুক্র শু_শনিবার শনি শনি'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -3198,7 +3225,7 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'কএক সেকেন্ড', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'কয়েক সেকেন্ড', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'এক মিনিট', '45 seconds = a minute'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'এক মিনিট', '89 seconds = a minute'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '২ মিনিট', '90 seconds = 2 minutes'); @@ -3228,16 +3255,16 @@ }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'কএক সেকেন্ড পরে', 'prefix'); - assert.equal(moment(0).from(30000), 'কএক সেকেন্ড আগে', 'suffix'); + assert.equal(moment(30000).from(0), 'কয়েক সেকেন্ড পরে', 'prefix'); + assert.equal(moment(0).from(30000), 'কয়েক সেকেন্ড আগে', 'suffix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'কএক সেকেন্ড আগে', 'now from now should display as in the past'); + assert.equal(moment().fromNow(), 'কয়েক সেকেন্ড আগে', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'কএক সেকেন্ড পরে', 'কএক সেকেন্ড পরে'); + assert.equal(moment().add({s: 30}).fromNow(), 'কয়েক সেকেন্ড পরে', 'কয়েক সেকেন্ড পরে'); assert.equal(moment().add({d: 5}).fromNow(), '৫ দিন পরে', '৫ দিন পরে'); }); @@ -3295,15 +3322,15 @@ assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), 'রাত', 'before dawn'); assert.equal(moment([2011, 2, 23, 9, 30]).format('a'), 'সকাল', 'morning'); assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'দুপুর', 'during day'); - assert.equal(moment([2011, 2, 23, 17, 30]).format('a'), 'বিকেল', 'evening'); - assert.equal(moment([2011, 2, 23, 19, 30]).format('a'), 'বিকেল', 'late evening'); + assert.equal(moment([2011, 2, 23, 17, 30]).format('a'), 'বিকাল', 'evening'); + assert.equal(moment([2011, 2, 23, 19, 30]).format('a'), 'বিকাল', 'late evening'); assert.equal(moment([2011, 2, 23, 21, 20]).format('a'), 'রাত', 'night'); assert.equal(moment([2011, 2, 23, 2, 30]).format('A'), 'রাত', 'before dawn'); assert.equal(moment([2011, 2, 23, 9, 30]).format('A'), 'সকাল', 'morning'); assert.equal(moment([2011, 2, 23, 14, 30]).format('A'), 'দুপুর', ' during day'); - assert.equal(moment([2011, 2, 23, 17, 30]).format('A'), 'বিকেল', 'evening'); - assert.equal(moment([2011, 2, 23, 19, 30]).format('A'), 'বিকেল', 'late evening'); + assert.equal(moment([2011, 2, 23, 17, 30]).format('A'), 'বিকাল', 'evening'); + assert.equal(moment([2011, 2, 23, 19, 30]).format('A'), 'বিকাল', 'late evening'); assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'রাত', 'night'); }); @@ -3414,8 +3441,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -3424,12 +3452,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -3447,8 +3477,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -3786,8 +3816,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -3796,12 +3827,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -3819,8 +3852,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -4098,8 +4131,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -4108,12 +4142,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -4131,8 +4167,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -4486,8 +4522,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -4496,12 +4533,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -4519,8 +4558,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -4842,8 +4881,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -4852,12 +4892,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -4875,8 +4917,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -4896,7 +4938,10 @@ test('parse', function (assert) { var tests = 'leden led_únor úno_březen bře_duben dub_květen kvě_červen čvn_červenec čvc_srpen srp_září zář_říjen říj_listopad lis_prosinec pro'.split('_'), i; function equalTest(input, mmm, monthIndex) { - assert.equal(moment(input, mmm).month(), monthIndex, input + ' should be month ' + (monthIndex + 1)); + assert.equal(moment(input, mmm).month(), monthIndex, input + ' ' + mmm + ' should be month ' + (monthIndex + 1)); + } + function equalTestStrict(input, mmm, monthIndex) { + assert.equal(moment(input, mmm, true).month(), monthIndex, input + ' ' + mmm + ' should be strict month ' + (monthIndex + 1)); } for (i = 0; i < 12; i++) { tests[i] = tests[i].split(' '); @@ -4908,6 +4953,13 @@ equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); + + equalTestStrict(tests[i][1], 'MMM', i); + equalTestStrict(tests[i][0], 'MMMM', i); + equalTestStrict(tests[i][1].toLocaleLowerCase(), 'MMM', i); + equalTestStrict(tests[i][1].toLocaleUpperCase(), 'MMM', i); + equalTestStrict(tests[i][0].toLocaleLowerCase(), 'MMMM', i); + equalTestStrict(tests[i][0].toLocaleUpperCase(), 'MMMM', i); } }); @@ -5285,8 +5337,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -5295,12 +5348,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -5318,8 +5373,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -5646,8 +5701,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -5656,12 +5712,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -5679,8 +5737,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -6000,8 +6058,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -6010,12 +6069,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -6033,8 +6094,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -6306,8 +6367,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -6316,12 +6378,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -6339,8 +6403,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -6505,12 +6569,12 @@ test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'Heute um 02:00 Uhr', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'Heute um 02:25 Uhr', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'Heute um 03:00 Uhr', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'Morgen um 02:00 Uhr', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'Heute um 01:00 Uhr', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'Gestern um 02:00 Uhr', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'heute um 02:00 Uhr', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'heute um 02:25 Uhr', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'heute um 03:00 Uhr', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'morgen um 02:00 Uhr', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'heute um 01:00 Uhr', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'gestern um 02:00 Uhr', 'yesterday at the same time'); }); test('calendar next week', function (assert) { @@ -6658,8 +6722,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -6668,12 +6733,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -6691,8 +6758,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -6856,12 +6923,12 @@ test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'Heute um 02:00 Uhr', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'Heute um 02:25 Uhr', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'Heute um 03:00 Uhr', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'Morgen um 02:00 Uhr', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'Heute um 01:00 Uhr', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'Gestern um 02:00 Uhr', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'heute um 02:00 Uhr', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'heute um 02:25 Uhr', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'heute um 03:00 Uhr', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'morgen um 02:00 Uhr', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'heute um 01:00 Uhr', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'gestern um 02:00 Uhr', 'yesterday at the same time'); }); test('calendar next week', function (assert) { @@ -7009,8 +7076,166 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + /*global QUnit:false*/ + + var test = QUnit.test; + + var expect = QUnit.expect; + + function module (name, lifecycle) { + QUnit.module(name, { + setup : function () { + moment.locale('en'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + function localeModule (name, lifecycle) { + QUnit.module('locale:' + name, { + setup : function () { + moment.locale(name); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + moment.locale('en'); + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + localeModule('dv'); + + test('parse', function (assert) { + var i, + tests = [ + 'ޖެނުއަރީ', + 'ފެބްރުއަރީ', + 'މާރިޗު', + 'އޭޕްރީލު', + 'މޭ', + 'ޖޫން', + 'ޖުލައި', + 'އޯގަސްޓު', + 'ސެޕްޓެމްބަރު', + 'އޮކްޓޯބަރު', + 'ނޮވެމްބަރު', + 'ޑިސެމްބަރު' + ]; + + function equalTest(input, mmm, i) { + assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); + } + + for (i = 0; i < 12; i++) { + equalTest(tests[i], 'MMM', i); + equalTest(tests[i], 'MMMM', i); + equalTest(tests[i].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i].toLocaleUpperCase(), 'MMMM', i); + } + }); + + test('format', function (assert) { + var a = [ + ['dddd, MMMM Do YYYY, h:mm:ss a', 'އާދިއްތަ، ފެބްރުއަރީ 14 2010، 3:25:50 މފ'], + ['ddd, hA', 'އާދިއްތަ، 3މފ'], + ['M Mo MM MMMM MMM', '2 2 02 ފެބްރުއަރީ ފެބްރުއަރީ'], + ['YYYY YY', '2010 10'], + ['D Do DD', '14 14 14'], + ['d do dddd ddd dd', '0 0 އާދިއްތަ އާދިއްތަ އާދި'], + ['DDD DDDo DDDD', '45 45 045'], + ['w wo ww', '8 8 08'], + ['h hh', '3 03'], + ['H HH', '15 15'], + ['m mm', '25 25'], + ['s ss', '50 50'], + ['a A', 'މފ މފ'], + ['LTS', '15:25:50'], + ['L', '14/2/2010'], + ['LL', '14 ފެބްރުއަރީ 2010'], + ['LLL', '14 ފެބްރުއަރީ 2010 15:25'], + ['LLLL', 'އާދިއްތަ 14 ފެބްރުއަރީ 2010 15:25'], + ['l', '14/2/2010'], + ['ll', '14 ފެބްރުއަރީ 2010'], + ['lll', '14 ފެބްރުއަރީ 2010 15:25'], + ['llll', 'އާދިއްތަ 14 ފެބްރުއަރީ 2010 15:25'] + ], + b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), + i; + + for (i = 0; i < a.length; i++) { + assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); + } + }); + + test('format month', function (assert) { + var i, + expected = [ + 'ޖެނުއަރީ', + 'ފެބްރުއަރީ', + 'މާރިޗު', + 'އޭޕްރީލު', + 'މޭ', + 'ޖޫން', + 'ޖުލައި', + 'އޯގަސްޓު', + 'ސެޕްޓެމްބަރު', + 'އޮކްޓޯބަރު', + 'ނޮވެމްބަރު', + 'ޑިސެމްބަރު' + ]; + + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, i, 1]).format('MMMM'), expected[i]); + } + }); + + test('format week', function (assert) { + var i, + expected = [ + 'އާދިއްތަ', + 'ހޯމަ', + 'އަންގާރަ', + 'ބުދަ', + 'ބުރާސްފަތި', + 'ހުކުރު', + 'ހޮނިހިރު' + ]; + + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, 0, 2 + i]).format('dddd'), expected[i]); + } + }); + +})); + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -7019,12 +7244,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -7042,8 +7269,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -7100,7 +7327,8 @@ ['10 Μ', 22, true], ['10 am', 10, false], ['10 pm', 10, false] - ]; + ], + parsed; // test that a formatted moment including meridiem string can be parsed back to the same moment assert.ok(b.isSame(moment(b.format('h:mm:ss a'), 'h:mm:ss a', 'el', true), 'seconds'), b.format('h:mm:ss a') + ' should be equal to ' + moment(b.format('h:mm:ss a'), 'h:mm:ss a', 'el', true).format('h:mm:ss a')); @@ -7109,8 +7337,11 @@ assert.ok(moment(b.format('h:mm:ss a'), 'h:mm:ss a', 'el', true).isValid(), b.format('h:mm:ss a') + ' should be parsed as valid'); for (i = 0; i < meridiemTests.length; i++) { - assert.equal(moment(meridiemTests[i][0], 'h a', 'el', true).hours(), meridiemTests[i][1], moment(meridiemTests[i][0], 'h a', 'el', true).hours() + ' should be ' + meridiemTests[i][1]); - assert.ok(moment(meridiemTests[i][0], 'h a', 'el', true).isValid() === meridiemTests[i][2], meridiemTests[i][0] + ' ----> ' + meridiemTests[i][2]); + parsed = moment(meridiemTests[i][0], 'h a', 'el', true); + assert.equal(parsed.isValid(), meridiemTests[i][2], 'validity for ' + meridiemTests[i][0]); + if (parsed.isValid()) { + assert.equal(parsed.hours(), meridiemTests[i][1], 'hours for ' + meridiemTests[i][0]); + } } }); @@ -7413,8 +7644,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -7423,12 +7655,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -7446,8 +7680,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -7760,8 +7994,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -7770,12 +8005,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -7793,8 +8030,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -8125,8 +8362,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -8135,12 +8373,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -8158,8 +8398,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -8481,8 +8721,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -8491,12 +8732,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -8514,8 +8757,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -8530,16 +8773,13 @@ }); } - localeModule('en'); + localeModule('en-ie'); test('parse', function (assert) { - var i, - tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split('_'); - + var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } - for (i = 0; i < 12; i++) { tests[i] = tests[i].split(' '); equalTest(tests[i][0], 'MMM', i); @@ -8562,26 +8802,25 @@ ['D Do DD', '14 14th 14'], ['d do dddd ddd dd', '0 0th Sunday Sun Su'], ['DDD DDDo DDDD', '45 45th 045'], - ['w wo ww', '8 8th 08'], + ['w wo ww', '6 6th 06'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], ['a A', 'pm PM'], ['[the] DDDo [day of the year]', 'the 45th day of the year'], - ['LTS', '3:25:50 PM'], - ['L', '02/14/2010'], - ['LL', 'February 14, 2010'], - ['LLL', 'February 14, 2010 3:25 PM'], - ['LLLL', 'Sunday, February 14, 2010 3:25 PM'], - ['l', '2/14/2010'], - ['ll', 'Feb 14, 2010'], - ['lll', 'Feb 14, 2010 3:25 PM'], - ['llll', 'Sun, Feb 14, 2010 3:25 PM'] + ['LTS', '15:25:50'], + ['L', '14-02-2010'], + ['LL', '14 February 2010'], + ['LLL', '14 February 2010 15:25'], + ['LLLL', 'Sunday 14 February 2010 15:25'], + ['l', '14-2-2010'], + ['ll', '14 Feb 2010'], + ['lll', '14 Feb 2010 15:25'], + ['llll', 'Sun 14 Feb 2010 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; - for (i = 0; i < a.length; i++) { assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); } @@ -8625,18 +8864,14 @@ }); test('format month', function (assert) { - var i, - expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split('_'); - + var expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var i, - expected = 'Sunday Sun Su_Monday Mon Mo_Tuesday Tue Tu_Wednesday Wed We_Thursday Thu Th_Friday Fri Fr_Saturday Sat Sa'.split('_'); - + var expected = 'Sunday Sun Su_Monday Mon Mo_Tuesday Tue Tu_Wednesday Wed We_Thursday Thu Th_Friday Fri Fr_Saturday Sat Sa'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -8644,7 +8879,6 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'a few seconds', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'a minute', '45 seconds = a minute'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'a minute', '89 seconds = a minute'); @@ -8692,17 +8926,16 @@ test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'Today at 2:00 AM', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'Today at 2:25 AM', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'Today at 3:00 AM', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'Tomorrow at 2:00 AM', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'Today at 1:00 AM', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'Yesterday at 2:00 AM', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'Today at 02:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'Today at 02:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'Today at 03:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'Tomorrow at 02:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'Today at 01:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'Yesterday at 02:00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; - for (i = 2; i < 7; i++) { m = moment().add({d: i}); assert.equal(m.calendar(), m.format('dddd [at] LT'), 'Today + ' + i + ' days current time'); @@ -8741,72 +8974,72 @@ }); test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); + assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); + assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); + assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); + assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); + assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); + assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); + assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); + assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); + assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); + assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); + assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); + assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); + assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); + assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); + assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); + assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); + assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); + assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); + assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); + assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); + assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); + assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); + assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); + assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); + assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); + assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); + assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); - test('weeks year starting sunday format', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1st', 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1st', 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2nd', 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2nd', 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3rd', 'Jan 15 2012 should be week 3'); + test('weeks year starting sunday formatted', function (assert) { + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52nd', 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1st', 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1st', 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2nd', 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2nd', 'Jan 15 2012 should be week 2'); }); test('lenient ordinal parsing', function (assert) { @@ -8847,8 +9080,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -8857,12 +9091,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -8880,8 +9116,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -8896,10 +9132,10 @@ }); } - localeModule('eo'); + localeModule('en-nz'); test('parse', function (assert) { - var tests = 'januaro jan_februaro feb_marto mar_aprilo apr_majo maj_junio jun_julio jul_aŭgusto aŭg_septembro sep_oktobro okt_novembro nov_decembro dec'.split('_'), i; + var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -8918,29 +9154,29 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss a', 'Dimanĉo, februaro 14a 2010, 3:25:50 p.t.m.'], - ['ddd, hA', 'Dim, 3P.T.M.'], - ['M Mo MM MMMM MMM', '2 2a 02 februaro feb'], + ['dddd, MMMM Do YYYY, h:mm:ss a', 'Sunday, February 14th 2010, 3:25:50 pm'], + ['ddd, hA', 'Sun, 3PM'], + ['M Mo MM MMMM MMM', '2 2nd 02 February Feb'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14a 14'], - ['d do dddd ddd dd', '0 0a Dimanĉo Dim Di'], - ['DDD DDDo DDDD', '45 45a 045'], - ['w wo ww', '7 7a 07'], + ['D Do DD', '14 14th 14'], + ['d do dddd ddd dd', '0 0th Sunday Sun Su'], + ['DDD DDDo DDDD', '45 45th 045'], + ['w wo ww', '6 6th 06'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], - ['a A', 'p.t.m. P.T.M.'], - ['[la] DDDo [tago] [de] [la] [jaro]', 'la 45a tago de la jaro'], - ['LTS', '15:25:50'], - ['L', '2010-02-14'], - ['LL', '14-an de februaro, 2010'], - ['LLL', '14-an de februaro, 2010 15:25'], - ['LLLL', 'Dimanĉo, la 14-an de februaro, 2010 15:25'], - ['l', '2010-2-14'], - ['ll', '14-an de feb, 2010'], - ['lll', '14-an de feb, 2010 15:25'], - ['llll', 'Dim, la 14-an de feb, 2010 15:25'] + ['a A', 'pm PM'], + ['[the] DDDo [day of the year]', 'the 45th day of the year'], + ['LTS', '3:25:50 PM'], + ['L', '14/02/2010'], + ['LL', '14 February 2010'], + ['LLL', '14 February 2010 3:25 PM'], + ['LLLL', 'Sunday, 14 February 2010 3:25 PM'], + ['l', '14/2/2010'], + ['ll', '14 Feb 2010'], + ['lll', '14 Feb 2010 3:25 PM'], + ['llll', 'Sun, 14 Feb 2010 3:25 PM'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -8950,51 +9186,51 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1a', '1a'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2a', '2a'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3a', '3a'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4a', '4a'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5a', '5a'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6a', '6a'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7a', '7a'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8a', '8a'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9a', '9a'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10a', '10a'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4th', '4th'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5th', '5th'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6th', '6th'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7th', '7th'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8th', '8th'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9th', '9th'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10th', '10th'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11a', '11a'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12a', '12a'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13a', '13a'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14a', '14a'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15a', '15a'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16a', '16a'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17a', '17a'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18a', '18a'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19a', '19a'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20a', '20a'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11th', '11th'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12th', '12th'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13th', '13th'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14th', '14th'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15th', '15th'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16th', '16th'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17th', '17th'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18th', '18th'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19th', '19th'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20th', '20th'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21a', '21a'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22a', '22a'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23a', '23a'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24a', '24a'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25a', '25a'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26a', '26a'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27a', '27a'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28a', '28a'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29a', '29a'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30a', '30a'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21st', '21st'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22nd', '22nd'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23rd', '23rd'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24th', '24th'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25th', '25th'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26th', '26th'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27th', '27th'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28th', '28th'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29th', '29th'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30th', '30th'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31a', '31a'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st'); }); test('format month', function (assert) { - var expected = 'januaro jan_februaro feb_marto mar_aprilo apr_majo maj_junio jun_julio jul_aŭgusto aŭg_septembro sep_oktobro okt_novembro nov_decembro dec'.split('_'), i; + var expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'Dimanĉo Dim Di_Lundo Lun Lu_Mardo Mard Ma_Merkredo Merk Me_Ĵaŭdo Ĵaŭ Ĵa_Vendredo Ven Ve_Sabato Sab Sa'.split('_'), i; + var expected = 'Sunday Sun Su_Monday Mon Mo_Tuesday Tue Tu_Wednesday Wed We_Thursday Thu Th_Friday Fri Fr_Saturday Sat Sa'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -9002,71 +9238,70 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'sekundoj', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'minuto', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'minuto', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutoj', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutoj', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'horo', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'horo', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 horoj', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 horoj', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 horoj', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'tago', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'tago', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 tagoj', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'tago', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 tagoj', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 tagoj', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'monato', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'monato', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'monato', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 monatoj', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 monatoj', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 monatoj', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'monato', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 monatoj', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'jaro', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 jaroj', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'jaro', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 jaroj', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'a few seconds', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'a minute', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'a minute', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutes', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutes', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'an hour', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'an hour', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 hours', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 hours', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 hours', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'a day', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'a day', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 days', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'a day', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 days', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 days', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'a month', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'a month', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'a month', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 months', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 months', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 months', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'a month', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 months', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'a year', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 years', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'a year', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 years', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'je sekundoj', 'je prefix'); - assert.equal(moment(0).from(30000), 'antaŭ sekundoj', 'antaŭ prefix'); + assert.equal(moment(30000).from(0), 'in a few seconds', 'prefix'); + assert.equal(moment(0).from(30000), 'a few seconds ago', 'suffix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'antaŭ sekundoj', 'now from now should display as in the past'); + assert.equal(moment().fromNow(), 'a few seconds ago', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'je sekundoj', 'je sekundoj'); - assert.equal(moment().add({d: 5}).fromNow(), 'je 5 tagoj', 'je 5 tagoj'); + assert.equal(moment().add({s: 30}).fromNow(), 'in a few seconds', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'in 5 days', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'Hodiaŭ je 02:00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'Hodiaŭ je 02:25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'Hodiaŭ je 03:00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'Morgaŭ je 02:00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'Hodiaŭ je 01:00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'Hieraŭ je 02:00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'Today at 2:00 AM', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'Today at 2:25 AM', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'Today at 3:00 AM', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'Tomorrow at 2:00 AM', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'Today at 1:00 AM', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'Yesterday at 2:00 AM', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; - for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd [je] LT'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [at] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [je] LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [at] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [je] LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [at] LT'), 'Today + ' + i + ' days end of day'); } }); @@ -9075,11 +9310,11 @@ for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('[pasinta] dddd [je] LT'), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('[Last] dddd [at] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[pasinta] dddd [je] LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[Last] dddd [at] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[pasinta] dddd [je] LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[Last] dddd [at] LT'), 'Today - ' + i + ' days end of day'); } }); @@ -9098,11 +9333,11 @@ }); test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); + assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); test('weeks year starting monday', function (assert) { @@ -9137,75 +9372,67 @@ assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); + assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); + assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); + assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); + assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); + assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); + assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); + assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); + assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); + assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); + assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); + assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); + assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); + assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1a', 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1a', 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2a', 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2a', 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3a', 'Jan 9 2012 should be week 3'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52nd', 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1st', 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1st', 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2nd', 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2nd', 'Jan 15 2012 should be week 2'); }); test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; + var i, ordinalStr, testStr; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); + testStr = moment(ordinalStr, 'YYYY MM Do').format('YYYY MM D'); + assert.equal(testStr, '2014 01 ' + i, 'lenient ordinal parsing ' + i); } }); test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; + var i, testStr; for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); + testStr = moment('2014 01 ' + i, 'YYYY MM Do').format('YYYY MM D'); + assert.equal(testStr, '2014 01 ' + i, + 'lenient ordinal parsing of number ' + i); } }); test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); + ordinalStr = moment([2014, 0, i]).format('YYYY MMM Do'); + testMoment = moment(ordinalStr, 'YYYY MMM Do', true); assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); } }); })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -9214,12 +9441,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -9237,8 +9466,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -9253,13 +9482,16 @@ }); } - localeModule('es'); + localeModule('en'); test('parse', function (assert) { - var tests = 'enero ene._febrero feb._marzo mar._abril abr._mayo may._junio jun._julio jul._agosto ago._septiembre sep._octubre oct._noviembre nov._diciembre dic.'.split('_'), i; + var i, + tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split('_'); + function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } + for (i = 0; i < 12; i++) { tests[i] = tests[i].split(' '); equalTest(tests[i][0], 'MMM', i); @@ -9275,84 +9507,88 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss a', 'Domingo, Febrero 14º 2010, 3:25:50 pm'], - ['ddd, hA', 'Dom., 3PM'], - ['M Mo MM MMMM MMM', '2 2º 02 Febrero Feb.'], + ['dddd, MMMM Do YYYY, h:mm:ss a', 'Sunday, February 14th 2010, 3:25:50 pm'], + ['ddd, hA', 'Sun, 3PM'], + ['M Mo MM MMMM MMM', '2 2nd 02 February Feb'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14º 14'], - ['d do dddd ddd dd', '0 0º Domingo Dom. Do'], - ['DDD DDDo DDDD', '45 45º 045'], - ['w wo ww', '6 6º 06'], - ['YYYY-MMM-DD', '2010-Feb-14'], + ['D Do DD', '14 14th 14'], + ['d do dddd ddd dd', '0 0th Sunday Sun Su'], + ['DDD DDDo DDDD', '45 45th 045'], + ['w wo ww', '8 8th 08'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], ['a A', 'pm PM'], - ['[the] DDDo [day of the year]', 'the 45º day of the year'], - ['LTS', '15:25:50'], - ['L', '14/02/2010'], - ['LL', '14 de Febrero de 2010'], - ['LLL', '14 de Febrero de 2010 15:25'], - ['LLLL', 'Domingo, 14 de Febrero de 2010 15:25'], - ['l', '14/2/2010'], - ['ll', '14 de Feb. de 2010'], - ['lll', '14 de Feb. de 2010 15:25'], - ['llll', 'Dom., 14 de Feb. de 2010 15:25'] + ['[the] DDDo [day of the year]', 'the 45th day of the year'], + ['LTS', '3:25:50 PM'], + ['L', '02/14/2010'], + ['LL', 'February 14, 2010'], + ['LLL', 'February 14, 2010 3:25 PM'], + ['LLLL', 'Sunday, February 14, 2010 3:25 PM'], + ['l', '2/14/2010'], + ['ll', 'Feb 14, 2010'], + ['lll', 'Feb 14, 2010 3:25 PM'], + ['llll', 'Sun, Feb 14, 2010 3:25 PM'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; + for (i = 0; i < a.length; i++) { assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); } }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4th', '4th'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5th', '5th'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6th', '6th'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7th', '7th'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8th', '8th'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9th', '9th'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10th', '10th'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11th', '11th'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12th', '12th'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13th', '13th'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14th', '14th'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15th', '15th'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16th', '16th'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17th', '17th'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18th', '18th'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19th', '19th'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20th', '20th'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21st', '21st'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22nd', '22nd'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23rd', '23rd'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24th', '24th'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25th', '25th'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26th', '26th'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27th', '27th'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28th', '28th'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29th', '29th'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30th', '30th'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st'); }); test('format month', function (assert) { - var expected = 'Enero Ene._Febrero Feb._Marzo Mar._Abril Abr._Mayo May._Junio Jun._Julio Jul._Agosto Ago._Septiembre Sep._Octubre Oct._Noviembre Nov._Diciembre Dic.'.split('_'), i; + var i, + expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split('_'); + for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'Domingo Dom. Do_Lunes Lun. Lu_Martes Mar. Ma_Miércoles Mié. Mi_Jueves Jue. Ju_Viernes Vie. Vi_Sábado Sáb. Sá'.split('_'), i; + var i, + expected = 'Sunday Sun Su_Monday Mon Mo_Tuesday Tue Tu_Wednesday Wed We_Thursday Thu Th_Friday Fri Fr_Saturday Sat Sa'.split('_'); + for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -9360,60 +9596,60 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'unos segundos', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'un minuto', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'un minuto', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutos', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutos', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'una hora', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'una hora', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 horas', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 horas', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 horas', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'un día', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'un día', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 días', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'un día', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 días', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 días', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'un mes', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'un mes', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'un mes', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 meses', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 meses', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 meses', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'un mes', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 meses', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'un año', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 años', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'un año', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 años', '5 years = 5 years'); + + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'a few seconds', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'a minute', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'a minute', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutes', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutes', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'an hour', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'an hour', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 hours', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 hours', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 hours', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'a day', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'a day', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 days', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'a day', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 days', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 days', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'a month', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'a month', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'a month', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 months', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 months', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 months', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'a month', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 months', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'a year', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 years', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'a year', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 years', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'en unos segundos', 'prefix'); - assert.equal(moment(0).from(30000), 'hace unos segundos', 'suffix'); + assert.equal(moment(30000).from(0), 'in a few seconds', 'prefix'); + assert.equal(moment(0).from(30000), 'a few seconds ago', 'suffix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'hace unos segundos', 'now from now should display as in the past'); + assert.equal(moment().fromNow(), 'a few seconds ago', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'en unos segundos', 'en unos segundos'); - assert.equal(moment().add({d: 5}).fromNow(), 'en 5 días', 'en 5 días'); + assert.equal(moment().add({s: 30}).fromNow(), 'in a few seconds', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'in 5 days', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'hoy a las 2:00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'hoy a las 2:25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'hoy a las 3:00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'mañana a las 2:00', 'tomorrow at the same time'); - assert.equal(moment(a).add({d: 1, h : -1}).calendar(), 'mañana a la 1:00', 'tomorrow minus 1 hour'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'hoy a la 1:00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'ayer a las 2:00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'Today at 2:00 AM', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'Today at 2:25 AM', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'Today at 3:00 AM', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'Tomorrow at 2:00 AM', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'Today at 1:00 AM', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'Yesterday at 2:00 AM', 'yesterday at the same time'); }); test('calendar next week', function (assert) { @@ -9421,11 +9657,11 @@ for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd [a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [at] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [at] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [at] LT'), 'Today + ' + i + ' days end of day'); } }); @@ -9434,11 +9670,11 @@ for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('[el] dddd [pasado a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('[Last] dddd [at] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[el] dddd [pasado a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[Last] dddd [at] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[el] dddd [pasado a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[Last] dddd [at] LT'), 'Today - ' + i + ' days end of day'); } }); @@ -9457,72 +9693,72 @@ }); test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); }); test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); + assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); + assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); }); test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); + assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); + assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); + assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); + assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); }); test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); + assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); + assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); + assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); + assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); }); test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); + assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); + assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); + assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); + assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); + }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); + assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); + assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); + assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); + assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); + assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); + assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); + assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); + assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); + assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); }); - test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52º', 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1º', 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1º', 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2º', 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2º', 'Jan 15 2012 should be week 2'); + test('weeks year starting sunday format', function (assert) { + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1st', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1st', 'Jan 7 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2nd', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2nd', 'Jan 14 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3rd', 'Jan 15 2012 should be week 3'); }); test('lenient ordinal parsing', function (assert) { @@ -9539,6 +9775,21 @@ } }); + test('weekdays strict parsing', function (assert) { + var m = moment('2015-01-01T12', moment.ISO_8601, true), + enLocale = moment.localeData('en'); + + for (var i = 0; i < 7; ++i) { + assert.equal(moment(enLocale.weekdays(m.day(i), ''), 'dddd', true).isValid(), true, 'parse weekday ' + i); + assert.equal(moment(enLocale.weekdaysShort(m.day(i), ''), 'ddd', true).isValid(), true, 'parse short weekday ' + i); + assert.equal(moment(enLocale.weekdaysMin(m.day(i), ''), 'dd', true).isValid(), true, 'parse min weekday ' + i); + + // negative tests + assert.equal(moment(enLocale.weekdaysMin(m.day(i), ''), 'ddd', true).isValid(), false, 'parse short weekday ' + i); + assert.equal(moment(enLocale.weekdaysShort(m.day(i), ''), 'dd', true).isValid(), false, 'parse min weekday ' + i); + } + }); + test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { @@ -9563,8 +9814,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -9573,12 +9825,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -9596,8 +9850,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -9612,12 +9866,12 @@ }); } - localeModule('et'); + localeModule('eo'); test('parse', function (assert) { - var tests = 'jaanuar jaan_veebruar veebr_märts märts_aprill apr_mai mai_juuni juuni_juuli juuli_august aug_september sept_oktoober okt_november nov_detsember dets'.split('_'), i; + var tests = 'januaro jan_februaro feb_marto mar_aprilo apr_majo maj_junio jun_julio jul_aŭgusto aŭg_septembro sep_oktobro okt_novembro nov_decembro dec'.split('_'), i; function equalTest(input, mmm, i) { - assert.equal(moment(input, mmm).month(), i, input + ' peaks olema kuu ' + (i + 1)); + assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } for (i = 0; i < 12; i++) { tests[i] = tests[i].split(' '); @@ -9634,29 +9888,29 @@ test('format', function (assert) { var a = [ - ['dddd, Do MMMM YYYY, H:mm:ss', 'pühapäev, 14. veebruar 2010, 15:25:50'], - ['ddd, h', 'P, 3'], - ['M Mo MM MMMM MMM', '2 2. 02 veebruar veebr'], - ['YYYY YY', '2010 10'], - ['D Do DD', '14 14. 14'], - ['d do dddd ddd dd', '0 0. pühapäev P P'], - ['DDD DDDo DDDD', '45 45. 045'], - ['w wo ww', '6 6. 06'], - ['h hh', '3 03'], - ['H HH', '15 15'], - ['m mm', '25 25'], - ['s ss', '50 50'], - ['a A', 'pm PM'], - ['[aasta] DDDo [päev]', 'aasta 45. päev'], - ['LTS', '15:25:50'], - ['L', '14.02.2010'], - ['LL', '14. veebruar 2010'], - ['LLL', '14. veebruar 2010 15:25'], - ['LLLL', 'pühapäev, 14. veebruar 2010 15:25'], - ['l', '14.2.2010'], - ['ll', '14. veebr 2010'], - ['lll', '14. veebr 2010 15:25'], - ['llll', 'P, 14. veebr 2010 15:25'] + ['dddd, MMMM Do YYYY, h:mm:ss a', 'Dimanĉo, februaro 14a 2010, 3:25:50 p.t.m.'], + ['ddd, hA', 'Dim, 3P.T.M.'], + ['M Mo MM MMMM MMM', '2 2a 02 februaro feb'], + ['YYYY YY', '2010 10'], + ['D Do DD', '14 14a 14'], + ['d do dddd ddd dd', '0 0a Dimanĉo Dim Di'], + ['DDD DDDo DDDD', '45 45a 045'], + ['w wo ww', '7 7a 07'], + ['h hh', '3 03'], + ['H HH', '15 15'], + ['m mm', '25 25'], + ['s ss', '50 50'], + ['a A', 'p.t.m. P.T.M.'], + ['[la] DDDo [tago] [de] [la] [jaro]', 'la 45a tago de la jaro'], + ['LTS', '15:25:50'], + ['L', '2010-02-14'], + ['LL', '14-an de februaro, 2010'], + ['LLL', '14-an de februaro, 2010 15:25'], + ['LLLL', 'Dimanĉo, la 14-an de februaro, 2010 15:25'], + ['l', '2010-2-14'], + ['ll', '14-an de feb, 2010'], + ['lll', '14-an de feb, 2010 15:25'], + ['llll', 'Dim, la 14-an de feb, 2010 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -9666,51 +9920,51 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1a', '1a'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2a', '2a'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3a', '3a'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4a', '4a'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5a', '5a'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6a', '6a'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7a', '7a'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8a', '8a'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9a', '9a'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10a', '10a'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11a', '11a'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12a', '12a'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13a', '13a'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14a', '14a'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15a', '15a'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16a', '16a'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17a', '17a'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18a', '18a'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19a', '19a'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20a', '20a'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21a', '21a'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22a', '22a'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23a', '23a'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24a', '24a'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25a', '25a'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26a', '26a'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27a', '27a'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28a', '28a'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29a', '29a'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30a', '30a'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31a', '31a'); }); test('format month', function (assert) { - var expected = 'jaanuar jaan_veebruar veebr_märts märts_aprill apr_mai mai_juuni juuni_juuli juuli_august aug_september sept_oktoober okt_november nov_detsember dets'.split('_'), i; + var expected = 'januaro jan_februaro feb_marto mar_aprilo apr_majo maj_junio jun_julio jul_aŭgusto aŭg_septembro sep_oktobro okt_novembro nov_decembro dec'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'pühapäev P P_esmaspäev E E_teisipäev T T_kolmapäev K K_neljapäev N N_reede R R_laupäev L L'.split('_'), i; + var expected = 'Dimanĉo Dim Di_Lundo Lun Lu_Mardo Mard Ma_Merkredo Merk Me_Ĵaŭdo Ĵaŭ Ĵa_Vendredo Ven Ve_Sabato Sab Sa'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -9718,106 +9972,84 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'paar sekundit', '44 seconds = paar sekundit'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'üks minut', '45 seconds = üks minut'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'üks minut', '89 seconds = üks minut'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutit', '90 seconds = 2 minutit'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutit', '44 minutes = 44 minutit'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'üks tund', '45 minutes = tund aega'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'üks tund', '89 minutes = üks tund'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 tundi', '90 minutes = 2 tundi'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 tundi', '5 hours = 5 tundi'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 tundi', '21 hours = 21 tundi'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'üks päev', '22 hours = üks päev'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'üks päev', '35 hours = üks päev'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 päeva', '36 hours = 2 päeva'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'üks päev', '1 day = üks päev'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 päeva', '5 days = 5 päeva'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 päeva', '25 days = 25 päeva'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'üks kuu', '26 days = üks kuu'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'üks kuu', '30 days = üks kuu'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'üks kuu', '43 days = üks kuu'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 kuud', '46 days = 2 kuud'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 kuud', '75 days = 2 kuud'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 kuud', '76 days = 3 kuud'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'üks kuu', '1 month = üks kuu'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 kuud', '5 months = 5 kuud'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'üks aasta', '345 days = üks aasta'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 aastat', '548 days = 2 aastat'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'üks aasta', '1 year = üks aasta'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 aastat', '5 years = 5 aastat'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'sekundoj', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'minuto', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'minuto', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutoj', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutoj', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'horo', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'horo', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 horoj', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 horoj', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 horoj', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'tago', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'tago', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 tagoj', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'tago', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 tagoj', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 tagoj', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'monato', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'monato', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'monato', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 monatoj', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 monatoj', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 monatoj', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'monato', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 monatoj', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'jaro', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 jaroj', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'jaro', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 jaroj', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'mõne sekundi pärast', 'prefix'); - assert.equal(moment(0).from(30000), 'mõni sekund tagasi', 'suffix'); + assert.equal(moment(30000).from(0), 'je sekundoj', 'je prefix'); + assert.equal(moment(0).from(30000), 'antaŭ sekundoj', 'antaŭ prefix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'mõni sekund tagasi', 'now from now should display as in the past'); + assert.equal(moment().fromNow(), 'antaŭ sekundoj', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'mõne sekundi pärast', 'in a few seconds'); - assert.equal(moment().subtract({s: 30}).fromNow(), 'mõni sekund tagasi', 'a few seconds ago'); - - assert.equal(moment().add({m: 1}).fromNow(), 'ühe minuti pärast', 'in a minute'); - assert.equal(moment().subtract({m: 1}).fromNow(), 'üks minut tagasi', 'a minute ago'); - - assert.equal(moment().add({m: 5}).fromNow(), '5 minuti pärast', 'in 5 minutes'); - assert.equal(moment().subtract({m: 5}).fromNow(), '5 minutit tagasi', '5 minutes ago'); - - assert.equal(moment().add({d: 1}).fromNow(), 'ühe päeva pärast', 'in one day'); - assert.equal(moment().subtract({d: 1}).fromNow(), 'üks päev tagasi', 'one day ago'); - - assert.equal(moment().add({d: 5}).fromNow(), '5 päeva pärast', 'in 5 days'); - assert.equal(moment().subtract({d: 5}).fromNow(), '5 päeva tagasi', '5 days ago'); - - assert.equal(moment().add({M: 1}).fromNow(), 'kuu aja pärast', 'in a month'); - assert.equal(moment().subtract({M: 1}).fromNow(), 'kuu aega tagasi', 'a month ago'); - - assert.equal(moment().add({M: 5}).fromNow(), '5 kuu pärast', 'in 5 months'); - assert.equal(moment().subtract({M: 5}).fromNow(), '5 kuud tagasi', '5 months ago'); - - assert.equal(moment().add({y: 1}).fromNow(), 'ühe aasta pärast', 'in a year'); - assert.equal(moment().subtract({y: 1}).fromNow(), 'aasta tagasi', 'a year ago'); - - assert.equal(moment().add({y: 5}).fromNow(), '5 aasta pärast', 'in 5 years'); - assert.equal(moment().subtract({y: 5}).fromNow(), '5 aastat tagasi', '5 years ago'); + assert.equal(moment().add({s: 30}).fromNow(), 'je sekundoj', 'je sekundoj'); + assert.equal(moment().add({d: 5}).fromNow(), 'je 5 tagoj', 'je 5 tagoj'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'Täna, 2:00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'Täna, 2:25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'Täna, 3:00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'Homme, 2:00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'Täna, 1:00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'Eile, 2:00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'Hodiaŭ je 02:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'Hodiaŭ je 02:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'Hodiaŭ je 03:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'Morgaŭ je 02:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'Hodiaŭ je 01:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'Hieraŭ je 02:00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; + for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('[Järgmine] dddd LT'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [je] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[Järgmine] dddd LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [je] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[Järgmine] dddd LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [je] LT'), 'Today + ' + i + ' days end of day'); } }); test('calendar last week', function (assert) { var i, m; + for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('[Eelmine] dddd LT'), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('[pasinta] dddd [je] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[Eelmine] dddd LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[pasinta] dddd [je] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[Eelmine] dddd LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[pasinta] dddd [je] LT'), 'Today - ' + i + ' days end of day'); } }); @@ -9825,22 +10057,22 @@ var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 nädal tagasi'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), '1 nädala pärast'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); weeksAgo = moment().subtract({w: 2}); weeksFromNow = moment().add({w: 2}); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 nädalat tagasi'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), '2 nädala pärast'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); + assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); test('weeks year starting monday', function (assert) { @@ -9875,33 +10107,33 @@ assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); + assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); + assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); + assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); + assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); + assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); + assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); + assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); + assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); + assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); + assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); + assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); + assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1a', 'Dec 26 2011 should be week 1'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1a', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2a', 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2a', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3a', 'Jan 9 2012 should be week 3'); }); test('lenient ordinal parsing', function (assert) { @@ -9942,8 +10174,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -9952,12 +10185,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -9975,8 +10210,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -9991,10 +10226,10 @@ }); } - localeModule('eu'); + localeModule('es'); test('parse', function (assert) { - var tests = 'urtarrila urt._otsaila ots._martxoa mar._apirila api._maiatza mai._ekaina eka._uztaila uzt._abuztua abu._iraila ira._urria urr._azaroa aza._abendua abe.'.split('_'), i; + var tests = 'enero ene._febrero feb._marzo mar._abril abr._mayo may._junio jun._julio jul._agosto ago._septiembre sep._octubre oct._noviembre nov._diciembre dic.'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -10013,29 +10248,30 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss a', 'igandea, otsaila 14. 2010, 3:25:50 pm'], - ['ddd, hA', 'ig., 3PM'], - ['M Mo MM MMMM MMM', '2 2. 02 otsaila ots.'], + ['dddd, MMMM Do YYYY, h:mm:ss a', 'domingo, febrero 14º 2010, 3:25:50 pm'], + ['ddd, hA', 'dom., 3PM'], + ['M Mo MM MMMM MMM', '2 2º 02 febrero feb.'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14. 14'], - ['d do dddd ddd dd', '0 0. igandea ig. ig'], - ['DDD DDDo DDDD', '45 45. 045'], - ['w wo ww', '7 7. 07'], + ['D Do DD', '14 14º 14'], + ['d do dddd ddd dd', '0 0º domingo dom. do'], + ['DDD DDDo DDDD', '45 45º 045'], + ['w wo ww', '6 6º 06'], + ['YYYY-MMM-DD', '2010-feb-14'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], ['a A', 'pm PM'], - ['[the] DDDo [day of the year]', 'the 45. day of the year'], + ['[the] DDDo [day of the year]', 'the 45º day of the year'], ['LTS', '15:25:50'], - ['L', '2010-02-14'], - ['LL', '2010ko otsailaren 14a'], - ['LLL', '2010ko otsailaren 14a 15:25'], - ['LLLL', 'igandea, 2010ko otsailaren 14a 15:25'], - ['l', '2010-2-14'], - ['ll', '2010ko ots. 14a'], - ['lll', '2010ko ots. 14a 15:25'], - ['llll', 'ig., 2010ko ots. 14a 15:25'] + ['L', '14/02/2010'], + ['LL', '14 de febrero de 2010'], + ['LLL', '14 de febrero de 2010 15:25'], + ['LLLL', 'domingo, 14 de febrero de 2010 15:25'], + ['l', '14/2/2010'], + ['ll', '14 de feb. de 2010'], + ['lll', '14 de feb. de 2010 15:25'], + ['llll', 'dom., 14 de feb. de 2010 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -10045,51 +10281,51 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º'); }); test('format month', function (assert) { - var expected = 'urtarrila urt._otsaila ots._martxoa mar._apirila api._maiatza mai._ekaina eka._uztaila uzt._abuztua abu._iraila ira._urria urr._azaroa aza._abendua abe.'.split('_'), i; + var expected = 'enero ene._febrero feb._marzo mar._abril abr._mayo may._junio jun._julio jul._agosto ago._septiembre sep._octubre oct._noviembre nov._diciembre dic.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'igandea ig. ig_astelehena al. al_asteartea ar. ar_asteazkena az. az_osteguna og. og_ostirala ol. ol_larunbata lr. lr'.split('_'), i; + var expected = 'domingo dom. do_lunes lun. lu_martes mar. ma_miércoles mié. mi_jueves jue. ju_viernes vie. vi_sábado sáb. sá'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -10097,82 +10333,85 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'segundo batzuk', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'minutu bat', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'minutu bat', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutu', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutu', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'ordu bat', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'ordu bat', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 ordu', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 ordu', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 ordu', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'egun bat', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'egun bat', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 egun', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'egun bat', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 egun', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 egun', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'hilabete bat', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'hilabete bat', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'hilabete bat', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 hilabete', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 hilabete', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 hilabete', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'hilabete bat', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 hilabete', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'urte bat', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 urte', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'urte bat', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 urte', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'unos segundos', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'un minuto', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'un minuto', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutos', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutos', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'una hora', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'una hora', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 horas', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 horas', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 horas', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'un día', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'un día', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 días', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'un día', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 días', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 días', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'un mes', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'un mes', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'un mes', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 meses', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 meses', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 meses', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'un mes', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 meses', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'un año', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 años', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'un año', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 años', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'segundo batzuk barru', 'prefix'); - assert.equal(moment(0).from(30000), 'duela segundo batzuk', 'suffix'); + assert.equal(moment(30000).from(0), 'en unos segundos', 'prefix'); + assert.equal(moment(0).from(30000), 'hace unos segundos', 'suffix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'duela segundo batzuk', 'now from now should display as in the past'); + assert.equal(moment().fromNow(), 'hace unos segundos', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'segundo batzuk barru', 'in seconds'); - assert.equal(moment().add({d: 5}).fromNow(), '5 egun barru', 'in 5 days'); + assert.equal(moment().add({s: 30}).fromNow(), 'en unos segundos', 'en unos segundos'); + assert.equal(moment().add({d: 5}).fromNow(), 'en 5 días', 'en 5 días'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'gaur 02:00etan', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'gaur 02:25etan', 'now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'gaur 03:00etan', 'now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'bihar 02:00etan', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'gaur 01:00etan', 'now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'atzo 02:00etan', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'hoy a las 2:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'hoy a las 2:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'hoy a las 3:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'mañana a las 2:00', 'tomorrow at the same time'); + assert.equal(moment(a).add({d: 1, h : -1}).calendar(), 'mañana a la 1:00', 'tomorrow minus 1 hour'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'hoy a la 1:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'ayer a las 2:00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; + for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd LT[etan]'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd LT[etan]'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd LT[etan]'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), 'Today + ' + i + ' days end of day'); } }); test('calendar last week', function (assert) { var i, m; + for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('[aurreko] dddd LT[etan]'), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('[el] dddd [pasado a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[aurreko] dddd LT[etan]'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[el] dddd [pasado a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[aurreko] dddd LT[etan]'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[el] dddd [pasado a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), 'Today - ' + i + ' days end of day'); } }); @@ -10191,11 +10430,11 @@ }); test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); + assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); test('weeks year starting monday', function (assert) { @@ -10230,33 +10469,33 @@ assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); + assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); + assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); + assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); + assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); + assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); + assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); + assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); + assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); + assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); + assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); + assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); + assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); + assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1.', 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2.', 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2.', 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52º', 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1º', 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1º', 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2º', 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2º', 'Jan 15 2012 should be week 2'); }); test('lenient ordinal parsing', function (assert) { @@ -10297,8 +10536,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -10307,12 +10547,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -10330,8 +10572,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -10346,44 +10588,51 @@ }); } - localeModule('fa'); + localeModule('et'); test('parse', function (assert) { - var tests = 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'), i; + var tests = 'jaanuar jaan_veebruar veebr_märts märts_aprill apr_mai mai_juuni juuni_juuli juuli_august aug_september sept_oktoober okt_november nov_detsember dets'.split('_'), i; function equalTest(input, mmm, i) { - assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1) + ' instead is month ' + moment(input, mmm).month()); + assert.equal(moment(input, mmm).month(), i, input + ' peaks olema kuu ' + (i + 1)); } for (i = 0; i < 12; i++) { - equalTest(tests[i], 'MMM', i); - equalTest(tests[i], 'MMMM', i); + tests[i] = tests[i].split(' '); + equalTest(tests[i][0], 'MMM', i); + equalTest(tests[i][1], 'MMM', i); + equalTest(tests[i][0], 'MMMM', i); + equalTest(tests[i][1], 'MMMM', i); + equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); } }); test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss a', 'یک\u200cشنبه، فوریه ۱۴م ۲۰۱۰، ۳:۲۵:۵۰ بعد از ظهر'], - ['ddd, hA', 'یک\u200cشنبه، ۳بعد از ظهر'], - ['M Mo MM MMMM MMM', '۲ ۲م ۰۲ فوریه فوریه'], - ['YYYY YY', '۲۰۱۰ ۱۰'], - ['D Do DD', '۱۴ ۱۴م ۱۴'], - ['d do dddd ddd dd', '۰ ۰م یک\u200cشنبه یک\u200cشنبه ی'], - ['DDD DDDo DDDD', '۴۵ ۴۵م ۰۴۵'], - ['w wo ww', '۸ ۸م ۰۸'], - ['h hh', '۳ ۰۳'], - ['H HH', '۱۵ ۱۵'], - ['m mm', '۲۵ ۲۵'], - ['s ss', '۵۰ ۵۰'], - ['a A', 'بعد از ظهر بعد از ظهر'], - ['DDDo [روز سال]', '۴۵م روز سال'], - ['LTS', '۱۵:۲۵:۵۰'], - ['L', '۱۴/۰۲/۲۰۱۰'], - ['LL', '۱۴ فوریه ۲۰۱۰'], - ['LLL', '۱۴ فوریه ۲۰۱۰ ۱۵:۲۵'], - ['LLLL', 'یک\u200cشنبه، ۱۴ فوریه ۲۰۱۰ ۱۵:۲۵'], - ['l', '۱۴/۲/۲۰۱۰'], - ['ll', '۱۴ فوریه ۲۰۱۰'], - ['lll', '۱۴ فوریه ۲۰۱۰ ۱۵:۲۵'], - ['llll', 'یک\u200cشنبه، ۱۴ فوریه ۲۰۱۰ ۱۵:۲۵'] + ['dddd, Do MMMM YYYY, H:mm:ss', 'pühapäev, 14. veebruar 2010, 15:25:50'], + ['ddd, h', 'P, 3'], + ['M Mo MM MMMM MMM', '2 2. 02 veebruar veebr'], + ['YYYY YY', '2010 10'], + ['D Do DD', '14 14. 14'], + ['d do dddd ddd dd', '0 0. pühapäev P P'], + ['DDD DDDo DDDD', '45 45. 045'], + ['w wo ww', '6 6. 06'], + ['h hh', '3 03'], + ['H HH', '15 15'], + ['m mm', '25 25'], + ['s ss', '50 50'], + ['a A', 'pm PM'], + ['[aasta] DDDo [päev]', 'aasta 45. päev'], + ['LTS', '15:25:50'], + ['L', '14.02.2010'], + ['LL', '14. veebruar 2010'], + ['LLL', '14. veebruar 2010 15:25'], + ['LLLL', 'pühapäev, 14. veebruar 2010 15:25'], + ['l', '14.2.2010'], + ['ll', '14. veebr 2010'], + ['lll', '14. veebr 2010 15:25'], + ['llll', 'P, 14. veebr 2010 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -10393,51 +10642,51 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '۱م', '1'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '۲م', '2'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '۳م', '3'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '۴م', '4'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '۵م', '5'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '۶م', '6'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '۷م', '7'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '۸م', '8'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '۹م', '9'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '۱۰م', '10'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '۱۱م', '11'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '۱۲م', '12'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '۱۳م', '13'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '۱۴م', '14'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '۱۵م', '15'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '۱۶م', '16'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '۱۷م', '17'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '۱۸م', '18'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '۱۹م', '19'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '۲۰م', '20'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '۲۱م', '21'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '۲۲م', '22'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '۲۳م', '23'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '۲۴م', '24'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '۲۵م', '25'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '۲۶م', '26'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '۲۷م', '27'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '۲۸م', '28'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '۲۹م', '29'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '۳۰م', '30'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '۳۱م', '31'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); test('format month', function (assert) { - var expected = 'ژانویه ژانویه_فوریه فوریه_مارس مارس_آوریل آوریل_مه مه_ژوئن ژوئن_ژوئیه ژوئیه_اوت اوت_سپتامبر سپتامبر_اکتبر اکتبر_نوامبر نوامبر_دسامبر دسامبر'.split('_'), i; + var expected = 'jaanuar jaan_veebruar veebr_märts märts_aprill apr_mai mai_juuni juuni_juuli juuli_august aug_september sept_oktoober okt_november nov_detsember dets'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'یک\u200cشنبه یک\u200cشنبه ی_دوشنبه دوشنبه د_سه\u200cشنبه سه\u200cشنبه س_چهارشنبه چهارشنبه چ_پنج\u200cشنبه پنج\u200cشنبه پ_جمعه جمعه ج_شنبه شنبه ش'.split('_'), i; + var expected = 'pühapäev P P_esmaspäev E E_teisipäev T T_kolmapäev K K_neljapäev N N_reede R R_laupäev L L'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -10445,70 +10694,94 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'چندین ثانیه', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'یک دقیقه', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'یک دقیقه', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '۲ دقیقه', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '۴۴ دقیقه', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'یک ساعت', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'یک ساعت', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '۲ ساعت', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '۵ ساعت', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '۲۱ ساعت', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'یک روز', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'یک روز', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '۲ روز', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'یک روز', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '۵ روز', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '۲۵ روز', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'یک ماه', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'یک ماه', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'یک ماه', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '۲ ماه', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '۲ ماه', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '۳ ماه', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'یک ماه', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '۵ ماه', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'یک سال', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '۲ سال', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'یک سال', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '۵ سال', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'paar sekundit', '44 seconds = paar sekundit'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'üks minut', '45 seconds = üks minut'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'üks minut', '89 seconds = üks minut'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutit', '90 seconds = 2 minutit'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutit', '44 minutes = 44 minutit'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'üks tund', '45 minutes = tund aega'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'üks tund', '89 minutes = üks tund'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 tundi', '90 minutes = 2 tundi'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 tundi', '5 hours = 5 tundi'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 tundi', '21 hours = 21 tundi'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'üks päev', '22 hours = üks päev'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'üks päev', '35 hours = üks päev'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 päeva', '36 hours = 2 päeva'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'üks päev', '1 day = üks päev'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 päeva', '5 days = 5 päeva'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 päeva', '25 days = 25 päeva'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'üks kuu', '26 days = üks kuu'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'üks kuu', '30 days = üks kuu'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'üks kuu', '43 days = üks kuu'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 kuud', '46 days = 2 kuud'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 kuud', '75 days = 2 kuud'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 kuud', '76 days = 3 kuud'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'üks kuu', '1 month = üks kuu'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 kuud', '5 months = 5 kuud'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'üks aasta', '345 days = üks aasta'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 aastat', '548 days = 2 aastat'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'üks aasta', '1 year = üks aasta'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 aastat', '5 years = 5 aastat'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'در چندین ثانیه', 'prefix'); - assert.equal(moment(0).from(30000), 'چندین ثانیه پیش', 'suffix'); + assert.equal(moment(30000).from(0), 'mõne sekundi pärast', 'prefix'); + assert.equal(moment(0).from(30000), 'mõni sekund tagasi', 'suffix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'چندین ثانیه پیش', 'now from now should display as in the past'); + assert.equal(moment().fromNow(), 'mõni sekund tagasi', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'در چندین ثانیه', 'in a few seconds'); - assert.equal(moment().add({d: 5}).fromNow(), 'در ۵ روز', 'in 5 days'); + assert.equal(moment().add({s: 30}).fromNow(), 'mõne sekundi pärast', 'in a few seconds'); + assert.equal(moment().subtract({s: 30}).fromNow(), 'mõni sekund tagasi', 'a few seconds ago'); + + assert.equal(moment().add({m: 1}).fromNow(), 'ühe minuti pärast', 'in a minute'); + assert.equal(moment().subtract({m: 1}).fromNow(), 'üks minut tagasi', 'a minute ago'); + + assert.equal(moment().add({m: 5}).fromNow(), '5 minuti pärast', 'in 5 minutes'); + assert.equal(moment().subtract({m: 5}).fromNow(), '5 minutit tagasi', '5 minutes ago'); + + assert.equal(moment().add({d: 1}).fromNow(), 'ühe päeva pärast', 'in one day'); + assert.equal(moment().subtract({d: 1}).fromNow(), 'üks päev tagasi', 'one day ago'); + + assert.equal(moment().add({d: 5}).fromNow(), '5 päeva pärast', 'in 5 days'); + assert.equal(moment().subtract({d: 5}).fromNow(), '5 päeva tagasi', '5 days ago'); + + assert.equal(moment().add({M: 1}).fromNow(), 'kuu aja pärast', 'in a month'); + assert.equal(moment().subtract({M: 1}).fromNow(), 'kuu aega tagasi', 'a month ago'); + + assert.equal(moment().add({M: 5}).fromNow(), '5 kuu pärast', 'in 5 months'); + assert.equal(moment().subtract({M: 5}).fromNow(), '5 kuud tagasi', '5 months ago'); + + assert.equal(moment().add({y: 1}).fromNow(), 'ühe aasta pärast', 'in a year'); + assert.equal(moment().subtract({y: 1}).fromNow(), 'aasta tagasi', 'a year ago'); + + assert.equal(moment().add({y: 5}).fromNow(), '5 aasta pärast', 'in 5 years'); + assert.equal(moment().subtract({y: 5}).fromNow(), '5 aastat tagasi', '5 years ago'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'امروز ساعت ۰۲:۰۰', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'امروز ساعت ۰۲:۲۵', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'امروز ساعت ۰۳:۰۰', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'فردا ساعت ۰۲:۰۰', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'امروز ساعت ۰۱:۰۰', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'دیروز ساعت ۰۲:۰۰', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'Täna, 2:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'Täna, 2:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'Täna, 3:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'Homme, 2:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'Täna, 1:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'Eile, 2:00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd [ساعت] LT'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('[Järgmine] dddd LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [ساعت] LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[Järgmine] dddd LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [ساعت] LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[Järgmine] dddd LT'), 'Today + ' + i + ' days end of day'); } }); @@ -10516,11 +10789,11 @@ var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('dddd [پیش ساعت] LT'), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('[Eelmine] dddd LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [پیش ساعت] LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[Eelmine] dddd LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [پیش ساعت] LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[Eelmine] dddd LT'), 'Today - ' + i + ' days end of day'); } }); @@ -10528,81 +10801,83 @@ var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 nädal tagasi'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), '1 nädala pärast'); weeksAgo = moment().subtract({w: 2}); weeksFromNow = moment().add({w: 2}); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 nädalat tagasi'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), '2 nädala pärast'); }); test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 31]).week(), 1, 'Dec 31 2011 should be week 1'); - assert.equal(moment([2012, 0, 6]).week(), 1, 'Jan 6 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 2, 'Jan 7 2012 should be week 2'); - assert.equal(moment([2012, 0, 13]).week(), 2, 'Jan 13 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 3, 'Jan 14 2012 should be week 3'); + assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 30]).week(), 1, 'Dec 30 2006 should be week 1'); - assert.equal(moment([2007, 0, 5]).week(), 1, 'Jan 5 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 2, 'Jan 6 2007 should be week 2'); - assert.equal(moment([2007, 0, 12]).week(), 2, 'Jan 12 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 3, 'Jan 13 2007 should be week 3'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); + assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); + assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 1, 'Dec 29 2007 should be week 1'); + assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 4]).week(), 1, 'Jan 4 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 2, 'Jan 5 2008 should be week 2'); - assert.equal(moment([2008, 0, 11]).week(), 2, 'Jan 11 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 3, 'Jan 12 2008 should be week 3'); + assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); + assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); + assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 28]).week(), 1, 'Dec 28 2002 should be week 1'); + assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 3]).week(), 1, 'Jan 3 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 2, 'Jan 4 2003 should be week 2'); - assert.equal(moment([2003, 0, 10]).week(), 2, 'Jan 10 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 3, 'Jan 11 2003 should be week 3'); + assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); + assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); + assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 27]).week(), 1, 'Dec 27 2008 should be week 1'); + assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 2]).week(), 1, 'Jan 2 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 2, 'Jan 3 2009 should be week 2'); - assert.equal(moment([2009, 0, 9]).week(), 2, 'Jan 9 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 3, 'Jan 10 2009 should be week 3'); + assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); + assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); + assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 26]).week(), 1, 'Dec 26 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 2, 'Jan 2 2010 should be week 2'); - assert.equal(moment([2010, 0, 8]).week(), 2, 'Jan 8 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 3, 'Jan 9 2010 should be week 3'); + assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); + assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); + assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); + assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); + assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); + assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 7]).week(), 1, 'Jan 7 2011 should be week 1'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 14]).week(), 2, 'Jan 14 2011 should be week 2'); - assert.equal(moment([2011, 0, 15]).week(), 3, 'Jan 15 2011 should be week 3'); + assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); + assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); + assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); + assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); + assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); + assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2011, 11, 31]).format('w ww wo'), '۱ ۰۱ ۱م', 'Dec 31 2011 should be week 1'); - assert.equal(moment([2012, 0, 6]).format('w ww wo'), '۱ ۰۱ ۱م', 'Jan 6 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).format('w ww wo'), '۲ ۰۲ ۲م', 'Jan 7 2012 should be week 2'); - assert.equal(moment([2012, 0, 13]).format('w ww wo'), '۲ ۰۲ ۲م', 'Jan 13 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).format('w ww wo'), '۳ ۰۳ ۳م', 'Jan 14 2012 should be week 3'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); test('lenient ordinal parsing', function (assert) { @@ -10643,8 +10918,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -10653,12 +10929,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -10676,8 +10954,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -10692,10 +10970,10 @@ }); } - localeModule('fi'); + localeModule('eu'); test('parse', function (assert) { - var tests = 'tammikuu tammi_helmikuu helmi_maaliskuu maalis_huhtikuu huhti_toukokuu touko_kesäkuu kesä_heinäkuu heinä_elokuu elo_syyskuu syys_lokakuu loka_marraskuu marras_joulukuu joulu'.split('_'), i; + var tests = 'urtarrila urt._otsaila ots._martxoa mar._apirila api._maiatza mai._ekaina eka._uztaila uzt._abuztua abu._iraila ira._urria urr._azaroa aza._abendua abe.'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -10714,29 +10992,29 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss a', 'sunnuntai, helmikuu 14. 2010, 3:25:50 pm'], - ['ddd, hA', 'su, 3PM'], - ['M Mo MM MMMM MMM', '2 2. 02 helmikuu helmi'], + ['dddd, MMMM Do YYYY, h:mm:ss a', 'igandea, otsaila 14. 2010, 3:25:50 pm'], + ['ddd, hA', 'ig., 3PM'], + ['M Mo MM MMMM MMM', '2 2. 02 otsaila ots.'], ['YYYY YY', '2010 10'], ['D Do DD', '14 14. 14'], - ['d do dddd ddd dd', '0 0. sunnuntai su su'], + ['d do dddd ddd dd', '0 0. igandea ig. ig'], ['DDD DDDo DDDD', '45 45. 045'], - ['w wo ww', '6 6. 06'], + ['w wo ww', '7 7. 07'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], ['a A', 'pm PM'], - ['[vuoden] DDDo [päivä]', 'vuoden 45. päivä'], - ['LTS', '15.25.50'], - ['L', '14.02.2010'], - ['LL', '14. helmikuuta 2010'], - ['LLL', '14. helmikuuta 2010, klo 15.25'], - ['LLLL', 'sunnuntai, 14. helmikuuta 2010, klo 15.25'], - ['l', '14.2.2010'], - ['ll', '14. helmi 2010'], - ['lll', '14. helmi 2010, klo 15.25'], - ['llll', 'su, 14. helmi 2010, klo 15.25'] + ['[the] DDDo [day of the year]', 'the 45. day of the year'], + ['LTS', '15:25:50'], + ['L', '2010-02-14'], + ['LL', '2010ko otsailaren 14a'], + ['LLL', '2010ko otsailaren 14a 15:25'], + ['LLLL', 'igandea, 2010ko otsailaren 14a 15:25'], + ['l', '2010-2-14'], + ['ll', '2010ko ots. 14a'], + ['lll', '2010ko ots. 14a 15:25'], + ['llll', 'ig., 2010ko ots. 14a 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -10746,51 +11024,51 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1st'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2nd'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3rd'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4th'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5th'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6th'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7th'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8th'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9th'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10th'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11th'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12th'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13th'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14th'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15th'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16th'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17th'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18th'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19th'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20th'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21st'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22nd'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23rd'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24th'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25th'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26th'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27th'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28th'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29th'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30th'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31st'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); test('format month', function (assert) { - var expected = 'tammikuu tammi_helmikuu helmi_maaliskuu maalis_huhtikuu huhti_toukokuu touko_kesäkuu kesä_heinäkuu heinä_elokuu elo_syyskuu syys_lokakuu loka_marraskuu marras_joulukuu joulu'.split('_'), i; + var expected = 'urtarrila urt._otsaila ots._martxoa mar._apirila api._maiatza mai._ekaina eka._uztaila uzt._abuztua abu._iraila ira._urria urr._azaroa aza._abendua abe.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'sunnuntai su su_maanantai ma ma_tiistai ti ti_keskiviikko ke ke_torstai to to_perjantai pe pe_lauantai la la'.split('_'), i; + var expected = 'igandea ig. ig_astelehena al. al_asteartea ar. ar_asteazkena az. az_osteguna og. og_ostirala ol. ol_larunbata lr. lr'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -10798,71 +11076,70 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'muutama sekunti', '44 seconds = few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'minuutti', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'minuutti', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), 'kaksi minuuttia', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minuuttia', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'tunti', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'tunti', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), 'kaksi tuntia', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), 'viisi tuntia', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 tuntia', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'päivä', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'päivä', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), 'kaksi päivää', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'päivä', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), 'viisi päivää', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 päivää', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'kuukausi', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'kuukausi', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'kuukausi', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), 'kaksi kuukautta', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), 'kaksi kuukautta', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), 'kolme kuukautta', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'kuukausi', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), 'viisi kuukautta', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'vuosi', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), 'kaksi vuotta', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'vuosi', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), 'viisi vuotta', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'segundo batzuk', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'minutu bat', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'minutu bat', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutu', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutu', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'ordu bat', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'ordu bat', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 ordu', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 ordu', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 ordu', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'egun bat', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'egun bat', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 egun', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'egun bat', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 egun', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 egun', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'hilabete bat', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'hilabete bat', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'hilabete bat', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 hilabete', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 hilabete', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 hilabete', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'hilabete bat', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 hilabete', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'urte bat', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 urte', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'urte bat', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 urte', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'muutaman sekunnin päästä', 'prefix'); - assert.equal(moment(0).from(30000), 'muutama sekunti sitten', 'suffix'); + assert.equal(moment(30000).from(0), 'segundo batzuk barru', 'prefix'); + assert.equal(moment(0).from(30000), 'duela segundo batzuk', 'suffix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'muutama sekunti sitten', 'now from now should display as in the past'); + assert.equal(moment().fromNow(), 'duela segundo batzuk', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'muutaman sekunnin päästä', 'in a few seconds'); - assert.equal(moment().add({d: 5}).fromNow(), 'viiden päivän päästä', 'in 5 days'); + assert.equal(moment().add({s: 30}).fromNow(), 'segundo batzuk barru', 'in seconds'); + assert.equal(moment().add({d: 5}).fromNow(), '5 egun barru', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'tänään klo 02.00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'tänään klo 02.25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'tänään klo 03.00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'huomenna klo 02.00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'tänään klo 01.00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'eilen klo 02.00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'gaur 02:00etan', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'gaur 02:25etan', 'now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'gaur 03:00etan', 'now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'bihar 02:00etan', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'gaur 01:00etan', 'now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'atzo 02:00etan', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; - for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd [klo] LT'), 'today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd LT[etan]'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [klo] LT'), 'today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd LT[etan]'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [klo] LT'), 'today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd LT[etan]'), 'Today + ' + i + ' days end of day'); } }); @@ -10870,11 +11147,11 @@ var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('[viime] dddd[na] [klo] LT'), 'today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('[aurreko] dddd LT[etan]'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[viime] dddd[na] [klo] LT'), 'today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[aurreko] dddd LT[etan]'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[viime] dddd[na] [klo] LT'), 'today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[aurreko] dddd LT[etan]'), 'Today - ' + i + ' days end of day'); } }); @@ -10882,22 +11159,22 @@ var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), 'yksi viikko sitten'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'yhden viikon päästä'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); weeksAgo = moment().subtract({w: 2}); weeksFromNow = moment().add({w: 2}); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), 'kaksi viikkoa sitten'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'kaden viikon päästä'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); + assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); test('weeks year starting monday', function (assert) { @@ -10932,33 +11209,33 @@ assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); + assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); + assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); + assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); + assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); + assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); + assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); + assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); + assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); + assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); + assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); + assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); + assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1.', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2.', 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2.', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3'); }); test('lenient ordinal parsing', function (assert) { @@ -10999,8 +11276,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -11009,12 +11287,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -11032,8 +11312,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -11048,51 +11328,44 @@ }); } - localeModule('fo'); + localeModule('fa'); test('parse', function (assert) { - var tests = 'januar jan_februar feb_mars mar_apríl apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split('_'), i; + var tests = 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'), i; function equalTest(input, mmm, i) { - assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); + assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1) + ' instead is month ' + moment(input, mmm).month()); } for (i = 0; i < 12; i++) { - tests[i] = tests[i].split(' '); - equalTest(tests[i][0], 'MMM', i); - equalTest(tests[i][1], 'MMM', i); - equalTest(tests[i][0], 'MMMM', i); - equalTest(tests[i][1], 'MMMM', i); - equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i); - equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); - equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); - equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); + equalTest(tests[i], 'MMM', i); + equalTest(tests[i], 'MMMM', i); } }); test('format', function (assert) { var a = [ - ['dddd [tann] Do MMMM YYYY, h:mm:ss a', 'sunnudagur tann 14. februar 2010, 3:25:50 pm'], - ['ddd hA', 'sun 3PM'], - ['M Mo MM MMMM MMM', '2 2. 02 februar feb'], - ['YYYY YY', '2010 10'], - ['D Do DD', '14 14. 14'], - ['d do dddd ddd dd', '0 0. sunnudagur sun su'], - ['DDD DDDo DDDD', '45 45. 045'], - ['w wo ww', '6 6. 06'], - ['h hh', '3 03'], - ['H HH', '15 15'], - ['m mm', '25 25'], - ['s ss', '50 50'], - ['a A', 'pm PM'], - ['[tann] DDDo [dagin á árinum]', 'tann 45. dagin á árinum'], - ['LTS', '15:25:50'], - ['L', '14/02/2010'], - ['LL', '14 februar 2010'], - ['LLL', '14 februar 2010 15:25'], - ['LLLL', 'sunnudagur 14. februar, 2010 15:25'], - ['l', '14/2/2010'], - ['ll', '14 feb 2010'], - ['lll', '14 feb 2010 15:25'], - ['llll', 'sun 14. feb, 2010 15:25'] + ['dddd, MMMM Do YYYY, h:mm:ss a', 'یک\u200cشنبه، فوریه ۱۴م ۲۰۱۰، ۳:۲۵:۵۰ بعد از ظهر'], + ['ddd, hA', 'یک\u200cشنبه، ۳بعد از ظهر'], + ['M Mo MM MMMM MMM', '۲ ۲م ۰۲ فوریه فوریه'], + ['YYYY YY', '۲۰۱۰ ۱۰'], + ['D Do DD', '۱۴ ۱۴م ۱۴'], + ['d do dddd ddd dd', '۰ ۰م یک\u200cشنبه یک\u200cشنبه ی'], + ['DDD DDDo DDDD', '۴۵ ۴۵م ۰۴۵'], + ['w wo ww', '۸ ۸م ۰۸'], + ['h hh', '۳ ۰۳'], + ['H HH', '۱۵ ۱۵'], + ['m mm', '۲۵ ۲۵'], + ['s ss', '۵۰ ۵۰'], + ['a A', 'بعد از ظهر بعد از ظهر'], + ['DDDo [روز سال]', '۴۵م روز سال'], + ['LTS', '۱۵:۲۵:۵۰'], + ['L', '۱۴/۰۲/۲۰۱۰'], + ['LL', '۱۴ فوریه ۲۰۱۰'], + ['LLL', '۱۴ فوریه ۲۰۱۰ ۱۵:۲۵'], + ['LLLL', 'یک\u200cشنبه، ۱۴ فوریه ۲۰۱۰ ۱۵:۲۵'], + ['l', '۱۴/۲/۲۰۱۰'], + ['ll', '۱۴ فوریه ۲۰۱۰'], + ['lll', '۱۴ فوریه ۲۰۱۰ ۱۵:۲۵'], + ['llll', 'یک\u200cشنبه، ۱۴ فوریه ۲۰۱۰ ۱۵:۲۵'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -11102,51 +11375,51 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '۱م', '1'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '۲م', '2'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '۳م', '3'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '۴م', '4'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '۵م', '5'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '۶م', '6'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '۷م', '7'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '۸م', '8'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '۹م', '9'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '۱۰م', '10'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '۱۱م', '11'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '۱۲م', '12'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '۱۳م', '13'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '۱۴م', '14'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '۱۵م', '15'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '۱۶م', '16'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '۱۷م', '17'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '۱۸م', '18'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '۱۹م', '19'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '۲۰م', '20'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '۲۱م', '21'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '۲۲م', '22'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '۲۳م', '23'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '۲۴م', '24'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '۲۵م', '25'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '۲۶م', '26'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '۲۷م', '27'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '۲۸م', '28'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '۲۹م', '29'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '۳۰م', '30'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '۳۱م', '31'); }); test('format month', function (assert) { - var expected = 'januar jan_februar feb_mars mar_apríl apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split('_'), i; + var expected = 'ژانویه ژانویه_فوریه فوریه_مارس مارس_آوریل آوریل_مه مه_ژوئن ژوئن_ژوئیه ژوئیه_اوت اوت_سپتامبر سپتامبر_اکتبر اکتبر_نوامبر نوامبر_دسامبر دسامبر'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'sunnudagur sun su_mánadagur mán má_týsdagur týs tý_mikudagur mik mi_hósdagur hós hó_fríggjadagur frí fr_leygardagur ley le'.split('_'), i; + var expected = 'یک\u200cشنبه یک\u200cشنبه ی_دوشنبه دوشنبه د_سه\u200cشنبه سه\u200cشنبه س_چهارشنبه چهارشنبه چ_پنج\u200cشنبه پنج\u200cشنبه پ_جمعه جمعه ج_شنبه شنبه ش'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -11154,117 +11427,164 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'fá sekund', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'ein minutt', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'ein minutt', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minuttir', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minuttir', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'ein tími', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'ein tími', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 tímar', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 tímar', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 tímar', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'ein dagur', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'ein dagur', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dagar', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'ein dagur', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dagar', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dagar', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'ein mánaði', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'ein mánaði', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'ein mánaði', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 mánaðir', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 mánaðir', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 mánaðir', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'ein mánaði', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 mánaðir', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'eitt ár', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 ár', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'eitt ár', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 ár', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'چندین ثانیه', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'یک دقیقه', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'یک دقیقه', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '۲ دقیقه', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '۴۴ دقیقه', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'یک ساعت', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'یک ساعت', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '۲ ساعت', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '۵ ساعت', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '۲۱ ساعت', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'یک روز', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'یک روز', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '۲ روز', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'یک روز', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '۵ روز', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '۲۵ روز', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'یک ماه', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'یک ماه', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'یک ماه', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '۲ ماه', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '۲ ماه', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '۳ ماه', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'یک ماه', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '۵ ماه', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'یک سال', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '۲ سال', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'یک سال', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '۵ سال', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'um fá sekund', 'prefix'); - assert.equal(moment(0).from(30000), 'fá sekund síðani', 'suffix'); + assert.equal(moment(30000).from(0), 'در چندین ثانیه', 'prefix'); + assert.equal(moment(0).from(30000), 'چندین ثانیه پیش', 'suffix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'fá sekund síðani', 'now from now should display as in the past'); + assert.equal(moment().fromNow(), 'چندین ثانیه پیش', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'um fá sekund', 'in a few seconds'); - assert.equal(moment().add({d: 5}).fromNow(), 'um 5 dagar', 'in 5 days'); + assert.equal(moment().add({s: 30}).fromNow(), 'در چندین ثانیه', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'در ۵ روز', 'in 5 days'); + }); + + test('calendar day', function (assert) { + var a = moment().hours(2).minutes(0).seconds(0); + + assert.equal(moment(a).calendar(), 'امروز ساعت ۰۲:۰۰', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'امروز ساعت ۰۲:۲۵', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'امروز ساعت ۰۳:۰۰', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'فردا ساعت ۰۲:۰۰', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'امروز ساعت ۰۱:۰۰', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'دیروز ساعت ۰۲:۰۰', 'yesterday at the same time'); + }); + + test('calendar next week', function (assert) { + var i, m; + for (i = 2; i < 7; i++) { + m = moment().add({d: i}); + assert.equal(m.calendar(), m.format('dddd [ساعت] LT'), 'Today + ' + i + ' days current time'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format('dddd [ساعت] LT'), 'Today + ' + i + ' days beginning of day'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format('dddd [ساعت] LT'), 'Today + ' + i + ' days end of day'); + } + }); + + test('calendar last week', function (assert) { + var i, m; + for (i = 2; i < 7; i++) { + m = moment().subtract({d: i}); + assert.equal(m.calendar(), m.format('dddd [پیش ساعت] LT'), 'Today - ' + i + ' days current time'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format('dddd [پیش ساعت] LT'), 'Today - ' + i + ' days beginning of day'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format('dddd [پیش ساعت] LT'), 'Today - ' + i + ' days end of day'); + } + }); + + test('calendar all else', function (assert) { + var weeksAgo = moment().subtract({w: 1}), + weeksFromNow = moment().add({w: 1}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); + + weeksAgo = moment().subtract({w: 2}); + weeksFromNow = moment().add({w: 2}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); + assert.equal(moment([2011, 11, 31]).week(), 1, 'Dec 31 2011 should be week 1'); + assert.equal(moment([2012, 0, 6]).week(), 1, 'Jan 6 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).week(), 2, 'Jan 7 2012 should be week 2'); + assert.equal(moment([2012, 0, 13]).week(), 2, 'Jan 13 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).week(), 3, 'Jan 14 2012 should be week 3'); }); test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); + assert.equal(moment([2006, 11, 30]).week(), 1, 'Dec 30 2006 should be week 1'); + assert.equal(moment([2007, 0, 5]).week(), 1, 'Jan 5 2007 should be week 1'); + assert.equal(moment([2007, 0, 6]).week(), 2, 'Jan 6 2007 should be week 2'); + assert.equal(moment([2007, 0, 12]).week(), 2, 'Jan 12 2007 should be week 2'); + assert.equal(moment([2007, 0, 13]).week(), 3, 'Jan 13 2007 should be week 3'); }); test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); + assert.equal(moment([2007, 11, 29]).week(), 1, 'Dec 29 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); + assert.equal(moment([2008, 0, 4]).week(), 1, 'Jan 4 2008 should be week 1'); + assert.equal(moment([2008, 0, 5]).week(), 2, 'Jan 5 2008 should be week 2'); + assert.equal(moment([2008, 0, 11]).week(), 2, 'Jan 11 2008 should be week 2'); + assert.equal(moment([2008, 0, 12]).week(), 3, 'Jan 12 2008 should be week 3'); }); test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); + assert.equal(moment([2002, 11, 28]).week(), 1, 'Dec 28 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); + assert.equal(moment([2003, 0, 3]).week(), 1, 'Jan 3 2003 should be week 1'); + assert.equal(moment([2003, 0, 4]).week(), 2, 'Jan 4 2003 should be week 2'); + assert.equal(moment([2003, 0, 10]).week(), 2, 'Jan 10 2003 should be week 2'); + assert.equal(moment([2003, 0, 11]).week(), 3, 'Jan 11 2003 should be week 3'); }); test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); + assert.equal(moment([2008, 11, 27]).week(), 1, 'Dec 27 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); + assert.equal(moment([2009, 0, 2]).week(), 1, 'Jan 2 2009 should be week 1'); + assert.equal(moment([2009, 0, 3]).week(), 2, 'Jan 3 2009 should be week 2'); + assert.equal(moment([2009, 0, 9]).week(), 2, 'Jan 9 2009 should be week 2'); + assert.equal(moment([2009, 0, 10]).week(), 3, 'Jan 10 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); + assert.equal(moment([2009, 11, 26]).week(), 1, 'Dec 26 2009 should be week 1'); + assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); + assert.equal(moment([2010, 0, 2]).week(), 2, 'Jan 2 2010 should be week 2'); + assert.equal(moment([2010, 0, 8]).week(), 2, 'Jan 8 2010 should be week 2'); + assert.equal(moment([2010, 0, 9]).week(), 3, 'Jan 9 2010 should be week 3'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); + assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); + assert.equal(moment([2011, 0, 7]).week(), 1, 'Jan 7 2011 should be week 1'); + assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); + assert.equal(moment([2011, 0, 14]).week(), 2, 'Jan 14 2011 should be week 2'); + assert.equal(moment([2011, 0, 15]).week(), 3, 'Jan 15 2011 should be week 3'); }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); + assert.equal(moment([2011, 11, 31]).format('w ww wo'), '۱ ۰۱ ۱م', 'Dec 31 2011 should be week 1'); + assert.equal(moment([2012, 0, 6]).format('w ww wo'), '۱ ۰۱ ۱م', 'Jan 6 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).format('w ww wo'), '۲ ۰۲ ۲م', 'Jan 7 2012 should be week 2'); + assert.equal(moment([2012, 0, 13]).format('w ww wo'), '۲ ۰۲ ۲م', 'Jan 13 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).format('w ww wo'), '۳ ۰۳ ۳م', 'Jan 14 2012 should be week 3'); }); test('lenient ordinal parsing', function (assert) { @@ -11305,8 +11625,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -11315,12 +11636,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -11338,8 +11661,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -11354,16 +11677,13 @@ }); } - localeModule('fr-ca'); + localeModule('fi'); test('parse', function (assert) { - var i, - tests = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split('_'); - + var tests = 'tammikuu tammi_helmikuu helmi_maaliskuu maalis_huhtikuu huhti_toukokuu touko_kesäkuu kesä_heinäkuu heinä_elokuu elo_syyskuu syys_lokakuu loka_marraskuu marras_joulukuu joulu'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } - for (i = 0; i < 12; i++) { tests[i] = tests[i].split(' '); equalTest(tests[i][0], 'MMM', i); @@ -11379,88 +11699,83 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss a', 'dimanche, février 14e 2010, 3:25:50 pm'], - ['ddd, hA', 'dim., 3PM'], - ['M Mo MM MMMM MMM', '2 2e 02 février févr.'], + ['dddd, MMMM Do YYYY, h:mm:ss a', 'sunnuntai, helmikuu 14. 2010, 3:25:50 pm'], + ['ddd, hA', 'su, 3PM'], + ['M Mo MM MMMM MMM', '2 2. 02 helmikuu helmi'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14e 14'], - ['d do dddd ddd dd', '0 0e dimanche dim. Di'], - ['DDD DDDo DDDD', '45 45e 045'], - ['w wo ww', '8 8e 08'], + ['D Do DD', '14 14. 14'], + ['d do dddd ddd dd', '0 0. sunnuntai su su'], + ['DDD DDDo DDDD', '45 45. 045'], + ['w wo ww', '6 6. 06'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], ['a A', 'pm PM'], - ['[the] DDDo [day of the year]', 'the 45e day of the year'], - ['LTS', '15:25:50'], - ['L', '2010-02-14'], - ['LL', '14 février 2010'], - ['LLL', '14 février 2010 15:25'], - ['LLLL', 'dimanche 14 février 2010 15:25'], - ['l', '2010-2-14'], - ['ll', '14 févr. 2010'], - ['lll', '14 févr. 2010 15:25'], - ['llll', 'dim. 14 févr. 2010 15:25'] + ['[vuoden] DDDo [päivä]', 'vuoden 45. päivä'], + ['LTS', '15.25.50'], + ['L', '14.02.2010'], + ['LL', '14. helmikuuta 2010'], + ['LLL', '14. helmikuuta 2010, klo 15.25'], + ['LLLL', 'sunnuntai, 14. helmikuuta 2010, klo 15.25'], + ['l', '14.2.2010'], + ['ll', '14. helmi 2010'], + ['lll', '14. helmi 2010, klo 15.25'], + ['llll', 'su, 14. helmi 2010, klo 15.25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; - for (i = 0; i < a.length; i++) { assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); } }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1er', '1er'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2e', '2e'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3e', '3e'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4e', '4e'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5e', '5e'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6e', '6e'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7e', '7e'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8e', '8e'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9e', '9e'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10e', '10e'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1st'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2nd'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3rd'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4th'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5th'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6th'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7th'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8th'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9th'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10th'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11e', '11e'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12e', '12e'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13e', '13e'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14e', '14e'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15e', '15e'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16e', '16e'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17e', '17e'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18e', '18e'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19e', '19e'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20e', '20e'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11th'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12th'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13th'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14th'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15th'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16th'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17th'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18th'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19th'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20th'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21e', '21e'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22e', '22e'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23e', '23e'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24e', '24e'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25e', '25e'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26e', '26e'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27e', '27e'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28e', '28e'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29e', '29e'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30e', '30e'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21st'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22nd'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23rd'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24th'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25th'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26th'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27th'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28th'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29th'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30th'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31e', '31e'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31st'); }); test('format month', function (assert) { - var i, - expected = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split('_'); - + var expected = 'tammikuu tammi_helmikuu helmi_maaliskuu maalis_huhtikuu huhti_toukokuu touko_kesäkuu kesä_heinäkuu heinä_elokuu elo_syyskuu syys_lokakuu loka_marraskuu marras_joulukuu joulu'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var i, - expected = 'dimanche dim. Di_lundi lun. Lu_mardi mar. Ma_mercredi mer. Me_jeudi jeu. Je_vendredi ven. Ve_samedi sam. Sa'.split('_'); - + var expected = 'sunnuntai su su_maanantai ma ma_tiistai ti ti_keskiviikko ke ke_torstai to to_perjantai pe pe_lauantai la la'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -11468,165 +11783,167 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'quelques secondes', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'une minute', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'une minute', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutes', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutes', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'une heure', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'une heure', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 heures', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 heures', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 heures', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'un jour', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'un jour', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 jours', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'un jour', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 jours', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 jours', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'un mois', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'un mois', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'un mois', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 mois', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 mois', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 mois', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'un mois', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 mois', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'un an', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 ans', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'un an', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 ans', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'muutama sekunti', '44 seconds = few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'minuutti', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'minuutti', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), 'kaksi minuuttia', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minuuttia', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'tunti', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'tunti', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), 'kaksi tuntia', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), 'viisi tuntia', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 tuntia', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'päivä', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'päivä', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), 'kaksi päivää', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'päivä', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), 'viisi päivää', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 päivää', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'kuukausi', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'kuukausi', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'kuukausi', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), 'kaksi kuukautta', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), 'kaksi kuukautta', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), 'kolme kuukautta', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'kuukausi', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), 'viisi kuukautta', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'vuosi', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), 'kaksi vuotta', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'vuosi', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), 'viisi vuotta', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'dans quelques secondes', 'prefix'); - assert.equal(moment(0).from(30000), 'il y a quelques secondes', 'suffix'); + assert.equal(moment(30000).from(0), 'muutaman sekunnin päästä', 'prefix'); + assert.equal(moment(0).from(30000), 'muutama sekunti sitten', 'suffix'); + }); + + test('now from now', function (assert) { + assert.equal(moment().fromNow(), 'muutama sekunti sitten', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'dans quelques secondes', 'in a few seconds'); - assert.equal(moment().add({d: 5}).fromNow(), 'dans 5 jours', 'in 5 days'); + assert.equal(moment().add({s: 30}).fromNow(), 'muutaman sekunnin päästä', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'viiden päivän päästä', 'in 5 days'); }); - test('same day', function (assert) { + test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'Aujourd\'hui à 02:00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'Aujourd\'hui à 02:25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'Aujourd\'hui à 03:00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'Demain à 02:00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'Aujourd\'hui à 01:00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'Hier à 02:00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'tänään klo 02.00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'tänään klo 02.25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'tänään klo 03.00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'huomenna klo 02.00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'tänään klo 01.00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'eilen klo 02.00', 'yesterday at the same time'); }); - test('same next week', function (assert) { + test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd [à] LT'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [klo] LT'), 'today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [à] LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [klo] LT'), 'today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [à] LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [klo] LT'), 'today + ' + i + ' days end of day'); } }); - test('same last week', function (assert) { + test('calendar last week', function (assert) { var i, m; - for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('dddd [dernier à] LT'), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('[viime] dddd[na] [klo] LT'), 'today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [dernier à] LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[viime] dddd[na] [klo] LT'), 'today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [dernier à] LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[viime] dddd[na] [klo] LT'), 'today - ' + i + ' days end of day'); } }); - test('same all else', function (assert) { + test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), 'yksi viikko sitten'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'yhden viikon päästä'); weeksAgo = moment().subtract({w: 2}); weeksFromNow = moment().add({w: 2}); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), 'kaksi viikkoa sitten'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'kaden viikon päästä'); }); test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); + assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); + assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); + assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); + assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); + assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); + assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); + assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); + assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); + assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); + assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); + assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); + assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); + assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); + assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); + assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); + assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); + assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); + assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); + assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); + assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); + assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); + assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); + assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); + assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); + assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); + assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); + assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); - test('weeks year starting sunday format', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1er', 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1er', 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2e', 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2e', 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3e', 'Jan 15 2012 should be week 3'); + test('weeks year starting sunday formatted', function (assert) { + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); test('lenient ordinal parsing', function (assert) { @@ -11667,8 +11984,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -11677,12 +11995,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -11700,8 +12020,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -11716,11 +12036,10 @@ }); } - localeModule('fr'); + localeModule('fo'); test('parse', function (assert) { - var tests = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split('_'), - i; + var tests = 'januar jan_februar feb_mars mar_apríl apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -11739,29 +12058,29 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss a', 'dimanche, février 14 2010, 3:25:50 pm'], - ['ddd, hA', 'dim., 3PM'], - ['M Mo MM MMMM MMM', '2 2 02 février févr.'], + ['dddd [tann] Do MMMM YYYY, h:mm:ss a', 'sunnudagur tann 14. februar 2010, 3:25:50 pm'], + ['ddd hA', 'sun 3PM'], + ['M Mo MM MMMM MMM', '2 2. 02 februar feb'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14 14'], - ['d do dddd ddd dd', '0 0 dimanche dim. Di'], - ['DDD DDDo DDDD', '45 45 045'], - ['w wo ww', '6 6 06'], + ['D Do DD', '14 14. 14'], + ['d do dddd ddd dd', '0 0. sunnudagur sun su'], + ['DDD DDDo DDDD', '45 45. 045'], + ['w wo ww', '6 6. 06'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], ['a A', 'pm PM'], - ['[the] DDDo [day of the year]', 'the 45 day of the year'], + ['[tann] DDDo [dagin á árinum]', 'tann 45. dagin á árinum'], ['LTS', '15:25:50'], ['L', '14/02/2010'], - ['LL', '14 février 2010'], - ['LLL', '14 février 2010 15:25'], - ['LLLL', 'dimanche 14 février 2010 15:25'], + ['LL', '14 februar 2010'], + ['LLL', '14 februar 2010 15:25'], + ['LLLL', 'sunnudagur 14. februar, 2010 15:25'], ['l', '14/2/2010'], - ['ll', '14 févr. 2010'], - ['lll', '14 févr. 2010 15:25'], - ['llll', 'dim. 14 févr. 2010 15:25'] + ['ll', '14 feb 2010'], + ['lll', '14 feb 2010 15:25'], + ['llll', 'sun 14. feb, 2010 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -11771,51 +12090,51 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1er', '1er'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); test('format month', function (assert) { - var expected = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split('_'), i; + var expected = 'januar jan_februar feb_mars mar_apríl apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'dimanche dim. Di_lundi lun. Lu_mardi mar. Ma_mercredi mer. Me_jeudi jeu. Je_vendredi ven. Ve_samedi sam. Sa'.split('_'), i; + var expected = 'sunnudagur sun su_mánadagur mán má_týsdagur týs tý_mikudagur mik mi_hósdagur hós hó_fríggjadagur frí fr_leygardagur ley le'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -11823,95 +12142,48 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'quelques secondes', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'une minute', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'une minute', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutes', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutes', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'une heure', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'une heure', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 heures', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 heures', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 heures', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'un jour', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'un jour', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 jours', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'un jour', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 jours', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 jours', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'un mois', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'un mois', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'un mois', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 mois', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 mois', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 mois', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'un mois', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 mois', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'un an', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 ans', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'un an', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 ans', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'fá sekund', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'ein minutt', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'ein minutt', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minuttir', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minuttir', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'ein tími', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'ein tími', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 tímar', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 tímar', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 tímar', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'ein dagur', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'ein dagur', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dagar', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'ein dagur', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dagar', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dagar', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'ein mánaði', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'ein mánaði', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'ein mánaði', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 mánaðir', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 mánaðir', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 mánaðir', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'ein mánaði', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 mánaðir', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'eitt ár', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 ár', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'eitt ár', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 ár', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'dans quelques secondes', 'prefix'); - assert.equal(moment(0).from(30000), 'il y a quelques secondes', 'suffix'); - }); - - test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'dans quelques secondes', 'in a few seconds'); - assert.equal(moment().add({d: 5}).fromNow(), 'dans 5 jours', 'in 5 days'); - }); - - test('same day', function (assert) { - var a = moment().hours(2).minutes(0).seconds(0); - - assert.equal(moment(a).calendar(), 'Aujourd\'hui à 02:00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'Aujourd\'hui à 02:25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'Aujourd\'hui à 03:00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'Demain à 02:00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'Aujourd\'hui à 01:00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'Hier à 02:00', 'yesterday at the same time'); - }); - - test('same next week', function (assert) { - var i, m; - - for (i = 2; i < 7; i++) { - m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd [à] LT'), 'Today + ' + i + ' days current time'); - m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [à] LT'), 'Today + ' + i + ' days beginning of day'); - m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [à] LT'), 'Today + ' + i + ' days end of day'); - } + assert.equal(moment(30000).from(0), 'um fá sekund', 'prefix'); + assert.equal(moment(0).from(30000), 'fá sekund síðani', 'suffix'); }); - test('same last week', function (assert) { - var i, m; - - for (i = 2; i < 7; i++) { - m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('dddd [dernier à] LT'), 'Today - ' + i + ' days current time'); - m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [dernier à] LT'), 'Today - ' + i + ' days beginning of day'); - m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [dernier à] LT'), 'Today - ' + i + ' days end of day'); - } + test('now from now', function (assert) { + assert.equal(moment().fromNow(), 'fá sekund síðani', 'now from now should display as in the past'); }); - test('same all else', function (assert) { - var weeksAgo = moment().subtract({w: 1}), - weeksFromNow = moment().add({w: 1}); - - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); - - weeksAgo = moment().subtract({w: 2}); - weeksFromNow = moment().add({w: 2}); - - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); + test('fromNow', function (assert) { + assert.equal(moment().add({s: 30}).fromNow(), 'um fá sekund', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'um 5 dagar', 'in 5 days'); }); test('weeks year starting sunday', function (assert) { @@ -11976,11 +12248,11 @@ }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52', 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1er', 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1er', 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2', 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2', 'Jan 15 2012 should be week 2'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); test('lenient ordinal parsing', function (assert) { @@ -12021,8 +12293,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -12031,12 +12304,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -12054,8 +12329,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -12070,13 +12345,16 @@ }); } - localeModule('fy'); + localeModule('fr-ca'); test('parse', function (assert) { - var tests = 'jannewaris jan._febrewaris feb._maart mrt._april apr._maaie mai._juny jun._july jul._augustus aug._septimber sep._oktober okt._novimber nov._desimber des.'.split('_'), i; + var i, + tests = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split('_'); + function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } + for (i = 0; i < 12; i++) { tests[i] = tests[i].split(' '); equalTest(tests[i][0], 'MMM', i); @@ -12092,83 +12370,88 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, HH:mm:ss', 'snein, febrewaris 14de 2010, 15:25:50'], - ['ddd, HH', 'si., 15'], - ['M Mo MM MMMM MMM', '2 2de 02 febrewaris feb.'], + ['dddd, MMMM Do YYYY, h:mm:ss a', 'dimanche, février 14e 2010, 3:25:50 pm'], + ['ddd, hA', 'dim., 3PM'], + ['M Mo MM MMMM MMM', '2 2e 02 février févr.'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14de 14'], - ['d do dddd ddd dd', '0 0de snein si. Si'], - ['DDD DDDo DDDD', '45 45ste 045'], - ['w wo ww', '6 6de 06'], + ['D Do DD', '14 14e 14'], + ['d do dddd ddd dd', '0 0e dimanche dim. Di'], + ['DDD DDDo DDDD', '45 45e 045'], + ['w wo ww', '8 8e 08'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], ['a A', 'pm PM'], - ['[the] DDDo [day of the year]', 'the 45ste day of the year'], + ['[the] DDDo [day of the year]', 'the 45e day of the year'], ['LTS', '15:25:50'], - ['L', '14-02-2010'], - ['LL', '14 febrewaris 2010'], - ['LLL', '14 febrewaris 2010 15:25'], - ['LLLL', 'snein 14 febrewaris 2010 15:25'], - ['l', '14-2-2010'], - ['ll', '14 feb. 2010'], - ['lll', '14 feb. 2010 15:25'], - ['llll', 'si. 14 feb. 2010 15:25'] + ['L', '2010-02-14'], + ['LL', '14 février 2010'], + ['LLL', '14 février 2010 15:25'], + ['LLLL', 'dimanche 14 février 2010 15:25'], + ['l', '2010-2-14'], + ['ll', '14 févr. 2010'], + ['lll', '14 févr. 2010 15:25'], + ['llll', 'dim. 14 févr. 2010 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; + for (i = 0; i < a.length; i++) { assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); } }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1ste', '1ste'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2de', '2de'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3de', '3de'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4de', '4de'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5de', '5de'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6de', '6de'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7de', '7de'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8ste', '8ste'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9de', '9de'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10de', '10de'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1er', '1er'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2e', '2e'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3e', '3e'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4e', '4e'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5e', '5e'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6e', '6e'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7e', '7e'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8e', '8e'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9e', '9e'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10e', '10e'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11de', '11de'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12de', '12de'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13de', '13de'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14de', '14de'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15de', '15de'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16de', '16de'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17de', '17de'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18de', '18de'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19de', '19de'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20ste', '20ste'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11e', '11e'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12e', '12e'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13e', '13e'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14e', '14e'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15e', '15e'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16e', '16e'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17e', '17e'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18e', '18e'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19e', '19e'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20e', '20e'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21ste', '21ste'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22ste', '22ste'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23ste', '23ste'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24ste', '24ste'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25ste', '25ste'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26ste', '26ste'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27ste', '27ste'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28ste', '28ste'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29ste', '29ste'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30ste', '30ste'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21e', '21e'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22e', '22e'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23e', '23e'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24e', '24e'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25e', '25e'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26e', '26e'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27e', '27e'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28e', '28e'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29e', '29e'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30e', '30e'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31ste', '31ste'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31e', '31e'); }); test('format month', function (assert) { - var expected = 'jannewaris jan._febrewaris feb._maart mrt._april apr._maaie mai_juny jun._july jul._augustus aug._septimber sep._oktober okt._novimber nov._desimber des.'.split('_'), i; + var i, + expected = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split('_'); + for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'snein si. Si_moandei mo. Mo_tiisdei ti. Ti_woansdei wo. Wo_tongersdei to. To_freed fr. Fr_sneon so. So'.split('_'), i; + var i, + expected = 'dimanche dim. Di_lundi lun. Lu_mardi mar. Ma_mercredi mer. Me_jeudi jeu. Je_vendredi ven. Ve_samedi sam. Sa'.split('_'); + for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -12176,86 +12459,85 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'in pear sekonden', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'ien minút', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'ien minút', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minuten', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minuten', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'ien oere', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'ien oere', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 oeren', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 oeren', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 oeren', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'ien dei', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'ien dei', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dagen', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'ien dei', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dagen', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dagen', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'ien moanne', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'ien moanne', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'ien moanne', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 moannen', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 moannen', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 moannen', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'ien moanne', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 moannen', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ien jier', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 jierren', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'ien jier', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 jierren', '5 years = 5 years'); - }); - test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'oer in pear sekonden', 'prefix'); - assert.equal(moment(0).from(30000), 'in pear sekonden lyn', 'suffix'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'quelques secondes', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'une minute', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'une minute', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutes', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutes', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'une heure', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'une heure', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 heures', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 heures', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 heures', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'un jour', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'un jour', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 jours', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'un jour', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 jours', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 jours', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'un mois', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'un mois', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'un mois', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 mois', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 mois', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 mois', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'un mois', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 mois', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'un an', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 ans', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'un an', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 ans', '5 years = 5 years'); }); - test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'in pear sekonden lyn', 'now from now should display as in the past'); + test('suffix', function (assert) { + assert.equal(moment(30000).from(0), 'dans quelques secondes', 'prefix'); + assert.equal(moment(0).from(30000), 'il y a quelques secondes', 'suffix'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'oer in pear sekonden', 'in a few seconds'); - assert.equal(moment().add({d: 5}).fromNow(), 'oer 5 dagen', 'in 5 days'); + assert.equal(moment().add({s: 30}).fromNow(), 'dans quelques secondes', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'dans 5 jours', 'in 5 days'); }); - test('calendar day', function (assert) { + test('same day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'hjoed om 02:00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'hjoed om 02:25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'hjoed om 03:00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'moarn om 02:00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'hjoed om 01:00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'juster om 02:00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'Aujourd\'hui à 02:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'Aujourd\'hui à 02:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'Aujourd\'hui à 03:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'Demain à 02:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'Aujourd\'hui à 01:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'Hier à 02:00', 'yesterday at the same time'); }); - test('calendar next week', function (assert) { + test('same next week', function (assert) { var i, m; + for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd [om] LT'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [à] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [om] LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [à] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [om] LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [à] LT'), 'Today + ' + i + ' days end of day'); } }); - test('calendar last week', function (assert) { + test('same last week', function (assert) { var i, m; + for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('[ôfrûne] dddd [om] LT'), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [dernier à] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[ôfrûne] dddd [om] LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [dernier à] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[ôfrûne] dddd [om] LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [dernier à] LT'), 'Today - ' + i + ' days end of day'); } }); - test('calendar all else', function (assert) { + test('same all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -12269,78 +12551,73 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('month abbreviation', function (assert) { - assert.equal(moment([2012, 5, 23]).format('D-MMM-YYYY'), '23-jun-2012', 'format month abbreviation surrounded by dashes should not include a dot'); - assert.equal(moment([2012, 5, 23]).format('D MMM YYYY'), '23 jun. 2012', 'format month abbreviation not surrounded by dashes should include a dot'); - }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); }); test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); + assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); + assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); }); test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); + assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); + assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); + assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); + assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); }); test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); + assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); + assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); + assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); + assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); }); test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); + assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); + assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); + assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); + assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); + assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); + assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); + assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); + assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); + assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); + assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); + assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); + assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); + assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); }); - test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52ste', 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1ste', 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1ste', 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2de', 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2de', 'Jan 15 2012 should be week 2'); + test('weeks year starting sunday format', function (assert) { + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1er', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1er', 'Jan 7 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2e', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2e', 'Jan 14 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3e', 'Jan 15 2012 should be week 3'); }); test('lenient ordinal parsing', function (assert) { @@ -12381,8 +12658,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -12391,12 +12669,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -12414,8 +12694,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -12430,13 +12710,16 @@ }); } - localeModule('gl'); + localeModule('fr-ch'); test('parse', function (assert) { - var tests = 'Xaneiro Xan._Febreiro Feb._Marzo Mar._Abril Abr._Maio Mai._Xuño Xuñ._Xullo Xul._Agosto Ago._Setembro Set._Outubro Out._Novembro Nov._Decembro Dec.'.split('_'), i; + var i, + tests = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split('_'); + function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } + for (i = 0; i < 12; i++) { tests[i] = tests[i].split(' '); equalTest(tests[i][0], 'MMM', i); @@ -12452,84 +12735,88 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss a', 'Domingo, Febreiro 14º 2010, 3:25:50 pm'], - ['ddd, hA', 'Dom., 3PM'], - ['M Mo MM MMMM MMM', '2 2º 02 Febreiro Feb.'], + ['dddd, MMMM Do YYYY, h:mm:ss a', 'dimanche, février 14e 2010, 3:25:50 pm'], + ['ddd, hA', 'dim., 3PM'], + ['M Mo MM MMMM MMM', '2 2e 02 février févr.'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14º 14'], - ['d do dddd ddd dd', '0 0º Domingo Dom. Do'], - ['DDD DDDo DDDD', '45 45º 045'], - ['w wo ww', '7 7º 07'], + ['D Do DD', '14 14e 14'], + ['d do dddd ddd dd', '0 0e dimanche dim. Di'], + ['DDD DDDo DDDD', '45 45e 045'], + ['w wo ww', '6 6e 06'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], ['a A', 'pm PM'], - ['[the] DDDo [day of the year]', 'the 45º day of the year'], + ['[the] DDDo [day of the year]', 'the 45e day of the year'], ['LTS', '15:25:50'], - ['L', '14/02/2010'], - ['LL', '14 Febreiro 2010'], - ['LLL', '14 Febreiro 2010 15:25'], - ['LLLL', 'Domingo 14 Febreiro 2010 15:25'], - ['l', '14/2/2010'], - ['ll', '14 Feb. 2010'], - ['lll', '14 Feb. 2010 15:25'], - ['llll', 'Dom. 14 Feb. 2010 15:25'] + ['L', '14.02.2010'], + ['LL', '14 février 2010'], + ['LLL', '14 février 2010 15:25'], + ['LLLL', 'dimanche 14 février 2010 15:25'], + ['l', '14.2.2010'], + ['ll', '14 févr. 2010'], + ['lll', '14 févr. 2010 15:25'], + ['llll', 'dim. 14 févr. 2010 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; + for (i = 0; i < a.length; i++) { assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); } }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1er', '1er'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2e', '2e'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3e', '3e'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4e', '4e'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5e', '5e'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6e', '6e'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7e', '7e'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8e', '8e'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9e', '9e'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10e', '10e'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11e', '11e'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12e', '12e'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13e', '13e'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14e', '14e'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15e', '15e'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16e', '16e'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17e', '17e'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18e', '18e'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19e', '19e'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20e', '20e'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21e', '21e'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22e', '22e'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23e', '23e'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24e', '24e'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25e', '25e'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26e', '26e'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27e', '27e'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28e', '28e'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29e', '29e'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30e', '30e'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31e', '31e'); }); test('format month', function (assert) { - var expected = 'Xaneiro Xan._Febreiro Feb._Marzo Mar._Abril Abr._Maio Mai._Xuño Xuñ._Xullo Xul._Agosto Ago._Setembro Set._Outubro Out._Novembro Nov._Decembro Dec.'.split('_'), i; + var i, + expected = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split('_'); + for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'Domingo Dom. Do_Luns Lun. Lu_Martes Mar. Ma_Mércores Mér. Mé_Xoves Xov. Xo_Venres Ven. Ve_Sábado Sáb. Sá'.split('_'), - i; + var i, + expected = 'dimanche dim. Di_lundi lun. Lu_mardi mar. Ma_mercredi mer. Me_jeudi jeu. Je_vendredi ven. Ve_samedi sam. Sa'.split('_'); + for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -12538,88 +12825,84 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'uns segundos', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'un minuto', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'un minuto', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutos', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutos', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'unha hora', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'unha hora', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 horas', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 horas', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 horas', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'un día', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'un día', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 días', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'un día', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 días', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 días', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'un mes', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'un mes', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'un mes', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 meses', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 meses', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 meses', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'un mes', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 meses', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'un ano', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 anos', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'un ano', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 anos', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'quelques secondes', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'une minute', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'une minute', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutes', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutes', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'une heure', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'une heure', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 heures', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 heures', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 heures', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'un jour', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'un jour', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 jours', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'un jour', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 jours', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 jours', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'un mois', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'un mois', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'un mois', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 mois', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 mois', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 mois', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'un mois', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 mois', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'un an', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 ans', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'un an', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 ans', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'nuns segundos', 'prefix'); - assert.equal(moment(0).from(30000), 'hai uns segundos', 'suffix'); - }); - - test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'hai uns segundos', 'now from now should display as in the past'); + assert.equal(moment(30000).from(0), 'dans quelques secondes', 'prefix'); + assert.equal(moment(0).from(30000), 'il y a quelques secondes', 'suffix'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'nuns segundos', 'en unos segundos'); - assert.equal(moment().add({d: 5}).fromNow(), 'en 5 días', 'en 5 días'); + assert.equal(moment().add({s: 30}).fromNow(), 'dans quelques secondes', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'dans 5 jours', 'in 5 days'); }); - test('calendar day', function (assert) { + test('same day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'hoxe ás 2:00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'hoxe ás 2:25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'hoxe ás 3:00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'mañá ás 2:00', 'tomorrow at the same time'); - assert.equal(moment(a).add({d: 1, h : -1}).calendar(), 'mañá á 1:00', 'tomorrow minus 1 hour'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'hoxe á 1:00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'onte á 2:00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'Aujourd\'hui à 02:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'Aujourd\'hui à 02:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'Aujourd\'hui à 03:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'Demain à 02:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'Aujourd\'hui à 01:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'Hier à 02:00', 'yesterday at the same time'); }); - test('calendar next week', function (assert) { + test('same next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd [' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [à] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [à] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [à] LT'), 'Today + ' + i + ' days end of day'); } }); - test('calendar last week', function (assert) { + test('same last week', function (assert) { var i, m; + for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('[o] dddd [pasado ' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [dernier à] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[o] dddd [pasado ' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [dernier à] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[o] dddd [pasado ' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [dernier à] LT'), 'Today - ' + i + ' days end of day'); } }); - test('calendar all else', function (assert) { + test('same all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -12633,17 +12916,12 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('regression tests', function (assert) { - var lastWeek = moment().subtract({d: 4}).hours(1); - assert.equal(lastWeek.calendar(), lastWeek.format('[o] dddd [pasado a] LT'), '1 o\'clock bug'); - }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); + assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); test('weeks year starting monday', function (assert) { @@ -12678,33 +12956,33 @@ assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); + assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); + assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); + assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); + assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); + assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); + assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); + assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); + assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); + assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); + assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); + assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); + assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); + assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); + }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1º', 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1º', 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2º', 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2º', 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3º', 'Jan 9 2012 should be week 3'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52e', 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1er', 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1er', 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2e', 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2e', 'Jan 15 2012 should be week 2'); }); test('lenient ordinal parsing', function (assert) { @@ -12745,8 +13023,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -12755,12 +13034,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -12778,8 +13059,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -12794,10 +13075,11 @@ }); } - localeModule('he'); + localeModule('fr'); test('parse', function (assert) { - var tests = 'ינואר ינו׳_פברואר פבר׳_מרץ מרץ_אפריל אפר׳_מאי מאי_יוני יוני_יולי יולי_אוגוסט אוג׳_ספטמבר ספט׳_אוקטובר אוק׳_נובמבר נוב׳_דצמבר דצמ׳'.split('_'), i; + var tests = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split('_'), + i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -12816,14 +13098,14 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss a', 'ראשון, פברואר 14 2010, 3:25:50 pm'], - ['ddd, hA', 'א׳, 3PM'], - ['M Mo MM MMMM MMM', '2 2 02 פברואר פבר׳'], + ['dddd, MMMM Do YYYY, h:mm:ss a', 'dimanche, février 14 2010, 3:25:50 pm'], + ['ddd, hA', 'dim., 3PM'], + ['M Mo MM MMMM MMM', '2 2 02 février févr.'], ['YYYY YY', '2010 10'], ['D Do DD', '14 14 14'], - ['d do dddd ddd dd', '0 0 ראשון א׳ א'], + ['d do dddd ddd dd', '0 0 dimanche dim. Di'], ['DDD DDDo DDDD', '45 45 045'], - ['w wo ww', '8 8 08'], + ['w wo ww', '6 6 06'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], @@ -12832,13 +13114,13 @@ ['[the] DDDo [day of the year]', 'the 45 day of the year'], ['LTS', '15:25:50'], ['L', '14/02/2010'], - ['LL', '14 בפברואר 2010'], - ['LLL', '14 בפברואר 2010 15:25'], - ['LLLL', 'ראשון, 14 בפברואר 2010 15:25'], + ['LL', '14 février 2010'], + ['LLL', '14 février 2010 15:25'], + ['LLLL', 'dimanche 14 février 2010 15:25'], ['l', '14/2/2010'], - ['ll', '14 פבר׳ 2010'], - ['lll', '14 פבר׳ 2010 15:25'], - ['llll', 'א׳, 14 פבר׳ 2010 15:25'] + ['ll', '14 févr. 2010'], + ['lll', '14 févr. 2010 15:25'], + ['llll', 'dim. 14 févr. 2010 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -12847,15 +13129,52 @@ } }); + test('format ordinal', function (assert) { + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1er', '1er'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10'); + + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20'); + + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30'); + + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31'); + }); + test('format month', function (assert) { - var expected = 'ינואר ינו׳_פברואר פבר׳_מרץ מרץ_אפריל אפר׳_מאי מאי_יוני יוני_יולי יולי_אוגוסט אוג׳_ספטמבר ספט׳_אוקטובר אוק׳_נובמבר נוב׳_דצמבר דצמ׳'.split('_'), i; + var expected = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'ראשון א׳ א|שני ב׳ ב|שלישי ג׳ ג|רביעי ד׳ ד|חמישי ה׳ ה|שישי ו׳ ו|שבת ש׳ ש'.split('|'), i; + var expected = 'dimanche dim. Di_lundi lun. Lu_mardi mar. Ma_mercredi mer. Me_jeudi jeu. Je_vendredi ven. Ve_samedi sam. Sa'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -12863,88 +13182,84 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'מספר שניות', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'דקה', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'דקה', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 דקות', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 דקות', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'שעה', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'שעה', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), 'שעתיים', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 שעות', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 שעות', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'יום', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'יום', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), 'יומיים', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'יום', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 ימים', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 ימים', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'חודש', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'חודש', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'חודש', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), 'חודשיים', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), 'חודשיים', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 חודשים', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'חודש', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 חודשים', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'שנה', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), 'שנתיים', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 3699}), true), '10 שנים', '345 days = 10 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 7340}), true), '20 שנה', '548 days = 20 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'שנה', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 שנים', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'quelques secondes', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'une minute', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'une minute', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutes', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutes', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'une heure', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'une heure', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 heures', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 heures', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 heures', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'un jour', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'un jour', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 jours', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'un jour', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 jours', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 jours', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'un mois', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'un mois', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'un mois', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 mois', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 mois', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 mois', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'un mois', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 mois', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'un an', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 ans', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'un an', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 ans', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'בעוד מספר שניות', 'prefix'); - assert.equal(moment(0).from(30000), 'לפני מספר שניות', 'suffix'); - }); - - test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'לפני מספר שניות', 'now from now should display as in the past'); + assert.equal(moment(30000).from(0), 'dans quelques secondes', 'prefix'); + assert.equal(moment(0).from(30000), 'il y a quelques secondes', 'suffix'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'בעוד מספר שניות', 'in a few seconds'); - assert.equal(moment().add({d: 5}).fromNow(), 'בעוד 5 ימים', 'in 5 days'); + assert.equal(moment().add({s: 30}).fromNow(), 'dans quelques secondes', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'dans 5 jours', 'in 5 days'); }); - test('calendar day', function (assert) { + test('same day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'היום ב־02:00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'היום ב־02:25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'היום ב־03:00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'מחר ב־02:00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'היום ב־01:00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'אתמול ב־02:00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'Aujourd\'hui à 02:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'Aujourd\'hui à 02:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'Aujourd\'hui à 03:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'Demain à 02:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'Aujourd\'hui à 01:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'Hier à 02:00', 'yesterday at the same time'); }); - test('calendar next week', function (assert) { + test('same next week', function (assert) { var i, m; + for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd [בשעה] LT'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [à] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [בשעה] LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [à] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [בשעה] LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [à] LT'), 'Today + ' + i + ' days end of day'); } }); - test('calendar last week', function (assert) { + test('same last week', function (assert) { var i, m; + for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('[ביום] dddd [האחרון בשעה] LT'), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [dernier à] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[ביום] dddd [האחרון בשעה] LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [dernier à] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[ביום] dddd [האחרון בשעה] LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [dernier à] LT'), 'Today - ' + i + ' days end of day'); } }); - test('calendar all else', function (assert) { + test('same all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -12959,72 +13274,72 @@ }); test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); + assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); + assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); + assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); + assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); + assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); + assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); + assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); + assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); + assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); + assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); + assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); + assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); + assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); + assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); + assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); + assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); + assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); + assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); + assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); + assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); + assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); + assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); + assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); + assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); + assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); + assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); + assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); - test('weeks year starting sunday format', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1', 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2', 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3'); + test('weeks year starting sunday formatted', function (assert) { + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52', 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1er', 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1er', 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2', 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2', 'Jan 15 2012 should be week 2'); }); test('lenient ordinal parsing', function (assert) { @@ -13065,8 +13380,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -13075,12 +13391,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -13098,8 +13416,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -13114,10 +13432,10 @@ }); } - localeModule('hi'); + localeModule('fy'); test('parse', function (assert) { - var tests = 'जनवरी जन._फ़रवरी फ़र._मार्च मार्च_अप्रैल अप्रै._मई मई_जून जून_जुलाई जुल._अगस्त अग._सितम्बर सित._अक्टूबर अक्टू._नवम्बर नव._दिसम्बर दिस.'.split('_'), i; + var tests = 'jannewaris jan._febrewaris feb._maart mrt._april apr._maaie mai._juny jun._july jul._augustus aug._septimber sep._oktober okt._novimber nov._desimber des.'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -13136,28 +13454,29 @@ test('format', function (assert) { var a = [ - ['dddd, Do MMMM YYYY, a h:mm:ss बजे', 'रविवार, १४ फ़रवरी २०१०, दोपहर ३:२५:५० बजे'], - ['ddd, a h बजे', 'रवि, दोपहर ३ बजे'], - ['M Mo MM MMMM MMM', '२ २ ०२ फ़रवरी फ़र.'], - ['YYYY YY', '२०१० १०'], - ['D Do DD', '१४ १४ १४'], - ['d do dddd ddd dd', '० ० रविवार रवि र'], - ['DDD DDDo DDDD', '४५ ४५ ०४५'], - ['w wo ww', '८ ८ ०८'], - ['h hh', '३ ०३'], - ['H HH', '१५ १५'], - ['m mm', '२५ २५'], - ['s ss', '५० ५०'], - ['a A', 'दोपहर दोपहर'], - ['LTS', 'दोपहर ३:२५:५० बजे'], - ['L', '१४/०२/२०१०'], - ['LL', '१४ फ़रवरी २०१०'], - ['LLL', '१४ फ़रवरी २०१०, दोपहर ३:२५ बजे'], - ['LLLL', 'रविवार, १४ फ़रवरी २०१०, दोपहर ३:२५ बजे'], - ['l', '१४/२/२०१०'], - ['ll', '१४ फ़र. २०१०'], - ['lll', '१४ फ़र. २०१०, दोपहर ३:२५ बजे'], - ['llll', 'रवि, १४ फ़र. २०१०, दोपहर ३:२५ बजे'] + ['dddd, MMMM Do YYYY, HH:mm:ss', 'snein, febrewaris 14de 2010, 15:25:50'], + ['ddd, HH', 'si., 15'], + ['M Mo MM MMMM MMM', '2 2de 02 febrewaris feb.'], + ['YYYY YY', '2010 10'], + ['D Do DD', '14 14de 14'], + ['d do dddd ddd dd', '0 0de snein si. Si'], + ['DDD DDDo DDDD', '45 45ste 045'], + ['w wo ww', '6 6de 06'], + ['h hh', '3 03'], + ['H HH', '15 15'], + ['m mm', '25 25'], + ['s ss', '50 50'], + ['a A', 'pm PM'], + ['[the] DDDo [day of the year]', 'the 45ste day of the year'], + ['LTS', '15:25:50'], + ['L', '14-02-2010'], + ['LL', '14 febrewaris 2010'], + ['LLL', '14 febrewaris 2010 15:25'], + ['LLLL', 'snein 14 febrewaris 2010 15:25'], + ['l', '14-2-2010'], + ['ll', '14 feb. 2010'], + ['lll', '14 feb. 2010 15:25'], + ['llll', 'si. 14 feb. 2010 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -13167,51 +13486,51 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '१', '१'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '२', '२'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '३', '३'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '४', '४'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '५', '५'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '६', '६'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '७', '७'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '८', '८'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '९', '९'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '१०', '१०'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1ste', '1ste'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2de', '2de'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3de', '3de'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4de', '4de'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5de', '5de'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6de', '6de'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7de', '7de'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8ste', '8ste'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9de', '9de'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10de', '10de'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '११', '११'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '१२', '१२'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '१३', '१३'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '१४', '१४'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '१५', '१५'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '१६', '१६'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '१७', '१७'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '१८', '१८'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '१९', '१९'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '२०', '२०'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11de', '11de'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12de', '12de'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13de', '13de'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14de', '14de'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15de', '15de'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16de', '16de'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17de', '17de'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18de', '18de'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19de', '19de'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20ste', '20ste'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '२१', '२१'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '२२', '२२'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '२३', '२३'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '२४', '२४'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '२५', '२५'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '२६', '२६'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '२७', '२७'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '२८', '२८'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '२९', '२९'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '३०', '३०'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21ste', '21ste'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22ste', '22ste'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23ste', '23ste'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24ste', '24ste'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25ste', '25ste'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26ste', '26ste'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27ste', '27ste'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28ste', '28ste'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29ste', '29ste'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30ste', '30ste'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '३१', '३१'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31ste', '31ste'); }); test('format month', function (assert) { - var expected = 'जनवरी जन._फ़रवरी फ़र._मार्च मार्च_अप्रैल अप्रै._मई मई_जून जून_जुलाई जुल._अगस्त अग._सितम्बर सित._अक्टूबर अक्टू._नवम्बर नव._दिसम्बर दिस.'.split('_'), i; + var expected = 'jannewaris jan._febrewaris feb._maart mrt._april apr._maaie mai_juny jun._july jul._augustus aug._septimber sep._oktober okt._novimber nov._desimber des.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'रविवार रवि र_सोमवार सोम सो_मंगलवार मंगल मं_बुधवार बुध बु_गुरूवार गुरू गु_शुक्रवार शुक्र शु_शनिवार शनि श'.split('_'), i; + var expected = 'snein si. Si_moandei mo. Mo_tiisdei ti. Ti_woansdei wo. Wo_tongersdei to. To_freed fr. Fr_sneon so. So'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -13219,83 +13538,82 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'कुछ ही क्षण', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'एक मिनट', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'एक मिनट', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '२ मिनट', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '४४ मिनट', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'एक घंटा', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'एक घंटा', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '२ घंटे', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '५ घंटे', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '२१ घंटे', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'एक दिन', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'एक दिन', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '२ दिन', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'एक दिन', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '५ दिन', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '२५ दिन', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'एक महीने', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'एक महीने', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'एक महीने', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '२ महीने', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '२ महीने', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '३ महीने', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'एक महीने', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '५ महीने', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'एक वर्ष', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '२ वर्ष', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'एक वर्ष', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '५ वर्ष', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'in pear sekonden', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'ien minút', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'ien minút', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minuten', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minuten', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'ien oere', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'ien oere', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 oeren', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 oeren', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 oeren', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'ien dei', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'ien dei', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dagen', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'ien dei', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dagen', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dagen', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'ien moanne', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'ien moanne', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'ien moanne', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 moannen', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 moannen', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 moannen', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'ien moanne', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 moannen', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ien jier', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 jierren', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'ien jier', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 jierren', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'कुछ ही क्षण में', 'prefix'); - assert.equal(moment(0).from(30000), 'कुछ ही क्षण पहले', 'suffix'); + assert.equal(moment(30000).from(0), 'oer in pear sekonden', 'prefix'); + assert.equal(moment(0).from(30000), 'in pear sekonden lyn', 'suffix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'कुछ ही क्षण पहले', 'now from now should display as in the past'); + assert.equal(moment().fromNow(), 'in pear sekonden lyn', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'कुछ ही क्षण में', 'कुछ ही क्षण में'); - assert.equal(moment().add({d: 5}).fromNow(), '५ दिन में', '५ दिन में'); + assert.equal(moment().add({s: 30}).fromNow(), 'oer in pear sekonden', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'oer 5 dagen', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'आज रात २:०० बजे', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'आज रात २:२५ बजे', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 3}).calendar(), 'आज सुबह ५:०० बजे', 'Now plus 3 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'कल रात २:०० बजे', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'आज रात १:०० बजे', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'कल रात २:०० बजे', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'hjoed om 02:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'hjoed om 02:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'hjoed om 03:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'moarn om 02:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'hjoed om 01:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'juster om 02:00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd[,] LT'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [om] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd[,] LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [om] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd[,] LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [om] LT'), 'Today + ' + i + ' days end of day'); } }); test('calendar last week', function (assert) { var i, m; - for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('[पिछले] dddd[,] LT'), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('[ôfrûne] dddd [om] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[पिछले] dddd[,] LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[ôfrûne] dddd [om] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[पिछले] dddd[,] LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[ôfrûne] dddd [om] LT'), 'Today - ' + i + ' days end of day'); } }); @@ -13313,89 +13631,78 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('meridiem invariant', function (assert) { - assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), 'रात', 'before dawn'); - assert.equal(moment([2011, 2, 23, 9, 30]).format('a'), 'सुबह', 'morning'); - assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'दोपहर', 'during day'); - assert.equal(moment([2011, 2, 23, 17, 30]).format('a'), 'शाम', 'evening'); - assert.equal(moment([2011, 2, 23, 19, 30]).format('a'), 'शाम', 'late evening'); - assert.equal(moment([2011, 2, 23, 21, 20]).format('a'), 'रात', 'night'); - - assert.equal(moment([2011, 2, 23, 2, 30]).format('A'), 'रात', 'before dawn'); - assert.equal(moment([2011, 2, 23, 9, 30]).format('A'), 'सुबह', 'morning'); - assert.equal(moment([2011, 2, 23, 14, 30]).format('A'), 'दोपहर', ' during day'); - assert.equal(moment([2011, 2, 23, 17, 30]).format('A'), 'शाम', 'evening'); - assert.equal(moment([2011, 2, 23, 19, 30]).format('A'), 'शाम', 'late evening'); - assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'रात', 'night'); + test('month abbreviation', function (assert) { + assert.equal(moment([2012, 5, 23]).format('D-MMM-YYYY'), '23-jun-2012', 'format month abbreviation surrounded by dashes should not include a dot'); + assert.equal(moment([2012, 5, 23]).format('D MMM YYYY'), '23 jun. 2012', 'format month abbreviation not surrounded by dashes should include a dot'); }); test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); + assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); + assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); + assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); + assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); + assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); + assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); + assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); + assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); + assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); + assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); + assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); + assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); + assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); + assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); + assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); + assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); + assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); + assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); + assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); + assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); + assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); + assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); + assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); + assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); + assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); + assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); + assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '१ ०१ १', 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).format('w ww wo'), '१ ०१ १', 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '२ ०२ २', 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).format('w ww wo'), '२ ०२ २', 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '३ ०३ ३', 'Jan 15 2012 should be week 3'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52ste', 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1ste', 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1ste', 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2de', 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2de', 'Jan 15 2012 should be week 2'); }); test('lenient ordinal parsing', function (assert) { @@ -13425,15 +13732,374 @@ } }); - test('meridiem', function (assert) { - var h, m, t1, t2; - for (h = 0; h < 24; ++h) { - for (m = 0; m < 60; m += 15) { - t1 = moment.utc([2000, 0, 1, h, m]); - t2 = moment(t1.format('A h:mm'), 'A h:mm'); - assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), - 'meridiem at ' + t1.format('HH:mm')); + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + +})); + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + /*global QUnit:false*/ + + var test = QUnit.test; + + var expect = QUnit.expect; + + function module (name, lifecycle) { + QUnit.module(name, { + setup : function () { + moment.locale('en'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + function localeModule (name, lifecycle) { + QUnit.module('locale:' + name, { + setup : function () { + moment.locale(name); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + moment.locale('en'); + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } } + }); + } + + localeModule('gd'); + + var months = [ + 'Am Faoilleach,Faoi', + 'An Gearran,Gear', + 'Am Màrt,Màrt', + 'An Giblean,Gibl', + 'An Cèitean,Cèit', + 'An t-Ògmhios,Ògmh', + 'An t-Iuchar,Iuch', + 'An Lùnastal,Lùn', + 'An t-Sultain,Sult', + 'An Dàmhair,Dàmh', + 'An t-Samhain,Samh', + 'An Dùbhlachd,Dùbh' + ]; + + test('parse', function (assert) { + function equalTest(monthName, monthFormat, monthNum) { + assert.equal(moment(monthName, monthFormat).month(), monthNum, monthName + ' should be month ' + (monthNum + 1)); + } + + for (var i = 0; i < 12; i++) { + var testMonth = months[i].split(','); + equalTest(testMonth[0], 'MMM', i); + equalTest(testMonth[1], 'MMM', i); + equalTest(testMonth[0], 'MMMM', i); + equalTest(testMonth[1], 'MMMM', i); + equalTest(testMonth[0].toLocaleLowerCase(), 'MMMM', i); + equalTest(testMonth[1].toLocaleLowerCase(), 'MMMM', i); + equalTest(testMonth[0].toLocaleUpperCase(), 'MMMM', i); + equalTest(testMonth[1].toLocaleUpperCase(), 'MMMM', i); + } + }); + + test('format', function (assert) { + var a = [ + ['dddd, MMMM Do YYYY, h:mm:ss a', 'Didòmhnaich, An Gearran 14mh 2010, 3:25:50 pm'], + ['ddd, hA', 'Did, 3PM'], + ['M Mo MM MMMM MMM', '2 2na 02 An Gearran Gear'], + ['YYYY YY', '2010 10'], + ['D Do DD', '14 14mh 14'], + ['d do dddd ddd dd', '0 0mh Didòmhnaich Did Dò'], + ['DDD DDDo DDDD', '45 45mh 045'], + ['w wo ww', '6 6mh 06'], + ['h hh', '3 03'], + ['H HH', '15 15'], + ['m mm', '25 25'], + ['s ss', '50 50'], + ['a A', 'pm PM'], + ['[an] DDDo [latha den bhliadhna]', 'an 45mh latha den bhliadhna'], + ['LTS', '15:25:50'], + ['L', '14/02/2010'], + ['LL', '14 An Gearran 2010'], + ['LLL', '14 An Gearran 2010 15:25'], + ['LLLL', 'Didòmhnaich, 14 An Gearran 2010 15:25'], + ['l', '14/2/2010'], + ['ll', '14 Gear 2010'], + ['lll', '14 Gear 2010 15:25'], + ['llll', 'Did, 14 Gear 2010 15:25'] + ], + b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), + i; + for (i = 0; i < a.length; i++) { + assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); + } + }); + + test('format ordinal', function (assert) { + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1d', '1d'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2na', '2na'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3mh', '3mh'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4mh', '4mh'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5mh', '5mh'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6mh', '6mh'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7mh', '7mh'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8mh', '8mh'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9mh', '9mh'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10mh', '10mh'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11mh', '11mh'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12na', '12na'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13mh', '13mh'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14mh', '14mh'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15mh', '15mh'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16mh', '16mh'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17mh', '17mh'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18mh', '18mh'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19mh', '19mh'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20mh', '20mh'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21mh', '21mh'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22na', '22na'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23mh', '23mh'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24mh', '24mh'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25mh', '25mh'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26mh', '26mh'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27mh', '27mh'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28mh', '28mh'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29mh', '29mh'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30mh', '30mh'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31mh', '31mh'); + }); + + test('format month', function (assert) { + var expected = months; + for (var i = 0; i < expected.length; i++) { + assert.equal(moment([2011, i, 1]).format('MMMM,MMM'), expected[i], expected[i]); + } + }); + + test('format week', function (assert) { + var expected = ['Didòmhnaich Did Dò', 'Diluain Dil Lu', 'Dimàirt Dim Mà', 'Diciadain Dic Ci', 'Diardaoin Dia Ar', 'Dihaoine Dih Ha', 'Disathairne Dis Sa']; + for (var i = 0; i < expected.length; i++) { + assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); + } + }); + + test('from', function (assert) { + var start = moment([2007, 1, 28]); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'beagan diogan', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'mionaid', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'mionaid', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 mionaidean', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 mionaidean', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'uair', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'uair', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 uairean', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 uairean', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 uairean', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'latha', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'latha', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 latha', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'latha', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 latha', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 latha', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'mìos', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'mìos', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'mìos', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 mìosan', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 mìosan', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 mìosan', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'mìos', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 mìosan', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'bliadhna', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 bliadhna', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'bliadhna', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 bliadhna', '5 years = 5 years'); + }); + + test('suffix', function (assert) { + assert.equal(moment(30000).from(0), 'ann an beagan diogan', 'prefix'); + assert.equal(moment(0).from(30000), 'bho chionn beagan diogan', 'suffix'); + }); + + test('now from now', function (assert) { + assert.equal(moment().fromNow(), 'bho chionn beagan diogan', 'now from now should display as in the past'); + }); + + test('fromNow', function (assert) { + assert.equal(moment().add({s: 30}).fromNow(), 'ann an beagan diogan', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'ann an 5 latha', 'in 5 days'); + }); + + test('calendar day', function (assert) { + var a = moment().hours(2).minutes(0).seconds(0); + + assert.equal(moment(a).calendar(), 'An-diugh aig 02:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'An-diugh aig 02:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'An-diugh aig 03:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'A-màireach aig 02:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'An-diugh aig 01:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'An-dè aig 02:00', 'yesterday at the same time'); + }); + + test('calendar next week', function (assert) { + var i, m; + for (i = 2; i < 7; i++) { + m = moment().add({d: i}); + assert.equal(m.calendar(), m.format('dddd [aig] LT'), 'Today + ' + i + ' days current time'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format('dddd [aig] LT'), 'Today + ' + i + ' days beginning of day'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format('dddd [aig] LT'), 'Today + ' + i + ' days end of day'); + } + }); + + test('calendar last week', function (assert) { + var i, m; + + for (i = 2; i < 7; i++) { + m = moment().subtract({d: i}); + assert.equal(m.calendar(), m.format('dddd [seo chaidh] [aig] LT'), 'Today - ' + i + ' days current time'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format('dddd [seo chaidh] [aig] LT'), 'Today - ' + i + ' days beginning of day'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format('dddd [seo chaidh] [aig] LT'), 'Today - ' + i + ' days end of day'); + } + }); + + test('calendar all else', function (assert) { + var weeksAgo = moment().subtract({w: 1}), + weeksFromNow = moment().add({w: 1}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); + + weeksAgo = moment().subtract({w: 2}); + weeksFromNow = moment().add({w: 2}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); + }); + + test('weeks year starting sunday', function (assert) { + assert.equal(moment([2012, 0, 1]).week(), 52, 'Faoi 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).week(), 1, 'Faoi 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 1, 'Faoi 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).week(), 2, 'Faoi 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 2, 'Faoi 15 2012 should be week 2'); + }); + + test('weeks year starting monday', function (assert) { + assert.equal(moment([2007, 0, 1]).week(), 1, 'Faoi 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 1, 'Faoi 7 2007 should be week 1'); + assert.equal(moment([2007, 0, 8]).week(), 2, 'Faoi 8 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 2, 'Faoi 14 2007 should be week 2'); + assert.equal(moment([2007, 0, 15]).week(), 3, 'Faoi 15 2007 should be week 3'); + }); + + test('weeks year starting tuesday', function (assert) { + assert.equal(moment([2007, 11, 31]).week(), 1, 'Dùbh 31 2007 should be week 1'); + assert.equal(moment([2008, 0, 1]).week(), 1, 'Faoi 1 2008 should be week 1'); + assert.equal(moment([2008, 0, 6]).week(), 1, 'Faoi 6 2008 should be week 1'); + assert.equal(moment([2008, 0, 7]).week(), 2, 'Faoi 7 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 2, 'Faoi 13 2008 should be week 2'); + assert.equal(moment([2008, 0, 14]).week(), 3, 'Faoi 14 2008 should be week 3'); + }); + + test('weeks year starting wednesday', function (assert) { + assert.equal(moment([2002, 11, 30]).week(), 1, 'Dùbh 30 2002 should be week 1'); + assert.equal(moment([2003, 0, 1]).week(), 1, 'Faoi 1 2003 should be week 1'); + assert.equal(moment([2003, 0, 5]).week(), 1, 'Faoi 5 2003 should be week 1'); + assert.equal(moment([2003, 0, 6]).week(), 2, 'Faoi 6 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 2, 'Faoi 12 2003 should be week 2'); + assert.equal(moment([2003, 0, 13]).week(), 3, 'Faoi 13 2003 should be week 3'); + }); + + test('weeks year starting thursday', function (assert) { + assert.equal(moment([2008, 11, 29]).week(), 1, 'Dùbh 29 2008 should be week 1'); + assert.equal(moment([2009, 0, 1]).week(), 1, 'Faoi 1 2009 should be week 1'); + assert.equal(moment([2009, 0, 4]).week(), 1, 'Faoi 4 2009 should be week 1'); + assert.equal(moment([2009, 0, 5]).week(), 2, 'Faoi 5 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 2, 'Faoi 11 2009 should be week 2'); + assert.equal(moment([2009, 0, 13]).week(), 3, 'Faoi 12 2009 should be week 3'); + }); + + test('weeks year starting friday', function (assert) { + assert.equal(moment([2009, 11, 28]).week(), 53, 'Dùbh 28 2009 should be week 53'); + assert.equal(moment([2010, 0, 1]).week(), 53, 'Faoi 1 2010 should be week 53'); + assert.equal(moment([2010, 0, 3]).week(), 53, 'Faoi 3 2010 should be week 53'); + assert.equal(moment([2010, 0, 4]).week(), 1, 'Faoi 4 2010 should be week 1'); + assert.equal(moment([2010, 0, 10]).week(), 1, 'Faoi 10 2010 should be week 1'); + assert.equal(moment([2010, 0, 11]).week(), 2, 'Faoi 11 2010 should be week 2'); + }); + + test('weeks year starting saturday', function (assert) { + assert.equal(moment([2010, 11, 27]).week(), 52, 'Dùbh 27 2010 should be week 52'); + assert.equal(moment([2011, 0, 1]).week(), 52, 'Faoi 1 2011 should be week 52'); + assert.equal(moment([2011, 0, 2]).week(), 52, 'Faoi 2 2011 should be week 52'); + assert.equal(moment([2011, 0, 3]).week(), 1, 'Faoi 3 2011 should be week 1'); + assert.equal(moment([2011, 0, 9]).week(), 1, 'Faoi 9 2011 should be week 1'); + assert.equal(moment([2011, 0, 10]).week(), 2, 'Faoi 10 2011 should be week 2'); + }); + + test('weeks year starting sunday formatted', function (assert) { + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52na', 'Faoi 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1d', 'Faoi 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1d', 'Faoi 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2na', 'Faoi 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2na', 'Faoi 15 2012 should be week 2'); + }); + + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); } }); @@ -13448,8 +14114,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -13458,12 +14125,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -13481,8 +14150,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -13497,10 +14166,10 @@ }); } - localeModule('hr'); + localeModule('gl'); test('parse', function (assert) { - var tests = 'siječanj sij._veljača velj._ožujak ožu._travanj tra._svibanj svi._lipanj lip._srpanj srp._kolovoz kol._rujan ruj._listopad lis._studeni stu._prosinac pro.'.split('_'), i; + var tests = 'Xaneiro Xan._Febreiro Feb._Marzo Mar._Abril Abr._Maio Mai._Xuño Xuñ._Xullo Xul._Agosto Ago._Setembro Set._Outubro Out._Novembro Nov._Decembro Dec.'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -13519,29 +14188,29 @@ test('format', function (assert) { var a = [ - ['dddd, Do MMMM YYYY, h:mm:ss a', 'nedjelja, 14. veljača 2010, 3:25:50 pm'], - ['ddd, hA', 'ned., 3PM'], - ['M Mo MM MMMM MMM', '2 2. 02 veljača velj.'], + ['dddd, MMMM Do YYYY, h:mm:ss a', 'Domingo, Febreiro 14º 2010, 3:25:50 pm'], + ['ddd, hA', 'Dom., 3PM'], + ['M Mo MM MMMM MMM', '2 2º 02 Febreiro Feb.'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14. 14'], - ['d do dddd ddd dd', '0 0. nedjelja ned. ne'], - ['DDD DDDo DDDD', '45 45. 045'], - ['w wo ww', '7 7. 07'], + ['D Do DD', '14 14º 14'], + ['d do dddd ddd dd', '0 0º Domingo Dom. Do'], + ['DDD DDDo DDDD', '45 45º 045'], + ['w wo ww', '7 7º 07'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], ['a A', 'pm PM'], - ['[the] DDDo [day of the year]', 'the 45. day of the year'], + ['[the] DDDo [day of the year]', 'the 45º day of the year'], ['LTS', '15:25:50'], - ['L', '14. 02. 2010'], - ['LL', '14. veljača 2010'], - ['LLL', '14. veljača 2010 15:25'], - ['LLLL', 'nedjelja, 14. veljača 2010 15:25'], - ['l', '14. 2. 2010'], - ['ll', '14. velj. 2010'], - ['lll', '14. velj. 2010 15:25'], - ['llll', 'ned., 14. velj. 2010 15:25'] + ['L', '14/02/2010'], + ['LL', '14 Febreiro 2010'], + ['LLL', '14 Febreiro 2010 15:25'], + ['LLLL', 'Domingo 14 Febreiro 2010 15:25'], + ['l', '14/2/2010'], + ['ll', '14 Feb. 2010'], + ['lll', '14 Feb. 2010 15:25'], + ['llll', 'Dom. 14 Feb. 2010 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -13551,51 +14220,52 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º'); }); test('format month', function (assert) { - var expected = 'siječanj sij._veljača velj._ožujak ožu._travanj tra._svibanj svi._lipanj lip._srpanj srp._kolovoz kol._rujan ruj._listopad lis._studeni stu._prosinac pro.'.split('_'), i; + var expected = 'Xaneiro Xan._Febreiro Feb._Marzo Mar._Abril Abr._Maio Mai._Xuño Xuñ._Xullo Xul._Agosto Ago._Setembro Set._Outubro Out._Novembro Nov._Decembro Dec.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'nedjelja ned. ne_ponedjeljak pon. po_utorak uto. ut_srijeda sri. sr_četvrtak čet. če_petak pet. pe_subota sub. su'.split('_'), i; + var expected = 'Domingo Dom. Do_Luns Lun. Lu_Martes Mar. Ma_Mércores Mér. Mé_Xoves Xov. Xo_Venres Ven. Ve_Sábado Sáb. Sá'.split('_'), + i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -13603,115 +14273,85 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'par sekundi', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'jedna minuta', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'jedna minuta', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minute', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minuta', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'jedan sat', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'jedan sat', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 sata', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 sati', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 sati', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'dan', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'dan', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dana', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'dan', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dana', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dana', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'mjesec', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'mjesec', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'mjesec', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 mjeseca', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 mjeseca', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 mjeseca', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'mjesec', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 mjeseci', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'godinu', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 godine', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'godinu', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 godina', '5 years = 5 years'); + + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'uns segundos', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'un minuto', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'un minuto', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutos', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutos', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'unha hora', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'unha hora', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 horas', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 horas', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 horas', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'un día', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'un día', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 días', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'un día', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 días', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 días', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'un mes', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'un mes', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'un mes', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 meses', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 meses', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 meses', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'un mes', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 meses', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'un ano', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 anos', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'un ano', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 anos', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'za par sekundi', 'prefix'); - assert.equal(moment(0).from(30000), 'prije par sekundi', 'prefix'); + assert.equal(moment(30000).from(0), 'nuns segundos', 'prefix'); + assert.equal(moment(0).from(30000), 'hai uns segundos', 'suffix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'prije par sekundi', 'now from now should display as in the past'); + assert.equal(moment().fromNow(), 'hai uns segundos', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'za par sekundi', 'in a few seconds'); - assert.equal(moment().add({d: 5}).fromNow(), 'za 5 dana', 'in 5 days'); + assert.equal(moment().add({s: 30}).fromNow(), 'nuns segundos', 'en unos segundos'); + assert.equal(moment().add({d: 5}).fromNow(), 'en 5 días', 'en 5 días'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'danas u 2:00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'danas u 2:25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'danas u 3:00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'sutra u 2:00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'danas u 1:00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'jučer u 2:00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'hoxe ás 2:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'hoxe ás 2:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'hoxe ás 3:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'mañá ás 2:00', 'tomorrow at the same time'); + assert.equal(moment(a).add({d: 1, h : -1}).calendar(), 'mañá á 1:00', 'tomorrow minus 1 hour'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'hoxe á 1:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'onte á 2:00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; - function makeFormat(d) { - switch (d.day()) { - case 0: - return '[u] [nedjelju] [u] LT'; - case 3: - return '[u] [srijedu] [u] LT'; - case 6: - return '[u] [subotu] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[u] dddd [u] LT'; - } - } - for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), 'Today + ' + i + ' days end of day'); } }); test('calendar last week', function (assert) { var i, m; - - function makeFormat(d) { - switch (d.day()) { - case 0: - case 3: - return '[prošlu] dddd [u] LT'; - case 6: - return '[prošle] [subote] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[prošli] dddd [u] LT'; - } - } - for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('[o] dddd [pasado ' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[o] dddd [pasado ' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[o] dddd [pasado ' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), 'Today - ' + i + ' days end of day'); } }); @@ -13729,6 +14369,11 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); + test('regression tests', function (assert) { + var lastWeek = moment().subtract({d: 4}).hours(1); + assert.equal(lastWeek.calendar(), lastWeek.format('[o] dddd [pasado a] LT'), '1 o\'clock bug'); + }); + test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); @@ -13791,11 +14436,11 @@ }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1.', 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2.', 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2.', 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3'); + assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1º', 'Dec 26 2011 should be week 1'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1º', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2º', 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2º', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3º', 'Jan 9 2012 should be week 3'); }); test('lenient ordinal parsing', function (assert) { @@ -13836,8 +14481,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -13846,12 +14492,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -13869,8 +14517,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -13885,11 +14533,10 @@ }); } - localeModule('hu'); + localeModule('he'); test('parse', function (assert) { - var tests = 'január jan_február feb_március márc_április ápr_május máj_június jún_július júl_augusztus aug_szeptember szept_október okt_november nov_december dec'.split('_'), - i; + var tests = 'ינואר ינו׳_פברואר פבר׳_מרץ מרץ_אפריל אפר׳_מאי מאי_יוני יוני_יולי יולי_אוגוסט אוג׳_ספטמבר ספט׳_אוקטובר אוק׳_נובמבר נוב׳_דצמבר דצמ׳'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -13908,27 +14555,29 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, HH:mm:ss', 'vasárnap, február 14. 2010, 15:25:50'], - ['ddd, HH', 'vas, 15'], - ['M Mo MM MMMM MMM', '2 2. 02 február feb'], + ['dddd, MMMM Do YYYY, h:mm:ss a', 'ראשון, פברואר 14 2010, 3:25:50 pm'], + ['ddd, hA', 'א׳, 3PM'], + ['M Mo MM MMMM MMM', '2 2 02 פברואר פבר׳'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14. 14'], - ['d do dddd ddd dd', '0 0. vasárnap vas v'], - ['DDD DDDo DDDD', '45 45. 045'], - ['w wo ww', '7 7. 07'], + ['D Do DD', '14 14 14'], + ['d do dddd ddd dd', '0 0 ראשון א׳ א'], + ['DDD DDDo DDDD', '45 45 045'], + ['w wo ww', '8 8 08'], + ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], - ['[az év] DDDo [napja]', 'az év 45. napja'], + ['a A', 'pm PM'], + ['[the] DDDo [day of the year]', 'the 45 day of the year'], ['LTS', '15:25:50'], - ['L', '2010.02.14.'], - ['LL', '2010. február 14.'], - ['LLL', '2010. február 14. 15:25'], - ['LLLL', '2010. február 14., vasárnap 15:25'], - ['l', '2010.2.14.'], - ['ll', '2010. feb 14.'], - ['lll', '2010. feb 14. 15:25'], - ['llll', '2010. feb 14., vas 15:25'] + ['L', '14/02/2010'], + ['LL', '14 בפברואר 2010'], + ['LLL', '14 בפברואר 2010 15:25'], + ['LLLL', 'ראשון, 14 בפברואר 2010 15:25'], + ['l', '14/2/2010'], + ['ll', '14 פבר׳ 2010'], + ['lll', '14 פבר׳ 2010 15:25'], + ['llll', 'א׳, 14 פבר׳ 2010 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -13937,150 +14586,100 @@ } }); - test('meridiem', function (assert) { - assert.equal(moment([2011, 2, 23, 0, 0]).format('a'), 'de', 'am'); - assert.equal(moment([2011, 2, 23, 11, 59]).format('a'), 'de', 'am'); - assert.equal(moment([2011, 2, 23, 12, 0]).format('a'), 'du', 'pm'); - assert.equal(moment([2011, 2, 23, 23, 59]).format('a'), 'du', 'pm'); - - assert.equal(moment([2011, 2, 23, 0, 0]).format('A'), 'DE', 'AM'); - assert.equal(moment([2011, 2, 23, 11, 59]).format('A'), 'DE', 'AM'); - assert.equal(moment([2011, 2, 23, 12, 0]).format('A'), 'DU', 'PM'); - assert.equal(moment([2011, 2, 23, 23, 59]).format('A'), 'DU', 'PM'); - }); - - test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); - - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); - - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); - - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); - }); - test('format month', function (assert) { - var expected = 'január jan_február feb_március márc_április ápr_május máj_június jún_július júl_augusztus aug_szeptember szept_október okt_november nov_december dec'.split('_'), - i; + var expected = 'ינואר ינו׳_פברואר פבר׳_מרץ מרץ_אפריל אפר׳_מאי מאי_יוני יוני_יולי יולי_אוגוסט אוג׳_ספטמבר ספט׳_אוקטובר אוק׳_נובמבר נוב׳_דצמבר דצמ׳'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'vasárnap vas_hétfő hét_kedd kedd_szerda sze_csütörtök csüt_péntek pén_szombat szo'.split('_'), - i; + var expected = 'ראשון א׳ א|שני ב׳ ב|שלישי ג׳ ג|רביעי ד׳ ד|חמישי ה׳ ה|שישי ו׳ ו|שבת ש׳ ש'.split('|'), i; for (i = 0; i < expected.length; i++) { - assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]); + assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'néhány másodperc', '44 másodperc = néhány másodperc'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'egy perc', '45 másodperc = egy perc'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'egy perc', '89 másodperc = egy perc'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 perc', '90 másodperc = 2 perc'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 perc', '44 perc = 44 perc'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'egy óra', '45 perc = egy óra'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'egy óra', '89 perc = egy óra'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 óra', '90 perc = 2 óra'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 óra', '5 óra = 5 óra'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 óra', '21 óra = 21 óra'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'egy nap', '22 óra = egy nap'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'egy nap', '35 óra = egy nap'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 nap', '36 óra = 2 nap'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'egy nap', '1 nap = egy nap'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 nap', '5 nap = 5 nap'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 nap', '25 nap = 25 nap'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'egy hónap', '26 nap = egy hónap'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'egy hónap', '30 nap = egy hónap'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'egy hónap', '45 nap = egy hónap'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 hónap', '46 nap = 2 hónap'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 hónap', '75 nap = 2 hónap'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 hónap', '76 nap = 3 hónap'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'egy hónap', '1 hónap = egy hónap'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 hónap', '5 hónap = 5 hónap'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'egy év', '345 nap = egy év'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 év', '548 nap = 2 év'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'egy év', '1 év = egy év'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 év', '5 év = 5 év'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'מספר שניות', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'דקה', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'דקה', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 דקות', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 דקות', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'שעה', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'שעה', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), 'שעתיים', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 שעות', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 שעות', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'יום', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'יום', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), 'יומיים', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'יום', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 ימים', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 ימים', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'חודש', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'חודש', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'חודש', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), 'חודשיים', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), 'חודשיים', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 חודשים', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'חודש', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 חודשים', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'שנה', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), 'שנתיים', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 3699}), true), '10 שנים', '345 days = 10 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 7340}), true), '20 שנה', '548 days = 20 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'שנה', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 שנים', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'néhány másodperc múlva', 'prefix'); - assert.equal(moment(0).from(30000), 'néhány másodperce', 'suffix'); + assert.equal(moment(30000).from(0), 'בעוד מספר שניות', 'prefix'); + assert.equal(moment(0).from(30000), 'לפני מספר שניות', 'suffix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'néhány másodperce', 'now from now should display as in the past'); + assert.equal(moment().fromNow(), 'לפני מספר שניות', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'néhány másodperc múlva', 'néhány másodperc múlva'); - assert.equal(moment().add({d: 5}).fromNow(), '5 nap múlva', '5 nap múlva'); + assert.equal(moment().add({s: 30}).fromNow(), 'בעוד מספר שניות', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'בעוד 5 ימים', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'ma 2:00-kor', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'ma 2:25-kor', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'ma 3:00-kor', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'holnap 2:00-kor', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'ma 1:00-kor', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'tegnap 2:00-kor', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'היום ב־02:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'היום ב־02:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'היום ב־03:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'מחר ב־02:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'היום ב־01:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'אתמול ב־02:00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { - var i, m, days = 'vasárnap_hétfőn_kedden_szerdán_csütörtökön_pénteken_szombaton'.split('_'); + var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('[' + days[m.day()] + '] LT[-kor]'), 'today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [בשעה] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[' + days[m.day()] + '] LT[-kor]'), 'today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [בשעה] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[' + days[m.day()] + '] LT[-kor]'), 'today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [בשעה] LT'), 'Today + ' + i + ' days end of day'); } }); test('calendar last week', function (assert) { - var i, m, days = 'vasárnap_hétfőn_kedden_szerdán_csütörtökön_pénteken_szombaton'.split('_'); - + var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('[múlt ' + days[m.day()] + '] LT[-kor]'), 'today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('[ביום] dddd [האחרון בשעה] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[múlt ' + days[m.day()] + '] LT[-kor]'), 'today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[ביום] dddd [האחרון בשעה] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[múlt ' + days[m.day()] + '] LT[-kor]'), 'today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[ביום] dddd [האחרון בשעה] LT'), 'Today - ' + i + ' days end of day'); } }); @@ -14088,83 +14687,83 @@ var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), 'egy héte'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'egy hét múlva'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); weeksAgo = moment().subtract({w: 2}); weeksFromNow = moment().add({w: 2}); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 hete'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), '2 hét múlva'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); }); test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); + assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); + assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); }); test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); + assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); + assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); + assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); + assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); }); test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); + assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); + assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); + assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); + assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); }); test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); + assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); + assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); + assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); + assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); + assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); + assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); + assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); + assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); + assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); + assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); + assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); }); - test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1.', 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2.', 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2.', 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3'); + test('weeks year starting sunday format', function (assert) { + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1', 'Jan 7 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2', 'Jan 14 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3'); }); test('lenient ordinal parsing', function (assert) { @@ -14205,8 +14804,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -14215,12 +14815,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -14238,8 +14840,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -14254,10 +14856,10 @@ }); } - localeModule('hy-am'); + localeModule('hi'); test('parse', function (assert) { - var tests = 'հունվար հնվ_փետրվար փտր_մարտ մրտ_ապրիլ ապր_մայիս մյս_հունիս հնս_հուլիս հլս_օգոստոս օգս_սեպտեմբեր սպտ_հոկտեմբեր հկտ_նոյեմբեր նմբ_դեկտեմբեր դկտ'.split('_'), i; + var tests = 'जनवरी जन._फ़रवरी फ़र._मार्च मार्च_अप्रैल अप्रै._मई मई_जून जून_जुलाई जुल._अगस्त अग._सितम्बर सित._अक्टूबर अक्टू._नवम्बर नव._दिसम्बर दिस.'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -14274,35 +14876,30 @@ } }); - test('parse exceptional case', function (assert) { - assert.equal(moment('11 մայիսի 1989', ['DD MMMM YYYY']).format('DD-MM-YYYY'), '11-05-1989'); - }); - test('format', function (assert) { var a = [ - ['dddd, Do MMMM YYYY, HH:mm:ss', 'կիրակի, 14 փետրվարի 2010, 15:25:50'], - ['ddd, h A', 'կրկ, 3 ցերեկվա'], - ['M Mo MM MMMM MMM', '2 2 02 փետրվար փտր'], - ['YYYY YY', '2010 10'], - ['D Do DD', '14 14 14'], - ['d do dddd ddd dd', '0 0 կիրակի կրկ կրկ'], - ['DDD DDDo DDDD', '45 45-րդ 045'], - ['w wo ww', '7 7-րդ 07'], - ['h hh', '3 03'], - ['H HH', '15 15'], - ['m mm', '25 25'], - ['s ss', '50 50'], - ['a A', 'ցերեկվա ցերեկվա'], - ['[տարվա] DDDo [օրը]', 'տարվա 45-րդ օրը'], - ['LTS', '15:25:50'], - ['L', '14.02.2010'], - ['LL', '14 փետրվարի 2010 թ.'], - ['LLL', '14 փետրվարի 2010 թ., 15:25'], - ['LLLL', 'կիրակի, 14 փետրվարի 2010 թ., 15:25'], - ['l', '14.2.2010'], - ['ll', '14 փտր 2010 թ.'], - ['lll', '14 փտր 2010 թ., 15:25'], - ['llll', 'կրկ, 14 փտր 2010 թ., 15:25'] + ['dddd, Do MMMM YYYY, a h:mm:ss बजे', 'रविवार, १४ फ़रवरी २०१०, दोपहर ३:२५:५० बजे'], + ['ddd, a h बजे', 'रवि, दोपहर ३ बजे'], + ['M Mo MM MMMM MMM', '२ २ ०२ फ़रवरी फ़र.'], + ['YYYY YY', '२०१० १०'], + ['D Do DD', '१४ १४ १४'], + ['d do dddd ddd dd', '० ० रविवार रवि र'], + ['DDD DDDo DDDD', '४५ ४५ ०४५'], + ['w wo ww', '८ ८ ०८'], + ['h hh', '३ ०३'], + ['H HH', '१५ १५'], + ['m mm', '२५ २५'], + ['s ss', '५० ५०'], + ['a A', 'दोपहर दोपहर'], + ['LTS', 'दोपहर ३:२५:५० बजे'], + ['L', '१४/०२/२०१०'], + ['LL', '१४ फ़रवरी २०१०'], + ['LLL', '१४ फ़रवरी २०१०, दोपहर ३:२५ बजे'], + ['LLLL', 'रविवार, १४ फ़रवरी २०१०, दोपहर ३:२५ बजे'], + ['l', '१४/२/२०१०'], + ['ll', '१४ फ़र. २०१०'], + ['lll', '१४ फ़र. २०१०, दोपहर ३:२५ बजे'], + ['llll', 'रवि, १४ फ़र. २०१०, दोपहर ३:२५ बजे'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -14311,201 +14908,136 @@ } }); - test('format meridiem', function (assert) { - assert.equal(moment([2012, 11, 28, 0, 0]).format('A'), 'գիշերվա', 'night'); - assert.equal(moment([2012, 11, 28, 3, 59]).format('A'), 'գիշերվա', 'night'); - assert.equal(moment([2012, 11, 28, 4, 0]).format('A'), 'առավոտվա', 'morning'); - assert.equal(moment([2012, 11, 28, 11, 59]).format('A'), 'առավոտվա', 'morning'); - assert.equal(moment([2012, 11, 28, 12, 0]).format('A'), 'ցերեկվա', 'afternoon'); - assert.equal(moment([2012, 11, 28, 16, 59]).format('A'), 'ցերեկվա', 'afternoon'); - assert.equal(moment([2012, 11, 28, 17, 0]).format('A'), 'երեկոյան', 'evening'); - assert.equal(moment([2012, 11, 28, 23, 59]).format('A'), 'երեկոյան', 'evening'); - }); - test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-ին', '1-ին'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-րդ', '2-րդ'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-րդ', '3-րդ'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4-րդ', '4-րդ'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5-րդ', '5-րդ'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6-րդ', '6-րդ'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7-րդ', '7-րդ'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8-րդ', '8-րդ'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9-րդ', '9-րդ'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10-րդ', '10-րդ'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '१', '१'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '२', '२'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '३', '३'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '४', '४'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '५', '५'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '६', '६'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '७', '७'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '८', '८'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '९', '९'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '१०', '१०'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11-րդ', '11-րդ'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12-րդ', '12-րդ'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13-րդ', '13-րդ'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14-րդ', '14-րդ'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15-րդ', '15-րդ'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16-րդ', '16-րդ'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17-րդ', '17-րդ'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18-րդ', '18-րդ'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19-րդ', '19-րդ'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20-րդ', '20-րդ'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '११', '११'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '१२', '१२'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '१३', '१३'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '१४', '१४'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '१५', '१५'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '१६', '१६'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '१७', '१७'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '१८', '१८'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '१९', '१९'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '२०', '२०'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21-րդ', '21-րդ'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22-րդ', '22-րդ'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23-րդ', '23-րդ'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24-րդ', '24-րդ'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25-րդ', '25-րդ'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26-րդ', '26-րդ'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27-րդ', '27-րդ'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28-րդ', '28-րդ'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29-րդ', '29-րդ'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30-րդ', '30-րդ'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '२१', '२१'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '२२', '२२'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '२३', '२३'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '२४', '२४'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '२५', '२५'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '२६', '२६'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '२७', '२७'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '२८', '२८'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '२९', '२९'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '३०', '३०'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-րդ', '31-րդ'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '३१', '३१'); }); test('format month', function (assert) { - var expected = 'հունվար հնվ_փետրվար փտր_մարտ մրտ_ապրիլ ապր_մայիս մյս_հունիս հնս_հուլիս հլս_օգոստոս օգս_սեպտեմբեր սպտ_հոկտեմբեր հկտ_նոյեմբեր նմբ_դեկտեմբեր դկտ'.split('_'), i; + var expected = 'जनवरी जन._फ़रवरी फ़र._मार्च मार्च_अप्रैल अप्रै._मई मई_जून जून_जुलाई जुल._अगस्त अग._सितम्बर सित._अक्टूबर अक्टू._नवम्बर नव._दिसम्बर दिस.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); - test('format month case', function (assert) { - var months = { - 'nominative': 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_'), - 'accusative': 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_') - }, i; - for (i = 0; i < 12; i++) { - assert.equal(moment([2011, i, 1]).format('D MMMM'), '1 ' + months.accusative[i], '1 ' + months.accusative[i]); - assert.equal(moment([2011, i, 1]).format('MMMM'), months.nominative[i], '1 ' + months.nominative[i]); + test('format week', function (assert) { + var expected = 'रविवार रवि र_सोमवार सोम सो_मंगलवार मंगल मं_बुधवार बुध बु_गुरूवार गुरू गु_शुक्रवार शुक्र शु_शनिवार शनि श'.split('_'), i; + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); - test('format month short case', function (assert) { - var monthsShort = { - 'nominative': 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'), - 'accusative': 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_') - }, i; - for (i = 0; i < 12; i++) { - assert.equal(moment([2011, i, 1]).format('D MMM'), '1 ' + monthsShort.accusative[i], '1 ' + monthsShort.accusative[i]); - assert.equal(moment([2011, i, 1]).format('MMM'), monthsShort.nominative[i], '1 ' + monthsShort.nominative[i]); - } + test('from', function (assert) { + var start = moment([2007, 1, 28]); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'कुछ ही क्षण', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'एक मिनट', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'एक मिनट', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '२ मिनट', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '४४ मिनट', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'एक घंटा', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'एक घंटा', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '२ घंटे', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '५ घंटे', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '२१ घंटे', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'एक दिन', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'एक दिन', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '२ दिन', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'एक दिन', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '५ दिन', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '२५ दिन', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'एक महीने', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'एक महीने', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'एक महीने', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '२ महीने', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '२ महीने', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '३ महीने', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'एक महीने', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '५ महीने', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'एक वर्ष', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '२ वर्ष', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'एक वर्ष', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '५ वर्ष', '5 years = 5 years'); }); - test('format month case with escaped symbols', function (assert) { - var months = { - 'nominative': 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_'), - 'accusative': 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_') - }, i; - for (i = 0; i < 12; i++) { - assert.equal(moment([2013, i, 1]).format('D[] MMMM'), '1 ' + months.accusative[i], '1 ' + months.accusative[i]); - assert.equal(moment([2013, i, 1]).format('[]D[] []MMMM[]'), '1 ' + months.accusative[i] + '', '1 ' + months.accusative[i] + ''); - assert.equal(moment([2013, i, 1]).format('D[-ին օրը] MMMM'), '1-ին օրը ' + months.accusative[i], '1-ին օրը ' + months.accusative[i]); - assert.equal(moment([2013, i, 1]).format('D, MMMM'), '1, ' + months.nominative[i], '1, ' + months.nominative[i]); - } + test('suffix', function (assert) { + assert.equal(moment(30000).from(0), 'कुछ ही क्षण में', 'prefix'); + assert.equal(moment(0).from(30000), 'कुछ ही क्षण पहले', 'suffix'); }); - test('format month short case with escaped symbols', function (assert) { - var monthsShort = { - 'nominative': 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'), - 'accusative': 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_') - }, i; - for (i = 0; i < 12; i++) { - assert.equal(moment([2013, i, 1]).format('D[] MMM'), '1 ' + monthsShort.accusative[i], '1 ' + monthsShort.accusative[i]); - assert.equal(moment([2013, i, 1]).format('[]D[] []MMM[]'), '1 ' + monthsShort.accusative[i] + '', '1 ' + monthsShort.accusative[i] + ''); - assert.equal(moment([2013, i, 1]).format('D[-ին օրը] MMM'), '1-ին օրը ' + monthsShort.accusative[i], '1-ին օրը ' + monthsShort.accusative[i]); - assert.equal(moment([2013, i, 1]).format('D, MMM'), '1, ' + monthsShort.nominative[i], '1, ' + monthsShort.nominative[i]); - } + test('now from now', function (assert) { + assert.equal(moment().fromNow(), 'कुछ ही क्षण पहले', 'now from now should display as in the past'); }); - test('format week', function (assert) { - var expected = 'կիրակի կրկ կրկ_երկուշաբթի երկ երկ_երեքշաբթի երք երք_չորեքշաբթի չրք չրք_հինգշաբթի հնգ հնգ_ուրբաթ ուրբ ուրբ_շաբաթ շբթ շբթ'.split('_'), i; - for (i = 0; i < expected.length; i++) { - assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); - } - }); - - test('from', function (assert) { - var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'մի քանի վայրկյան', '44 seconds = seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'րոպե', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'րոպե', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 րոպե', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 րոպե', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'ժամ', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'ժամ', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 ժամ', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 ժամ', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 ժամ', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'օր', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'օր', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 օր', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'օր', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 օր', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 11}), true), '11 օր', '11 days = 11 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 21}), true), '21 օր', '21 days = 21 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 օր', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'ամիս', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'ամիս', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'ամիս', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 ամիս', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 ամիս', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 ամիս', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'ամիս', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 ամիս', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'տարի', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 տարի', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'տարի', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 տարի', '5 years = 5 years'); - }); - - test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'մի քանի վայրկյան հետո', 'prefix'); - assert.equal(moment(0).from(30000), 'մի քանի վայրկյան առաջ', 'suffix'); - }); - - test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'մի քանի վայրկյան հետո', 'in seconds'); - assert.equal(moment().add({d: 5}).fromNow(), '5 օր հետո', 'in 5 days'); - }); - - test('calendar day', function (assert) { - var a = moment().hours(2).minutes(0).seconds(0); - - assert.equal(moment(a).calendar(), 'այսօր 02:00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'այսօր 02:25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'այսօր 03:00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'վաղը 02:00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'այսօր 01:00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'երեկ 02:00', 'yesterday at the same time'); - }); - - test('calendar next week', function (assert) { - var i, m; - function makeFormat(d) { - return 'dddd [օրը ժամը] LT'; - } - - for (i = 2; i < 7; i++) { - m = moment().add({d: i}); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today + ' + i + ' days current time'); - m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today + ' + i + ' days beginning of day'); - m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today + ' + i + ' days end of day'); + test('fromNow', function (assert) { + assert.equal(moment().add({s: 30}).fromNow(), 'कुछ ही क्षण में', 'कुछ ही क्षण में'); + assert.equal(moment().add({d: 5}).fromNow(), '५ दिन में', '५ दिन में'); + }); + + test('calendar day', function (assert) { + var a = moment().hours(2).minutes(0).seconds(0); + + assert.equal(moment(a).calendar(), 'आज रात २:०० बजे', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'आज रात २:२५ बजे', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 3}).calendar(), 'आज सुबह ५:०० बजे', 'Now plus 3 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'कल रात २:०० बजे', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'आज रात १:०० बजे', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'कल रात २:०० बजे', 'yesterday at the same time'); + }); + + test('calendar next week', function (assert) { + var i, m; + for (i = 2; i < 7; i++) { + m = moment().add({d: i}); + assert.equal(m.calendar(), m.format('dddd[,] LT'), 'Today + ' + i + ' days current time'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format('dddd[,] LT'), 'Today + ' + i + ' days beginning of day'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format('dddd[,] LT'), 'Today + ' + i + ' days end of day'); } }); test('calendar last week', function (assert) { var i, m; - function makeFormat(d) { - return '[անցած] dddd [օրը ժամը] LT'; - } - for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('[पिछले] dddd[,] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[पिछले] dddd[,] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[पिछले] dddd[,] LT'), 'Today - ' + i + ' days end of day'); } }); @@ -14523,73 +15055,89 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); + test('meridiem invariant', function (assert) { + assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), 'रात', 'before dawn'); + assert.equal(moment([2011, 2, 23, 9, 30]).format('a'), 'सुबह', 'morning'); + assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'दोपहर', 'during day'); + assert.equal(moment([2011, 2, 23, 17, 30]).format('a'), 'शाम', 'evening'); + assert.equal(moment([2011, 2, 23, 19, 30]).format('a'), 'शाम', 'late evening'); + assert.equal(moment([2011, 2, 23, 21, 20]).format('a'), 'रात', 'night'); + + assert.equal(moment([2011, 2, 23, 2, 30]).format('A'), 'रात', 'before dawn'); + assert.equal(moment([2011, 2, 23, 9, 30]).format('A'), 'सुबह', 'morning'); + assert.equal(moment([2011, 2, 23, 14, 30]).format('A'), 'दोपहर', ' during day'); + assert.equal(moment([2011, 2, 23, 17, 30]).format('A'), 'शाम', 'evening'); + assert.equal(moment([2011, 2, 23, 19, 30]).format('A'), 'शाम', 'late evening'); + assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'रात', 'night'); + }); + test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); }); test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); + assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); + assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); }); test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); + assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); + assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); + assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); + assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); }); test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); + assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); + assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); + assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); + assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); }); test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); + assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); + assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); + assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); + assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); + assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); + assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); + assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); + assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); + assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); + assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); + assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-ին', 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-ին', 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2-րդ', 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2-րդ', 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-րդ', 'Jan 9 2012 should be week 3'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '१ ०१ १', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).format('w ww wo'), '१ ०१ १', 'Jan 7 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '२ ०२ २', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).format('w ww wo'), '२ ०२ २', 'Jan 14 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '३ ०३ ३', 'Jan 15 2012 should be week 3'); }); test('lenient ordinal parsing', function (assert) { @@ -14619,6 +15167,18 @@ } }); + test('meridiem', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { @@ -14630,8 +15190,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -14640,12 +15201,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -14663,8 +15226,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -14679,10 +15242,10 @@ }); } - localeModule('id'); + localeModule('hr'); test('parse', function (assert) { - var tests = 'Januari Jan_Februari Feb_Maret Mar_April Apr_Mei Mei_Juni Jun_Juli Jul_Agustus Ags_September Sep_Oktober Okt_November Nov_Desember Des'.split('_'), i; + var tests = 'siječanj sij._veljača velj._ožujak ožu._travanj tra._svibanj svi._lipanj lip._srpanj srp._kolovoz kol._rujan ruj._listopad lis._studeni stu._prosinac pro.'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -14701,29 +15264,29 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss a', 'Minggu, Februari 14 2010, 3:25:50 sore'], - ['ddd, hA', 'Min, 3sore'], - ['M Mo MM MMMM MMM', '2 2 02 Februari Feb'], + ['dddd, Do MMMM YYYY, h:mm:ss a', 'nedjelja, 14. veljače 2010, 3:25:50 pm'], + ['ddd, hA', 'ned., 3PM'], + ['M Mo MM MMMM MMM', '2 2. 02 veljača velj.'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14 14'], - ['d do dddd ddd dd', '0 0 Minggu Min Mg'], - ['DDD DDDo DDDD', '45 45 045'], - ['w wo ww', '7 7 07'], + ['D Do DD', '14 14. 14'], + ['d do dddd ddd dd', '0 0. nedjelja ned. ne'], + ['DDD DDDo DDDD', '45 45. 045'], + ['w wo ww', '7 7. 07'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], - ['a A', 'sore sore'], - ['[the] DDDo [day of the year]', 'the 45 day of the year'], - ['LTS', '15.25.50'], - ['L', '14/02/2010'], - ['LL', '14 Februari 2010'], - ['LLL', '14 Februari 2010 pukul 15.25'], - ['LLLL', 'Minggu, 14 Februari 2010 pukul 15.25'], - ['l', '14/2/2010'], - ['ll', '14 Feb 2010'], - ['lll', '14 Feb 2010 pukul 15.25'], - ['llll', 'Min, 14 Feb 2010 pukul 15.25'] + ['a A', 'pm PM'], + ['[the] DDDo [day of the year]', 'the 45. day of the year'], + ['LTS', '15:25:50'], + ['L', '14. 02. 2010'], + ['LL', '14. veljača 2010'], + ['LLL', '14. veljača 2010 15:25'], + ['LLLL', 'nedjelja, 14. veljača 2010 15:25'], + ['l', '14. 2. 2010'], + ['ll', '14. velj. 2010'], + ['lll', '14. velj. 2010 15:25'], + ['llll', 'ned., 14. velj. 2010 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -14732,15 +15295,52 @@ } }); + test('format ordinal', function (assert) { + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); + + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); + + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); + + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); + }); + test('format month', function (assert) { - var expected = 'Januari Jan_Februari Feb_Maret Mar_April Apr_Mei Mei_Juni Jun_Juli Jul_Agustus Ags_September Sep_Oktober Okt_November Nov_Desember Des'.split('_'), i; + var expected = 'siječanj sij._veljača velj._ožujak ožu._travanj tra._svibanj svi._lipanj lip._srpanj srp._kolovoz kol._rujan ruj._listopad lis._studeni stu._prosinac pro.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'Minggu Min Mg_Senin Sen Sn_Selasa Sel Sl_Rabu Rab Rb_Kamis Kam Km_Jumat Jum Jm_Sabtu Sab Sb'.split('_'), i; + var expected = 'nedjelja ned. ne_ponedjeljak pon. po_utorak uto. ut_srijeda sri. sr_četvrtak čet. če_petak pet. pe_subota sub. su'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -14748,82 +15348,115 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'beberapa detik', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'semenit', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'semenit', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 menit', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 menit', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'sejam', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'sejam', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 jam', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 jam', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 jam', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'sehari', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'sehari', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 hari', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'sehari', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 hari', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 hari', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'sebulan', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'sebulan', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'sebulan', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 bulan', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 bulan', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 bulan', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'sebulan', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 bulan', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'setahun', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 tahun', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'setahun', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 tahun', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'par sekundi', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'jedna minuta', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'jedna minuta', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minute', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minuta', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'jedan sat', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'jedan sat', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 sata', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 sati', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 sati', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'dan', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'dan', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dana', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'dan', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dana', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dana', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'mjesec', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'mjesec', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'mjesec', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 mjeseca', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 mjeseca', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 mjeseca', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'mjesec', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 mjeseci', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'godinu', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 godine', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'godinu', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 godina', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'dalam beberapa detik', 'prefix'); - assert.equal(moment(0).from(30000), 'beberapa detik yang lalu', 'suffix'); + assert.equal(moment(30000).from(0), 'za par sekundi', 'prefix'); + assert.equal(moment(0).from(30000), 'prije par sekundi', 'prefix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'beberapa detik yang lalu', 'now from now should display as in the past'); + assert.equal(moment().fromNow(), 'prije par sekundi', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'dalam beberapa detik', 'in a few seconds'); - assert.equal(moment().add({d: 5}).fromNow(), 'dalam 5 hari', 'in 5 days'); + assert.equal(moment().add({s: 30}).fromNow(), 'za par sekundi', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'za 5 dana', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'Hari ini pukul 02.00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'Hari ini pukul 02.25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'Hari ini pukul 03.00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'Besok pukul 02.00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'Hari ini pukul 01.00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'Kemarin pukul 02.00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'danas u 2:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'danas u 2:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'danas u 3:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'sutra u 2:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'danas u 1:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'jučer u 2:00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; + + function makeFormat(d) { + switch (d.day()) { + case 0: + return '[u] [nedjelju] [u] LT'; + case 3: + return '[u] [srijedu] [u] LT'; + case 6: + return '[u] [subotu] [u] LT'; + case 1: + case 2: + case 4: + case 5: + return '[u] dddd [u] LT'; + } + } + for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd [pukul] LT'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [pukul] LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [pukul] LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today + ' + i + ' days end of day'); } }); test('calendar last week', function (assert) { var i, m; + + function makeFormat(d) { + switch (d.day()) { + case 0: + case 3: + return '[prošlu] dddd [u] LT'; + case 6: + return '[prošle] [subote] [u] LT'; + case 1: + case 2: + case 4: + case 5: + return '[prošli] dddd [u] LT'; + } + } + for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('dddd [lalu pukul] LT'), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [lalu pukul] LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [lalu pukul] LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days end of day'); } }); @@ -14903,11 +15536,11 @@ }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1', 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2', 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3', 'Jan 9 2012 should be week 3'); + assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1.', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2.', 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2.', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3'); }); test('lenient ordinal parsing', function (assert) { @@ -14937,18 +15570,6 @@ } }); - test('meridiem invariant', function (assert) { - var h, m, t1, t2; - for (h = 0; h < 24; ++h) { - for (m = 0; m < 60; m += 15) { - t1 = moment.utc([2000, 0, 1, h, m]); - t2 = moment(t1.format('A h:mm'), 'A h:mm'); - assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), - 'meridiem at ' + t1.format('HH:mm')); - } - } - }); - test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { @@ -14960,8 +15581,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -14970,12 +15592,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -14993,8 +15617,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -15009,10 +15633,11 @@ }); } - localeModule('is'); + localeModule('hu'); test('parse', function (assert) { - var tests = 'janúar jan_febrúar feb_mars mar_apríl apr_maí maí_júní jún_júlí júl_ágúst ágú_september sep_október okt_nóvember nóv_desember des'.split('_'), i; + var tests = 'január jan_február feb_március márc_április ápr_május máj_június jún_július júl_augusztus aug_szeptember szept_október okt_november nov_december dec'.split('_'), + i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -15031,29 +15656,27 @@ test('format', function (assert) { var a = [ - ['dddd, Do MMMM YYYY, h:mm:ss a', 'sunnudagur, 14. febrúar 2010, 3:25:50 pm'], - ['ddd, hA', 'sun, 3PM'], - ['M Mo MM MMMM MMM', '2 2. 02 febrúar feb'], + ['dddd, MMMM Do YYYY, HH:mm:ss', 'vasárnap, február 14. 2010, 15:25:50'], + ['ddd, HH', 'vas, 15'], + ['M Mo MM MMMM MMM', '2 2. 02 február feb'], ['YYYY YY', '2010 10'], ['D Do DD', '14 14. 14'], - ['d do dddd ddd dd', '0 0. sunnudagur sun Su'], + ['d do dddd ddd dd', '0 0. vasárnap vas v'], ['DDD DDDo DDDD', '45 45. 045'], - ['w wo ww', '6 6. 06'], - ['h hh', '3 03'], + ['w wo ww', '7 7. 07'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], - ['a A', 'pm PM'], - ['[the] DDDo [day of the year]', 'the 45. day of the year'], + ['[az év] DDDo [napja]', 'az év 45. napja'], ['LTS', '15:25:50'], - ['L', '14/02/2010'], - ['LL', '14. febrúar 2010'], - ['LLL', '14. febrúar 2010 kl. 15:25'], - ['LLLL', 'sunnudagur, 14. febrúar 2010 kl. 15:25'], - ['l', '14/2/2010'], - ['ll', '14. feb 2010'], - ['lll', '14. feb 2010 kl. 15:25'], - ['llll', 'sun, 14. feb 2010 kl. 15:25'] + ['L', '2010.02.14.'], + ['LL', '2010. február 14.'], + ['LLL', '2010. február 14. 15:25'], + ['LLLL', '2010. február 14., vasárnap 15:25'], + ['l', '2010.2.14.'], + ['ll', '2010. feb 14.'], + ['lll', '2010. feb 14. 15:25'], + ['llll', '2010. feb 14., vas 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -15062,6 +15685,18 @@ } }); + test('meridiem', function (assert) { + assert.equal(moment([2011, 2, 23, 0, 0]).format('a'), 'de', 'am'); + assert.equal(moment([2011, 2, 23, 11, 59]).format('a'), 'de', 'am'); + assert.equal(moment([2011, 2, 23, 12, 0]).format('a'), 'du', 'pm'); + assert.equal(moment([2011, 2, 23, 23, 59]).format('a'), 'du', 'pm'); + + assert.equal(moment([2011, 2, 23, 0, 0]).format('A'), 'DE', 'AM'); + assert.equal(moment([2011, 2, 23, 11, 59]).format('A'), 'DE', 'AM'); + assert.equal(moment([2011, 2, 23, 12, 0]).format('A'), 'DU', 'PM'); + assert.equal(moment([2011, 2, 23, 23, 59]).format('A'), 'DU', 'PM'); + }); + test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); @@ -15100,104 +15735,100 @@ }); test('format month', function (assert) { - var expected = 'janúar jan_febrúar feb_mars mar_apríl apr_maí maí_júní jún_júlí júl_ágúst ágú_september sep_október okt_nóvember nóv_desember des'.split('_'), i; + var expected = 'január jan_február feb_március márc_április ápr_május máj_június jún_július júl_augusztus aug_szeptember szept_október okt_november nov_december dec'.split('_'), + i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'sunnudagur sun Su_mánudagur mán Má_þriðjudagur þri Þr_miðvikudagur mið Mi_fimmtudagur fim Fi_föstudagur fös Fö_laugardagur lau La'.split('_'), i; + var expected = 'vasárnap vas_hétfő hét_kedd kedd_szerda sze_csütörtök csüt_péntek pén_szombat szo'.split('_'), + i; for (i = 0; i < expected.length; i++) { - assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); + assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]); } }); test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'nokkrar sekúndur', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'mínúta', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'mínúta', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 mínútur', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 mínútur', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 21}), true), '21 mínúta', '21 minutes = 21 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'klukkustund', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'klukkustund', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 klukkustundir', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 klukkustundir', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 klukkustund', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'dagur', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'dagur', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dagar', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'dagur', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dagar', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dagar', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 11}), true), '11 dagar', '11 days = 11 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 21}), true), '21 dagur', '21 days = 21 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'mánuður', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'mánuður', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'mánuður', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 mánuðir', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 mánuðir', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 mánuðir', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'mánuður', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 mánuðir', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ár', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 ár', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'ár', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 ár', '5 years = 5 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 21}), true), '21 ár', '21 years = 21 years'); - }); - - test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'eftir nokkrar sekúndur', 'prefix'); - assert.equal(moment(0).from(30000), 'fyrir nokkrum sekúndum síðan', 'suffix'); - assert.equal(moment().subtract({m: 1}).fromNow(), 'fyrir mínútu síðan', 'a minute ago'); - }); - - test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'fyrir nokkrum sekúndum síðan', 'now from now should display as in the past'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'néhány másodperc', '44 másodperc = néhány másodperc'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'egy perc', '45 másodperc = egy perc'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'egy perc', '89 másodperc = egy perc'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 perc', '90 másodperc = 2 perc'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 perc', '44 perc = 44 perc'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'egy óra', '45 perc = egy óra'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'egy óra', '89 perc = egy óra'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 óra', '90 perc = 2 óra'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 óra', '5 óra = 5 óra'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 óra', '21 óra = 21 óra'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'egy nap', '22 óra = egy nap'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'egy nap', '35 óra = egy nap'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 nap', '36 óra = 2 nap'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'egy nap', '1 nap = egy nap'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 nap', '5 nap = 5 nap'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 nap', '25 nap = 25 nap'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'egy hónap', '26 nap = egy hónap'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'egy hónap', '30 nap = egy hónap'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'egy hónap', '45 nap = egy hónap'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 hónap', '46 nap = 2 hónap'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 hónap', '75 nap = 2 hónap'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 hónap', '76 nap = 3 hónap'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'egy hónap', '1 hónap = egy hónap'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 hónap', '5 hónap = 5 hónap'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'egy év', '345 nap = egy év'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 év', '548 nap = 2 év'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'egy év', '1 év = egy év'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 év', '5 év = 5 év'); + }); + + test('suffix', function (assert) { + assert.equal(moment(30000).from(0), 'néhány másodperc múlva', 'prefix'); + assert.equal(moment(0).from(30000), 'néhány másodperce', 'suffix'); + }); + + test('now from now', function (assert) { + assert.equal(moment().fromNow(), 'néhány másodperce', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'eftir nokkrar sekúndur', 'in a few seconds'); - assert.equal(moment().add({m: 1}).fromNow(), 'eftir mínútu', 'in a minute'); - assert.equal(moment().add({d: 5}).fromNow(), 'eftir 5 daga', 'in 5 days'); + assert.equal(moment().add({s: 30}).fromNow(), 'néhány másodperc múlva', 'néhány másodperc múlva'); + assert.equal(moment().add({d: 5}).fromNow(), '5 nap múlva', '5 nap múlva'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'í dag kl. 2:00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'í dag kl. 2:25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'í dag kl. 3:00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'á morgun kl. 2:00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'í dag kl. 1:00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'í gær kl. 2:00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'ma 2:00-kor', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'ma 2:25-kor', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'ma 3:00-kor', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'holnap 2:00-kor', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'ma 1:00-kor', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'tegnap 2:00-kor', 'yesterday at the same time'); }); test('calendar next week', function (assert) { - var i, m; + var i, m, days = 'vasárnap_hétfőn_kedden_szerdán_csütörtökön_pénteken_szombaton'.split('_'); for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd [kl.] LT'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('[' + days[m.day()] + '] LT[-kor]'), 'today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [kl.] LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[' + days[m.day()] + '] LT[-kor]'), 'today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [kl.] LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[' + days[m.day()] + '] LT[-kor]'), 'today + ' + i + ' days end of day'); } }); test('calendar last week', function (assert) { - var i, m; + var i, m, days = 'vasárnap_hétfőn_kedden_szerdán_csütörtökön_pénteken_szombaton'.split('_'); for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('[síðasta] dddd [kl.] LT'), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('[múlt ' + days[m.day()] + '] LT[-kor]'), 'today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[síðasta] dddd [kl.] LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[múlt ' + days[m.day()] + '] LT[-kor]'), 'today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[síðasta] dddd [kl.] LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[múlt ' + days[m.day()] + '] LT[-kor]'), 'today - ' + i + ' days end of day'); } }); @@ -15205,22 +15836,22 @@ var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), 'egy héte'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'egy hét múlva'); weeksAgo = moment().subtract({w: 2}); weeksFromNow = moment().add({w: 2}); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 hete'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), '2 hét múlva'); }); test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); + assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); test('weeks year starting monday', function (assert) { @@ -15255,33 +15886,33 @@ assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); + assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); + assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); + assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); + assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); + assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); + assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); + assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); + assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); + assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); + assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); + assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); + assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1.', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2.', 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2.', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3'); }); test('lenient ordinal parsing', function (assert) { @@ -15322,8 +15953,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -15332,12 +15964,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -15355,8 +15989,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -15371,10 +16005,10 @@ }); } - localeModule('it'); + localeModule('hy-am'); test('parse', function (assert) { - var tests = 'gennaio gen_febbraio feb_marzo mar_aprile apr_maggio mag_giugno giu_luglio lug_agosto ago_settembre set_ottobre ott_novembre nov_dicembre dic'.split('_'), i; + var tests = 'հունվար հնվ_փետրվար փտր_մարտ մրտ_ապրիլ ապր_մայիս մյս_հունիս հնս_հուլիս հլս_օգոստոս օգս_սեպտեմբեր սպտ_հոկտեմբեր հկտ_նոյեմբեր նմբ_դեկտեմբեր դկտ'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -15391,31 +16025,35 @@ } }); + test('parse exceptional case', function (assert) { + assert.equal(moment('11 մայիսի 1989', ['DD MMMM YYYY']).format('DD-MM-YYYY'), '11-05-1989'); + }); + test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss a', 'Domenica, febbraio 14º 2010, 3:25:50 pm'], - ['ddd, hA', 'Dom, 3PM'], - ['M Mo MM MMMM MMM', '2 2º 02 febbraio feb'], + ['dddd, Do MMMM YYYY, HH:mm:ss', 'կիրակի, 14 փետրվարի 2010, 15:25:50'], + ['ddd, h A', 'կրկ, 3 ցերեկվա'], + ['M Mo MM MMMM MMM', '2 2 02 փետրվար փտր'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14º 14'], - ['d do dddd ddd dd', '0 0º Domenica Dom D'], - ['DDD DDDo DDDD', '45 45º 045'], - ['w wo ww', '6 6º 06'], + ['D Do DD', '14 14 14'], + ['d do dddd ddd dd', '0 0 կիրակի կրկ կրկ'], + ['DDD DDDo DDDD', '45 45-րդ 045'], + ['w wo ww', '7 7-րդ 07'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], - ['a A', 'pm PM'], - ['[the] DDDo [day of the year]', 'the 45º day of the year'], + ['a A', 'ցերեկվա ցերեկվա'], + ['[տարվա] DDDo [օրը]', 'տարվա 45-րդ օրը'], ['LTS', '15:25:50'], - ['L', '14/02/2010'], - ['LL', '14 febbraio 2010'], - ['LLL', '14 febbraio 2010 15:25'], - ['LLLL', 'Domenica, 14 febbraio 2010 15:25'], - ['l', '14/2/2010'], - ['ll', '14 feb 2010'], - ['lll', '14 feb 2010 15:25'], - ['llll', 'Dom, 14 feb 2010 15:25'] + ['L', '14.02.2010'], + ['LL', '14 փետրվարի 2010 թ.'], + ['LLL', '14 փետրվարի 2010 թ., 15:25'], + ['LLLL', 'կիրակի, 14 փետրվարի 2010 թ., 15:25'], + ['l', '14.2.2010'], + ['ll', '14 փտր 2010 թ.'], + ['lll', '14 փտր 2010 թ., 15:25'], + ['llll', 'կրկ, 14 փտր 2010 թ., 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -15424,52 +16062,111 @@ } }); + test('format meridiem', function (assert) { + assert.equal(moment([2012, 11, 28, 0, 0]).format('A'), 'գիշերվա', 'night'); + assert.equal(moment([2012, 11, 28, 3, 59]).format('A'), 'գիշերվա', 'night'); + assert.equal(moment([2012, 11, 28, 4, 0]).format('A'), 'առավոտվա', 'morning'); + assert.equal(moment([2012, 11, 28, 11, 59]).format('A'), 'առավոտվա', 'morning'); + assert.equal(moment([2012, 11, 28, 12, 0]).format('A'), 'ցերեկվա', 'afternoon'); + assert.equal(moment([2012, 11, 28, 16, 59]).format('A'), 'ցերեկվա', 'afternoon'); + assert.equal(moment([2012, 11, 28, 17, 0]).format('A'), 'երեկոյան', 'evening'); + assert.equal(moment([2012, 11, 28, 23, 59]).format('A'), 'երեկոյան', 'evening'); + }); + test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-ին', '1-ին'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-րդ', '2-րդ'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-րդ', '3-րդ'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4-րդ', '4-րդ'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5-րդ', '5-րդ'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6-րդ', '6-րդ'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7-րդ', '7-րդ'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8-րդ', '8-րդ'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9-րդ', '9-րդ'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10-րդ', '10-րդ'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11-րդ', '11-րդ'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12-րդ', '12-րդ'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13-րդ', '13-րդ'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14-րդ', '14-րդ'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15-րդ', '15-րդ'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16-րդ', '16-րդ'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17-րդ', '17-րդ'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18-րդ', '18-րդ'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19-րդ', '19-րդ'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20-րդ', '20-րդ'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21-րդ', '21-րդ'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22-րդ', '22-րդ'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23-րդ', '23-րդ'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24-րդ', '24-րդ'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25-րդ', '25-րդ'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26-րդ', '26-րդ'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27-րդ', '27-րդ'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28-րդ', '28-րդ'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29-րդ', '29-րդ'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30-րդ', '30-րդ'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-րդ', '31-րդ'); }); test('format month', function (assert) { - var expected = 'gennaio gen_febbraio feb_marzo mar_aprile apr_maggio mag_giugno giu_luglio lug_agosto ago_settembre set_ottobre ott_novembre nov_dicembre dic'.split('_'), i; + var expected = 'հունվար հնվ_փետրվար փտր_մարտ մրտ_ապրիլ ապր_մայիս մյս_հունիս հնս_հուլիս հլս_օգոստոս օգս_սեպտեմբեր սպտ_հոկտեմբեր հկտ_նոյեմբեր նմբ_դեկտեմբեր դկտ'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); + test('format month case', function (assert) { + var months = { + 'nominative': 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_'), + 'accusative': 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_') + }, i; + for (i = 0; i < 12; i++) { + assert.equal(moment([2011, i, 1]).format('D MMMM'), '1 ' + months.accusative[i], '1 ' + months.accusative[i]); + assert.equal(moment([2011, i, 1]).format('MMMM'), months.nominative[i], '1 ' + months.nominative[i]); + } + }); + + test('format month short case', function (assert) { + var monthsShort = { + 'nominative': 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'), + 'accusative': 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_') + }, i; + for (i = 0; i < 12; i++) { + assert.equal(moment([2011, i, 1]).format('D MMM'), '1 ' + monthsShort.accusative[i], '1 ' + monthsShort.accusative[i]); + assert.equal(moment([2011, i, 1]).format('MMM'), monthsShort.nominative[i], '1 ' + monthsShort.nominative[i]); + } + }); + + test('format month case with escaped symbols', function (assert) { + var months = { + 'nominative': 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_'), + 'accusative': 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_') + }, i; + for (i = 0; i < 12; i++) { + assert.equal(moment([2013, i, 1]).format('D[] MMMM'), '1 ' + months.accusative[i], '1 ' + months.accusative[i]); + assert.equal(moment([2013, i, 1]).format('[]D[] []MMMM[]'), '1 ' + months.accusative[i] + '', '1 ' + months.accusative[i] + ''); + assert.equal(moment([2013, i, 1]).format('D[-ին օրը] MMMM'), '1-ին օրը ' + months.accusative[i], '1-ին օրը ' + months.accusative[i]); + assert.equal(moment([2013, i, 1]).format('D, MMMM'), '1, ' + months.nominative[i], '1, ' + months.nominative[i]); + } + }); + + test('format month short case with escaped symbols', function (assert) { + var monthsShort = { + 'nominative': 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'), + 'accusative': 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_') + }, i; + for (i = 0; i < 12; i++) { + assert.equal(moment([2013, i, 1]).format('D[] MMM'), '1 ' + monthsShort.accusative[i], '1 ' + monthsShort.accusative[i]); + assert.equal(moment([2013, i, 1]).format('[]D[] []MMM[]'), '1 ' + monthsShort.accusative[i] + '', '1 ' + monthsShort.accusative[i] + ''); + assert.equal(moment([2013, i, 1]).format('D[-ին օրը] MMM'), '1-ին օրը ' + monthsShort.accusative[i], '1-ին օրը ' + monthsShort.accusative[i]); + assert.equal(moment([2013, i, 1]).format('D, MMM'), '1, ' + monthsShort.nominative[i], '1, ' + monthsShort.nominative[i]); + } + }); + test('format week', function (assert) { - var expected = 'Domenica Dom D_Lunedì Lun L_Martedì Mar Ma_Mercoledì Mer Me_Giovedì Gio G_Venerdì Ven V_Sabato Sab S'.split('_'), i; + var expected = 'կիրակի կրկ կրկ_երկուշաբթի երկ երկ_երեքշաբթի երք երք_չորեքշաբթի չրք չրք_հինգշաբթի հնգ հնգ_ուրբաթ ուրբ ուրբ_շաբաթ շբթ շբթ'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -15477,81 +16174,89 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'alcuni secondi', '44 seconds = seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'un minuto', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'un minuto', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minuti', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minuti', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'un\'ora', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'un\'ora', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 ore', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 ore', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 ore', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'un giorno', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'un giorno', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 giorni', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'un giorno', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 giorni', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 giorni', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'un mese', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'un mese', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'un mese', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 mesi', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 mesi', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 mesi', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'un mese', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 mesi', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'un anno', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 anni', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'un anno', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 anni', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'մի քանի վայրկյան', '44 seconds = seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'րոպե', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'րոպե', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 րոպե', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 րոպե', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'ժամ', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'ժամ', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 ժամ', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 ժամ', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 ժամ', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'օր', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'օր', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 օր', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'օր', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 օր', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 11}), true), '11 օր', '11 days = 11 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 21}), true), '21 օր', '21 days = 21 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 օր', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'ամիս', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'ամիս', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'ամիս', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 ամիս', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 ամիս', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 ամիս', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'ամիս', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 ամիս', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'տարի', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 տարի', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'տարի', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 տարի', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'in alcuni secondi', 'prefix'); - assert.equal(moment(0).from(30000), 'alcuni secondi fa', 'suffix'); + assert.equal(moment(30000).from(0), 'մի քանի վայրկյան հետո', 'prefix'); + assert.equal(moment(0).from(30000), 'մի քանի վայրկյան առաջ', 'suffix'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'in alcuni secondi', 'in seconds'); - assert.equal(moment().add({d: 5}).fromNow(), 'tra 5 giorni', 'in 5 days'); + assert.equal(moment().add({s: 30}).fromNow(), 'մի քանի վայրկյան հետո', 'in seconds'); + assert.equal(moment().add({d: 5}).fromNow(), '5 օր հետո', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'Oggi alle 02:00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'Oggi alle 02:25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'Oggi alle 03:00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'Domani alle 02:00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'Oggi alle 01:00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'Ieri alle 02:00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'այսօր 02:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'այսօր 02:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'այսօր 03:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'վաղը 02:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'այսօր 01:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'երեկ 02:00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; + function makeFormat(d) { + return 'dddd [օրը ժամը] LT'; + } + for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd [alle] LT'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [alle] LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [alle] LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today + ' + i + ' days end of day'); } }); test('calendar last week', function (assert) { - var i, m, weekday, datestring; + var i, m; + + function makeFormat(d) { + return '[անցած] dddd [օրը ժամը] LT'; + } + for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - // Different date string - weekday = parseInt(m.format('d'), 10); - datestring = (weekday === 0) ? '[la scorsa] dddd [alle] LT' : '[lo scorso] dddd [alle] LT'; - assert.equal(m.calendar(), m.format(datestring), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format(datestring), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format(datestring), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days end of day'); } }); @@ -15570,11 +16275,11 @@ }); test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); + assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); test('weeks year starting monday', function (assert) { @@ -15609,33 +16314,33 @@ assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); + assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); + assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); + assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); + assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); + assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); + assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); + assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); + assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); + assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); + assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); + assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52º', 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1º', 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1º', 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2º', 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2º', 'Jan 15 2012 should be week 2'); + assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-ին', 'Dec 26 2011 should be week 1'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-ին', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2-րդ', 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2-րդ', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-րդ', 'Jan 9 2012 should be week 3'); }); test('lenient ordinal parsing', function (assert) { @@ -15676,8 +16381,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -15686,12 +16392,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -15709,8 +16417,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -15725,10 +16433,10 @@ }); } - localeModule('ja'); + localeModule('id'); test('parse', function (assert) { - var tests = '1月 1月_2月 2月_3月 3月_4月 4月_5月 5月_6月 6月_7月 7月_8月 8月_9月 9月_10月 10月_11月 11月_12月 12月'.split('_'), i; + var tests = 'Januari Jan_Februari Feb_Maret Mar_April Apr_Mei Mei_Juni Jun_Juli Jul_Agustus Ags_September Sep_Oktober Okt_November Nov_Desember Des'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -15747,29 +16455,29 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, a h:mm:ss', '日曜日, 2月 14 2010, 午後 3:25:50'], - ['ddd, Ah', '日, 午後3'], - ['M Mo MM MMMM MMM', '2 2 02 2月 2月'], + ['dddd, MMMM Do YYYY, h:mm:ss a', 'Minggu, Februari 14 2010, 3:25:50 sore'], + ['ddd, hA', 'Min, 3sore'], + ['M Mo MM MMMM MMM', '2 2 02 Februari Feb'], ['YYYY YY', '2010 10'], ['D Do DD', '14 14 14'], - ['d do dddd ddd dd', '0 0 日曜日 日 日'], + ['d do dddd ddd dd', '0 0 Minggu Min Mg'], ['DDD DDDo DDDD', '45 45 045'], - ['w wo ww', '8 8 08'], + ['w wo ww', '7 7 07'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], - ['a A', '午後 午後'], + ['a A', 'sore sore'], ['[the] DDDo [day of the year]', 'the 45 day of the year'], - ['LTS', '午後3時25分50秒'], - ['L', '2010/02/14'], - ['LL', '2010年2月14日'], - ['LLL', '2010年2月14日午後3時25分'], - ['LLLL', '2010年2月14日午後3時25分 日曜日'], - ['l', '2010/2/14'], - ['ll', '2010年2月14日'], - ['lll', '2010年2月14日午後3時25分'], - ['llll', '2010年2月14日午後3時25分 日'] + ['LTS', '15.25.50'], + ['L', '14/02/2010'], + ['LL', '14 Februari 2010'], + ['LLL', '14 Februari 2010 pukul 15.25'], + ['LLLL', 'Minggu, 14 Februari 2010 pukul 15.25'], + ['l', '14/2/2010'], + ['ll', '14 Feb 2010'], + ['lll', '14 Feb 2010 pukul 15.25'], + ['llll', 'Min, 14 Feb 2010 pukul 15.25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -15779,14 +16487,14 @@ }); test('format month', function (assert) { - var expected = '1月 1月_2月 2月_3月 3月_4月 4月_5月 5月_6月 6月_7月 7月_8月 8月_9月 9月_10月 10月_11月 11月_12月 12月'.split('_'), i; + var expected = 'Januari Jan_Februari Feb_Maret Mar_April Apr_Mei Mei_Juni Jun_Juli Jul_Agustus Ags_September Sep_Oktober Okt_November Nov_Desember Des'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = '日曜日 日 日_月曜日 月 月_火曜日 火 火_水曜日 水 水_木曜日 木 木_金曜日 金 金_土曜日 土 土'.split('_'), i; + var expected = 'Minggu Min Mg_Senin Sen Sn_Selasa Sel Sl_Rabu Rab Rb_Kamis Kam Km_Jumat Jum Jm_Sabtu Sab Sb'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -15794,70 +16502,70 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), '数秒', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), '1分', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), '1分', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2分', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44分', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), '1時間', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), '1時間', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2時間', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5時間', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21時間', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), '1日', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), '1日', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2日', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), '1日', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5日', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25日', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), '1ヶ月', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), '1ヶ月', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), '1ヶ月', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2ヶ月', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2ヶ月', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3ヶ月', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), '1ヶ月', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5ヶ月', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), '1年', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2年', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), '1年', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5年', '5 years = 5 years'); - }); - - test('suffix', function (assert) { - assert.equal(moment(30000).from(0), '数秒後', 'prefix'); - assert.equal(moment(0).from(30000), '数秒前', 'suffix'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'beberapa detik', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'semenit', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'semenit', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 menit', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 menit', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'sejam', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'sejam', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 jam', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 jam', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 jam', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'sehari', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'sehari', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 hari', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'sehari', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 hari', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 hari', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'sebulan', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'sebulan', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'sebulan', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 bulan', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 bulan', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 bulan', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'sebulan', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 bulan', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'setahun', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 tahun', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'setahun', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 tahun', '5 years = 5 years'); + }); + + test('suffix', function (assert) { + assert.equal(moment(30000).from(0), 'dalam beberapa detik', 'prefix'); + assert.equal(moment(0).from(30000), 'beberapa detik yang lalu', 'suffix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), '数秒前', 'now from now should display as in the past'); + assert.equal(moment().fromNow(), 'beberapa detik yang lalu', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), '数秒後', 'in a few seconds'); - assert.equal(moment().add({d: 5}).fromNow(), '5日後', 'in 5 days'); + assert.equal(moment().add({s: 30}).fromNow(), 'dalam beberapa detik', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'dalam 5 hari', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), '今日 午前2時0分', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), '今日 午前2時25分', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), '今日 午前3時0分', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), '明日 午前2時0分', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), '今日 午前1時0分', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), '昨日 午前2時0分', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'Hari ini pukul 02.00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'Hari ini pukul 02.25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'Hari ini pukul 03.00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'Besok pukul 02.00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'Hari ini pukul 01.00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'Kemarin pukul 02.00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('[来週]dddd LT'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [pukul] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[来週]dddd LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [pukul] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[来週]dddd LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [pukul] LT'), 'Today + ' + i + ' days end of day'); } }); @@ -15865,11 +16573,11 @@ var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('[前週]dddd LT'), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [lalu pukul] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[前週]dddd LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [lalu pukul] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[前週]dddd LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [lalu pukul] LT'), 'Today - ' + i + ' days end of day'); } }); @@ -15877,83 +16585,83 @@ var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); weeksAgo = moment().subtract({w: 2}); weeksFromNow = moment().add({w: 2}); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); + assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); + assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); + assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); + assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); + assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); + assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); + assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); + assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); + assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); + assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); + assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); + assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); + assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); + assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); + assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); + assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); + assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); + assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); + assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); + assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); + assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); + assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); + assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); - test('weeks year starting sunday format', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1', 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2', 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3'); + test('weeks year starting sunday formatted', function (assert) { + assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1', 'Dec 26 2011 should be week 1'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2', 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3', 'Jan 9 2012 should be week 3'); }); test('lenient ordinal parsing', function (assert) { @@ -15983,6 +16691,18 @@ } }); + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { @@ -15994,8 +16714,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -16004,12 +16725,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -16027,8 +16750,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -16043,11 +16766,10 @@ }); } - localeModule('jv'); - + localeModule('is'); test('parse', function (assert) { - var tests = 'Januari Jan_Februari Feb_Maret Mar_April Apr_Mei Mei_Juni Jun_Juli Jul_Agustus Ags_September Sep_Oktober Okt_Nopember Nop_Desember Des'.split('_'), i; + var tests = 'janúar jan_febrúar feb_mars mar_apríl apr_maí maí_júní jún_júlí júl_ágúst ágú_september sep_október okt_nóvember nóv_desember des'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -16066,29 +16788,29 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss a', 'Minggu, Februari 14 2010, 3:25:50 sonten'], - ['ddd, hA', 'Min, 3sonten'], - ['M Mo MM MMMM MMM', '2 2 02 Februari Feb'], + ['dddd, Do MMMM YYYY, h:mm:ss a', 'sunnudagur, 14. febrúar 2010, 3:25:50 pm'], + ['ddd, hA', 'sun, 3PM'], + ['M Mo MM MMMM MMM', '2 2. 02 febrúar feb'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14 14'], - ['d do dddd ddd dd', '0 0 Minggu Min Mg'], - ['DDD DDDo DDDD', '45 45 045'], - ['w wo ww', '7 7 07'], + ['D Do DD', '14 14. 14'], + ['d do dddd ddd dd', '0 0. sunnudagur sun Su'], + ['DDD DDDo DDDD', '45 45. 045'], + ['w wo ww', '6 6. 06'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], - ['a A', 'sonten sonten'], - ['[the] DDDo [day of the year]', 'the 45 day of the year'], - ['LTS', '15.25.50'], + ['a A', 'pm PM'], + ['[the] DDDo [day of the year]', 'the 45. day of the year'], + ['LTS', '15:25:50'], ['L', '14/02/2010'], - ['LL', '14 Februari 2010'], - ['LLL', '14 Februari 2010 pukul 15.25'], - ['LLLL', 'Minggu, 14 Februari 2010 pukul 15.25'], + ['LL', '14. febrúar 2010'], + ['LLL', '14. febrúar 2010 kl. 15:25'], + ['LLLL', 'sunnudagur, 14. febrúar 2010 kl. 15:25'], ['l', '14/2/2010'], - ['ll', '14 Feb 2010'], - ['lll', '14 Feb 2010 pukul 15.25'], - ['llll', 'Min, 14 Feb 2010 pukul 15.25'] + ['ll', '14. feb 2010'], + ['lll', '14. feb 2010 kl. 15:25'], + ['llll', 'sun, 14. feb 2010 kl. 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -16097,15 +16819,52 @@ } }); + test('format ordinal', function (assert) { + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); + + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); + + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); + + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); + }); + test('format month', function (assert) { - var expected = 'Januari Jan_Februari Feb_Maret Mar_April Apr_Mei Mei_Juni Jun_Juli Jul_Agustus Ags_September Sep_Oktober Okt_Nopember Nop_Desember Des'.split('_'), i; + var expected = 'janúar jan_febrúar feb_mars mar_apríl apr_maí maí_júní jún_júlí júl_ágúst ágú_september sep_október okt_nóvember nóv_desember des'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'Minggu Min Mg_Senen Sen Sn_Seloso Sel Sl_Rebu Reb Rb_Kemis Kem Km_Jemuwah Jem Jm_Septu Sep Sp'.split('_'), i; + var expected = 'sunnudagur sun Su_mánudagur mán Má_þriðjudagur þri Þr_miðvikudagur mið Mi_fimmtudagur fim Fi_föstudagur fös Fö_laugardagur lau La'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -16113,82 +16872,89 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'sawetawis detik', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'setunggal menit', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'setunggal menit', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 menit', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 menit', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'setunggal jam', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'setunggal jam', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 jam', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 jam', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 jam', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'sedinten', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'sedinten', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dinten', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'sedinten', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dinten', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dinten', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'sewulan', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'sewulan', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'sewulan', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 wulan', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 wulan', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 wulan', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'sewulan', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 wulan', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'setaun', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 taun', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'setaun', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 taun', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'nokkrar sekúndur', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'mínúta', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'mínúta', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 mínútur', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 mínútur', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 21}), true), '21 mínúta', '21 minutes = 21 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'klukkustund', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'klukkustund', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 klukkustundir', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 klukkustundir', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 klukkustund', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'dagur', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'dagur', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dagar', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'dagur', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dagar', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dagar', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 11}), true), '11 dagar', '11 days = 11 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 21}), true), '21 dagur', '21 days = 21 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'mánuður', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'mánuður', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'mánuður', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 mánuðir', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 mánuðir', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 mánuðir', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'mánuður', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 mánuðir', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ár', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 ár', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'ár', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 ár', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 21}), true), '21 ár', '21 years = 21 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'wonten ing sawetawis detik', 'prefix'); - assert.equal(moment(0).from(30000), 'sawetawis detik ingkang kepengker', 'suffix'); + assert.equal(moment(30000).from(0), 'eftir nokkrar sekúndur', 'prefix'); + assert.equal(moment(0).from(30000), 'fyrir nokkrum sekúndum síðan', 'suffix'); + assert.equal(moment().subtract({m: 1}).fromNow(), 'fyrir mínútu síðan', 'a minute ago'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'sawetawis detik ingkang kepengker', 'now from now should display as in the past'); + assert.equal(moment().fromNow(), 'fyrir nokkrum sekúndum síðan', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'wonten ing sawetawis detik', 'in a few seconds'); - assert.equal(moment().add({d: 5}).fromNow(), 'wonten ing 5 dinten', 'in 5 days'); + assert.equal(moment().add({s: 30}).fromNow(), 'eftir nokkrar sekúndur', 'in a few seconds'); + assert.equal(moment().add({m: 1}).fromNow(), 'eftir mínútu', 'in a minute'); + assert.equal(moment().add({d: 5}).fromNow(), 'eftir 5 daga', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'Dinten puniko pukul 02.00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'Dinten puniko pukul 02.25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'Dinten puniko pukul 03.00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'Mbenjang pukul 02.00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'Dinten puniko pukul 01.00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'Kala wingi pukul 02.00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'í dag kl. 2:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'í dag kl. 2:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'í dag kl. 3:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'á morgun kl. 2:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'í dag kl. 1:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'í gær kl. 2:00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd [pukul] LT'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [kl.] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [pukul] LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [kl.] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [pukul] LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [kl.] LT'), 'Today + ' + i + ' days end of day'); } }); test('calendar last week', function (assert) { var i, m; + for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('dddd [kepengker pukul] LT'), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('[síðasta] dddd [kl.] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [kepengker pukul] LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[síðasta] dddd [kl.] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [kepengker pukul] LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[síðasta] dddd [kl.] LT'), 'Today - ' + i + ' days end of day'); } }); @@ -16206,15 +16972,12 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - // Monday is the first day of the week. - // The week that contains Jan 1st is the first week of the year. - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); + assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); test('weeks year starting monday', function (assert) { @@ -16249,33 +17012,33 @@ assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); + assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); + assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); + assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); + assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); + assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); + assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); + assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); + assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); + assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); + assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); + assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); + assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); + assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1', 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2', 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3', 'Jan 9 2012 should be week 3'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); test('lenient ordinal parsing', function (assert) { @@ -16305,18 +17068,6 @@ } }); - test('meridiem invariant', function (assert) { - var h, m, t1, t2; - for (h = 0; h < 24; ++h) { - for (m = 0; m < 60; m += 15) { - t1 = moment.utc([2000, 0, 1, h, m]); - t2 = moment(t1.format('A h:mm'), 'A h:mm'); - assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), - 'meridiem at ' + t1.format('HH:mm')); - } - } - }); - test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { @@ -16328,8 +17079,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -16338,12 +17090,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -16361,8 +17115,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -16377,16 +17131,13 @@ }); } - localeModule('ka'); + localeModule('it'); test('parse', function (assert) { - var i, - tests = 'იანვარი იან_თებერვალი თებ_მარტი მარ_აპრილი აპრ_მაისი მაი_ივნისი ივნ_ივლისი ივლ_აგვისტო აგვ_სექტემბერი სექ_ოქტომბერი ოქტ_ნოემბერი ნოე_დეკემბერი დეკ'.split('_'); - + var tests = 'gennaio gen_febbraio feb_marzo mar_aprile apr_maggio mag_giugno giu_luglio lug_agosto ago_settembre set_ottobre ott_novembre nov_dicembre dic'.split('_'), i; function equalTest(input, mmm, i) { - assert.equal(moment(input, mmm).month(), i, input + ' უნდა იყოს თვე ' + (i + 1)); + assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } - for (i = 0; i < 12; i++) { tests[i] = tests[i].split(' '); equalTest(tests[i][0], 'MMM', i); @@ -16402,92 +17153,83 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss a', 'კვირა, თებერვალი მე-14 2010, 3:25:50 pm'], - ['ddd, hA', 'კვი, 3PM'], - ['M Mo MM MMMM MMM', '2 მე-2 02 თებერვალი თებ'], - ['YYYY YY', '2010 10'], - ['D Do DD', '14 მე-14 14'], - ['d do dddd ddd dd', '0 0 კვირა კვი კვ'], - ['DDD DDDo DDDD', '45 45-ე 045'], - ['w wo ww', '7 მე-7 07'], - ['h hh', '3 03'], - ['H HH', '15 15'], - ['m mm', '25 25'], - ['s ss', '50 50'], - ['a A', 'pm PM'], - ['წლის DDDo დღე', 'წლის 45-ე დღე'], - ['LTS', '3:25:50 PM'], - ['L', '14/02/2010'], - ['LL', '14 თებერვალი 2010'], - ['LLL', '14 თებერვალი 2010 3:25 PM'], - ['LLLL', 'კვირა, 14 თებერვალი 2010 3:25 PM'], - ['l', '14/2/2010'], - ['ll', '14 თებ 2010'], - ['lll', '14 თებ 2010 3:25 PM'], - ['llll', 'კვი, 14 თებ 2010 3:25 PM'] + ['dddd, MMMM Do YYYY, h:mm:ss a', 'Domenica, febbraio 14º 2010, 3:25:50 pm'], + ['ddd, hA', 'Dom, 3PM'], + ['M Mo MM MMMM MMM', '2 2º 02 febbraio feb'], + ['YYYY YY', '2010 10'], + ['D Do DD', '14 14º 14'], + ['d do dddd ddd dd', '0 0º Domenica Dom Do'], + ['DDD DDDo DDDD', '45 45º 045'], + ['w wo ww', '6 6º 06'], + ['h hh', '3 03'], + ['H HH', '15 15'], + ['m mm', '25 25'], + ['s ss', '50 50'], + ['a A', 'pm PM'], + ['[the] DDDo [day of the year]', 'the 45º day of the year'], + ['LTS', '15:25:50'], + ['L', '14/02/2010'], + ['LL', '14 febbraio 2010'], + ['LLL', '14 febbraio 2010 15:25'], + ['LLLL', 'Domenica, 14 febbraio 2010 15:25'], + ['l', '14/2/2010'], + ['ll', '14 feb 2010'], + ['lll', '14 feb 2010 15:25'], + ['llll', 'Dom, 14 feb 2010 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; - for (i = 0; i < a.length; i++) { assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); } }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-ლი', '1-ლი'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), 'მე-2', 'მე-2'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), 'მე-3', 'მე-3'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), 'მე-4', 'მე-4'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), 'მე-5', 'მე-5'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), 'მე-6', 'მე-6'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), 'მე-7', 'მე-7'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), 'მე-8', 'მე-8'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), 'მე-9', 'მე-9'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), 'მე-10', 'მე-10'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), 'მე-11', 'მე-11'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), 'მე-12', 'მე-12'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), 'მე-13', 'მე-13'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), 'მე-14', 'მე-14'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), 'მე-15', 'მე-15'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), 'მე-16', 'მე-16'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), 'მე-17', 'მე-17'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), 'მე-18', 'მე-18'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), 'მე-19', 'მე-19'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), 'მე-20', 'მე-20'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21-ე', '21-ე'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22-ე', '22-ე'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23-ე', '23-ე'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24-ე', '24-ე'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25-ე', '25-ე'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26-ე', '26-ე'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27-ე', '27-ე'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28-ე', '28-ე'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29-ე', '29-ე'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30-ე', '30-ე'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º'); - assert.equal(moment('2011 40', 'YYYY DDD').format('DDDo'), 'მე-40', 'მე-40'); - assert.equal(moment('2011 50', 'YYYY DDD').format('DDDo'), '50-ე', '50-ე'); - assert.equal(moment('2011 60', 'YYYY DDD').format('DDDo'), 'მე-60', 'მე-60'); - assert.equal(moment('2011 100', 'YYYY DDD').format('DDDo'), 'მე-100', 'მე-100'); - assert.equal(moment('2011 101', 'YYYY DDD').format('DDDo'), '101-ე', '101-ე'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º'); }); test('format month', function (assert) { - var i, - expected = 'იანვარი იან_თებერვალი თებ_მარტი მარ_აპრილი აპრ_მაისი მაი_ივნისი ივნ_ივლისი ივლ_აგვისტო აგვ_სექტემბერი სექ_ოქტომბერი ოქტ_ნოემბერი ნოე_დეკემბერი დეკ'.split('_'); - + var expected = 'gennaio gen_febbraio feb_marzo mar_aprile apr_maggio mag_giugno giu_luglio lug_agosto ago_settembre set_ottobre ott_novembre nov_dicembre dic'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var i, - expected = 'კვირა კვი კვ_ორშაბათი ორშ ორ_სამშაბათი სამ სა_ოთხშაბათი ოთხ ოთ_ხუთშაბათი ხუთ ხუ_პარასკევი პარ პა_შაბათი შაბ შა'.split('_'); - + var expected = 'Domenica Dom Do_Lunedì Lun Lu_Martedì Mar Ma_Mercoledì Mer Me_Giovedì Gio Gi_Venerdì Ven Ve_Sabato Sab Sa'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -16495,83 +17237,81 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'რამდენიმე წამი', '44 წამი = რამდენიმე წამი'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'წუთი', '45 წამი = წუთი'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'წუთი', '89 წამი = წუთი'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 წუთი', '90 წამი = 2 წუთი'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 წუთი', '44 წამი = 44 წუთი'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'საათი', '45 წამი = საათი'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'საათი', '89 წამი = საათი'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 საათი', '90 წამი = 2 საათი'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 საათი', '5 საათი = 5 საათი'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 საათი', '21 საათი = 21 საათი'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'დღე', '22 საათი = დღე'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'დღე', '35 საათი = დღე'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 დღე', '36 საათი = 2 დღე'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'დღე', '1 დღე = დღე'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 დღე', '5 დღე = 5 დღე'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 დღე', '25 დღე = 25 დღე'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'თვე', '26 დღე = თვე'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'თვე', '30 დღე = თვე'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'თვე', '45 დღე = თვე'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 თვე', '46 დღე = 2 თვე'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 თვე', '75 დღე = 2 თვე'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 თვე', '76 დღე = 3 თვე'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'თვე', '1 თვე = თვე'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 თვე', '5 თვე = 5 თვე'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'წელი', '345 დღე = წელი'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 წელი', '548 დღე = 2 წელი'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'წელი', '1 წელი = წელი'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 წელი', '5 წელი = 5 წელი'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'alcuni secondi', '44 seconds = seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'un minuto', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'un minuto', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minuti', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minuti', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'un\'ora', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'un\'ora', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 ore', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 ore', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 ore', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'un giorno', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'un giorno', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 giorni', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'un giorno', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 giorni', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 giorni', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'un mese', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'un mese', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'un mese', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 mesi', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 mesi', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 mesi', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'un mese', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 mesi', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'un anno', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 anni', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'un anno', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 anni', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'რამდენიმე წამში', 'ში სუფიქსი'); - assert.equal(moment(0).from(30000), 'რამდენიმე წამის წინ', 'წინ სუფიქსი'); - }); - - test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'რამდენიმე წამის წინ', 'უნდა აჩვენოს როგორც წარსული'); + assert.equal(moment(30000).from(0), 'in alcuni secondi', 'prefix'); + assert.equal(moment(0).from(30000), 'alcuni secondi fa', 'suffix'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'რამდენიმე წამში', 'რამდენიმე წამში'); - assert.equal(moment().add({d: 5}).fromNow(), '5 დღეში', '5 დღეში'); + assert.equal(moment().add({s: 30}).fromNow(), 'in alcuni secondi', 'in seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'tra 5 giorni', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'დღეს 2:00 AM-ზე', 'დღეს ამავე დროს'); - assert.equal(moment(a).add({m: 25}).calendar(), 'დღეს 2:25 AM-ზე', 'ახლანდელ დროს დამატებული 25 წუთი'); - assert.equal(moment(a).add({h: 1}).calendar(), 'დღეს 3:00 AM-ზე', 'ახლანდელ დროს დამატებული 1 საათი'); - assert.equal(moment(a).add({d: 1}).calendar(), 'ხვალ 2:00 AM-ზე', 'ხვალ ამავე დროს'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'დღეს 1:00 AM-ზე', 'ახლანდელ დროს გამოკლებული 1 საათი'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'გუშინ 2:00 AM-ზე', 'გუშინ ამავე დროს'); + assert.equal(moment(a).calendar(), 'Oggi alle 02:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'Oggi alle 02:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'Oggi alle 03:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'Domani alle 02:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'Oggi alle 01:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'Ieri alle 02:00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('[შემდეგ] dddd LT[-ზე]'), 'დღეს + ' + i + ' დღე ახლანდელ დროს'); + assert.equal(m.calendar(), m.format('dddd [alle] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[შემდეგ] dddd LT[-ზე]'), 'დღეს + ' + i + ' დღე დღის დასაწყისში'); + assert.equal(m.calendar(), m.format('dddd [alle] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[შემდეგ] dddd LT[-ზე]'), 'დღეს + ' + i + ' დღე დღის დასასრულს'); + assert.equal(m.calendar(), m.format('dddd [alle] LT'), 'Today + ' + i + ' days end of day'); } }); test('calendar last week', function (assert) { - var i, m; + var i, m, weekday, datestring; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('[წინა] dddd LT[-ზე]'), 'დღეს - ' + i + ' დღე ახლანდელ დროს'); + // Different date string + weekday = parseInt(m.format('d'), 10); + datestring = (weekday === 0) ? '[la scorsa] dddd [alle] LT' : '[lo scorso] dddd [alle] LT'; + assert.equal(m.calendar(), m.format(datestring), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[წინა] dddd LT[-ზე]'), 'დღეს - ' + i + ' დღე დღის დასაწყისში'); + assert.equal(m.calendar(), m.format(datestring), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[წინა] dddd LT[-ზე]'), 'დღეს - ' + i + ' დღე დღის დასასრულს'); + assert.equal(m.calendar(), m.format(datestring), 'Today - ' + i + ' days end of day'); } }); @@ -16579,83 +17319,83 @@ var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 კვირის წინ'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), '1 კვირაში'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); weeksAgo = moment().subtract({w: 2}); weeksFromNow = moment().add({w: 2}); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 კვირის წინ'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), '2 კვირაში'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'დეკ 26 2011 უნდა იყოს კვირა 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'იან 1 2012 უნდა იყოს კვირა 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'იან 2 2012 უნდა იყოს კვირა 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'იან 8 2012 უნდა იყოს კვირა 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'იან 9 2012 უნდა იყოს კვირა 3'); + assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'იან 1 2007 უნდა იყოს კვირა 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'იან 7 2007 უნდა იყოს კვირა 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'იან 8 2007 უნდა იყოს კვირა 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'იან 14 2007 უნდა იყოს კვირა 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'იან 15 2007 უნდა იყოს კვირა 3'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); + assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); + assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'დეკ 31 2007 უნდა იყოს კვირა 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'იან 1 2008 უნდა იყოს კვირა 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'იან 6 2008 უნდა იყოს კვირა 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'იან 7 2008 უნდა იყოს კვირა 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'იან 13 2008 უნდა იყოს კვირა 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'იან 14 2008 უნდა იყოს კვირა 3'); + assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); + assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); + assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); + assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); + assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'დეკ 30 2002 უნდა იყოს კვირა 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'იან 1 2003 უნდა იყოს კვირა 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'იან 5 2003 უნდა იყოს კვირა 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'იან 6 2003 უნდა იყოს კვირა 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'იან 12 2003 უნდა იყოს კვირა 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'იან 13 2003 უნდა იყოს კვირა 3'); + assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); + assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); + assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); + assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); + assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'დეკ 29 2008 უნდა იყოს კვირა 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'იან 1 2009 უნდა იყოს კვირა 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'იან 4 2009 უნდა იყოს კვირა 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'იან 5 2009 უნდა იყოს კვირა 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'იან 11 2009 უნდა იყოს კვირა 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'იან 12 2009 უნდა იყოს კვირა 3'); + assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); + assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); + assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); + assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); + assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'დეკ 28 2009 უნდა იყოს კვირა 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'იან 1 2010 უნდა იყოს კვირა 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'იან 3 2010 უნდა იყოს კვირა 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'იან 4 2010 უნდა იყოს კვირა 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'იან 10 2010 უნდა იყოს კვირა 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'იან 11 2010 უნდა იყოს კვირა 3'); + assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); + assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); + assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); + assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); + assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); + assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'დეკ 27 2010 უნდა იყოს კვირა 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'იან 1 2011 უნდა იყოს კვირა 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'იან 2 2011 უნდა იყოს კვირა 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'იან 3 2011 უნდა იყოს კვირა 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'იან 9 2011 უნდა იყოს კვირა 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'იან 10 2011 უნდა იყოს კვირა 3'); + assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); + assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); + assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); + assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); + assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); + assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-ლი', 'დეკ 26 2011 უნდა იყოს კვირა 1'); - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-ლი', 'იან 1 2012 უნდა იყოს კვირა 1'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 მე-2', 'იან 2 2012 უნდა იყოს კვირა 2'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 მე-2', 'იან 8 2012 უნდა იყოს კვირა 2'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 მე-3', 'იან 9 2012 უნდა იყოს კვირა 3'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52º', 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1º', 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1º', 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2º', 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2º', 'Jan 15 2012 should be week 2'); }); test('lenient ordinal parsing', function (assert) { @@ -16696,8 +17436,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -16706,12 +17447,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -16729,8 +17472,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -16745,12 +17488,10 @@ }); } - localeModule('km'); + localeModule('ja'); test('parse', function (assert) { - var tests = 'មករា មករា_កុម្ភៈ កុម្ភៈ_មិនា មិនា_មេសា មេសា_ឧសភា ឧសភា_មិថុនា មិថុនា_កក្កដា កក្កដា_សីហា សីហា_កញ្ញា កញ្ញា_តុលា តុលា_វិច្ឆិកា វិច្ឆិកា_ធ្នូ ធ្នូ'.split('_'), - i; - + var tests = '1月 1月_2月 2月_3月 3月_4月 4月_5月 5月_6月 6月_7月 7月_8月 8月_9月 9月_10月 10月_11月 11月_12月 12月'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -16769,29 +17510,29 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss a', 'អាទិត្យ, កុម្ភៈ 14 2010, 3:25:50 pm'], - ['ddd, hA', 'អាទិត្យ, 3PM'], - ['M Mo MM MMMM MMM', '2 2 02 កុម្ភៈ កុម្ភៈ'], - ['YYYY YY', '2010 10'], - ['D Do DD', '14 14 14'], - ['d do dddd ddd dd', '0 0 អាទិត្យ អាទិត្យ អាទិត្យ'], - ['DDD DDDo DDDD', '45 45 045'], - ['w wo ww', '6 6 06'], - ['h hh', '3 03'], - ['H HH', '15 15'], - ['m mm', '25 25'], - ['s ss', '50 50'], - ['a A', 'pm PM'], - ['[the] DDDo [day of the year]', 'the 45 day of the year'], - ['LTS', '15:25:50'], - ['L', '14/02/2010'], - ['LL', '14 កុម្ភៈ 2010'], - ['LLL', '14 កុម្ភៈ 2010 15:25'], - ['LLLL', 'អាទិត្យ, 14 កុម្ភៈ 2010 15:25'], - ['l', '14/2/2010'], - ['ll', '14 កុម្ភៈ 2010'], - ['lll', '14 កុម្ភៈ 2010 15:25'], - ['llll', 'អាទិត្យ, 14 កុម្ភៈ 2010 15:25'] + ['dddd, MMMM Do YYYY, a h:mm:ss', '日曜日, 2月 14 2010, 午後 3:25:50'], + ['ddd, Ah', '日, 午後3'], + ['M Mo MM MMMM MMM', '2 2 02 2月 2月'], + ['YYYY YY', '2010 10'], + ['D Do DD', '14 14 14'], + ['d do dddd ddd dd', '0 0 日曜日 日 日'], + ['DDD DDDo DDDD', '45 45 045'], + ['w wo ww', '8 8 08'], + ['h hh', '3 03'], + ['H HH', '15 15'], + ['m mm', '25 25'], + ['s ss', '50 50'], + ['a A', '午後 午後'], + ['[the] DDDo [day of the year]', 'the 45 day of the year'], + ['LTS', '午後3時25分50秒'], + ['L', '2010/02/14'], + ['LL', '2010年2月14日'], + ['LLL', '2010年2月14日午後3時25分'], + ['LLLL', '2010年2月14日午後3時25分 日曜日'], + ['l', '2010/2/14'], + ['ll', '2010年2月14日'], + ['lll', '2010年2月14日午後3時25分'], + ['llll', '2010年2月14日午後3時25分 日'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -16800,54 +17541,15 @@ } }); - test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1st'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2nd'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3rd'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4th'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5th'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6th'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7th'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8th'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9th'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10th'); - - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11th'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12th'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13th'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14th'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15th'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16th'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17th'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18th'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19th'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20th'); - - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21st'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22nd'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23rd'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24th'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25th'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26th'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27th'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28th'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29th'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30th'); - - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31st'); - }); - test('format month', function (assert) { - var expected = 'មករា មករា_កុម្ភៈ កុម្ភៈ_មិនា មិនា_មេសា មេសា_ឧសភា ឧសភា_មិថុនា មិថុនា_កក្កដា កក្កដា_សីហា សីហា_កញ្ញា កញ្ញា_តុលា តុលា_វិច្ឆិកា វិច្ឆិកា_ធ្នូ ធ្នូ'.split('_'), - i; + var expected = '1月 1月_2月 2月_3月 3月_4月 4月_5月 5月_6月 6月_7月 7月_8月 8月_9月 9月_10月 10月_11月 11月_12月 12月'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'អាទិត្យ អាទិត្យ អាទិត្យ_ច័ន្ទ ច័ន្ទ ច័ន្ទ_អង្គារ អង្គារ អង្គារ_ពុធ ពុធ ពុធ_ព្រហស្បតិ៍ ព្រហស្បតិ៍ ព្រហស្បតិ៍_សុក្រ សុក្រ សុក្រ_សៅរ៍ សៅរ៍ សៅរ៍'.split('_'), - i; + var expected = '日曜日 日 日_月曜日 月 月_火曜日 火 火_水曜日 水 水_木曜日 木 木_金曜日 金 金_土曜日 土 土'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -16855,193 +17557,166 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'ប៉ុន្មានវិនាទី', '44 seconds = ប៉ុន្មានវិនាទី'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'មួយនាទី', '45 seconds = មួយនាទី'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'មួយនាទី', '89 seconds = មួយនាទី'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 នាទី', '90 seconds = 2 នាទី'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 នាទី', '44 minutes = 44 នាទី'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'មួយម៉ោង', '45 minutes = មួយម៉ោង'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'មួយម៉ោង', '89 minutes = មួយម៉ោង'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 ម៉ោង', '90 minutes = 2 ម៉ោង'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 ម៉ោង', '5 hours = 5 ម៉ោង'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 ម៉ោង', '21 hours = 21 ម៉ោង'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'មួយថ្ងៃ', '22 hours = មួយថ្ងៃ'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'មួយថ្ងៃ', '35 hours = មួយថ្ងៃ'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 ថ្ងៃ', '36 hours = 2 ថ្ងៃ'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'មួយថ្ងៃ', '1 day = មួយថ្ងៃ'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 ថ្ងៃ', '5 days = 5 ថ្ងៃ'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 ថ្ងៃ', '25 days = 25 ថ្ងៃ'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'មួយខែ', '26 days = មួយខែ'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'មួយខែ', '30 days = មួយខែ'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'មួយខែ', '43 days = មួយខែ'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 ខែ', '46 days = 2 ខែ'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 ខែ', '75 days = 2 ខែ'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 ខែ', '76 days = 3 ខែ'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'មួយខែ', '1 month = មួយខែ'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 ខែ', '5 months = 5 ខែ'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'មួយឆ្នាំ', '345 days = មួយឆ្នាំ'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 ឆ្នាំ', '548 days = 2 ឆ្នាំ'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'មួយឆ្នាំ', '1 year = មួយឆ្នាំ'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 ឆ្នាំ', '5 years = 5 ឆ្នាំ'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), '数秒', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), '1分', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), '1分', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2分', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44分', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), '1時間', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), '1時間', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2時間', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5時間', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21時間', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), '1日', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), '1日', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2日', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), '1日', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5日', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25日', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), '1ヶ月', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), '1ヶ月', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), '1ヶ月', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2ヶ月', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2ヶ月', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3ヶ月', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), '1ヶ月', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5ヶ月', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), '1年', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2年', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), '1年', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5年', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'ប៉ុន្មានវិនាទីទៀត', 'prefix'); - assert.equal(moment(0).from(30000), 'ប៉ុន្មានវិនាទីមុន', 'suffix'); + assert.equal(moment(30000).from(0), '数秒後', 'prefix'); + assert.equal(moment(0).from(30000), '数秒前', 'suffix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'ប៉ុន្មានវិនាទីមុន', 'now from now should display as in the past'); + assert.equal(moment().fromNow(), '数秒前', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({ - s: 30 - }).fromNow(), 'ប៉ុន្មានវិនាទីទៀត', 'in a few seconds'); - assert.equal(moment().add({ - d: 5 - }).fromNow(), '5 ថ្ងៃទៀត', 'in 5 days'); + assert.equal(moment().add({s: 30}).fromNow(), '数秒後', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), '5日後', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'ថ្ងៃនៈ ម៉ោង 02:00', 'today at the same time'); - assert.equal(moment(a).add({ - m: 25 - }).calendar(), 'ថ្ងៃនៈ ម៉ោង 02:25', 'Now plus 25 min'); - assert.equal(moment(a).add({ - h: 1 - }).calendar(), 'ថ្ងៃនៈ ម៉ោង 03:00', 'Now plus 1 hour'); - assert.equal(moment(a).add({ - d: 1 - }).calendar(), 'ស្អែក ម៉ោង 02:00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({ - h: 1 - }).calendar(), 'ថ្ងៃនៈ ម៉ោង 01:00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({ - d: 1 - }).calendar(), 'ម្សិលមិញ ម៉ោង 02:00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), '今日 午前2時0分', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), '今日 午前2時25分', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), '今日 午前3時0分', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), '明日 午前2時0分', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), '今日 午前1時0分', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), '昨日 午前2時0分', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { - m = moment().add({ - d: i - }); - assert.equal(m.calendar(), m.format('dddd [ម៉ោង] LT'), 'Today + ' + i + ' days current time'); + m = moment().add({d: i}); + assert.equal(m.calendar(), m.format('[来週]dddd LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [ម៉ោង] LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[来週]dddd LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [ម៉ោង] LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[来週]dddd LT'), 'Today + ' + i + ' days end of day'); } }); test('calendar last week', function (assert) { var i, m; - for (i = 2; i < 7; i++) { - m = moment().subtract({ - d: i - }); - assert.equal(m.calendar(), m.format('dddd [សប្តាហ៍មុន] [ម៉ោង] LT'), 'Today - ' + i + ' days current time'); + m = moment().subtract({d: i}); + assert.equal(m.calendar(), m.format('[前週]dddd LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [សប្តាហ៍មុន] [ម៉ោង] LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[前週]dddd LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [សប្តាហ៍មុន] [ម៉ោង] LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[前週]dddd LT'), 'Today - ' + i + ' days end of day'); } }); test('calendar all else', function (assert) { - var weeksAgo = moment().subtract({ - w: 1 - }), - weeksFromNow = moment().add({ - w: 1 - }); + var weeksAgo = moment().subtract({w: 1}), + weeksFromNow = moment().add({w: 1}); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); - weeksAgo = moment().subtract({ - w: 2 - }); - weeksFromNow = moment().add({ - w: 2 - }); + weeksAgo = moment().subtract({w: 2}); + weeksFromNow = moment().add({w: 2}); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); }); test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); + assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); + assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); }); test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); + assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); + assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); + assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); + assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); + assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); }); test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); + assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); + assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); + assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); + assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); + assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); }); test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); + assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); + assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); + assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); + assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); + assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); + assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); + assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); + assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); + assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); + assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); + assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); + assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); + assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); + assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); }); - test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52', 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1', 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1', 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2', 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2', 'Jan 15 2012 should be week 2'); + test('weeks year starting sunday format', function (assert) { + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1', 'Jan 7 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2', 'Jan 14 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3'); }); test('lenient ordinal parsing', function (assert) { @@ -17082,8 +17757,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -17092,12 +17768,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -17115,8 +17793,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -17131,10 +17809,11 @@ }); } - localeModule('ko'); + localeModule('jv'); + test('parse', function (assert) { - var tests = '1월 1월_2월 2월_3월 3월_4월 4월_5월 5월_6월 6월_7월 7월_8월 8월_9월 9월_10월 10월_11월 11월_12월 12월'.split('_'), i; + var tests = 'Januari Jan_Februari Feb_Maret Mar_April Apr_Mei Mei_Juni Jun_Juli Jul_Agustus Ags_September Sep_Oktober Okt_Nopember Nop_Desember Des'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -17151,67 +17830,31 @@ } }); - test('parse meridiem', function (assert) { - var elements = [{ - expression : '1981년 9월 8일 오후 2시 30분', - inputFormat : 'YYYY[년] M[월] D[일] A h[시] m[분]', - outputFormat : 'A', - expected : '오후' - }, { - expression : '1981년 9월 8일 오전 2시 30분', - inputFormat : 'YYYY[년] M[월] D[일] A h[시] m[분]', - outputFormat : 'A h시', - expected : '오전 2시' - }, { - expression : '14시 30분', - inputFormat : 'H[시] m[분]', - outputFormat : 'A', - expected : '오후' - }, { - expression : '오후 4시', - inputFormat : 'A h[시]', - outputFormat : 'H', - expected : '16' - }], i, l, it, actual; - - - for (i = 0, l = elements.length; i < l; ++i) { - it = elements[i]; - actual = moment(it.expression, it.inputFormat).format(it.outputFormat); - - assert.equal( - actual, - it.expected, - '\'' + it.outputFormat + '\' of \'' + it.expression + '\' must be \'' + it.expected + '\' but was \'' + actual + '\'.' - ); - } - }); - test('format', function (assert) { var a = [ - ['YYYY년 MMMM Do dddd a h:mm:ss', '2010년 2월 14일 일요일 오후 3:25:50'], - ['ddd A h', '일 오후 3'], - ['M Mo MM MMMM MMM', '2 2일 02 2월 2월'], + ['dddd, MMMM Do YYYY, h:mm:ss a', 'Minggu, Februari 14 2010, 3:25:50 sonten'], + ['ddd, hA', 'Min, 3sonten'], + ['M Mo MM MMMM MMM', '2 2 02 Februari Feb'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14일 14'], - ['d do dddd ddd dd', '0 0일 일요일 일 일'], - ['DDD DDDo DDDD', '45 45일 045'], - ['w wo ww', '8 8일 08'], + ['D Do DD', '14 14 14'], + ['d do dddd ddd dd', '0 0 Minggu Min Mg'], + ['DDD DDDo DDDD', '45 45 045'], + ['w wo ww', '7 7 07'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], - ['a A', '오후 오후'], - ['일년 중 DDDo째 되는 날', '일년 중 45일째 되는 날'], - ['LTS', '오후 3시 25분 50초'], - ['L', '2010.02.14'], - ['LL', '2010년 2월 14일'], - ['LLL', '2010년 2월 14일 오후 3시 25분'], - ['LLLL', '2010년 2월 14일 일요일 오후 3시 25분'], - ['l', '2010.2.14'], - ['ll', '2010년 2월 14일'], - ['lll', '2010년 2월 14일 오후 3시 25분'], - ['llll', '2010년 2월 14일 일 오후 3시 25분'] + ['a A', 'sonten sonten'], + ['[the] DDDo [day of the year]', 'the 45 day of the year'], + ['LTS', '15.25.50'], + ['L', '14/02/2010'], + ['LL', '14 Februari 2010'], + ['LLL', '14 Februari 2010 pukul 15.25'], + ['LLLL', 'Minggu, 14 Februari 2010 pukul 15.25'], + ['l', '14/2/2010'], + ['ll', '14 Feb 2010'], + ['lll', '14 Feb 2010 pukul 15.25'], + ['llll', 'Min, 14 Feb 2010 pukul 15.25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -17220,52 +17863,15 @@ } }); - test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1일', '1일'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2일', '2일'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3일', '3일'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4일', '4일'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5일', '5일'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6일', '6일'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7일', '7일'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8일', '8일'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9일', '9일'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10일', '10일'); - - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11일', '11일'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12일', '12일'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13일', '13일'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14일', '14일'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15일', '15일'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16일', '16일'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17일', '17일'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18일', '18일'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19일', '19일'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20일', '20일'); - - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21일', '21일'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22일', '22일'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23일', '23일'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24일', '24일'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25일', '25일'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26일', '26일'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27일', '27일'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28일', '28일'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29일', '29일'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30일', '30일'); - - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31일', '31일'); - }); - test('format month', function (assert) { - var expected = '1월 1월_2월 2월_3월 3월_4월 4월_5월 5월_6월 6월_7월 7월_8월 8월_9월 9월_10월 10월_11월 11월_12월 12월'.split('_'), i; + var expected = 'Januari Jan_Februari Feb_Maret Mar_April Apr_Mei Mei_Juni Jun_Juli Jul_Agustus Ags_September Sep_Oktober Okt_Nopember Nop_Desember Des'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = '일요일 일 일_월요일 월 월_화요일 화 화_수요일 수 수_목요일 목 목_금요일 금 금_토요일 토 토'.split('_'), i; + var expected = 'Minggu Min Mg_Senen Sen Sn_Seloso Sel Sl_Rebu Reb Rb_Kemis Kem Km_Jemuwah Jem Jm_Septu Sep Sp'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -17273,70 +17879,70 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), '몇초', '44초 = 몇초'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), '일분', '45초 = 일분'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), '일분', '89초 = 일분'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2분', '90초 = 2분'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44분', '44분 = 44분'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), '한시간', '45분 = 한시간'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), '한시간', '89분 = 한시간'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2시간', '90분 = 2시간'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5시간', '5시간 = 5시간'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21시간', '21시간 = 21시간'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), '하루', '22시간 = 하루'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), '하루', '35시간 = 하루'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2일', '36시간 = 2일'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), '하루', '하루 = 하루'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5일', '5일 = 5일'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25일', '25일 = 25일'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), '한달', '26일 = 한달'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), '한달', '30일 = 한달'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), '한달', '45일 = 한달'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2달', '46일 = 2달'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2달', '75일 = 2달'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3달', '76일 = 3달'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), '한달', '1달 = 한달'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5달', '5달 = 5달'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), '일년', '345일 = 일년'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2년', '548일 = 2년'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), '일년', '일년 = 일년'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5년', '5년 = 5년'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'sawetawis detik', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'setunggal menit', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'setunggal menit', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 menit', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 menit', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'setunggal jam', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'setunggal jam', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 jam', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 jam', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 jam', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'sedinten', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'sedinten', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dinten', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'sedinten', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dinten', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dinten', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'sewulan', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'sewulan', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'sewulan', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 wulan', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 wulan', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 wulan', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'sewulan', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 wulan', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'setaun', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 taun', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'setaun', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 taun', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), '몇초 후', 'prefix'); - assert.equal(moment(0).from(30000), '몇초 전', 'suffix'); + assert.equal(moment(30000).from(0), 'wonten ing sawetawis detik', 'prefix'); + assert.equal(moment(0).from(30000), 'sawetawis detik ingkang kepengker', 'suffix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), '몇초 전', 'now from now should display as in the past'); + assert.equal(moment().fromNow(), 'sawetawis detik ingkang kepengker', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), '몇초 후', 'in a few seconds'); - assert.equal(moment().add({d: 5}).fromNow(), '5일 후', 'in 5 days'); + assert.equal(moment().add({s: 30}).fromNow(), 'wonten ing sawetawis detik', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'wonten ing 5 dinten', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), '오늘 오전 2시 0분', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), '오늘 오전 2시 25분', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), '오늘 오전 3시 0분', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), '내일 오전 2시 0분', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), '오늘 오전 1시 0분', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), '어제 오전 2시 0분', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'Dinten puniko pukul 02.00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'Dinten puniko pukul 02.25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'Dinten puniko pukul 03.00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'Mbenjang pukul 02.00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'Dinten puniko pukul 01.00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'Kala wingi pukul 02.00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd LT'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [pukul] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [pukul] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [pukul] LT'), 'Today + ' + i + ' days end of day'); } }); @@ -17344,11 +17950,11 @@ var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('지난주 dddd LT'), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [kepengker pukul] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('지난주 dddd LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [kepengker pukul] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('지난주 dddd LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [kepengker pukul] LT'), 'Today - ' + i + ' days end of day'); } }); @@ -17366,73 +17972,76 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); + // Monday is the first day of the week. + // The week that contains Jan 1st is the first week of the year. + test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); + assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); + assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); + assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); + assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); + assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); + assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); + assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); + assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); + assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); + assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); + assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); + assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); + assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); + assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); + assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); + assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); + assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); + assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); + assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); + assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); + assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); + assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); + assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); - test('weeks year starting sunday format', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1일', 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1일', 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2일', 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2일', 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3일', 'Jan 15 2012 should be week 3'); + test('weeks year starting sunday formatted', function (assert) { + assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1', 'Dec 26 2011 should be week 1'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2', 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3', 'Jan 9 2012 should be week 3'); }); test('lenient ordinal parsing', function (assert) { @@ -17462,6 +18071,18 @@ } }); + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { @@ -17473,8 +18094,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -17483,12 +18105,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -17506,8 +18130,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -17522,13 +18146,14 @@ }); } - localeModule('lb'); + localeModule('ka'); test('parse', function (assert) { - var tests = 'Januar Jan._Februar Febr._Mäerz Mrz._Abrëll Abr._Mee Mee_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split('_'), i; + var i, + tests = 'იანვარი იან_თებერვალი თებ_მარტი მარ_აპრილი აპრ_მაისი მაი_ივნისი ივნ_ივლისი ივლ_აგვისტო აგვ_სექტემბერი სექ_ოქტომბერი ოქტ_ნოემბერი ნოე_დეკემბერი დეკ'.split('_'); function equalTest(input, mmm, i) { - assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); + assert.equal(moment(input, mmm).month(), i, input + ' უნდა იყოს თვე ' + (i + 1)); } for (i = 0; i < 12; i++) { @@ -17546,46 +18171,92 @@ test('format', function (assert) { var a = [ - ['dddd, Do MMMM YYYY, HH:mm:ss', 'Sonndeg, 14. Februar 2010, 15:25:50'], - ['ddd, HH:mm', 'So., 15:25'], - ['M Mo MM MMMM MMM', '2 2. 02 Februar Febr.'], - ['YYYY YY', '2010 10'], - ['D Do DD', '14 14. 14'], - ['d do dddd ddd dd', '0 0. Sonndeg So. So'], - ['DDD DDDo DDDD', '45 45. 045'], - ['w wo ww', '6 6. 06'], - ['h hh', '3 03'], - ['H HH', '15 15'], - ['m mm', '25 25'], - ['s ss', '50 50'], - ['a A', 'pm PM'], - ['[the] DDDo [day of the year]', 'the 45. day of the year'], - ['LTS', '15:25:50 Auer'], - ['L', '14.02.2010'], - ['LL', '14. Februar 2010'], - ['LLL', '14. Februar 2010 15:25 Auer'], - ['LLLL', 'Sonndeg, 14. Februar 2010 15:25 Auer'], - ['l', '14.2.2010'], - ['ll', '14. Febr. 2010'], - ['lll', '14. Febr. 2010 15:25 Auer'], - ['llll', 'So., 14. Febr. 2010 15:25 Auer'] + ['dddd, MMMM Do YYYY, h:mm:ss a', 'კვირა, თებერვალი მე-14 2010, 3:25:50 pm'], + ['ddd, hA', 'კვი, 3PM'], + ['M Mo MM MMMM MMM', '2 მე-2 02 თებერვალი თებ'], + ['YYYY YY', '2010 10'], + ['D Do DD', '14 მე-14 14'], + ['d do dddd ddd dd', '0 0 კვირა კვი კვ'], + ['DDD DDDo DDDD', '45 45-ე 045'], + ['w wo ww', '7 მე-7 07'], + ['h hh', '3 03'], + ['H HH', '15 15'], + ['m mm', '25 25'], + ['s ss', '50 50'], + ['a A', 'pm PM'], + ['წლის DDDo დღე', 'წლის 45-ე დღე'], + ['LTS', '3:25:50 PM'], + ['L', '14/02/2010'], + ['LL', '14 თებერვალს 2010'], + ['LLL', '14 თებერვალს 2010 3:25 PM'], + ['LLLL', 'კვირა, 14 თებერვალს 2010 3:25 PM'], + ['l', '14/2/2010'], + ['ll', '14 თებ 2010'], + ['lll', '14 თებ 2010 3:25 PM'], + ['llll', 'კვი, 14 თებ 2010 3:25 PM'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; + for (i = 0; i < a.length; i++) { assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); } }); + test('format ordinal', function (assert) { + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-ლი', '1-ლი'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), 'მე-2', 'მე-2'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), 'მე-3', 'მე-3'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), 'მე-4', 'მე-4'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), 'მე-5', 'მე-5'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), 'მე-6', 'მე-6'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), 'მე-7', 'მე-7'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), 'მე-8', 'მე-8'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), 'მე-9', 'მე-9'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), 'მე-10', 'მე-10'); + + assert.equal(moment([2011, 0, 11]).format('DDDo'), 'მე-11', 'მე-11'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), 'მე-12', 'მე-12'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), 'მე-13', 'მე-13'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), 'მე-14', 'მე-14'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), 'მე-15', 'მე-15'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), 'მე-16', 'მე-16'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), 'მე-17', 'მე-17'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), 'მე-18', 'მე-18'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), 'მე-19', 'მე-19'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), 'მე-20', 'მე-20'); + + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21-ე', '21-ე'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22-ე', '22-ე'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23-ე', '23-ე'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24-ე', '24-ე'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25-ე', '25-ე'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26-ე', '26-ე'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27-ე', '27-ე'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28-ე', '28-ე'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29-ე', '29-ე'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30-ე', '30-ე'); + + assert.equal(moment('2011 40', 'YYYY DDD').format('DDDo'), 'მე-40', 'მე-40'); + assert.equal(moment('2011 50', 'YYYY DDD').format('DDDo'), '50-ე', '50-ე'); + assert.equal(moment('2011 60', 'YYYY DDD').format('DDDo'), 'მე-60', 'მე-60'); + assert.equal(moment('2011 100', 'YYYY DDD').format('DDDo'), 'მე-100', 'მე-100'); + assert.equal(moment('2011 101', 'YYYY DDD').format('DDDo'), '101-ე', '101-ე'); + }); + test('format month', function (assert) { - var expected = 'Januar Jan._Februar Febr._Mäerz Mrz._Abrëll Abr._Mee Mee_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split('_'), i; + var i, + expected = 'იანვარი იან_თებერვალი თებ_მარტი მარ_აპრილი აპრ_მაისი მაი_ივნისი ივნ_ივლისი ივლ_აგვისტო აგვ_სექტემბერი სექ_ოქტომბერი ოქტ_ნოემბერი ნოე_დეკემბერი დეკ'.split('_'); + for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'Sonndeg So. So_Méindeg Mé. Mé_Dënschdeg Dë. Dë_Mëttwoch Më. Më_Donneschdeg Do. Do_Freideg Fr. Fr_Samschdeg Sa. Sa'.split('_'), i; + var i, + expected = 'კვირა კვი კვ_ორშაბათი ორშ ორ_სამშაბათი სამ სა_ოთხშაბათი ოთხ ოთ_ხუთშაბათი ხუთ ხუ_პარასკევი პარ პა_შაბათი შაბ შა'.split('_'); + for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -17593,74 +18264,169 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'e puer Sekonnen', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'eng Minutt', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'eng Minutt', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 Minutten', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 Minutten', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'eng Stonn', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'eng Stonn', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 Stonnen', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 Stonnen', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 Stonnen', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'een Dag', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'een Dag', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 Deeg', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'een Dag', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 Deeg', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 Deeg', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'ee Mount', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'ee Mount', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'ee Mount', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 Méint', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 Méint', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 Méint', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'ee Mount', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 Méint', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ee Joer', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 Joer', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'ee Joer', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 Joer', '5 years = 5 years'); + + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'რამდენიმე წამი', '44 წამი = რამდენიმე წამი'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'წუთი', '45 წამი = წუთი'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'წუთი', '89 წამი = წუთი'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 წუთი', '90 წამი = 2 წუთი'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 წუთი', '44 წამი = 44 წუთი'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'საათი', '45 წამი = საათი'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'საათი', '89 წამი = საათი'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 საათი', '90 წამი = 2 საათი'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 საათი', '5 საათი = 5 საათი'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 საათი', '21 საათი = 21 საათი'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'დღე', '22 საათი = დღე'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'დღე', '35 საათი = დღე'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 დღე', '36 საათი = 2 დღე'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'დღე', '1 დღე = დღე'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 დღე', '5 დღე = 5 დღე'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 დღე', '25 დღე = 25 დღე'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'თვე', '26 დღე = თვე'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'თვე', '30 დღე = თვე'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'თვე', '45 დღე = თვე'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 თვე', '46 დღე = 2 თვე'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 თვე', '75 დღე = 2 თვე'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 თვე', '76 დღე = 3 თვე'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'თვე', '1 თვე = თვე'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 თვე', '5 თვე = 5 თვე'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'წელი', '345 დღე = წელი'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 წელი', '548 დღე = 2 წელი'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'წელი', '1 წელი = წელი'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 წელი', '5 წელი = 5 წელი'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'an e puer Sekonnen', 'prefix'); - assert.equal(moment(0).from(30000), 'virun e puer Sekonnen', 'suffix'); + assert.equal(moment(30000).from(0), 'რამდენიმე წამში', 'ში სუფიქსი'); + assert.equal(moment(0).from(30000), 'რამდენიმე წამის წინ', 'წინ სუფიქსი'); + }); + + test('now from now', function (assert) { + assert.equal(moment().fromNow(), 'რამდენიმე წამის წინ', 'უნდა აჩვენოს როგორც წარსული'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'an e puer Sekonnen', 'in a few seconds'); - assert.equal(moment().add({d: 1}).fromNow(), 'an engem Dag', 'in one day'); - assert.equal(moment().add({d: 2}).fromNow(), 'an 2 Deeg', 'in 2 days'); - assert.equal(moment().add({d: 3}).fromNow(), 'an 3 Deeg', 'in 3 days'); - assert.equal(moment().add({d: 4}).fromNow(), 'a 4 Deeg', 'in 4 days'); - assert.equal(moment().add({d: 5}).fromNow(), 'a 5 Deeg', 'in 5 days'); - assert.equal(moment().add({d: 6}).fromNow(), 'a 6 Deeg', 'in 6 days'); - assert.equal(moment().add({d: 7}).fromNow(), 'a 7 Deeg', 'in 7 days'); - assert.equal(moment().add({d: 8}).fromNow(), 'an 8 Deeg', 'in 8 days'); - assert.equal(moment().add({d: 9}).fromNow(), 'an 9 Deeg', 'in 9 days'); - assert.equal(moment().add({d: 10}).fromNow(), 'an 10 Deeg', 'in 10 days'); - assert.equal(moment().add({y: 100}).fromNow(), 'an 100 Joer', 'in 100 years'); - assert.equal(moment().add({y: 400}).fromNow(), 'a 400 Joer', 'in 400 years'); + assert.equal(moment().add({s: 30}).fromNow(), 'რამდენიმე წამში', 'რამდენიმე წამში'); + assert.equal(moment().add({d: 5}).fromNow(), '5 დღეში', '5 დღეში'); }); - test('calendar last week', function (assert) { - var i, m, weekday, datestring; - for (i = 2; i < 7; i++) { - m = moment().subtract({d: i}); + test('calendar day', function (assert) { + var a = moment().hours(2).minutes(0).seconds(0); - // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) - weekday = parseInt(m.format('d'), 10); - datestring = (weekday === 2 || weekday === 4 ? '[Leschten] dddd [um] LT' : '[Leschte] dddd [um] LT'); + assert.equal(moment(a).calendar(), 'დღეს 2:00 AM-ზე', 'დღეს ამავე დროს'); + assert.equal(moment(a).add({m: 25}).calendar(), 'დღეს 2:25 AM-ზე', 'ახლანდელ დროს დამატებული 25 წუთი'); + assert.equal(moment(a).add({h: 1}).calendar(), 'დღეს 3:00 AM-ზე', 'ახლანდელ დროს დამატებული 1 საათი'); + assert.equal(moment(a).add({d: 1}).calendar(), 'ხვალ 2:00 AM-ზე', 'ხვალ ამავე დროს'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'დღეს 1:00 AM-ზე', 'ახლანდელ დროს გამოკლებული 1 საათი'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'გუშინ 2:00 AM-ზე', 'გუშინ ამავე დროს'); + }); - assert.equal(m.calendar(), m.format(datestring), 'Today + ' + i + ' days current time'); + test('calendar next week', function (assert) { + var i, m; + for (i = 2; i < 7; i++) { + m = moment().add({d: i}); + assert.equal(m.calendar(), m.format('[შემდეგ] dddd LT[-ზე]'), 'დღეს + ' + i + ' დღე ახლანდელ დროს'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format(datestring), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[შემდეგ] dddd LT[-ზე]'), 'დღეს + ' + i + ' დღე დღის დასაწყისში'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format(datestring), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[შემდეგ] dddd LT[-ზე]'), 'დღეს + ' + i + ' დღე დღის დასასრულს'); + } + }); + + test('calendar last week', function (assert) { + var i, m; + for (i = 2; i < 7; i++) { + m = moment().subtract({d: i}); + assert.equal(m.calendar(), m.format('[წინა] dddd LT[-ზე]'), 'დღეს - ' + i + ' დღე ახლანდელ დროს'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format('[წინა] dddd LT[-ზე]'), 'დღეს - ' + i + ' დღე დღის დასაწყისში'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format('[წინა] dddd LT[-ზე]'), 'დღეს - ' + i + ' დღე დღის დასასრულს'); } }); + test('calendar all else', function (assert) { + var weeksAgo = moment().subtract({w: 1}), + weeksFromNow = moment().add({w: 1}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 კვირის წინ'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), '1 კვირაში'); + + weeksAgo = moment().subtract({w: 2}); + weeksFromNow = moment().add({w: 2}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 კვირის წინ'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), '2 კვირაში'); + }); + + test('weeks year starting sunday', function (assert) { + assert.equal(moment([2011, 11, 26]).week(), 1, 'დეკ 26 2011 უნდა იყოს კვირა 1'); + assert.equal(moment([2012, 0, 1]).week(), 1, 'იან 1 2012 უნდა იყოს კვირა 1'); + assert.equal(moment([2012, 0, 2]).week(), 2, 'იან 2 2012 უნდა იყოს კვირა 2'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'იან 8 2012 უნდა იყოს კვირა 2'); + assert.equal(moment([2012, 0, 9]).week(), 3, 'იან 9 2012 უნდა იყოს კვირა 3'); + }); + + test('weeks year starting monday', function (assert) { + assert.equal(moment([2007, 0, 1]).week(), 1, 'იან 1 2007 უნდა იყოს კვირა 1'); + assert.equal(moment([2007, 0, 7]).week(), 1, 'იან 7 2007 უნდა იყოს კვირა 1'); + assert.equal(moment([2007, 0, 8]).week(), 2, 'იან 8 2007 უნდა იყოს კვირა 2'); + assert.equal(moment([2007, 0, 14]).week(), 2, 'იან 14 2007 უნდა იყოს კვირა 2'); + assert.equal(moment([2007, 0, 15]).week(), 3, 'იან 15 2007 უნდა იყოს კვირა 3'); + }); + + test('weeks year starting tuesday', function (assert) { + assert.equal(moment([2007, 11, 31]).week(), 1, 'დეკ 31 2007 უნდა იყოს კვირა 1'); + assert.equal(moment([2008, 0, 1]).week(), 1, 'იან 1 2008 უნდა იყოს კვირა 1'); + assert.equal(moment([2008, 0, 6]).week(), 1, 'იან 6 2008 უნდა იყოს კვირა 1'); + assert.equal(moment([2008, 0, 7]).week(), 2, 'იან 7 2008 უნდა იყოს კვირა 2'); + assert.equal(moment([2008, 0, 13]).week(), 2, 'იან 13 2008 უნდა იყოს კვირა 2'); + assert.equal(moment([2008, 0, 14]).week(), 3, 'იან 14 2008 უნდა იყოს კვირა 3'); + }); + + test('weeks year starting wednesday', function (assert) { + assert.equal(moment([2002, 11, 30]).week(), 1, 'დეკ 30 2002 უნდა იყოს კვირა 1'); + assert.equal(moment([2003, 0, 1]).week(), 1, 'იან 1 2003 უნდა იყოს კვირა 1'); + assert.equal(moment([2003, 0, 5]).week(), 1, 'იან 5 2003 უნდა იყოს კვირა 1'); + assert.equal(moment([2003, 0, 6]).week(), 2, 'იან 6 2003 უნდა იყოს კვირა 2'); + assert.equal(moment([2003, 0, 12]).week(), 2, 'იან 12 2003 უნდა იყოს კვირა 2'); + assert.equal(moment([2003, 0, 13]).week(), 3, 'იან 13 2003 უნდა იყოს კვირა 3'); + }); + + test('weeks year starting thursday', function (assert) { + assert.equal(moment([2008, 11, 29]).week(), 1, 'დეკ 29 2008 უნდა იყოს კვირა 1'); + assert.equal(moment([2009, 0, 1]).week(), 1, 'იან 1 2009 უნდა იყოს კვირა 1'); + assert.equal(moment([2009, 0, 4]).week(), 1, 'იან 4 2009 უნდა იყოს კვირა 1'); + assert.equal(moment([2009, 0, 5]).week(), 2, 'იან 5 2009 უნდა იყოს კვირა 2'); + assert.equal(moment([2009, 0, 11]).week(), 2, 'იან 11 2009 უნდა იყოს კვირა 2'); + assert.equal(moment([2009, 0, 12]).week(), 3, 'იან 12 2009 უნდა იყოს კვირა 3'); + }); + + test('weeks year starting friday', function (assert) { + assert.equal(moment([2009, 11, 28]).week(), 1, 'დეკ 28 2009 უნდა იყოს კვირა 1'); + assert.equal(moment([2010, 0, 1]).week(), 1, 'იან 1 2010 უნდა იყოს კვირა 1'); + assert.equal(moment([2010, 0, 3]).week(), 1, 'იან 3 2010 უნდა იყოს კვირა 1'); + assert.equal(moment([2010, 0, 4]).week(), 2, 'იან 4 2010 უნდა იყოს კვირა 2'); + assert.equal(moment([2010, 0, 10]).week(), 2, 'იან 10 2010 უნდა იყოს კვირა 2'); + assert.equal(moment([2010, 0, 11]).week(), 3, 'იან 11 2010 უნდა იყოს კვირა 3'); + }); + + test('weeks year starting saturday', function (assert) { + assert.equal(moment([2010, 11, 27]).week(), 1, 'დეკ 27 2010 უნდა იყოს კვირა 1'); + assert.equal(moment([2011, 0, 1]).week(), 1, 'იან 1 2011 უნდა იყოს კვირა 1'); + assert.equal(moment([2011, 0, 2]).week(), 1, 'იან 2 2011 უნდა იყოს კვირა 1'); + assert.equal(moment([2011, 0, 3]).week(), 2, 'იან 3 2011 უნდა იყოს კვირა 2'); + assert.equal(moment([2011, 0, 9]).week(), 2, 'იან 9 2011 უნდა იყოს კვირა 2'); + assert.equal(moment([2011, 0, 10]).week(), 3, 'იან 10 2011 უნდა იყოს კვირა 3'); + }); + + test('weeks year starting sunday formatted', function (assert) { + assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-ლი', 'დეკ 26 2011 უნდა იყოს კვირა 1'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-ლი', 'იან 1 2012 უნდა იყოს კვირა 1'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 მე-2', 'იან 2 2012 უნდა იყოს კვირა 2'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 მე-2', 'იან 8 2012 უნდა იყოს კვირა 2'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 მე-3', 'იან 9 2012 უნდა იყოს კვირა 3'); + }); + test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { @@ -17699,8 +18465,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -17709,12 +18476,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -17732,8 +18501,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -17748,10 +18517,10 @@ }); } - localeModule('lt'); + localeModule('kk'); test('parse', function (assert) { - var tests = 'sausis sau_vasaris vas_kovas kov_balandis bal_gegužė geg_birželis bir_liepa lie_rugpjūtis rgp_rugsėjis rgs_spalis spa_lapkritis lap_gruodis grd'.split('_'), i; + var tests = 'Қаңтар Қаң_Ақпан Ақп_Наурыз Нау_Сәуір Сәу_Мамыр Мам_Маусым Мау_Шілде Шіл_Тамыз Там_Қыркүйек Қыр_Қазан Қаз_Қараша Қар_Желтоқсан Жел'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -17770,29 +18539,29 @@ test('format', function (assert) { var a = [ - ['dddd, Do MMMM YYYY, h:mm:ss a', 'sekmadienis, 14-oji vasario 2010, 3:25:50 pm'], - ['ddd, hA', 'Sek, 3PM'], - ['M Mo MM MMMM MMM', '2 2-oji 02 vasaris vas'], + ['dddd, Do MMMM YYYY, HH:mm:ss', 'Жексенбі, 14-ші Ақпан 2010, 15:25:50'], + ['ddd, hA', 'Жек, 3PM'], + ['M Mo MM MMMM MMM', '2 2-ші 02 Ақпан Ақп'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14-oji 14'], - ['d do dddd ddd dd', '0 0-oji sekmadienis Sek S'], - ['DDD DDDo DDDD', '45 45-oji 045'], - ['w wo ww', '6 6-oji 06'], + ['D Do DD', '14 14-ші 14'], + ['d do dddd ddd dd', '0 0-ші Жексенбі Жек Жк'], + ['DDD DDDo DDDD', '45 45-ші 045'], + ['w wo ww', '7 7-ші 07'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], ['a A', 'pm PM'], - ['DDDo [metų diena]', '45-oji metų diena'], + ['[жылдың] DDDo [күні]', 'жылдың 45-ші күні'], ['LTS', '15:25:50'], - ['L', '2010-02-14'], - ['LL', '2010 m. vasaris 14 d.'], - ['LLL', '2010 m. vasaris 14 d., 15:25 val.'], - ['LLLL', '2010 m. vasaris 14 d., sekmadienis, 15:25 val.'], - ['l', '2010-02-14'], - ['ll', '2010 m. vasaris 14 d.'], - ['lll', '2010 m. vasaris 14 d., 15:25 val.'], - ['llll', '2010 m. vasaris 14 d., Sek, 15:25 val.'] + ['L', '14.02.2010'], + ['LL', '14 Ақпан 2010'], + ['LLL', '14 Ақпан 2010 15:25'], + ['LLLL', 'Жексенбі, 14 Ақпан 2010 15:25'], + ['l', '14.2.2010'], + ['ll', '14 Ақп 2010'], + ['lll', '14 Ақп 2010 15:25'], + ['llll', 'Жек, 14 Ақп 2010 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -17802,151 +18571,135 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-oji', '1-oji'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-oji', '2-oji'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-oji', '3-oji'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4-oji', '4-oji'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5-oji', '5-oji'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6-oji', '6-oji'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7-oji', '7-oji'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8-oji', '8-oji'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9-oji', '9-oji'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10-oji', '10-oji'); - - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11-oji', '11-oji'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12-oji', '12-oji'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13-oji', '13-oji'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14-oji', '14-oji'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15-oji', '15-oji'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16-oji', '16-oji'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17-oji', '17-oji'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18-oji', '18-oji'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19-oji', '19-oji'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20-oji', '20-oji'); - - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21-oji', '21-oji'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22-oji', '22-oji'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23-oji', '23-oji'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24-oji', '24-oji'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25-oji', '25-oji'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26-oji', '26-oji'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27-oji', '27-oji'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28-oji', '28-oji'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29-oji', '29-oji'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30-oji', '30-oji'); - - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-oji', '31-oji'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-ші', '1st'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-ші', '2nd'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-ші', '3rd'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4-ші', '4th'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5-ші', '5th'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6-шы', '6th'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7-ші', '7th'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8-ші', '8th'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9-шы', '9th'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10-шы', '10th'); + + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11-ші', '11th'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12-ші', '12th'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13-ші', '13th'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14-ші', '14th'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15-ші', '15th'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16-шы', '16th'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17-ші', '17th'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18-ші', '18th'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19-шы', '19th'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20-шы', '20th'); + + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21-ші', '21st'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22-ші', '22nd'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23-ші', '23rd'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24-ші', '24th'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25-ші', '25th'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26-шы', '26th'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27-ші', '27th'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28-ші', '28th'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29-шы', '29th'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30-шы', '30th'); + + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-ші', '31st'); }); test('format month', function (assert) { - var expected = 'sausis sau_vasaris vas_kovas kov_balandis bal_gegužė geg_birželis bir_liepa lie_rugpjūtis rgp_rugsėjis rgs_spalis spa_lapkritis lap_gruodis grd'.split('_'), i; + var expected = 'Қаңтар Қаң_Ақпан Ақп_Наурыз Нау_Сәуір Сәу_Мамыр Мам_Маусым Мау_Шілде Шіл_Тамыз Там_Қыркүйек Қыр_Қазан Қаз_Қараша Қар_Желтоқсан Жел'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'sekmadienis Sek S_pirmadienis Pir P_antradienis Ant A_trečiadienis Tre T_ketvirtadienis Ket K_penktadienis Pen Pn_šeštadienis Šeš Š'.split('_'), i; - for (i = 0; i < expected.length; i++) { - assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); - } - }); - - test('format week on US calendar', function (assert) { - // Tests, whether the weekday names are correct, even if the week does not start on Monday - moment.locale('lt', {week: {dow: 0, doy: 6}}); - var expected = 'sekmadienis Sek S_pirmadienis Pir P_antradienis Ant A_trečiadienis Tre T_ketvirtadienis Ket K_penktadienis Pen Pn_šeštadienis Šeš Š'.split('_'), i; + var expected = 'Жексенбі Жек Жк_Дүйсенбі Дүй Дй_Сейсенбі Сей Сй_Сәрсенбі Сәр Ср_Бейсенбі Бей Бй_Жұма Жұм Жм_Сенбі Сен Сн'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } - moment.locale('lt', {week: {dow: 1, doy: 4}}); }); test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'kelios sekundės', '44 seconds = seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'minutė', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'minutė', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutės', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 10}), true), '10 minučių', '10 minutes = 10 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 11}), true), '11 minučių', '11 minutes = 11 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 19}), true), '19 minučių', '19 minutes = 19 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 20}), true), '20 minučių', '20 minutes = 20 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutės', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'valanda', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'valanda', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 valandos', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 valandos', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 10}), true), '10 valandų', '10 hours = 10 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 valandos', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'diena', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'diena', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dienos', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'diena', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dienos', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 10}), true), '10 dienų', '10 days = 10 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dienos', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'mėnuo', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'mėnuo', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'mėnuo', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 mėnesiai', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 mėnesiai', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 mėnesiai', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'mėnuo', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 mėnesiai', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 10}), true), '10 mėnesių', '10 months = 10 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'metai', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 metai', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'metai', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 metai', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'бірнеше секунд', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'бір минут', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'бір минут', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 минут', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 минут', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'бір сағат', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'бір сағат', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 сағат', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 сағат', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 сағат', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'бір күн', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'бір күн', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 күн', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'бір күн', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 күн', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 күн', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'бір ай', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'бір ай', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'бір ай', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 ай', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 ай', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 ай', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'бір ай', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 ай', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'бір жыл', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 жыл', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'бір жыл', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 жыл', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'po kelių sekundžių', 'prefix'); - assert.equal(moment(0).from(30000), 'prieš kelias sekundes', 'suffix'); + assert.equal(moment(30000).from(0), 'бірнеше секунд ішінде', 'prefix'); + assert.equal(moment(0).from(30000), 'бірнеше секунд бұрын', 'suffix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'prieš kelias sekundes', 'now from now should display as in the past'); + assert.equal(moment().fromNow(), 'бірнеше секунд бұрын', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'po kelių sekundžių', 'in seconds'); - assert.equal(moment().add({d: 5}).fromNow(), 'po 5 dienų', 'in 5 days'); + assert.equal(moment().add({s: 30}).fromNow(), 'бірнеше секунд ішінде', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), '5 күн ішінде', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'Šiandien 02:00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'Šiandien 02:25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'Šiandien 03:00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'Rytoj 02:00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'Šiandien 01:00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'Vakar 02:00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'Бүгін сағат 02:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'Бүгін сағат 02:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'Бүгін сағат 03:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'Ертең сағат 02:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'Бүгін сағат 01:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'Кеше сағат 02:00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd LT'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [сағат] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [сағат] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [сағат] LT'), 'Today + ' + i + ' days end of day'); } }); test('calendar last week', function (assert) { var i, m; + for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('[Praėjusį] dddd LT'), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('[Өткен аптаның] dddd [сағат] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[Praėjusį] dddd LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[Өткен аптаның] dddd [сағат] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[Praėjusį] dddd LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[Өткен аптаның] dddd [сағат] LT'), 'Today - ' + i + ' days end of day'); } }); @@ -17965,11 +18718,11 @@ }); test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); + assert.equal(moment([2011, 11, 25]).week(), 52, 'Dec 25 2011 should be week 52'); + assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); + assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); }); test('weeks year starting monday', function (assert) { @@ -18008,29 +18761,29 @@ }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); + assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); + assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); + assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); + assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); + assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); + assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); + assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); + assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); + assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); + assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52-oji', 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1-oji', 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1-oji', 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2-oji', 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2-oji', 'Jan 15 2012 should be week 2'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-ші', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2-ші', 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2-ші', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-ші', 'Jan 9 2012 should be week 3'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3-ші', 'Jan 15 2012 should be week 3'); }); test('lenient ordinal parsing', function (assert) { @@ -18071,8 +18824,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -18081,12 +18835,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -18104,8 +18860,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -18120,10 +18876,12 @@ }); } - localeModule('lv'); + localeModule('km'); test('parse', function (assert) { - var tests = 'janvāris jan_februāris feb_marts mar_aprīlis apr_maijs mai_jūnijs jūn_jūlijs jūl_augusts aug_septembris sep_oktobris okt_novembris nov_decembris dec'.split('_'), i; + var tests = 'មករា មករា_កុម្ភៈ កុម្ភៈ_មិនា មិនា_មេសា មេសា_ឧសភា ឧសភា_មិថុនា មិថុនា_កក្កដា កក្កដា_សីហា សីហា_កញ្ញា កញ្ញា_តុលា តុលា_វិច្ឆិកា វិច្ឆិកា_ធ្នូ ធ្នូ'.split('_'), + i; + function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -18142,29 +18900,29 @@ test('format', function (assert) { var a = [ - ['dddd, Do MMMM YYYY, h:mm:ss a', 'svētdiena, 14. februāris 2010, 3:25:50 pm'], - ['ddd, hA', 'Sv, 3PM'], - ['M Mo MM MMMM MMM', '2 2. 02 februāris feb'], - ['YYYY YY', '2010 10'], - ['D Do DD', '14 14. 14'], - ['d do dddd ddd dd', '0 0. svētdiena Sv Sv'], - ['DDD DDDo DDDD', '45 45. 045'], - ['w wo ww', '6 6. 06'], - ['h hh', '3 03'], - ['H HH', '15 15'], - ['m mm', '25 25'], - ['s ss', '50 50'], - ['a A', 'pm PM'], - ['[the] DDDo [day of the year]', 'the 45. day of the year'], - ['LTS', '15:25:50'], - ['L', '14.02.2010.'], - ['LL', '2010. gada 14. februāris'], - ['LLL', '2010. gada 14. februāris, 15:25'], - ['LLLL', '2010. gada 14. februāris, svētdiena, 15:25'], - ['l', '14.2.2010.'], - ['ll', '2010. gada 14. feb'], - ['lll', '2010. gada 14. feb, 15:25'], - ['llll', '2010. gada 14. feb, Sv, 15:25'] + ['dddd, MMMM Do YYYY, h:mm:ss a', 'អាទិត្យ, កុម្ភៈ 14 2010, 3:25:50 pm'], + ['ddd, hA', 'អាទិត្យ, 3PM'], + ['M Mo MM MMMM MMM', '2 2 02 កុម្ភៈ កុម្ភៈ'], + ['YYYY YY', '2010 10'], + ['D Do DD', '14 14 14'], + ['d do dddd ddd dd', '0 0 អាទិត្យ អាទិត្យ អាទិត្យ'], + ['DDD DDDo DDDD', '45 45 045'], + ['w wo ww', '6 6 06'], + ['h hh', '3 03'], + ['H HH', '15 15'], + ['m mm', '25 25'], + ['s ss', '50 50'], + ['a A', 'pm PM'], + ['[the] DDDo [day of the year]', 'the 45 day of the year'], + ['LTS', '15:25:50'], + ['L', '14/02/2010'], + ['LL', '14 កុម្ភៈ 2010'], + ['LLL', '14 កុម្ភៈ 2010 15:25'], + ['LLLL', 'អាទិត្យ, 14 កុម្ភៈ 2010 15:25'], + ['l', '14/2/2010'], + ['ll', '14 កុម្ភៈ 2010'], + ['lll', '14 កុម្ភៈ 2010 15:25'], + ['llll', 'អាទិត្យ, 14 កុម្ភៈ 2010 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -18174,239 +18932,247 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1st'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2nd'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3rd'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4th'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5th'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6th'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7th'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8th'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9th'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10th'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11th'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12th'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13th'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14th'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15th'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16th'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17th'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18th'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19th'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20th'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21st'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22nd'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23rd'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24th'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25th'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26th'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27th'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28th'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29th'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30th'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31st'); }); test('format month', function (assert) { - var expected = 'janvāris jan_februāris feb_marts mar_aprīlis apr_maijs mai_jūnijs jūn_jūlijs jūl_augusts aug_septembris sep_oktobris okt_novembris nov_decembris dec'.split('_'), i; + var expected = 'មករា មករា_កុម្ភៈ កុម្ភៈ_មិនា មិនា_មេសា មេសា_ឧសភា ឧសភា_មិថុនា មិថុនា_កក្កដា កក្កដា_សីហា សីហា_កញ្ញា កញ្ញា_តុលា តុលា_វិច្ឆិកា វិច្ឆិកា_ធ្នូ ធ្នូ'.split('_'), + i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'svētdiena Sv Sv_pirmdiena P P_otrdiena O O_trešdiena T T_ceturtdiena C C_piektdiena Pk Pk_sestdiena S S'.split('_'), i; + var expected = 'អាទិត្យ អាទិត្យ អាទិត្យ_ច័ន្ទ ច័ន្ទ ច័ន្ទ_អង្គារ អង្គារ អង្គារ_ពុធ ពុធ ពុធ_ព្រហស្បតិ៍ ព្រហស្បតិ៍ ព្រហស្បតិ៍_សុក្រ សុក្រ សុក្រ_សៅរ៍ សៅរ៍ សៅរ៍'.split('_'), + i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); - // Includes testing the cases of withoutSuffix = true and false. test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'dažas sekundes', '44 seconds = seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), false), 'pirms dažām sekundēm', '44 seconds with suffix = seconds ago'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'minūte', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), false), 'pirms minūtes', '45 seconds with suffix = a minute ago'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'minūte', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: -89}), false), 'pēc minūtes', '89 seconds with suffix/prefix = in a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minūtes', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), false), 'pirms 2 minūtēm', '90 seconds with suffix = 2 minutes ago'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minūtes', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), false), 'pirms 44 minūtēm', '44 minutes with suffix = 44 minutes ago'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'stunda', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), false), 'pirms stundas', '45 minutes with suffix = an hour ago'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'stunda', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 stundas', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: -90}), false), 'pēc 2 stundām', '90 minutes with suffix = in 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 stundas', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), false), 'pirms 5 stundām', '5 hours with suffix = 5 hours ago'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 stunda', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), false), 'pirms 21 stundas', '21 hours with suffix = 21 hours ago'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'diena', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), false), 'pirms dienas', '22 hours with suffix = a day ago'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'diena', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dienas', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), false), 'pirms 2 dienām', '36 hours with suffix = 2 days ago'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'diena', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dienas', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), false), 'pirms 5 dienām', '5 days with suffix = 5 days ago'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dienas', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), false), 'pirms 25 dienām', '25 days with suffix = 25 days ago'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'mēnesis', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), false), 'pirms mēneša', '26 days with suffix = a month ago'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'mēnesis', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'mēnesis', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 mēneši', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), false), 'pirms 2 mēnešiem', '46 days with suffix = 2 months ago'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 mēneši', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 mēneši', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), false), 'pirms 3 mēnešiem', '76 days with suffix = 3 months ago'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'mēnesis', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 mēneši', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), false), 'pirms 5 mēnešiem', '5 months with suffix = 5 months ago'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'gads', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), false), 'pirms gada', '345 days with suffix = a year ago'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 gadi', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), false), 'pirms 2 gadiem', '548 days with suffix = 2 years ago'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'gads', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 gadi', '5 years = 5 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), false), 'pirms 5 gadiem', '5 years with suffix = 5 years ago'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'ប៉ុន្មានវិនាទី', '44 seconds = ប៉ុន្មានវិនាទី'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'មួយនាទី', '45 seconds = មួយនាទី'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'មួយនាទី', '89 seconds = មួយនាទី'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 នាទី', '90 seconds = 2 នាទី'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 នាទី', '44 minutes = 44 នាទី'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'មួយម៉ោង', '45 minutes = មួយម៉ោង'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'មួយម៉ោង', '89 minutes = មួយម៉ោង'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 ម៉ោង', '90 minutes = 2 ម៉ោង'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 ម៉ោង', '5 hours = 5 ម៉ោង'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 ម៉ោង', '21 hours = 21 ម៉ោង'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'មួយថ្ងៃ', '22 hours = មួយថ្ងៃ'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'មួយថ្ងៃ', '35 hours = មួយថ្ងៃ'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 ថ្ងៃ', '36 hours = 2 ថ្ងៃ'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'មួយថ្ងៃ', '1 day = មួយថ្ងៃ'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 ថ្ងៃ', '5 days = 5 ថ្ងៃ'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 ថ្ងៃ', '25 days = 25 ថ្ងៃ'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'មួយខែ', '26 days = មួយខែ'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'មួយខែ', '30 days = មួយខែ'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'មួយខែ', '43 days = មួយខែ'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 ខែ', '46 days = 2 ខែ'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 ខែ', '75 days = 2 ខែ'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 ខែ', '76 days = 3 ខែ'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'មួយខែ', '1 month = មួយខែ'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 ខែ', '5 months = 5 ខែ'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'មួយឆ្នាំ', '345 days = មួយឆ្នាំ'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 ឆ្នាំ', '548 days = 2 ឆ្នាំ'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'មួយឆ្នាំ', '1 year = មួយឆ្នាំ'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 ឆ្នាំ', '5 years = 5 ឆ្នាំ'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'pēc dažām sekundēm', 'prefix'); - assert.equal(moment(0).from(30000), 'pirms dažām sekundēm', 'suffix'); + assert.equal(moment(30000).from(0), 'ប៉ុន្មានវិនាទីទៀត', 'prefix'); + assert.equal(moment(0).from(30000), 'ប៉ុន្មានវិនាទីមុន', 'suffix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'pirms dažām sekundēm', 'now from now should display as in the past'); + assert.equal(moment().fromNow(), 'ប៉ុន្មានវិនាទីមុន', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'pēc dažām sekundēm', 'in seconds'); - assert.equal(moment().add({d: 5}).fromNow(), 'pēc 5 dienām', 'in 5 days'); + assert.equal(moment().add({ + s: 30 + }).fromNow(), 'ប៉ុន្មានវិនាទីទៀត', 'in a few seconds'); + assert.equal(moment().add({ + d: 5 + }).fromNow(), '5 ថ្ងៃទៀត', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'Šodien pulksten 02:00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'Šodien pulksten 02:25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'Šodien pulksten 03:00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'Rīt pulksten 02:00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'Šodien pulksten 01:00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'Vakar pulksten 02:00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'ថ្ងៃនេះ ម៉ោង 02:00', 'today at the same time'); + assert.equal(moment(a).add({ + m: 25 + }).calendar(), 'ថ្ងៃនេះ ម៉ោង 02:25', 'Now plus 25 min'); + assert.equal(moment(a).add({ + h: 1 + }).calendar(), 'ថ្ងៃនេះ ម៉ោង 03:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({ + d: 1 + }).calendar(), 'ស្អែក ម៉ោង 02:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({ + h: 1 + }).calendar(), 'ថ្ងៃនេះ ម៉ោង 01:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({ + d: 1 + }).calendar(), 'ម្សិលមិញ ម៉ោង 02:00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { - m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd [pulksten] LT'), 'Today + ' + i + ' days current time'); + m = moment().add({ + d: i + }); + assert.equal(m.calendar(), m.format('dddd [ម៉ោង] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [pulksten] LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [ម៉ោង] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [pulksten] LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [ម៉ោង] LT'), 'Today + ' + i + ' days end of day'); } }); test('calendar last week', function (assert) { var i, m; + for (i = 2; i < 7; i++) { - m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('[Pagājušā] dddd [pulksten] LT'), 'Today - ' + i + ' days current time'); + m = moment().subtract({ + d: i + }); + assert.equal(m.calendar(), m.format('dddd [សប្តាហ៍មុន] [ម៉ោង] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[Pagājušā] dddd [pulksten] LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [សប្តាហ៍មុន] [ម៉ោង] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[Pagājušā] dddd [pulksten] LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [សប្តាហ៍មុន] [ម៉ោង] LT'), 'Today - ' + i + ' days end of day'); } }); test('calendar all else', function (assert) { - var weeksAgo = moment().subtract({w: 1}), - weeksFromNow = moment().add({w: 1}); + var weeksAgo = moment().subtract({ + w: 1 + }), + weeksFromNow = moment().add({ + w: 1 + }); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); - weeksAgo = moment().subtract({w: 2}); - weeksFromNow = moment().add({w: 2}); + weeksAgo = moment().subtract({ + w: 2 + }); + weeksFromNow = moment().add({ + w: 2 + }); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); + assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); + assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); + assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); + assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); + assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); + assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); + assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); + assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); + assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); + assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); + assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); + assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); + assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); + assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); + assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); + assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); + assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); + assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); + assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); + assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); + assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); + assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); + assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52', 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1', 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1', 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2', 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2', 'Jan 15 2012 should be week 2'); }); test('lenient ordinal parsing', function (assert) { @@ -18447,8 +19213,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -18457,12 +19224,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -18480,8 +19249,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -18496,11 +19265,10 @@ }); } - localeModule('me'); + localeModule('ko'); test('parse', function (assert) { - var tests = 'januar jan._februar feb._mart mar._april apr._maj maj_jun jun_jul jul_avgust avg._septembar sep._oktobar okt._novembar nov._decembar dec.'.split('_'), - i; + var tests = '1월 1월_2월 2월_3월 3월_4월 4월_5월 5월_6월 6월_7월 7월_8월 8월_9월 9월_10월 10월_11월 11월_12월 12월'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -18517,31 +19285,67 @@ } }); + test('parse meridiem', function (assert) { + var elements = [{ + expression : '1981년 9월 8일 오후 2시 30분', + inputFormat : 'YYYY[년] M[월] D[일] A h[시] m[분]', + outputFormat : 'A', + expected : '오후' + }, { + expression : '1981년 9월 8일 오전 2시 30분', + inputFormat : 'YYYY[년] M[월] D[일] A h[시] m[분]', + outputFormat : 'A h시', + expected : '오전 2시' + }, { + expression : '14시 30분', + inputFormat : 'H[시] m[분]', + outputFormat : 'A', + expected : '오후' + }, { + expression : '오후 4시', + inputFormat : 'A h[시]', + outputFormat : 'H', + expected : '16' + }], i, l, it, actual; + + + for (i = 0, l = elements.length; i < l; ++i) { + it = elements[i]; + actual = moment(it.expression, it.inputFormat).format(it.outputFormat); + + assert.equal( + actual, + it.expected, + '\'' + it.outputFormat + '\' of \'' + it.expression + '\' must be \'' + it.expected + '\' but was \'' + actual + '\'.' + ); + } + }); + test('format', function (assert) { var a = [ - ['dddd, Do MMMM YYYY, h:mm:ss a', 'nedjelja, 14. februar 2010, 3:25:50 pm'], - ['ddd, hA', 'ned., 3PM'], - ['M Mo MM MMMM MMM', '2 2. 02 februar feb.'], + ['YYYY년 MMMM Do dddd a h:mm:ss', '2010년 2월 14일 일요일 오후 3:25:50'], + ['ddd A h', '일 오후 3'], + ['M Mo MM MMMM MMM', '2 2일 02 2월 2월'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14. 14'], - ['d do dddd ddd dd', '0 0. nedjelja ned. ne'], - ['DDD DDDo DDDD', '45 45. 045'], - ['w wo ww', '7 7. 07'], + ['D Do DD', '14 14일 14'], + ['d do dddd ddd dd', '0 0일 일요일 일 일'], + ['DDD DDDo DDDD', '45 45일 045'], + ['w wo ww', '8 8일 08'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], - ['a A', 'pm PM'], - ['[the] DDDo [day of the year]', 'the 45. day of the year'], - ['LTS', '15:25:50'], - ['L', '14. 02. 2010'], - ['LL', '14. februar 2010'], - ['LLL', '14. februar 2010 15:25'], - ['LLLL', 'nedjelja, 14. februar 2010 15:25'], - ['l', '14. 2. 2010'], - ['ll', '14. feb. 2010'], - ['lll', '14. feb. 2010 15:25'], - ['llll', 'ned., 14. feb. 2010 15:25'] + ['a A', '오후 오후'], + ['일년 중 DDDo째 되는 날', '일년 중 45일째 되는 날'], + ['LTS', '오후 3시 25분 50초'], + ['L', '2010.02.14'], + ['LL', '2010년 2월 14일'], + ['LLL', '2010년 2월 14일 오후 3시 25분'], + ['LLLL', '2010년 2월 14일 일요일 오후 3시 25분'], + ['l', '2010.2.14'], + ['ll', '2010년 2월 14일'], + ['lll', '2010년 2월 14일 오후 3시 25분'], + ['llll', '2010년 2월 14일 일 오후 3시 25분'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -18551,53 +19355,51 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1일', '1일'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2일', '2일'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3일', '3일'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4일', '4일'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5일', '5일'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6일', '6일'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7일', '7일'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8일', '8일'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9일', '9일'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10일', '10일'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11일', '11일'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12일', '12일'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13일', '13일'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14일', '14일'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15일', '15일'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16일', '16일'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17일', '17일'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18일', '18일'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19일', '19일'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20일', '20일'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21일', '21일'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22일', '22일'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23일', '23일'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24일', '24일'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25일', '25일'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26일', '26일'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27일', '27일'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28일', '28일'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29일', '29일'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30일', '30일'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31일', '31일'); }); test('format month', function (assert) { - var expected = 'januar jan._februar feb._mart mar._april apr._maj maj_jun jun_jul jul_avgust avg._septembar sep._oktobar okt._novembar nov._decembar dec.'.split('_'), - i; + var expected = '1월 1월_2월 2월_3월 3월_4월 4월_5월 5월_6월 6월_7월 7월_8월 8월_9월 9월_10월 10월_11월 11월_12월 12월'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'nedjelja ned. ne_ponedjeljak pon. po_utorak uto. ut_srijeda sri. sr_četvrtak čet. če_petak pet. pe_subota sub. su'.split('_'), - i; + var expected = '일요일 일 일_월요일 월 월_화요일 화 화_수요일 수 수_목요일 목 목_금요일 금 금_토요일 토 토'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -18605,114 +19407,82 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'nekoliko sekundi', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'jedan minut', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'jedan minut', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minuta', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minuta', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'jedan sat', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'jedan sat', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 sata', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 sati', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 sati', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'dan', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'dan', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dana', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'dan', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dana', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dana', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'mjesec', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'mjesec', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'mjesec', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 mjeseca', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 mjeseca', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 mjeseca', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'mjesec', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 mjeseci', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'godinu', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 godine', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'godinu', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 godina', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), '몇초', '44초 = 몇초'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), '일분', '45초 = 일분'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), '일분', '89초 = 일분'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2분', '90초 = 2분'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44분', '44분 = 44분'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), '한시간', '45분 = 한시간'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), '한시간', '89분 = 한시간'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2시간', '90분 = 2시간'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5시간', '5시간 = 5시간'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21시간', '21시간 = 21시간'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), '하루', '22시간 = 하루'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), '하루', '35시간 = 하루'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2일', '36시간 = 2일'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), '하루', '하루 = 하루'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5일', '5일 = 5일'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25일', '25일 = 25일'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), '한달', '26일 = 한달'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), '한달', '30일 = 한달'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), '한달', '45일 = 한달'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2달', '46일 = 2달'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2달', '75일 = 2달'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3달', '76일 = 3달'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), '한달', '1달 = 한달'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5달', '5달 = 5달'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), '일년', '345일 = 일년'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2년', '548일 = 2년'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), '일년', '일년 = 일년'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5년', '5년 = 5년'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'za nekoliko sekundi', 'prefix'); - assert.equal(moment(0).from(30000), 'prije nekoliko sekundi', 'prefix'); + assert.equal(moment(30000).from(0), '몇초 후', 'prefix'); + assert.equal(moment(0).from(30000), '몇초 전', 'suffix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'prije nekoliko sekundi', 'now from now should display as in the past'); + assert.equal(moment().fromNow(), '몇초 전', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'za nekoliko sekundi', 'in a few seconds'); - assert.equal(moment().add({d: 5}).fromNow(), 'za 5 dana', 'in 5 days'); + assert.equal(moment().add({s: 30}).fromNow(), '몇초 후', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), '5일 후', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'danas u 2:00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'danas u 2:25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'danas u 3:00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'sjutra u 2:00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'danas u 1:00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'juče u 2:00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), '오늘 오전 2시 0분', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), '오늘 오전 2시 25분', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), '오늘 오전 3시 0분', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), '내일 오전 2시 0분', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), '오늘 오전 1시 0분', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), '어제 오전 2시 0분', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; - - function makeFormat(d) { - switch (d.day()) { - case 0: - return '[u] [nedjelju] [u] LT'; - case 3: - return '[u] [srijedu] [u] LT'; - case 6: - return '[u] [subotu] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[u] dddd [u] LT'; - } - } - for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd LT'), 'Today + ' + i + ' days end of day'); } }); test('calendar last week', function (assert) { var i, m; - - function makeFormat(d) { - var lastWeekDay = [ - '[prošle] [nedjelje] [u] LT', - '[prošlog] [ponedjeljka] [u] LT', - '[prošlog] [utorka] [u] LT', - '[prošle] [srijede] [u] LT', - '[prošlog] [četvrtka] [u] LT', - '[prošlog] [petka] [u] LT', - '[prošle] [subote] [u] LT' - ]; - - return lastWeekDay[d.day()]; - } - for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('지난주 dddd LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('지난주 dddd LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('지난주 dddd LT'), 'Today - ' + i + ' days end of day'); } }); @@ -18730,76 +19500,73 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - // Monday is the first day of the week. - // The week that contains Jan 1st is the first week of the year. - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); }); test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); + assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); + assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); }); test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); + assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); + assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); + assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); + assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); }); test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); + assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); + assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); + assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); + assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); }); test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); + assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); + assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); + assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); + assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); + assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); + assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); + assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); + assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); + assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); + assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); + assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); }); - test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1.', 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2.', 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2.', 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3'); + test('weeks year starting sunday format', function (assert) { + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1일', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1일', 'Jan 7 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2일', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2일', 'Jan 14 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3일', 'Jan 15 2012 should be week 3'); }); test('lenient ordinal parsing', function (assert) { @@ -18840,8 +19607,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -18850,12 +19618,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -18873,8 +19643,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -18889,13 +19659,15 @@ }); } - localeModule('mk'); + localeModule('lb'); test('parse', function (assert) { - var tests = 'јануари јан_февруари фев_март мар_април апр_мај мај_јуни јун_јули јул_август авг_септември сеп_октомври окт_ноември ное_декември дек'.split('_'), i; + var tests = 'Januar Jan._Februar Febr._Mäerz Mrz._Abrëll Abr._Mee Mee_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split('_'), i; + function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } + for (i = 0; i < 12; i++) { tests[i] = tests[i].split(' '); equalTest(tests[i][0], 'MMM', i); @@ -18911,29 +19683,29 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, H:mm:ss', 'недела, февруари 14-ти 2010, 15:25:50'], - ['ddd, hA', 'нед, 3PM'], - ['M Mo MM MMMM MMM', '2 2-ри 02 февруари фев'], - ['YYYY YY', '2010 10'], - ['D Do DD', '14 14-ти 14'], - ['d do dddd ddd dd', '0 0-ев недела нед нe'], - ['DDD DDDo DDDD', '45 45-ти 045'], - ['w wo ww', '7 7-ми 07'], - ['h hh', '3 03'], - ['H HH', '15 15'], - ['m mm', '25 25'], - ['s ss', '50 50'], - ['a A', 'pm PM'], - ['[the] DDDo [day of the year]', 'the 45-ти day of the year'], - ['LTS', '15:25:50'], - ['L', '14.02.2010'], - ['LL', '14 февруари 2010'], - ['LLL', '14 февруари 2010 15:25'], - ['LLLL', 'недела, 14 февруари 2010 15:25'], - ['l', '14.2.2010'], - ['ll', '14 фев 2010'], - ['lll', '14 фев 2010 15:25'], - ['llll', 'нед, 14 фев 2010 15:25'] + ['dddd, Do MMMM YYYY, HH:mm:ss', 'Sonndeg, 14. Februar 2010, 15:25:50'], + ['ddd, HH:mm', 'So., 15:25'], + ['M Mo MM MMMM MMM', '2 2. 02 Februar Febr.'], + ['YYYY YY', '2010 10'], + ['D Do DD', '14 14. 14'], + ['d do dddd ddd dd', '0 0. Sonndeg So. So'], + ['DDD DDDo DDDD', '45 45. 045'], + ['w wo ww', '6 6. 06'], + ['h hh', '3 03'], + ['H HH', '15 15'], + ['m mm', '25 25'], + ['s ss', '50 50'], + ['a A', 'pm PM'], + ['[the] DDDo [day of the year]', 'the 45. day of the year'], + ['LTS', '15:25:50 Auer'], + ['L', '14.02.2010'], + ['LL', '14. Februar 2010'], + ['LLL', '14. Februar 2010 15:25 Auer'], + ['LLLL', 'Sonndeg, 14. Februar 2010 15:25 Auer'], + ['l', '14.2.2010'], + ['ll', '14. Febr. 2010'], + ['lll', '14. Febr. 2010 15:25 Auer'], + ['llll', 'So., 14. Febr. 2010 15:25 Auer'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -18942,52 +19714,15 @@ } }); - test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-ви', '1-ви'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-ри', '2-ри'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-ти', '3-ти'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4-ти', '4-ти'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5-ти', '5-ти'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6-ти', '6-ти'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7-ми', '7-ми'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8-ми', '8-ми'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9-ти', '9-ти'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10-ти', '10-ти'); - - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11-ти', '11-ти'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12-ти', '12-ти'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13-ти', '13-ти'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14-ти', '14-ти'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15-ти', '15-ти'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16-ти', '16-ти'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17-ти', '17-ти'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18-ти', '18-ти'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19-ти', '19-ти'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20-ти', '20-ти'); - - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21-ви', '21-ви'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22-ри', '22-ри'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23-ти', '23-ти'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24-ти', '24-ти'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25-ти', '25-ти'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26-ти', '26-ти'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27-ми', '27-ми'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28-ми', '28-ми'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29-ти', '29-ти'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30-ти', '30-ти'); - - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-ви', '31-ви'); - }); - test('format month', function (assert) { - var expected = 'јануари јан_февруари фев_март мар_април апр_мај мај_јуни јун_јули јул_август авг_септември сеп_октомври окт_ноември ное_декември дек'.split('_'), i; + var expected = 'Januar Jan._Februar Febr._Mäerz Mrz._Abrëll Abr._Mee Mee_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'недела нед нe_понеделник пон пo_вторник вто вт_среда сре ср_четврток чет че_петок пет пе_сабота саб сa'.split('_'), i; + var expected = 'Sonndeg So. So_Méindeg Mé. Mé_Dënschdeg Dë. Dë_Mëttwoch Më. Më_Donneschdeg Do. Do_Freideg Fr. Fr_Samschdeg Sa. Sa'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -18995,183 +19730,74 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'неколку секунди', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'минута', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'минута', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 минути', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 минути', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'час', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'час', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 часа', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 часа', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 часа', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'ден', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'ден', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 дена', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'ден', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 дена', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 дена', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'месец', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'месец', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'месец', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 месеци', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 месеци', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 месеци', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'месец', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 месеци', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'година', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 години', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'година', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 години', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'e puer Sekonnen', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'eng Minutt', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'eng Minutt', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 Minutten', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 Minutten', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'eng Stonn', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'eng Stonn', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 Stonnen', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 Stonnen', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 Stonnen', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'een Dag', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'een Dag', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 Deeg', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'een Dag', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 Deeg', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 Deeg', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'ee Mount', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'ee Mount', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'ee Mount', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 Méint', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 Méint', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 Méint', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'ee Mount', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 Méint', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ee Joer', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 Joer', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'ee Joer', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 Joer', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'после неколку секунди', 'prefix'); - assert.equal(moment(0).from(30000), 'пред неколку секунди', 'suffix'); - }); - - test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'пред неколку секунди', 'now from now should display as in the past'); + assert.equal(moment(30000).from(0), 'an e puer Sekonnen', 'prefix'); + assert.equal(moment(0).from(30000), 'virun e puer Sekonnen', 'suffix'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'после неколку секунди', 'in a few seconds'); - assert.equal(moment().add({d: 5}).fromNow(), 'после 5 дена', 'in 5 days'); - }); - - test('calendar day', function (assert) { - var a = moment().hours(2).minutes(0).seconds(0); - - assert.equal(moment(a).calendar(), 'Денес во 2:00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'Денес во 2:25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'Денес во 3:00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'Утре во 2:00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'Денес во 1:00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'Вчера во 2:00', 'yesterday at the same time'); - }); - - test('calendar next week', function (assert) { - var i, m; - for (i = 2; i < 7; i++) { - m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd [во] LT'), 'Today + ' + i + ' days current time'); - m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [во] LT'), 'Today + ' + i + ' days beginning of day'); - m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [во] LT'), 'Today + ' + i + ' days end of day'); - } + assert.equal(moment().add({s: 30}).fromNow(), 'an e puer Sekonnen', 'in a few seconds'); + assert.equal(moment().add({d: 1}).fromNow(), 'an engem Dag', 'in one day'); + assert.equal(moment().add({d: 2}).fromNow(), 'an 2 Deeg', 'in 2 days'); + assert.equal(moment().add({d: 3}).fromNow(), 'an 3 Deeg', 'in 3 days'); + assert.equal(moment().add({d: 4}).fromNow(), 'a 4 Deeg', 'in 4 days'); + assert.equal(moment().add({d: 5}).fromNow(), 'a 5 Deeg', 'in 5 days'); + assert.equal(moment().add({d: 6}).fromNow(), 'a 6 Deeg', 'in 6 days'); + assert.equal(moment().add({d: 7}).fromNow(), 'a 7 Deeg', 'in 7 days'); + assert.equal(moment().add({d: 8}).fromNow(), 'an 8 Deeg', 'in 8 days'); + assert.equal(moment().add({d: 9}).fromNow(), 'an 9 Deeg', 'in 9 days'); + assert.equal(moment().add({d: 10}).fromNow(), 'an 10 Deeg', 'in 10 days'); + assert.equal(moment().add({y: 100}).fromNow(), 'an 100 Joer', 'in 100 years'); + assert.equal(moment().add({y: 400}).fromNow(), 'a 400 Joer', 'in 400 years'); }); test('calendar last week', function (assert) { - var i, m; - - function makeFormat(d) { - switch (d.day()) { - case 0: - case 3: - case 6: - return '[Во изминатата] dddd [во] LT'; - case 1: - case 2: - case 4: - case 5: - return '[Во изминатиот] dddd [во] LT'; - } - } - + var i, m, weekday, datestring; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days current time'); + + // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) + weekday = parseInt(m.format('d'), 10); + datestring = (weekday === 2 || weekday === 4 ? '[Leschten] dddd [um] LT' : '[Leschte] dddd [um] LT'); + + assert.equal(m.calendar(), m.format(datestring), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format(datestring), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format(datestring), 'Today + ' + i + ' days end of day'); } }); - test('calendar all else', function (assert) { - var weeksAgo = moment().subtract({w: 1}), - weeksFromNow = moment().add({w: 1}); - - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); - - weeksAgo = moment().subtract({w: 2}); - weeksFromNow = moment().add({w: 2}); - - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); - }); - - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - - test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-ви', 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-ви', 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2-ри', 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2-ри', 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-ти', 'Jan 9 2012 should be week 3'); - }); - test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { @@ -19210,8 +19836,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -19220,12 +19847,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -19243,8 +19872,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -19259,10 +19888,10 @@ }); } - localeModule('ml'); + localeModule('lo'); test('parse', function (assert) { - var tests = 'ജനുവരി ജനു._ഫെബ്രുവരി ഫെബ്രു._മാർച്ച് മാർ._ഏപ്രിൽ ഏപ്രി._മേയ് മേയ്_ജൂൺ ജൂൺ_ജൂലൈ ജൂലൈ._ഓഗസ്റ്റ് ഓഗ._സെപ്റ്റംബർ സെപ്റ്റ._ഒക്ടോബർ ഒക്ടോ._നവംബർ നവം._ഡിസംബർ ഡിസം.'.split('_'), i; + var tests = 'ມັງກອນ ມັງກອນ_ກຸມພາ ກຸມພາ_ມີນາ ມີນາ_ເມສາ ເມສາ_ພຶດສະພາ ພຶດສະພາ_ມິຖຸນາ ມິຖຸນາ_ກໍລະກົດ ກໍລະກົດ_ສິງຫາ ສິງຫາ_ກັນຍາ ກັນຍາ_ຕຸລາ ຕຸລາ_ພະຈິກ ພະຈິກ_ທັນວາ ທັນວາ'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -19281,28 +19910,29 @@ test('format', function (assert) { var a = [ - ['dddd, Do MMMM YYYY, a h:mm:ss -നു', 'ഞായറാഴ്ച, 14 ഫെബ്രുവരി 2010, ഉച്ച കഴിഞ്ഞ് 3:25:50 -നു'], - ['ddd, a h -നു', 'ഞായർ, ഉച്ച കഴിഞ്ഞ് 3 -നു'], - ['M Mo MM MMMM MMM', '2 2 02 ഫെബ്രുവരി ഫെബ്രു.'], + ['dddd, MMMM Do YYYY, h:mm:ss a', 'ອາທິດ, ກຸມພາ ທີ່14 2010, 3:25:50 ຕອນແລງ'], + ['ddd, hA', 'ທິດ, 3ຕອນແລງ'], + ['M Mo MM MMMM MMM', '2 ທີ່2 02 ກຸມພາ ກຸມພາ'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14 14'], - ['d do dddd ddd dd', '0 0 ഞായറാഴ്ച ഞായർ ഞാ'], - ['DDD DDDo DDDD', '45 45 045'], - ['w wo ww', '8 8 08'], + ['D Do DD', '14 ທີ່14 14'], + ['d do dddd ddd dd', '0 ທີ່0 ອາທິດ ທິດ ທ'], + ['DDD DDDo DDDD', '45 ທີ່45 045'], + ['w wo ww', '8 ທີ່8 08'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], - ['a A', 'ഉച്ച കഴിഞ്ഞ് ഉച്ച കഴിഞ്ഞ്'], - ['LTS', 'ഉച്ച കഴിഞ്ഞ് 3:25:50 -നു'], + ['a A', 'ຕອນແລງ ຕອນແລງ'], + ['[ວັນ]DDDo [ຂອງປີ]', 'ວັນທີ່45 ຂອງປີ'], + ['LTS', '15:25:50'], ['L', '14/02/2010'], - ['LL', '14 ഫെബ്രുവരി 2010'], - ['LLL', '14 ഫെബ്രുവരി 2010, ഉച്ച കഴിഞ്ഞ് 3:25 -നു'], - ['LLLL', 'ഞായറാഴ്ച, 14 ഫെബ്രുവരി 2010, ഉച്ച കഴിഞ്ഞ് 3:25 -നു'], + ['LL', '14 ກຸມພາ 2010'], + ['LLL', '14 ກຸມພາ 2010 15:25'], + ['LLLL', 'ວັນອາທິດ 14 ກຸມພາ 2010 15:25'], ['l', '14/2/2010'], - ['ll', '14 ഫെബ്രു. 2010'], - ['lll', '14 ഫെബ്രു. 2010, ഉച്ച കഴിഞ്ഞ് 3:25 -നു'], - ['llll', 'ഞായർ, 14 ഫെബ്രു. 2010, ഉച്ച കഴിഞ്ഞ് 3:25 -നു'] + ['ll', '14 ກຸມພາ 2010'], + ['lll', '14 ກຸມພາ 2010 15:25'], + ['llll', 'ວັນທິດ 14 ກຸມພາ 2010 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -19312,51 +19942,51 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10'); - - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20'); - - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30'); - - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), 'ທີ່1', 'ທີ່1'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), 'ທີ່2', 'ທີ່2'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), 'ທີ່3', 'ທີ່3'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), 'ທີ່4', 'ທີ່4'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), 'ທີ່5', 'ທີ່5'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), 'ທີ່6', 'ທີ່6'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), 'ທີ່7', 'ທີ່7'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), 'ທີ່8', 'ທີ່8'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), 'ທີ່9', 'ທີ່9'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), 'ທີ່10', 'ທີ່10'); + + assert.equal(moment([2011, 0, 11]).format('DDDo'), 'ທີ່11', 'ທີ່11'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), 'ທີ່12', 'ທີ່12'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), 'ທີ່13', 'ທີ່13'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), 'ທີ່14', 'ທີ່14'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), 'ທີ່15', 'ທີ່15'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), 'ທີ່16', 'ທີ່16'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), 'ທີ່17', 'ທີ່17'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), 'ທີ່18', 'ທີ່18'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), 'ທີ່19', 'ທີ່19'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), 'ທີ່20', 'ທີ່20'); + + assert.equal(moment([2011, 0, 21]).format('DDDo'), 'ທີ່21', 'ທີ່21'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), 'ທີ່22', 'ທີ່22'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), 'ທີ່23', 'ທີ່23'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), 'ທີ່24', 'ທີ່24'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), 'ທີ່25', 'ທີ່25'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), 'ທີ່26', 'ທີ່26'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), 'ທີ່27', 'ທີ່27'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), 'ທີ່28', 'ທີ່28'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), 'ທີ່29', 'ທີ່29'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), 'ທີ່30', 'ທີ່30'); + + assert.equal(moment([2011, 0, 31]).format('DDDo'), 'ທີ່31', 'ທີ່31'); }); test('format month', function (assert) { - var expected = 'ജനുവരി ജനു._ഫെബ്രുവരി ഫെബ്രു._മാർച്ച് മാർ._ഏപ്രിൽ ഏപ്രി._മേയ് മേയ്_ജൂൺ ജൂൺ_ജൂലൈ ജൂലൈ._ഓഗസ്റ്റ് ഓഗ._സെപ്റ്റംബർ സെപ്റ്റ._ഒക്ടോബർ ഒക്ടോ._നവംബർ നവം._ഡിസംബർ ഡിസം.'.split('_'), i; + var expected = 'ມັງກອນ ມັງກອນ_ກຸມພາ ກຸມພາ_ມີນາ ມີນາ_ເມສາ ເມສາ_ພຶດສະພາ ພຶດສະພາ_ມິຖຸນາ ມິຖຸນາ_ກໍລະກົດ ກໍລະກົດ_ສິງຫາ ສິງຫາ_ກັນຍາ ກັນຍາ_ຕຸລາ ຕຸລາ_ພະຈິກ ພະຈິກ_ທັນວາ ທັນວາ'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'ഞായറാഴ്ച ഞായർ ഞാ_തിങ്കളാഴ്ച തിങ്കൾ തി_ചൊവ്വാഴ്ച ചൊവ്വ ചൊ_ബുധനാഴ്ച ബുധൻ ബു_വ്യാഴാഴ്ച വ്യാഴം വ്യാ_വെള്ളിയാഴ്ച വെള്ളി വെ_ശനിയാഴ്ച ശനി ശ'.split('_'), i; + var expected = 'ອາທິດ ທິດ ທ_ຈັນ ຈັນ ຈ_ອັງຄານ ອັງຄານ ອຄ_ພຸດ ພຸດ ພ_ພະຫັດ ພະຫັດ ພຫ_ສຸກ ສຸກ ສກ_ເສົາ ເສົາ ສ'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -19364,70 +19994,70 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'അൽപ നിമിഷങ്ങൾ', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'ഒരു മിനിറ്റ്', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'ഒരു മിനിറ്റ്', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 മിനിറ്റ്', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 മിനിറ്റ്', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'ഒരു മണിക്കൂർ', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'ഒരു മണിക്കൂർ', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 മണിക്കൂർ', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 മണിക്കൂർ', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 മണിക്കൂർ', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'ഒരു ദിവസം', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'ഒരു ദിവസം', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 ദിവസം', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'ഒരു ദിവസം', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 ദിവസം', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 ദിവസം', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'ഒരു മാസം', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'ഒരു മാസം', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'ഒരു മാസം', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 മാസം', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 മാസം', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 മാസം', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'ഒരു മാസം', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 മാസം', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ഒരു വർഷം', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 വർഷം', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'ഒരു വർഷം', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 വർഷം', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'ບໍ່ເທົ່າໃດວິນາທີ', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), '1 ນາທີ', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), '1 ນາທີ', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 ນາທີ', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 ນາທີ', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), '1 ຊົ່ວໂມງ', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), '1 ຊົ່ວໂມງ', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 ຊົ່ວໂມງ', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 ຊົ່ວໂມງ', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 ຊົ່ວໂມງ', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), '1 ມື້', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), '1 ມື້', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 ມື້', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), '1 ມື້', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 ມື້', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 ມື້', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), '1 ເດືອນ', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), '1 ເດືອນ', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), '1 ເດືອນ', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 ເດືອນ', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 ເດືອນ', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 ເດືອນ', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), '1 ເດືອນ', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 ເດືອນ', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), '1 ປີ', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 ປີ', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), '1 ປີ', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 ປີ', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'അൽപ നിമിഷങ്ങൾ കഴിഞ്ഞ്', 'prefix'); - assert.equal(moment(0).from(30000), 'അൽപ നിമിഷങ്ങൾ മുൻപ്', 'suffix'); + assert.equal(moment(30000).from(0), 'ອີກ ບໍ່ເທົ່າໃດວິນາທີ', 'prefix'); + assert.equal(moment(0).from(30000), 'ບໍ່ເທົ່າໃດວິນາທີຜ່ານມາ', 'suffix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'അൽപ നിമിഷങ്ങൾ മുൻപ്', 'now from now should display as in the past'); + assert.equal(moment().fromNow(), 'ບໍ່ເທົ່າໃດວິນາທີຜ່ານມາ', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'അൽപ നിമിഷങ്ങൾ കഴിഞ്ഞ്', 'അൽപ നിമിഷങ്ങൾ കഴിഞ്ഞ്'); - assert.equal(moment().add({d: 5}).fromNow(), '5 ദിവസം കഴിഞ്ഞ്', '5 ദിവസം കഴിഞ്ഞ്'); + assert.equal(moment().add({s: 30}).fromNow(), 'ອີກ ບໍ່ເທົ່າໃດວິນາທີ', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'ອີກ 5 ມື້', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'ഇന്ന് രാത്രി 2:00 -നു', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'ഇന്ന് രാത്രി 2:25 -നു', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 3}).calendar(), 'ഇന്ന് രാവിലെ 5:00 -നു', 'Now plus 3 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'നാളെ രാത്രി 2:00 -നു', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'ഇന്ന് രാത്രി 1:00 -നു', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'ഇന്നലെ രാത്രി 2:00 -നു', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'ມື້ນີ້ເວລາ 02:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'ມື້ນີ້ເວລາ 02:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'ມື້ນີ້ເວລາ 03:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'ມື້ອື່ນເວລາ 02:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'ມື້ນີ້ເວລາ 01:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'ມື້ວານນີ້ເວລາ 02:00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd[,] LT'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('[ວັນ]dddd[ໜ້າເວລາ] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd[,] LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[ວັນ]dddd[ໜ້າເວລາ] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd[,] LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[ວັນ]dddd[ໜ້າເວລາ] LT'), 'Today + ' + i + ' days end of day'); } }); @@ -19436,11 +20066,11 @@ for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('[കഴിഞ്ഞ] dddd[,] LT'), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[കഴിഞ്ഞ] dddd[,] LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[കഴിഞ്ഞ] dddd[,] LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT'), 'Today - ' + i + ' days end of day'); } }); @@ -19458,22 +20088,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('meridiem', function (assert) { - assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), 'രാത്രി', 'before dawn'); - assert.equal(moment([2011, 2, 23, 9, 30]).format('a'), 'രാവിലെ', 'morning'); - assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'ഉച്ച കഴിഞ്ഞ്', 'during day'); - assert.equal(moment([2011, 2, 23, 17, 30]).format('a'), 'വൈകുന്നേരം', 'evening'); - assert.equal(moment([2011, 2, 23, 19, 30]).format('a'), 'വൈകുന്നേരം', 'late evening'); - assert.equal(moment([2011, 2, 23, 21, 20]).format('a'), 'രാത്രി', 'night'); - - assert.equal(moment([2011, 2, 23, 2, 30]).format('A'), 'രാത്രി', 'before dawn'); - assert.equal(moment([2011, 2, 23, 9, 30]).format('A'), 'രാവിലെ', 'morning'); - assert.equal(moment([2011, 2, 23, 14, 30]).format('A'), 'ഉച്ച കഴിഞ്ഞ്', ' during day'); - assert.equal(moment([2011, 2, 23, 17, 30]).format('A'), 'വൈകുന്നേരം', 'evening'); - assert.equal(moment([2011, 2, 23, 19, 30]).format('A'), 'വൈകുന്നേരം', 'late evening'); - assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'രാത്രി', 'night'); - }); - test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); @@ -19535,12 +20149,12 @@ assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); }); - test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1', 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2', 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3'); + test('weeks year starting sunday format', function (assert) { + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 ທີ່1', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 ທີ່1', 'Jan 7 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 ທີ່2', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 ທີ່2', 'Jan 14 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 ທີ່3', 'Jan 15 2012 should be week 3'); }); test('lenient ordinal parsing', function (assert) { @@ -19581,8 +20195,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -19591,12 +20206,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -19614,8 +20231,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -19630,10 +20247,10 @@ }); } - localeModule('mr'); + localeModule('lt'); test('parse', function (assert) { - var tests = 'जानेवारी जाने._फेब्रुवारी फेब्रु._मार्च मार्च._एप्रिल एप्रि._मे मे._जून जून._जुलै जुलै._ऑगस्ट ऑग._सप्टेंबर सप्टें._ऑक्टोबर ऑक्टो._नोव्हेंबर नोव्हें._डिसेंबर डिसें.'.split('_'), i; + var tests = 'sausis sau_vasaris vas_kovas kov_balandis bal_gegužė geg_birželis bir_liepa lie_rugpjūtis rgp_rugsėjis rgs_spalis spa_lapkritis lap_gruodis grd'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -19652,28 +20269,29 @@ test('format', function (assert) { var a = [ - ['dddd, Do MMMM YYYY, a h:mm:ss वाजता', 'रविवार, १४ फेब्रुवारी २०१०, दुपारी ३:२५:५० वाजता'], - ['ddd, a h वाजता', 'रवि, दुपारी ३ वाजता'], - ['M Mo MM MMMM MMM', '२ २ ०२ फेब्रुवारी फेब्रु.'], - ['YYYY YY', '२०१० १०'], - ['D Do DD', '१४ १४ १४'], - ['d do dddd ddd dd', '० ० रविवार रवि र'], - ['DDD DDDo DDDD', '४५ ४५ ०४५'], - ['w wo ww', '८ ८ ०८'], - ['h hh', '३ ०३'], - ['H HH', '१५ १५'], - ['m mm', '२५ २५'], - ['s ss', '५० ५०'], - ['a A', 'दुपारी दुपारी'], - ['LTS', 'दुपारी ३:२५:५० वाजता'], - ['L', '१४/०२/२०१०'], - ['LL', '१४ फेब्रुवारी २०१०'], - ['LLL', '१४ फेब्रुवारी २०१०, दुपारी ३:२५ वाजता'], - ['LLLL', 'रविवार, १४ फेब्रुवारी २०१०, दुपारी ३:२५ वाजता'], - ['l', '१४/२/२०१०'], - ['ll', '१४ फेब्रु. २०१०'], - ['lll', '१४ फेब्रु. २०१०, दुपारी ३:२५ वाजता'], - ['llll', 'रवि, १४ फेब्रु. २०१०, दुपारी ३:२५ वाजता'] + ['dddd, Do MMMM YYYY, h:mm:ss a', 'sekmadienis, 14-oji vasario 2010, 3:25:50 pm'], + ['ddd, hA', 'Sek, 3PM'], + ['M Mo MM MMMM MMM', '2 2-oji 02 vasaris vas'], + ['YYYY YY', '2010 10'], + ['D Do DD', '14 14-oji 14'], + ['d do dddd ddd dd', '0 0-oji sekmadienis Sek S'], + ['DDD DDDo DDDD', '45 45-oji 045'], + ['w wo ww', '6 6-oji 06'], + ['h hh', '3 03'], + ['H HH', '15 15'], + ['m mm', '25 25'], + ['s ss', '50 50'], + ['a A', 'pm PM'], + ['DDDo [metų diena]', '45-oji metų diena'], + ['LTS', '15:25:50'], + ['L', '2010-02-14'], + ['LL', '2010 m. vasaris 14 d.'], + ['LLL', '2010 m. vasaris 14 d., 15:25 val.'], + ['LLLL', '2010 m. vasaris 14 d., sekmadienis, 15:25 val.'], + ['l', '2010-02-14'], + ['ll', '2010 m. vasaris 14 d.'], + ['lll', '2010 m. vasaris 14 d., 15:25 val.'], + ['llll', '2010 m. vasaris 14 d., Sek, 15:25 val.'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -19683,135 +20301,151 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '१', '१'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '२', '२'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '३', '३'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '४', '४'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '५', '५'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '६', '६'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '७', '७'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '८', '८'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '९', '९'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '१०', '१०'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-oji', '1-oji'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-oji', '2-oji'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-oji', '3-oji'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4-oji', '4-oji'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5-oji', '5-oji'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6-oji', '6-oji'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7-oji', '7-oji'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8-oji', '8-oji'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9-oji', '9-oji'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10-oji', '10-oji'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '११', '११'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '१२', '१२'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '१३', '१३'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '१४', '१४'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '१५', '१५'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '१६', '१६'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '१७', '१७'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '१८', '१८'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '१९', '१९'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '२०', '२०'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11-oji', '11-oji'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12-oji', '12-oji'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13-oji', '13-oji'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14-oji', '14-oji'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15-oji', '15-oji'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16-oji', '16-oji'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17-oji', '17-oji'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18-oji', '18-oji'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19-oji', '19-oji'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20-oji', '20-oji'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '२१', '२१'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '२२', '२२'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '२३', '२३'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '२४', '२४'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '२५', '२५'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '२६', '२६'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '२७', '२७'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '२८', '२८'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '२९', '२९'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '३०', '३०'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21-oji', '21-oji'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22-oji', '22-oji'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23-oji', '23-oji'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24-oji', '24-oji'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25-oji', '25-oji'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26-oji', '26-oji'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27-oji', '27-oji'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28-oji', '28-oji'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29-oji', '29-oji'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30-oji', '30-oji'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '३१', '३१'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-oji', '31-oji'); }); test('format month', function (assert) { - var expected = 'जानेवारी जाने._फेब्रुवारी फेब्रु._मार्च मार्च._एप्रिल एप्रि._मे मे._जून जून._जुलै जुलै._ऑगस्ट ऑग._सप्टेंबर सप्टें._ऑक्टोबर ऑक्टो._नोव्हेंबर नोव्हें._डिसेंबर डिसें.'.split('_'), i; + var expected = 'sausis sau_vasaris vas_kovas kov_balandis bal_gegužė geg_birželis bir_liepa lie_rugpjūtis rgp_rugsėjis rgs_spalis spa_lapkritis lap_gruodis grd'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'रविवार रवि र_सोमवार सोम सो_मंगळवार मंगळ मं_बुधवार बुध बु_गुरूवार गुरू गु_शुक्रवार शुक्र शु_शनिवार शनि श'.split('_'), i; + var expected = 'sekmadienis Sek S_pirmadienis Pir P_antradienis Ant A_trečiadienis Tre T_ketvirtadienis Ket K_penktadienis Pen Pn_šeštadienis Šeš Š'.split('_'), i; + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); + } + }); + + test('format week on US calendar', function (assert) { + // Tests, whether the weekday names are correct, even if the week does not start on Monday + moment.locale('lt', {week: {dow: 0, doy: 6}}); + var expected = 'sekmadienis Sek S_pirmadienis Pir P_antradienis Ant A_trečiadienis Tre T_ketvirtadienis Ket K_penktadienis Pen Pn_šeštadienis Šeš Š'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } + moment.locale('lt', {week: {dow: 1, doy: 4}}); }); test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'सेकंद', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'एक मिनिट', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'एक मिनिट', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '२ मिनिटे', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '४४ मिनिटे', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'एक तास', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'एक तास', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '२ तास', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '५ तास', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '२१ तास', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'एक दिवस', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'एक दिवस', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '२ दिवस', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'एक दिवस', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '५ दिवस', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '२५ दिवस', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'एक महिना', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'एक महिना', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'एक महिना', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '२ महिने', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '२ महिने', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '३ महिने', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'एक महिना', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '५ महिने', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'एक वर्ष', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '२ वर्षे', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'एक वर्ष', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '५ वर्षे', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'kelios sekundės', '44 seconds = seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'minutė', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'minutė', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutės', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 10}), true), '10 minučių', '10 minutes = 10 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 11}), true), '11 minučių', '11 minutes = 11 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 19}), true), '19 minučių', '19 minutes = 19 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 20}), true), '20 minučių', '20 minutes = 20 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutės', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'valanda', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'valanda', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 valandos', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 valandos', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 10}), true), '10 valandų', '10 hours = 10 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 valandos', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'diena', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'diena', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dienos', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'diena', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dienos', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 10}), true), '10 dienų', '10 days = 10 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dienos', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'mėnuo', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'mėnuo', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'mėnuo', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 mėnesiai', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 mėnesiai', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 mėnesiai', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'mėnuo', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 mėnesiai', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 10}), true), '10 mėnesių', '10 months = 10 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'metai', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 metai', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'metai', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 metai', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'सेकंद नंतर', 'prefix'); - assert.equal(moment(0).from(30000), 'सेकंद पूर्वी', 'suffix'); + assert.equal(moment(30000).from(0), 'po kelių sekundžių', 'prefix'); + assert.equal(moment(0).from(30000), 'prieš kelias sekundes', 'suffix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'सेकंद पूर्वी', 'now from now should display as in the past'); + assert.equal(moment().fromNow(), 'prieš kelias sekundes', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'सेकंद नंतर', 'सेकंद नंतर'); - assert.equal(moment().add({d: 5}).fromNow(), '५ दिवस नंतर', '५ दिवस नंतर'); + assert.equal(moment().add({s: 30}).fromNow(), 'po kelių sekundžių', 'in seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'po 5 dienų', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'आज रात्री २:०० वाजता', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'आज रात्री २:२५ वाजता', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 3}).calendar(), 'आज सकाळी ५:०० वाजता', 'Now plus 3 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'उद्या रात्री २:०० वाजता', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'आज रात्री १:०० वाजता', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'काल रात्री २:०० वाजता', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'Šiandien 02:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'Šiandien 02:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'Šiandien 03:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'Rytoj 02:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'Šiandien 01:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'Vakar 02:00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd[,] LT'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd[,] LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd[,] LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd LT'), 'Today + ' + i + ' days end of day'); } }); test('calendar last week', function (assert) { var i, m; - for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('[मागील] dddd[,] LT'), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('[Praėjusį] dddd LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[मागील] dddd[,] LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[Praėjusį] dddd LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[मागील] dddd[,] LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[Praėjusį] dddd LT'), 'Today - ' + i + ' days end of day'); } }); @@ -19829,89 +20463,73 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('meridiem', function (assert) { - assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), 'रात्री', 'before dawn'); - assert.equal(moment([2011, 2, 23, 9, 30]).format('a'), 'सकाळी', 'morning'); - assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'दुपारी', 'during day'); - assert.equal(moment([2011, 2, 23, 17, 30]).format('a'), 'सायंकाळी', 'evening'); - assert.equal(moment([2011, 2, 23, 19, 30]).format('a'), 'सायंकाळी', 'late evening'); - assert.equal(moment([2011, 2, 23, 21, 20]).format('a'), 'रात्री', 'night'); - - assert.equal(moment([2011, 2, 23, 2, 30]).format('A'), 'रात्री', 'before dawn'); - assert.equal(moment([2011, 2, 23, 9, 30]).format('A'), 'सकाळी', 'morning'); - assert.equal(moment([2011, 2, 23, 14, 30]).format('A'), 'दुपारी', ' during day'); - assert.equal(moment([2011, 2, 23, 17, 30]).format('A'), 'सायंकाळी', 'evening'); - assert.equal(moment([2011, 2, 23, 19, 30]).format('A'), 'सायंकाळी', 'late evening'); - assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'रात्री', 'night'); - }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); + assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); + assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); + assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); + assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); + assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); + assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); + assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); + assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); + assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); + assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); + assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); + assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); + assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); + assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); + assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); + assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); + assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); + assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); + assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); + assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); + assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); + assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); + assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); + assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); + assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); + assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); + assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '१ ०१ १', 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).format('w ww wo'), '१ ०१ १', 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '२ ०२ २', 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).format('w ww wo'), '२ ०२ २', 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '३ ०३ ३', 'Jan 15 2012 should be week 3'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52-oji', 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1-oji', 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1-oji', 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2-oji', 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2-oji', 'Jan 15 2012 should be week 2'); }); test('lenient ordinal parsing', function (assert) { @@ -19941,18 +20559,6 @@ } }); - test('meridiem invariant', function (assert) { - var h, m, t1, t2; - for (h = 0; h < 24; ++h) { - for (m = 0; m < 60; m += 15) { - t1 = moment.utc([2000, 0, 1, h, m]); - t2 = moment(t1.format('A h:mm'), 'A h:mm'); - assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), - 'meridiem at ' + t1.format('HH:mm')); - } - } - }); - test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { @@ -19964,8 +20570,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -19974,12 +20581,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -19997,8 +20606,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -20013,16 +20622,13 @@ }); } - localeModule('ms-my'); + localeModule('lv'); test('parse', function (assert) { - var i, - tests = 'Januari Jan_Februari Feb_Mac Mac_April Apr_Mei Mei_Jun Jun_Julai Jul_Ogos Ogs_September Sep_Oktober Okt_November Nov_Disember Dis'.split('_'); - + var tests = 'janvāris jan_februāris feb_marts mar_aprīlis apr_maijs mai_jūnijs jūn_jūlijs jūl_augusts aug_septembris sep_oktobris okt_novembris nov_decembris dec'.split('_'), i; function equalTest(input, mmm, i) { - assert.equal(moment(input, mmm).month(), i, input + ' sepatutnya bulan ' + (i + 1)); + assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } - for (i = 0; i < 12; i++) { tests[i] = tests[i].split(' '); equalTest(tests[i][0], 'MMM', i); @@ -20038,160 +20644,175 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss a', 'Ahad, Februari 14 2010, 3:25:50 petang'], - ['ddd, hA', 'Ahd, 3petang'], - ['M Mo MM MMMM MMM', '2 2 02 Februari Feb'], + ['dddd, Do MMMM YYYY, h:mm:ss a', 'svētdiena, 14. februāris 2010, 3:25:50 pm'], + ['ddd, hA', 'Sv, 3PM'], + ['M Mo MM MMMM MMM', '2 2. 02 februāris feb'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14 14'], - ['d do dddd ddd dd', '0 0 Ahad Ahd Ah'], - ['DDD DDDo DDDD', '45 45 045'], - ['w wo ww', '7 7 07'], + ['D Do DD', '14 14. 14'], + ['d do dddd ddd dd', '0 0. svētdiena Sv Sv'], + ['DDD DDDo DDDD', '45 45. 045'], + ['w wo ww', '6 6. 06'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], - ['a A', 'petang petang'], - ['[hari] [ke] DDDo [tahun] ini', 'hari ke 45 tahun ini'], - ['LTS', '15.25.50'], - ['L', '14/02/2010'], - ['LL', '14 Februari 2010'], - ['LLL', '14 Februari 2010 pukul 15.25'], - ['LLLL', 'Ahad, 14 Februari 2010 pukul 15.25'], - ['l', '14/2/2010'], - ['ll', '14 Feb 2010'], - ['lll', '14 Feb 2010 pukul 15.25'], - ['llll', 'Ahd, 14 Feb 2010 pukul 15.25'] + ['a A', 'pm PM'], + ['[the] DDDo [day of the year]', 'the 45. day of the year'], + ['LTS', '15:25:50'], + ['L', '14.02.2010.'], + ['LL', '2010. gada 14. februāris'], + ['LLL', '2010. gada 14. februāris, 15:25'], + ['LLLL', '2010. gada 14. februāris, svētdiena, 15:25'], + ['l', '14.2.2010.'], + ['ll', '2010. gada 14. feb'], + ['lll', '2010. gada 14. feb, 15:25'], + ['llll', '2010. gada 14. feb, Sv, 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; - for (i = 0; i < a.length; i++) { assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); } }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); test('format month', function (assert) { - var i, - expected = 'Januari Jan_Februari Feb_Mac Mac_April Apr_Mei Mei_Jun Jun_Julai Jul_Ogos Ogs_September Sep_Oktober Okt_November Nov_Disember Dis'.split('_'); - + var expected = 'janvāris jan_februāris feb_marts mar_aprīlis apr_maijs mai_jūnijs jūn_jūlijs jūl_augusts aug_septembris sep_oktobris okt_novembris nov_decembris dec'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var i, - expected = 'Ahad Ahd Ah_Isnin Isn Is_Selasa Sel Sl_Rabu Rab Rb_Khamis Kha Km_Jumaat Jum Jm_Sabtu Sab Sb'.split('_'); - + var expected = 'svētdiena Sv Sv_pirmdiena P P_otrdiena O O_trešdiena T T_ceturtdiena C C_piektdiena Pk Pk_sestdiena S S'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); + // Includes testing the cases of withoutSuffix = true and false. test('from', function (assert) { var start = moment([2007, 1, 28]); - - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'beberapa saat', '44 saat = beberapa saat'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'seminit', '45 saat = seminit'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'seminit', '89 saat = seminit'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minit', '90 saat = 2 minit'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minit', '44 minit = 44 minit'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'sejam', '45 minit = sejam'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'sejam', '89 minit = sejam'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 jam', '90 minit = 2 jam'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 jam', '5 jam = 5 jam'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 jam', '21 jam = 21 jam'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'sehari', '22 jam = sehari'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'sehari', '35 jam = sehari'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 hari', '36 jam = 2 hari'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'sehari', '1 hari = sehari'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 hari', '5 hari = 5 hari'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 hari', '25 hari = 25 hari'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'sebulan', '26 hari = sebulan'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'sebulan', '30 hari = sebulan'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'sebulan', '45 hari = sebulan'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 bulan', '46 hari = 2 bulan'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 bulan', '75 hari = 2 bulan'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 bulan', '76 hari = 3 bulan'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'sebulan', '1 bulan = sebulan'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 bulan', '5 bulan = 5 bulan'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'setahun', '345 hari = setahun'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 tahun', '548 hari = 2 tahun'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'setahun', '1 tahun = setahun'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 tahun', '5 tahun = 5 tahun'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'dažas sekundes', '44 seconds = seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), false), 'pirms dažām sekundēm', '44 seconds with suffix = seconds ago'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'minūte', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), false), 'pirms minūtes', '45 seconds with suffix = a minute ago'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'minūte', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: -89}), false), 'pēc minūtes', '89 seconds with suffix/prefix = in a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minūtes', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), false), 'pirms 2 minūtēm', '90 seconds with suffix = 2 minutes ago'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minūtes', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), false), 'pirms 44 minūtēm', '44 minutes with suffix = 44 minutes ago'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'stunda', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), false), 'pirms stundas', '45 minutes with suffix = an hour ago'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'stunda', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 stundas', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: -90}), false), 'pēc 2 stundām', '90 minutes with suffix = in 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 stundas', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), false), 'pirms 5 stundām', '5 hours with suffix = 5 hours ago'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 stunda', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), false), 'pirms 21 stundas', '21 hours with suffix = 21 hours ago'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'diena', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), false), 'pirms dienas', '22 hours with suffix = a day ago'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'diena', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dienas', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), false), 'pirms 2 dienām', '36 hours with suffix = 2 days ago'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'diena', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dienas', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), false), 'pirms 5 dienām', '5 days with suffix = 5 days ago'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dienas', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), false), 'pirms 25 dienām', '25 days with suffix = 25 days ago'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'mēnesis', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), false), 'pirms mēneša', '26 days with suffix = a month ago'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'mēnesis', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'mēnesis', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 mēneši', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), false), 'pirms 2 mēnešiem', '46 days with suffix = 2 months ago'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 mēneši', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 mēneši', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), false), 'pirms 3 mēnešiem', '76 days with suffix = 3 months ago'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'mēnesis', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 mēneši', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), false), 'pirms 5 mēnešiem', '5 months with suffix = 5 months ago'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'gads', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), false), 'pirms gada', '345 days with suffix = a year ago'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 gadi', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), false), 'pirms 2 gadiem', '548 days with suffix = 2 years ago'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'gads', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 gadi', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), false), 'pirms 5 gadiem', '5 years with suffix = 5 years ago'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'dalam beberapa saat', 'prefix'); - assert.equal(moment(0).from(30000), 'beberapa saat yang lepas', 'suffix'); + assert.equal(moment(30000).from(0), 'pēc dažām sekundēm', 'prefix'); + assert.equal(moment(0).from(30000), 'pirms dažām sekundēm', 'suffix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'beberapa saat yang lepas', 'waktu sekarang dari sekarang sepatutnya menunjukkan sebagai telah lepas'); + assert.equal(moment().fromNow(), 'pirms dažām sekundēm', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'dalam beberapa saat', 'dalam beberapa saat'); - assert.equal(moment().add({d: 5}).fromNow(), 'dalam 5 hari', 'dalam 5 hari'); + assert.equal(moment().add({s: 30}).fromNow(), 'pēc dažām sekundēm', 'in seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'pēc 5 dienām', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'Hari ini pukul 02.00', 'hari ini pada waktu yang sama'); - assert.equal(moment(a).add({m: 25}).calendar(), 'Hari ini pukul 02.25', 'Sekarang tambah 25 minit'); - assert.equal(moment(a).add({h: 1}).calendar(), 'Hari ini pukul 03.00', 'Sekarang tambah 1 jam'); - assert.equal(moment(a).add({d: 1}).calendar(), 'Esok pukul 02.00', 'esok pada waktu yang sama'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'Hari ini pukul 01.00', 'Sekarang tolak 1 jam'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'Kelmarin pukul 02.00', 'kelmarin pada waktu yang sama'); + assert.equal(moment(a).calendar(), 'Šodien pulksten 02:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'Šodien pulksten 02:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'Šodien pulksten 03:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'Rīt pulksten 02:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'Šodien pulksten 01:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'Vakar pulksten 02:00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd [pukul] LT'), 'Hari ini + ' + i + ' hari waktu sekarang'); + assert.equal(m.calendar(), m.format('dddd [pulksten] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [pukul] LT'), 'Hari ini + ' + i + ' hari permulaan hari'); + assert.equal(m.calendar(), m.format('dddd [pulksten] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [pukul] LT'), 'Hari ini + ' + i + ' hari tamat hari'); + assert.equal(m.calendar(), m.format('dddd [pulksten] LT'), 'Today + ' + i + ' days end of day'); } }); @@ -20199,11 +20820,11 @@ var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('dddd [lepas] [pukul] LT'), 'Hari ini - ' + i + ' hari waktu sekarang'); + assert.equal(m.calendar(), m.format('[Pagājušā] dddd [pulksten] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [lepas] [pukul] LT'), 'Hari ini - ' + i + ' hari permulaan hari'); + assert.equal(m.calendar(), m.format('[Pagājušā] dddd [pulksten] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [lepas] [pukul] LT'), 'Hari ini - ' + i + ' hari tamat hari'); + assert.equal(m.calendar(), m.format('[Pagājušā] dddd [pulksten] LT'), 'Today - ' + i + ' days end of day'); } }); @@ -20211,86 +20832,86 @@ var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 minggu lepas'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'dalam 1 minggu'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); weeksAgo = moment().subtract({w: 2}); weeksFromNow = moment().add({w: 2}); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 minggu lepas'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'dalam 2 minggu'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 sepatutnya minggu 1'); - assert.equal(moment([2012, 0, 7]).week(), 2, 'Jan 7 2012 sepatutnya minggu 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 sepatutnya minggu 2'); - assert.equal(moment([2012, 0, 14]).week(), 3, 'Jan 14 2012 sepatutnya minggu 3'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 sepatutnya minggu 3'); + assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 53, 'Dec 31 2006 sepatutnya minggu 53'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 sepatutnya minggu 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 sepatutnya minggu 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 sepatutnya minggu 1'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 sepatutnya minggu 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 sepatutnya minggu 2'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); + assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); + assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 30]).week(), 52, 'Dec 30 2007 sepatutnya minggu 52'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 sepatutnya minggu 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 sepatutnya minggu 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 sepatutnya minggu 1'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 sepatutnya minggu 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 sepatutnya minggu 2'); + assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); + assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); + assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); + assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); + assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 52, 'Dec 29 2002 sepatutnya minggu 52'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 sepatutnya minggu 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 sepatutnya minggu 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 sepatutnya minggu 1'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 sepatutnya minggu 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 sepatutnya minggu 2'); + assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); + assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); + assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); + assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); + assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 52, 'Dec 28 2008 sepatutnya minggu 52'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 sepatutnya minggu 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 sepatutnya minggu 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 sepatutnya minggu 1'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 sepatutnya minggu 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 sepatutnya minggu 2'); + assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); + assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); + assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); + assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); + assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 52, 'Dec 27 2009 sepatutnya minggu 52'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 sepatutnya minggu 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 sepatutnya minggu 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 sepatutnya minggu 1'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 sepatutnya minggu 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 sepatutnya minggu 2'); + assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); + assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); + assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); + assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); + assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); + assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 52, 'Dec 26 2010 sepatutnya minggu 52'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 sepatutnya minggu 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 sepatutnya minggu 1'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 sepatutnya minggu 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 sepatutnya minggu 2'); - }); - - test('weeks year starting sunday format', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 sepatutnya minggu 1'); - assert.equal(moment([2012, 0, 7]).format('w ww wo'), '2 02 2', 'Jan 7 2012 sepatutnya minggu 2'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 sepatutnya minggu 2'); - assert.equal(moment([2012, 0, 14]).format('w ww wo'), '3 03 3', 'Jan 14 2012 sepatutnya minggu 3'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 sepatutnya minggu 3'); + assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); + assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); + assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); + assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); + assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); + assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { + test('weeks year starting sunday formatted', function (assert) { + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); + }); + + test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -20304,18 +20925,6 @@ } }); - test('meridiem invariant', function (assert) { - var h, m, t1, t2; - for (h = 0; h < 24; ++h) { - for (m = 0; m < 60; m += 15) { - t1 = moment.utc([2000, 0, 1, h, m]); - t2 = moment(t1.format('A h:mm'), 'A h:mm'); - assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), - 'meridiem at ' + t1.format('HH:mm')); - } - } - }); - test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { @@ -20340,8 +20949,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -20350,12 +20960,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -20373,8 +20985,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -20389,16 +21001,14 @@ }); } - localeModule('ms'); + localeModule('me'); test('parse', function (assert) { - var i, - tests = 'Januari Jan_Februari Feb_Mac Mac_April Apr_Mei Mei_Jun Jun_Julai Jul_Ogos Ogs_September Sep_Oktober Okt_November Nov_Disember Dis'.split('_'); - + var tests = 'januar jan._februar feb._mart mar._april apr._maj maj_jun jun_jul jul_avgust avg._septembar sep._oktobar okt._novembar nov._decembar dec.'.split('_'), + i; function equalTest(input, mmm, i) { - assert.equal(moment(input, mmm).month(), i, input + ' sepatutnya bulan ' + (i + 1)); + assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } - for (i = 0; i < 12; i++) { tests[i] = tests[i].split(' '); equalTest(tests[i][0], 'MMM', i); @@ -20414,88 +21024,2816 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss a', 'Ahad, Februari 14 2010, 3:25:50 petang'], - ['ddd, hA', 'Ahd, 3petang'], - ['M Mo MM MMMM MMM', '2 2 02 Februari Feb'], + ['dddd, Do MMMM YYYY, h:mm:ss a', 'nedjelja, 14. februar 2010, 3:25:50 pm'], + ['ddd, hA', 'ned., 3PM'], + ['M Mo MM MMMM MMM', '2 2. 02 februar feb.'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14 14'], - ['d do dddd ddd dd', '0 0 Ahad Ahd Ah'], - ['DDD DDDo DDDD', '45 45 045'], - ['w wo ww', '7 7 07'], + ['D Do DD', '14 14. 14'], + ['d do dddd ddd dd', '0 0. nedjelja ned. ne'], + ['DDD DDDo DDDD', '45 45. 045'], + ['w wo ww', '7 7. 07'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], - ['a A', 'petang petang'], - ['[hari] [ke] DDDo [tahun] ini', 'hari ke 45 tahun ini'], - ['LTS', '15.25.50'], - ['L', '14/02/2010'], - ['LL', '14 Februari 2010'], - ['LLL', '14 Februari 2010 pukul 15.25'], - ['LLLL', 'Ahad, 14 Februari 2010 pukul 15.25'], - ['l', '14/2/2010'], - ['ll', '14 Feb 2010'], - ['lll', '14 Feb 2010 pukul 15.25'], - ['llll', 'Ahd, 14 Feb 2010 pukul 15.25'] + ['a A', 'pm PM'], + ['[the] DDDo [day of the year]', 'the 45. day of the year'], + ['LTS', '15:25:50'], + ['L', '14. 02. 2010'], + ['LL', '14. februar 2010'], + ['LLL', '14. februar 2010 15:25'], + ['LLLL', 'nedjelja, 14. februar 2010 15:25'], + ['l', '14. 2. 2010'], + ['ll', '14. feb. 2010'], + ['lll', '14. feb. 2010 15:25'], + ['llll', 'ned., 14. feb. 2010 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; - for (i = 0; i < a.length; i++) { assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); } }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); test('format month', function (assert) { - var i, - expected = 'Januari Jan_Februari Feb_Mac Mac_April Apr_Mei Mei_Jun Jun_Julai Jul_Ogos Ogs_September Sep_Oktober Okt_November Nov_Disember Dis'.split('_'); - + var expected = 'januar jan._februar feb._mart mar._april apr._maj maj_jun jun_jul jul_avgust avg._septembar sep._oktobar okt._novembar nov._decembar dec.'.split('_'), + i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var i, - expected = 'Ahad Ahd Ah_Isnin Isn Is_Selasa Sel Sl_Rabu Rab Rb_Khamis Kha Km_Jumaat Jum Jm_Sabtu Sab Sb'.split('_'); + var expected = 'nedjelja ned. ne_ponedjeljak pon. po_utorak uto. ut_srijeda sri. sr_četvrtak čet. če_petak pet. pe_subota sub. su'.split('_'), + i; + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); + } + }); + + test('from', function (assert) { + var start = moment([2007, 1, 28]); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'nekoliko sekundi', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'jedan minut', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'jedan minut', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minuta', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minuta', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'jedan sat', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'jedan sat', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 sata', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 sati', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 sati', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'dan', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'dan', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dana', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'dan', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dana', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dana', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'mjesec', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'mjesec', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'mjesec', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 mjeseca', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 mjeseca', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 mjeseca', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'mjesec', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 mjeseci', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'godinu', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 godine', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'godinu', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 godina', '5 years = 5 years'); + }); + + test('suffix', function (assert) { + assert.equal(moment(30000).from(0), 'za nekoliko sekundi', 'prefix'); + assert.equal(moment(0).from(30000), 'prije nekoliko sekundi', 'prefix'); + }); + + test('now from now', function (assert) { + assert.equal(moment().fromNow(), 'prije nekoliko sekundi', 'now from now should display as in the past'); + }); + + test('fromNow', function (assert) { + assert.equal(moment().add({s: 30}).fromNow(), 'za nekoliko sekundi', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'za 5 dana', 'in 5 days'); + }); + + test('calendar day', function (assert) { + var a = moment().hours(2).minutes(0).seconds(0); + + assert.equal(moment(a).calendar(), 'danas u 2:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'danas u 2:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'danas u 3:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'sjutra u 2:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'danas u 1:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'juče u 2:00', 'yesterday at the same time'); + }); + + test('calendar next week', function (assert) { + var i, m; + + function makeFormat(d) { + switch (d.day()) { + case 0: + return '[u] [nedjelju] [u] LT'; + case 3: + return '[u] [srijedu] [u] LT'; + case 6: + return '[u] [subotu] [u] LT'; + case 1: + case 2: + case 4: + case 5: + return '[u] dddd [u] LT'; + } + } + + for (i = 2; i < 7; i++) { + m = moment().add({d: i}); + assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today + ' + i + ' days current time'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today + ' + i + ' days beginning of day'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today + ' + i + ' days end of day'); + } + }); + + test('calendar last week', function (assert) { + var i, m; + + function makeFormat(d) { + var lastWeekDay = [ + '[prošle] [nedjelje] [u] LT', + '[prošlog] [ponedjeljka] [u] LT', + '[prošlog] [utorka] [u] LT', + '[prošle] [srijede] [u] LT', + '[prošlog] [četvrtka] [u] LT', + '[prošlog] [petka] [u] LT', + '[prošle] [subote] [u] LT' + ]; + + return lastWeekDay[d.day()]; + } + + for (i = 2; i < 7; i++) { + m = moment().subtract({d: i}); + assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days current time'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days beginning of day'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days end of day'); + } + }); + + test('calendar all else', function (assert) { + var weeksAgo = moment().subtract({w: 1}), + weeksFromNow = moment().add({w: 1}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); + + weeksAgo = moment().subtract({w: 2}); + weeksFromNow = moment().add({w: 2}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); + }); + + // Monday is the first day of the week. + // The week that contains Jan 1st is the first week of the year. + + test('weeks year starting sunday', function (assert) { + assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); + }); + + test('weeks year starting monday', function (assert) { + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); + assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); + assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); + }); + + test('weeks year starting tuesday', function (assert) { + assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); + assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); + assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); + assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); + assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); + }); + + test('weeks year starting wednesday', function (assert) { + assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); + assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); + assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); + assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); + assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); + }); + + test('weeks year starting thursday', function (assert) { + assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); + assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); + assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); + assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); + assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); + }); + + test('weeks year starting friday', function (assert) { + assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); + assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); + assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); + assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); + assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); + }); + + test('weeks year starting saturday', function (assert) { + assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); + assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); + assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); + assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); + assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); + }); + + test('weeks year starting sunday formatted', function (assert) { + assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1.', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2.', 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2.', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3'); + }); + + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + +})); + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + /*global QUnit:false*/ + + var test = QUnit.test; + + var expect = QUnit.expect; + + function module (name, lifecycle) { + QUnit.module(name, { + setup : function () { + moment.locale('en'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + function localeModule (name, lifecycle) { + QUnit.module('locale:' + name, { + setup : function () { + moment.locale(name); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + moment.locale('en'); + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + localeModule('mk'); + + test('parse', function (assert) { + var tests = 'јануари јан_февруари фев_март мар_април апр_мај мај_јуни јун_јули јул_август авг_септември сеп_октомври окт_ноември ное_декември дек'.split('_'), i; + function equalTest(input, mmm, i) { + assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); + } + for (i = 0; i < 12; i++) { + tests[i] = tests[i].split(' '); + equalTest(tests[i][0], 'MMM', i); + equalTest(tests[i][1], 'MMM', i); + equalTest(tests[i][0], 'MMMM', i); + equalTest(tests[i][1], 'MMMM', i); + equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); + } + }); + + test('format', function (assert) { + var a = [ + ['dddd, MMMM Do YYYY, H:mm:ss', 'недела, февруари 14-ти 2010, 15:25:50'], + ['ddd, hA', 'нед, 3PM'], + ['M Mo MM MMMM MMM', '2 2-ри 02 февруари фев'], + ['YYYY YY', '2010 10'], + ['D Do DD', '14 14-ти 14'], + ['d do dddd ddd dd', '0 0-ев недела нед нe'], + ['DDD DDDo DDDD', '45 45-ти 045'], + ['w wo ww', '7 7-ми 07'], + ['h hh', '3 03'], + ['H HH', '15 15'], + ['m mm', '25 25'], + ['s ss', '50 50'], + ['a A', 'pm PM'], + ['[the] DDDo [day of the year]', 'the 45-ти day of the year'], + ['LTS', '15:25:50'], + ['L', '14.02.2010'], + ['LL', '14 февруари 2010'], + ['LLL', '14 февруари 2010 15:25'], + ['LLLL', 'недела, 14 февруари 2010 15:25'], + ['l', '14.2.2010'], + ['ll', '14 фев 2010'], + ['lll', '14 фев 2010 15:25'], + ['llll', 'нед, 14 фев 2010 15:25'] + ], + b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), + i; + for (i = 0; i < a.length; i++) { + assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); + } + }); + + test('format ordinal', function (assert) { + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-ви', '1-ви'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-ри', '2-ри'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-ти', '3-ти'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4-ти', '4-ти'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5-ти', '5-ти'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6-ти', '6-ти'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7-ми', '7-ми'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8-ми', '8-ми'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9-ти', '9-ти'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10-ти', '10-ти'); + + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11-ти', '11-ти'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12-ти', '12-ти'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13-ти', '13-ти'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14-ти', '14-ти'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15-ти', '15-ти'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16-ти', '16-ти'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17-ти', '17-ти'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18-ти', '18-ти'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19-ти', '19-ти'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20-ти', '20-ти'); + + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21-ви', '21-ви'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22-ри', '22-ри'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23-ти', '23-ти'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24-ти', '24-ти'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25-ти', '25-ти'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26-ти', '26-ти'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27-ми', '27-ми'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28-ми', '28-ми'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29-ти', '29-ти'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30-ти', '30-ти'); + + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-ви', '31-ви'); + }); + + test('format month', function (assert) { + var expected = 'јануари јан_февруари фев_март мар_април апр_мај мај_јуни јун_јули јул_август авг_септември сеп_октомври окт_ноември ное_декември дек'.split('_'), i; + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); + } + }); + + test('format week', function (assert) { + var expected = 'недела нед нe_понеделник пон пo_вторник вто вт_среда сре ср_четврток чет че_петок пет пе_сабота саб сa'.split('_'), i; + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); + } + }); + + test('from', function (assert) { + var start = moment([2007, 1, 28]); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'неколку секунди', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'минута', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'минута', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 минути', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 минути', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'час', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'час', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 часа', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 часа', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 часа', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'ден', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'ден', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 дена', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'ден', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 дена', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 дена', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'месец', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'месец', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'месец', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 месеци', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 месеци', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 месеци', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'месец', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 месеци', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'година', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 години', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'година', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 години', '5 years = 5 years'); + }); + + test('suffix', function (assert) { + assert.equal(moment(30000).from(0), 'после неколку секунди', 'prefix'); + assert.equal(moment(0).from(30000), 'пред неколку секунди', 'suffix'); + }); + + test('now from now', function (assert) { + assert.equal(moment().fromNow(), 'пред неколку секунди', 'now from now should display as in the past'); + }); + + test('fromNow', function (assert) { + assert.equal(moment().add({s: 30}).fromNow(), 'после неколку секунди', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'после 5 дена', 'in 5 days'); + }); + + test('calendar day', function (assert) { + var a = moment().hours(2).minutes(0).seconds(0); + + assert.equal(moment(a).calendar(), 'Денес во 2:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'Денес во 2:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'Денес во 3:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'Утре во 2:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'Денес во 1:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'Вчера во 2:00', 'yesterday at the same time'); + }); + + test('calendar next week', function (assert) { + var i, m; + for (i = 2; i < 7; i++) { + m = moment().add({d: i}); + assert.equal(m.calendar(), m.format('[Во] dddd [во] LT'), 'Today + ' + i + ' days current time'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format('[Во] dddd [во] LT'), 'Today + ' + i + ' days beginning of day'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format('[Во] dddd [во] LT'), 'Today + ' + i + ' days end of day'); + } + }); + + test('calendar last week', function (assert) { + var i, m; + + function makeFormat(d) { + switch (d.day()) { + case 0: + case 3: + case 6: + return '[Изминатата] dddd [во] LT'; + case 1: + case 2: + case 4: + case 5: + return '[Изминатиот] dddd [во] LT'; + } + } + + for (i = 2; i < 7; i++) { + m = moment().subtract({d: i}); + assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days current time'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days beginning of day'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days end of day'); + } + }); + + test('calendar all else', function (assert) { + var weeksAgo = moment().subtract({w: 1}), + weeksFromNow = moment().add({w: 1}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); + + weeksAgo = moment().subtract({w: 2}); + weeksFromNow = moment().add({w: 2}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); + }); + + test('weeks year starting sunday', function (assert) { + assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); + }); + + test('weeks year starting monday', function (assert) { + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); + assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); + assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); + }); + + test('weeks year starting tuesday', function (assert) { + assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); + assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); + assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); + assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); + assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); + }); + + test('weeks year starting wednesday', function (assert) { + assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); + assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); + assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); + assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); + assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); + }); + + test('weeks year starting thursday', function (assert) { + assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); + assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); + assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); + assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); + assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); + }); + + test('weeks year starting friday', function (assert) { + assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); + assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); + assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); + assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); + assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); + }); + + test('weeks year starting saturday', function (assert) { + assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); + assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); + assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); + assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); + assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); + }); + + test('weeks year starting sunday formatted', function (assert) { + assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-ви', 'Dec 26 2011 should be week 1'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-ви', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2-ри', 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2-ри', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-ти', 'Jan 9 2012 should be week 3'); + }); + + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + +})); + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + /*global QUnit:false*/ + + var test = QUnit.test; + + var expect = QUnit.expect; + + function module (name, lifecycle) { + QUnit.module(name, { + setup : function () { + moment.locale('en'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + function localeModule (name, lifecycle) { + QUnit.module('locale:' + name, { + setup : function () { + moment.locale(name); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + moment.locale('en'); + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + localeModule('ml'); + + test('parse', function (assert) { + var tests = 'ജനുവരി ജനു._ഫെബ്രുവരി ഫെബ്രു._മാർച്ച് മാർ._ഏപ്രിൽ ഏപ്രി._മേയ് മേയ്_ജൂൺ ജൂൺ_ജൂലൈ ജൂലൈ._ഓഗസ്റ്റ് ഓഗ._സെപ്റ്റംബർ സെപ്റ്റ._ഒക്ടോബർ ഒക്ടോ._നവംബർ നവം._ഡിസംബർ ഡിസം.'.split('_'), i; + function equalTest(input, mmm, i) { + assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); + } + for (i = 0; i < 12; i++) { + tests[i] = tests[i].split(' '); + equalTest(tests[i][0], 'MMM', i); + equalTest(tests[i][1], 'MMM', i); + equalTest(tests[i][0], 'MMMM', i); + equalTest(tests[i][1], 'MMMM', i); + equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); + } + }); + + test('format', function (assert) { + var a = [ + ['dddd, Do MMMM YYYY, a h:mm:ss -നു', 'ഞായറാഴ്ച, 14 ഫെബ്രുവരി 2010, ഉച്ച കഴിഞ്ഞ് 3:25:50 -നു'], + ['ddd, a h -നു', 'ഞായർ, ഉച്ച കഴിഞ്ഞ് 3 -നു'], + ['M Mo MM MMMM MMM', '2 2 02 ഫെബ്രുവരി ഫെബ്രു.'], + ['YYYY YY', '2010 10'], + ['D Do DD', '14 14 14'], + ['d do dddd ddd dd', '0 0 ഞായറാഴ്ച ഞായർ ഞാ'], + ['DDD DDDo DDDD', '45 45 045'], + ['w wo ww', '8 8 08'], + ['h hh', '3 03'], + ['H HH', '15 15'], + ['m mm', '25 25'], + ['s ss', '50 50'], + ['a A', 'ഉച്ച കഴിഞ്ഞ് ഉച്ച കഴിഞ്ഞ്'], + ['LTS', 'ഉച്ച കഴിഞ്ഞ് 3:25:50 -നു'], + ['L', '14/02/2010'], + ['LL', '14 ഫെബ്രുവരി 2010'], + ['LLL', '14 ഫെബ്രുവരി 2010, ഉച്ച കഴിഞ്ഞ് 3:25 -നു'], + ['LLLL', 'ഞായറാഴ്ച, 14 ഫെബ്രുവരി 2010, ഉച്ച കഴിഞ്ഞ് 3:25 -നു'], + ['l', '14/2/2010'], + ['ll', '14 ഫെബ്രു. 2010'], + ['lll', '14 ഫെബ്രു. 2010, ഉച്ച കഴിഞ്ഞ് 3:25 -നു'], + ['llll', 'ഞായർ, 14 ഫെബ്രു. 2010, ഉച്ച കഴിഞ്ഞ് 3:25 -നു'] + ], + b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), + i; + for (i = 0; i < a.length; i++) { + assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); + } + }); + + test('format ordinal', function (assert) { + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10'); + + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20'); + + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30'); + + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31'); + }); + + test('format month', function (assert) { + var expected = 'ജനുവരി ജനു._ഫെബ്രുവരി ഫെബ്രു._മാർച്ച് മാർ._ഏപ്രിൽ ഏപ്രി._മേയ് മേയ്_ജൂൺ ജൂൺ_ജൂലൈ ജൂലൈ._ഓഗസ്റ്റ് ഓഗ._സെപ്റ്റംബർ സെപ്റ്റ._ഒക്ടോബർ ഒക്ടോ._നവംബർ നവം._ഡിസംബർ ഡിസം.'.split('_'), i; + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); + } + }); + + test('format week', function (assert) { + var expected = 'ഞായറാഴ്ച ഞായർ ഞാ_തിങ്കളാഴ്ച തിങ്കൾ തി_ചൊവ്വാഴ്ച ചൊവ്വ ചൊ_ബുധനാഴ്ച ബുധൻ ബു_വ്യാഴാഴ്ച വ്യാഴം വ്യാ_വെള്ളിയാഴ്ച വെള്ളി വെ_ശനിയാഴ്ച ശനി ശ'.split('_'), i; + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); + } + }); + + test('from', function (assert) { + var start = moment([2007, 1, 28]); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'അൽപ നിമിഷങ്ങൾ', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'ഒരു മിനിറ്റ്', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'ഒരു മിനിറ്റ്', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 മിനിറ്റ്', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 മിനിറ്റ്', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'ഒരു മണിക്കൂർ', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'ഒരു മണിക്കൂർ', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 മണിക്കൂർ', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 മണിക്കൂർ', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 മണിക്കൂർ', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'ഒരു ദിവസം', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'ഒരു ദിവസം', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 ദിവസം', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'ഒരു ദിവസം', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 ദിവസം', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 ദിവസം', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'ഒരു മാസം', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'ഒരു മാസം', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'ഒരു മാസം', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 മാസം', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 മാസം', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 മാസം', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'ഒരു മാസം', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 മാസം', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ഒരു വർഷം', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 വർഷം', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'ഒരു വർഷം', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 വർഷം', '5 years = 5 years'); + }); + + test('suffix', function (assert) { + assert.equal(moment(30000).from(0), 'അൽപ നിമിഷങ്ങൾ കഴിഞ്ഞ്', 'prefix'); + assert.equal(moment(0).from(30000), 'അൽപ നിമിഷങ്ങൾ മുൻപ്', 'suffix'); + }); + + test('now from now', function (assert) { + assert.equal(moment().fromNow(), 'അൽപ നിമിഷങ്ങൾ മുൻപ്', 'now from now should display as in the past'); + }); + + test('fromNow', function (assert) { + assert.equal(moment().add({s: 30}).fromNow(), 'അൽപ നിമിഷങ്ങൾ കഴിഞ്ഞ്', 'അൽപ നിമിഷങ്ങൾ കഴിഞ്ഞ്'); + assert.equal(moment().add({d: 5}).fromNow(), '5 ദിവസം കഴിഞ്ഞ്', '5 ദിവസം കഴിഞ്ഞ്'); + }); + + test('calendar day', function (assert) { + var a = moment().hours(2).minutes(0).seconds(0); + + assert.equal(moment(a).calendar(), 'ഇന്ന് രാത്രി 2:00 -നു', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'ഇന്ന് രാത്രി 2:25 -നു', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 3}).calendar(), 'ഇന്ന് രാവിലെ 5:00 -നു', 'Now plus 3 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'നാളെ രാത്രി 2:00 -നു', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'ഇന്ന് രാത്രി 1:00 -നു', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'ഇന്നലെ രാത്രി 2:00 -നു', 'yesterday at the same time'); + }); + + test('calendar next week', function (assert) { + var i, m; + for (i = 2; i < 7; i++) { + m = moment().add({d: i}); + assert.equal(m.calendar(), m.format('dddd[,] LT'), 'Today + ' + i + ' days current time'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format('dddd[,] LT'), 'Today + ' + i + ' days beginning of day'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format('dddd[,] LT'), 'Today + ' + i + ' days end of day'); + } + }); + + test('calendar last week', function (assert) { + var i, m; + + for (i = 2; i < 7; i++) { + m = moment().subtract({d: i}); + assert.equal(m.calendar(), m.format('[കഴിഞ്ഞ] dddd[,] LT'), 'Today - ' + i + ' days current time'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format('[കഴിഞ്ഞ] dddd[,] LT'), 'Today - ' + i + ' days beginning of day'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format('[കഴിഞ്ഞ] dddd[,] LT'), 'Today - ' + i + ' days end of day'); + } + }); + + test('calendar all else', function (assert) { + var weeksAgo = moment().subtract({w: 1}), + weeksFromNow = moment().add({w: 1}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); + + weeksAgo = moment().subtract({w: 2}); + weeksFromNow = moment().add({w: 2}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); + }); + + test('meridiem', function (assert) { + assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), 'രാത്രി', 'before dawn'); + assert.equal(moment([2011, 2, 23, 9, 30]).format('a'), 'രാവിലെ', 'morning'); + assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'ഉച്ച കഴിഞ്ഞ്', 'during day'); + assert.equal(moment([2011, 2, 23, 17, 30]).format('a'), 'വൈകുന്നേരം', 'evening'); + assert.equal(moment([2011, 2, 23, 19, 30]).format('a'), 'വൈകുന്നേരം', 'late evening'); + assert.equal(moment([2011, 2, 23, 21, 20]).format('a'), 'രാത്രി', 'night'); + + assert.equal(moment([2011, 2, 23, 2, 30]).format('A'), 'രാത്രി', 'before dawn'); + assert.equal(moment([2011, 2, 23, 9, 30]).format('A'), 'രാവിലെ', 'morning'); + assert.equal(moment([2011, 2, 23, 14, 30]).format('A'), 'ഉച്ച കഴിഞ്ഞ്', ' during day'); + assert.equal(moment([2011, 2, 23, 17, 30]).format('A'), 'വൈകുന്നേരം', 'evening'); + assert.equal(moment([2011, 2, 23, 19, 30]).format('A'), 'വൈകുന്നേരം', 'late evening'); + assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'രാത്രി', 'night'); + }); + + test('weeks year starting sunday', function (assert) { + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); + }); + + test('weeks year starting monday', function (assert) { + assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); + assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); + }); + + test('weeks year starting tuesday', function (assert) { + assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); + assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); + assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); + assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); + assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); + }); + + test('weeks year starting wednesday', function (assert) { + assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); + assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); + assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); + assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); + assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); + }); + + test('weeks year starting thursday', function (assert) { + assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); + assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); + assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); + assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); + assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); + }); + + test('weeks year starting friday', function (assert) { + assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); + assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); + assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); + assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); + assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); + }); + + test('weeks year starting saturday', function (assert) { + assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); + assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); + assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); + assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); + }); + + test('weeks year starting sunday formatted', function (assert) { + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1', 'Jan 7 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2', 'Jan 14 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3'); + }); + + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + +})); + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + /*global QUnit:false*/ + + var test = QUnit.test; + + var expect = QUnit.expect; + + function module (name, lifecycle) { + QUnit.module(name, { + setup : function () { + moment.locale('en'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + function localeModule (name, lifecycle) { + QUnit.module('locale:' + name, { + setup : function () { + moment.locale(name); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + moment.locale('en'); + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + localeModule('mr'); + + test('parse', function (assert) { + var tests = 'जानेवारी जाने._फेब्रुवारी फेब्रु._मार्च मार्च._एप्रिल एप्रि._मे मे._जून जून._जुलै जुलै._ऑगस्ट ऑग._सप्टेंबर सप्टें._ऑक्टोबर ऑक्टो._नोव्हेंबर नोव्हें._डिसेंबर डिसें.'.split('_'), i; + function equalTest(input, mmm, i) { + assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); + } + for (i = 0; i < 12; i++) { + tests[i] = tests[i].split(' '); + equalTest(tests[i][0], 'MMM', i); + equalTest(tests[i][1], 'MMM', i); + equalTest(tests[i][0], 'MMMM', i); + equalTest(tests[i][1], 'MMMM', i); + equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); + } + }); + + test('format', function (assert) { + var a = [ + ['dddd, Do MMMM YYYY, a h:mm:ss वाजता', 'रविवार, १४ फेब्रुवारी २०१०, दुपारी ३:२५:५० वाजता'], + ['ddd, a h वाजता', 'रवि, दुपारी ३ वाजता'], + ['M Mo MM MMMM MMM', '२ २ ०२ फेब्रुवारी फेब्रु.'], + ['YYYY YY', '२०१० १०'], + ['D Do DD', '१४ १४ १४'], + ['d do dddd ddd dd', '० ० रविवार रवि र'], + ['DDD DDDo DDDD', '४५ ४५ ०४५'], + ['w wo ww', '८ ८ ०८'], + ['h hh', '३ ०३'], + ['H HH', '१५ १५'], + ['m mm', '२५ २५'], + ['s ss', '५० ५०'], + ['a A', 'दुपारी दुपारी'], + ['LTS', 'दुपारी ३:२५:५० वाजता'], + ['L', '१४/०२/२०१०'], + ['LL', '१४ फेब्रुवारी २०१०'], + ['LLL', '१४ फेब्रुवारी २०१०, दुपारी ३:२५ वाजता'], + ['LLLL', 'रविवार, १४ फेब्रुवारी २०१०, दुपारी ३:२५ वाजता'], + ['l', '१४/२/२०१०'], + ['ll', '१४ फेब्रु. २०१०'], + ['lll', '१४ फेब्रु. २०१०, दुपारी ३:२५ वाजता'], + ['llll', 'रवि, १४ फेब्रु. २०१०, दुपारी ३:२५ वाजता'] + ], + b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), + i; + for (i = 0; i < a.length; i++) { + assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); + } + }); + + test('format ordinal', function (assert) { + assert.equal(moment([2011, 0, 1]).format('DDDo'), '१', '१'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '२', '२'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '३', '३'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '४', '४'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '५', '५'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '६', '६'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '७', '७'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '८', '८'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '९', '९'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '१०', '१०'); + + assert.equal(moment([2011, 0, 11]).format('DDDo'), '११', '११'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '१२', '१२'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '१३', '१३'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '१४', '१४'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '१५', '१५'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '१६', '१६'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '१७', '१७'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '१८', '१८'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '१९', '१९'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '२०', '२०'); + + assert.equal(moment([2011, 0, 21]).format('DDDo'), '२१', '२१'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '२२', '२२'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '२३', '२३'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '२४', '२४'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '२५', '२५'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '२६', '२६'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '२७', '२७'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '२८', '२८'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '२९', '२९'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '३०', '३०'); + + assert.equal(moment([2011, 0, 31]).format('DDDo'), '३१', '३१'); + }); + + test('format month', function (assert) { + var expected = 'जानेवारी जाने._फेब्रुवारी फेब्रु._मार्च मार्च._एप्रिल एप्रि._मे मे._जून जून._जुलै जुलै._ऑगस्ट ऑग._सप्टेंबर सप्टें._ऑक्टोबर ऑक्टो._नोव्हेंबर नोव्हें._डिसेंबर डिसें.'.split('_'), i; + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); + } + }); + + test('format week', function (assert) { + var expected = 'रविवार रवि र_सोमवार सोम सो_मंगळवार मंगळ मं_बुधवार बुध बु_गुरूवार गुरू गु_शुक्रवार शुक्र शु_शनिवार शनि श'.split('_'), i; + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); + } + }); + + test('from', function (assert) { + var start = moment([2007, 1, 28]); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'काही सेकंद', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'एक मिनिट', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'एक मिनिट', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '२ मिनिटे', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '४४ मिनिटे', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'एक तास', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'एक तास', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '२ तास', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '५ तास', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '२१ तास', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'एक दिवस', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'एक दिवस', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '२ दिवस', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'एक दिवस', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '५ दिवस', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '२५ दिवस', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'एक महिना', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'एक महिना', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'एक महिना', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '२ महिने', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '२ महिने', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '३ महिने', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'एक महिना', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '५ महिने', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'एक वर्ष', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '२ वर्षे', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'एक वर्ष', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '५ वर्षे', '5 years = 5 years'); + }); + + test('suffix', function (assert) { + assert.equal(moment(30000).from(0), 'काही सेकंदांमध्ये', 'prefix'); + assert.equal(moment(0).from(30000), 'काही सेकंदांपूर्वी', 'suffix'); + }); + + test('now from now', function (assert) { + assert.equal(moment().fromNow(), 'काही सेकंदांपूर्वी', 'now from now should display as in the past'); + }); + + test('fromNow', function (assert) { + assert.equal(moment().add({s: 30}).fromNow(), 'काही सेकंदांमध्ये', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), '५ दिवसांमध्ये', 'in 5 days'); + }); + + test('calendar day', function (assert) { + var a = moment().hours(2).minutes(0).seconds(0); + + assert.equal(moment(a).calendar(), 'आज रात्री २:०० वाजता', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'आज रात्री २:२५ वाजता', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 3}).calendar(), 'आज सकाळी ५:०० वाजता', 'Now plus 3 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'उद्या रात्री २:०० वाजता', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'आज रात्री १:०० वाजता', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'काल रात्री २:०० वाजता', 'yesterday at the same time'); + }); + + test('calendar next week', function (assert) { + var i, m; + for (i = 2; i < 7; i++) { + m = moment().add({d: i}); + assert.equal(m.calendar(), m.format('dddd[,] LT'), 'Today + ' + i + ' days current time'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format('dddd[,] LT'), 'Today + ' + i + ' days beginning of day'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format('dddd[,] LT'), 'Today + ' + i + ' days end of day'); + } + }); + + test('calendar last week', function (assert) { + var i, m; + + for (i = 2; i < 7; i++) { + m = moment().subtract({d: i}); + assert.equal(m.calendar(), m.format('[मागील] dddd[,] LT'), 'Today - ' + i + ' days current time'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format('[मागील] dddd[,] LT'), 'Today - ' + i + ' days beginning of day'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format('[मागील] dddd[,] LT'), 'Today - ' + i + ' days end of day'); + } + }); + + test('calendar all else', function (assert) { + var weeksAgo = moment().subtract({w: 1}), + weeksFromNow = moment().add({w: 1}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); + + weeksAgo = moment().subtract({w: 2}); + weeksFromNow = moment().add({w: 2}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); + }); + + test('meridiem', function (assert) { + assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), 'रात्री', 'before dawn'); + assert.equal(moment([2011, 2, 23, 9, 30]).format('a'), 'सकाळी', 'morning'); + assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'दुपारी', 'during day'); + assert.equal(moment([2011, 2, 23, 17, 30]).format('a'), 'सायंकाळी', 'evening'); + assert.equal(moment([2011, 2, 23, 19, 30]).format('a'), 'सायंकाळी', 'late evening'); + assert.equal(moment([2011, 2, 23, 21, 20]).format('a'), 'रात्री', 'night'); + + assert.equal(moment([2011, 2, 23, 2, 30]).format('A'), 'रात्री', 'before dawn'); + assert.equal(moment([2011, 2, 23, 9, 30]).format('A'), 'सकाळी', 'morning'); + assert.equal(moment([2011, 2, 23, 14, 30]).format('A'), 'दुपारी', ' during day'); + assert.equal(moment([2011, 2, 23, 17, 30]).format('A'), 'सायंकाळी', 'evening'); + assert.equal(moment([2011, 2, 23, 19, 30]).format('A'), 'सायंकाळी', 'late evening'); + assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'रात्री', 'night'); + }); + + test('weeks year starting sunday', function (assert) { + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); + }); + + test('weeks year starting monday', function (assert) { + assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); + assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); + }); + + test('weeks year starting tuesday', function (assert) { + assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); + assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); + assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); + assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); + assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); + }); + + test('weeks year starting wednesday', function (assert) { + assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); + assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); + assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); + assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); + assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); + }); + + test('weeks year starting thursday', function (assert) { + assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); + assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); + assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); + assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); + assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); + }); + + test('weeks year starting friday', function (assert) { + assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); + assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); + assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); + assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); + assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); + }); + + test('weeks year starting saturday', function (assert) { + assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); + assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); + assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); + assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); + }); + + test('weeks year starting sunday formatted', function (assert) { + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '१ ०१ १', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).format('w ww wo'), '१ ०१ १', 'Jan 7 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '२ ०२ २', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).format('w ww wo'), '२ ०२ २', 'Jan 14 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '३ ०३ ३', 'Jan 15 2012 should be week 3'); + }); + + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + +})); + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + /*global QUnit:false*/ + + var test = QUnit.test; + + var expect = QUnit.expect; + + function module (name, lifecycle) { + QUnit.module(name, { + setup : function () { + moment.locale('en'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + function localeModule (name, lifecycle) { + QUnit.module('locale:' + name, { + setup : function () { + moment.locale(name); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + moment.locale('en'); + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + localeModule('ms-my'); + + test('parse', function (assert) { + var i, + tests = 'Januari Jan_Februari Feb_Mac Mac_April Apr_Mei Mei_Jun Jun_Julai Jul_Ogos Ogs_September Sep_Oktober Okt_November Nov_Disember Dis'.split('_'); + + function equalTest(input, mmm, i) { + assert.equal(moment(input, mmm).month(), i, input + ' sepatutnya bulan ' + (i + 1)); + } + + for (i = 0; i < 12; i++) { + tests[i] = tests[i].split(' '); + equalTest(tests[i][0], 'MMM', i); + equalTest(tests[i][1], 'MMM', i); + equalTest(tests[i][0], 'MMMM', i); + equalTest(tests[i][1], 'MMMM', i); + equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); + } + }); + + test('format', function (assert) { + var a = [ + ['dddd, MMMM Do YYYY, h:mm:ss a', 'Ahad, Februari 14 2010, 3:25:50 petang'], + ['ddd, hA', 'Ahd, 3petang'], + ['M Mo MM MMMM MMM', '2 2 02 Februari Feb'], + ['YYYY YY', '2010 10'], + ['D Do DD', '14 14 14'], + ['d do dddd ddd dd', '0 0 Ahad Ahd Ah'], + ['DDD DDDo DDDD', '45 45 045'], + ['w wo ww', '7 7 07'], + ['h hh', '3 03'], + ['H HH', '15 15'], + ['m mm', '25 25'], + ['s ss', '50 50'], + ['a A', 'petang petang'], + ['[hari] [ke] DDDo [tahun] ini', 'hari ke 45 tahun ini'], + ['LTS', '15.25.50'], + ['L', '14/02/2010'], + ['LL', '14 Februari 2010'], + ['LLL', '14 Februari 2010 pukul 15.25'], + ['LLLL', 'Ahad, 14 Februari 2010 pukul 15.25'], + ['l', '14/2/2010'], + ['ll', '14 Feb 2010'], + ['lll', '14 Feb 2010 pukul 15.25'], + ['llll', 'Ahd, 14 Feb 2010 pukul 15.25'] + ], + b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), + i; + + for (i = 0; i < a.length; i++) { + assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); + } + }); + + test('format ordinal', function (assert) { + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10'); + + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20'); + + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30'); + + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31'); + }); + + test('format month', function (assert) { + var i, + expected = 'Januari Jan_Februari Feb_Mac Mac_April Apr_Mei Mei_Jun Jun_Julai Jul_Ogos Ogs_September Sep_Oktober Okt_November Nov_Disember Dis'.split('_'); + + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); + } + }); + + test('format week', function (assert) { + var i, + expected = 'Ahad Ahd Ah_Isnin Isn Is_Selasa Sel Sl_Rabu Rab Rb_Khamis Kha Km_Jumaat Jum Jm_Sabtu Sab Sb'.split('_'); + + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); + } + }); + + test('from', function (assert) { + var start = moment([2007, 1, 28]); + + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'beberapa saat', '44 saat = beberapa saat'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'seminit', '45 saat = seminit'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'seminit', '89 saat = seminit'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minit', '90 saat = 2 minit'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minit', '44 minit = 44 minit'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'sejam', '45 minit = sejam'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'sejam', '89 minit = sejam'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 jam', '90 minit = 2 jam'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 jam', '5 jam = 5 jam'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 jam', '21 jam = 21 jam'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'sehari', '22 jam = sehari'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'sehari', '35 jam = sehari'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 hari', '36 jam = 2 hari'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'sehari', '1 hari = sehari'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 hari', '5 hari = 5 hari'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 hari', '25 hari = 25 hari'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'sebulan', '26 hari = sebulan'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'sebulan', '30 hari = sebulan'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'sebulan', '45 hari = sebulan'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 bulan', '46 hari = 2 bulan'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 bulan', '75 hari = 2 bulan'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 bulan', '76 hari = 3 bulan'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'sebulan', '1 bulan = sebulan'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 bulan', '5 bulan = 5 bulan'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'setahun', '345 hari = setahun'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 tahun', '548 hari = 2 tahun'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'setahun', '1 tahun = setahun'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 tahun', '5 tahun = 5 tahun'); + }); + + test('suffix', function (assert) { + assert.equal(moment(30000).from(0), 'dalam beberapa saat', 'prefix'); + assert.equal(moment(0).from(30000), 'beberapa saat yang lepas', 'suffix'); + }); + + test('now from now', function (assert) { + assert.equal(moment().fromNow(), 'beberapa saat yang lepas', 'waktu sekarang dari sekarang sepatutnya menunjukkan sebagai telah lepas'); + }); + + test('fromNow', function (assert) { + assert.equal(moment().add({s: 30}).fromNow(), 'dalam beberapa saat', 'dalam beberapa saat'); + assert.equal(moment().add({d: 5}).fromNow(), 'dalam 5 hari', 'dalam 5 hari'); + }); + + test('calendar day', function (assert) { + var a = moment().hours(2).minutes(0).seconds(0); + + assert.equal(moment(a).calendar(), 'Hari ini pukul 02.00', 'hari ini pada waktu yang sama'); + assert.equal(moment(a).add({m: 25}).calendar(), 'Hari ini pukul 02.25', 'Sekarang tambah 25 minit'); + assert.equal(moment(a).add({h: 1}).calendar(), 'Hari ini pukul 03.00', 'Sekarang tambah 1 jam'); + assert.equal(moment(a).add({d: 1}).calendar(), 'Esok pukul 02.00', 'esok pada waktu yang sama'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'Hari ini pukul 01.00', 'Sekarang tolak 1 jam'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'Kelmarin pukul 02.00', 'kelmarin pada waktu yang sama'); + }); + + test('calendar next week', function (assert) { + var i, m; + for (i = 2; i < 7; i++) { + m = moment().add({d: i}); + assert.equal(m.calendar(), m.format('dddd [pukul] LT'), 'Hari ini + ' + i + ' hari waktu sekarang'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format('dddd [pukul] LT'), 'Hari ini + ' + i + ' hari permulaan hari'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format('dddd [pukul] LT'), 'Hari ini + ' + i + ' hari tamat hari'); + } + }); + + test('calendar last week', function (assert) { + var i, m; + for (i = 2; i < 7; i++) { + m = moment().subtract({d: i}); + assert.equal(m.calendar(), m.format('dddd [lepas] [pukul] LT'), 'Hari ini - ' + i + ' hari waktu sekarang'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format('dddd [lepas] [pukul] LT'), 'Hari ini - ' + i + ' hari permulaan hari'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format('dddd [lepas] [pukul] LT'), 'Hari ini - ' + i + ' hari tamat hari'); + } + }); + + test('calendar all else', function (assert) { + var weeksAgo = moment().subtract({w: 1}), + weeksFromNow = moment().add({w: 1}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 minggu lepas'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'dalam 1 minggu'); + + weeksAgo = moment().subtract({w: 2}); + weeksFromNow = moment().add({w: 2}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 minggu lepas'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'dalam 2 minggu'); + }); + + test('weeks year starting sunday', function (assert) { + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 sepatutnya minggu 1'); + assert.equal(moment([2012, 0, 7]).week(), 2, 'Jan 7 2012 sepatutnya minggu 2'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 sepatutnya minggu 2'); + assert.equal(moment([2012, 0, 14]).week(), 3, 'Jan 14 2012 sepatutnya minggu 3'); + assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 sepatutnya minggu 3'); + }); + + test('weeks year starting monday', function (assert) { + assert.equal(moment([2006, 11, 31]).week(), 53, 'Dec 31 2006 sepatutnya minggu 53'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 sepatutnya minggu 1'); + assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 sepatutnya minggu 1'); + assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 sepatutnya minggu 1'); + assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 sepatutnya minggu 2'); + assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 sepatutnya minggu 2'); + }); + + test('weeks year starting tuesday', function (assert) { + assert.equal(moment([2007, 11, 30]).week(), 52, 'Dec 30 2007 sepatutnya minggu 52'); + assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 sepatutnya minggu 1'); + assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 sepatutnya minggu 1'); + assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 sepatutnya minggu 1'); + assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 sepatutnya minggu 2'); + assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 sepatutnya minggu 2'); + }); + + test('weeks year starting wednesday', function (assert) { + assert.equal(moment([2002, 11, 29]).week(), 52, 'Dec 29 2002 sepatutnya minggu 52'); + assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 sepatutnya minggu 1'); + assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 sepatutnya minggu 1'); + assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 sepatutnya minggu 1'); + assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 sepatutnya minggu 2'); + assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 sepatutnya minggu 2'); + }); + + test('weeks year starting thursday', function (assert) { + assert.equal(moment([2008, 11, 28]).week(), 52, 'Dec 28 2008 sepatutnya minggu 52'); + assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 sepatutnya minggu 1'); + assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 sepatutnya minggu 1'); + assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 sepatutnya minggu 1'); + assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 sepatutnya minggu 2'); + assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 sepatutnya minggu 2'); + }); + + test('weeks year starting friday', function (assert) { + assert.equal(moment([2009, 11, 27]).week(), 52, 'Dec 27 2009 sepatutnya minggu 52'); + assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 sepatutnya minggu 1'); + assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 sepatutnya minggu 1'); + assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 sepatutnya minggu 1'); + assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 sepatutnya minggu 2'); + assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 sepatutnya minggu 2'); + }); + + test('weeks year starting saturday', function (assert) { + assert.equal(moment([2010, 11, 26]).week(), 52, 'Dec 26 2010 sepatutnya minggu 52'); + assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 sepatutnya minggu 1'); + assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 sepatutnya minggu 1'); + assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 sepatutnya minggu 2'); + assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 sepatutnya minggu 2'); + }); + + test('weeks year starting sunday format', function (assert) { + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 sepatutnya minggu 1'); + assert.equal(moment([2012, 0, 7]).format('w ww wo'), '2 02 2', 'Jan 7 2012 sepatutnya minggu 2'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 sepatutnya minggu 2'); + assert.equal(moment([2012, 0, 14]).format('w ww wo'), '3 03 3', 'Jan 14 2012 sepatutnya minggu 3'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 sepatutnya minggu 3'); + }); + + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + +})); + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + /*global QUnit:false*/ + + var test = QUnit.test; + + var expect = QUnit.expect; + + function module (name, lifecycle) { + QUnit.module(name, { + setup : function () { + moment.locale('en'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + function localeModule (name, lifecycle) { + QUnit.module('locale:' + name, { + setup : function () { + moment.locale(name); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + moment.locale('en'); + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + localeModule('ms'); + + test('parse', function (assert) { + var i, + tests = 'Januari Jan_Februari Feb_Mac Mac_April Apr_Mei Mei_Jun Jun_Julai Jul_Ogos Ogs_September Sep_Oktober Okt_November Nov_Disember Dis'.split('_'); + + function equalTest(input, mmm, i) { + assert.equal(moment(input, mmm).month(), i, input + ' sepatutnya bulan ' + (i + 1)); + } + + for (i = 0; i < 12; i++) { + tests[i] = tests[i].split(' '); + equalTest(tests[i][0], 'MMM', i); + equalTest(tests[i][1], 'MMM', i); + equalTest(tests[i][0], 'MMMM', i); + equalTest(tests[i][1], 'MMMM', i); + equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); + } + }); + + test('format', function (assert) { + var a = [ + ['dddd, MMMM Do YYYY, h:mm:ss a', 'Ahad, Februari 14 2010, 3:25:50 petang'], + ['ddd, hA', 'Ahd, 3petang'], + ['M Mo MM MMMM MMM', '2 2 02 Februari Feb'], + ['YYYY YY', '2010 10'], + ['D Do DD', '14 14 14'], + ['d do dddd ddd dd', '0 0 Ahad Ahd Ah'], + ['DDD DDDo DDDD', '45 45 045'], + ['w wo ww', '7 7 07'], + ['h hh', '3 03'], + ['H HH', '15 15'], + ['m mm', '25 25'], + ['s ss', '50 50'], + ['a A', 'petang petang'], + ['[hari] [ke] DDDo [tahun] ini', 'hari ke 45 tahun ini'], + ['LTS', '15.25.50'], + ['L', '14/02/2010'], + ['LL', '14 Februari 2010'], + ['LLL', '14 Februari 2010 pukul 15.25'], + ['LLLL', 'Ahad, 14 Februari 2010 pukul 15.25'], + ['l', '14/2/2010'], + ['ll', '14 Feb 2010'], + ['lll', '14 Feb 2010 pukul 15.25'], + ['llll', 'Ahd, 14 Feb 2010 pukul 15.25'] + ], + b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), + i; + + for (i = 0; i < a.length; i++) { + assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); + } + }); + + test('format ordinal', function (assert) { + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10'); + + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20'); + + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30'); + + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31'); + }); + + test('format month', function (assert) { + var i, + expected = 'Januari Jan_Februari Feb_Mac Mac_April Apr_Mei Mei_Jun Jun_Julai Jul_Ogos Ogs_September Sep_Oktober Okt_November Nov_Disember Dis'.split('_'); + + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); + } + }); + + test('format week', function (assert) { + var i, + expected = 'Ahad Ahd Ah_Isnin Isn Is_Selasa Sel Sl_Rabu Rab Rb_Khamis Kha Km_Jumaat Jum Jm_Sabtu Sab Sb'.split('_'); + + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); + } + }); + + test('from', function (assert) { + var start = moment([2007, 1, 28]); + + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'beberapa saat', '44 saat = beberapa saat'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'seminit', '45 saat = seminit'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'seminit', '89 saat = seminit'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minit', '90 saat = 2 minit'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minit', '44 minit = 44 minit'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'sejam', '45 minit = sejam'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'sejam', '89 minit = sejam'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 jam', '90 minit = 2 jam'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 jam', '5 jam = 5 jam'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 jam', '21 jam = 21 jam'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'sehari', '22 jam = sehari'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'sehari', '35 jam = sehari'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 hari', '36 jam = 2 hari'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'sehari', '1 hari = sehari'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 hari', '5 hari = 5 hari'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 hari', '25 hari = 25 hari'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'sebulan', '26 hari = sebulan'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'sebulan', '30 hari = sebulan'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'sebulan', '45 hari = sebulan'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 bulan', '46 hari = 2 bulan'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 bulan', '75 hari = 2 bulan'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 bulan', '76 hari = 3 bulan'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'sebulan', '1 bulan = sebulan'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 bulan', '5 bulan = 5 bulan'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'setahun', '345 hari = setahun'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 tahun', '548 hari = 2 tahun'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'setahun', '1 tahun = setahun'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 tahun', '5 tahun = 5 tahun'); + }); + + test('suffix', function (assert) { + assert.equal(moment(30000).from(0), 'dalam beberapa saat', 'prefix'); + assert.equal(moment(0).from(30000), 'beberapa saat yang lepas', 'suffix'); + }); + + test('now from now', function (assert) { + assert.equal(moment().fromNow(), 'beberapa saat yang lepas', 'waktu sekarang dari sekarang sepatutnya menunjukkan sebagai telah lepas'); + }); + + test('fromNow', function (assert) { + assert.equal(moment().add({s: 30}).fromNow(), 'dalam beberapa saat', 'dalam beberapa saat'); + assert.equal(moment().add({d: 5}).fromNow(), 'dalam 5 hari', 'dalam 5 hari'); + }); + + test('calendar day', function (assert) { + var a = moment().hours(2).minutes(0).seconds(0); + + assert.equal(moment(a).calendar(), 'Hari ini pukul 02.00', 'hari ini pada waktu yang sama'); + assert.equal(moment(a).add({m: 25}).calendar(), 'Hari ini pukul 02.25', 'Sekarang tambah 25 minit'); + assert.equal(moment(a).add({h: 1}).calendar(), 'Hari ini pukul 03.00', 'Sekarang tambah 1 jam'); + assert.equal(moment(a).add({d: 1}).calendar(), 'Esok pukul 02.00', 'esok pada waktu yang sama'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'Hari ini pukul 01.00', 'Sekarang tolak 1 jam'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'Kelmarin pukul 02.00', 'kelmarin pada waktu yang sama'); + }); + + test('calendar next week', function (assert) { + var i, m; + for (i = 2; i < 7; i++) { + m = moment().add({d: i}); + assert.equal(m.calendar(), m.format('dddd [pukul] LT'), 'Hari ini + ' + i + ' hari waktu sekarang'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format('dddd [pukul] LT'), 'Hari ini + ' + i + ' hari permulaan hari'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format('dddd [pukul] LT'), 'Hari ini + ' + i + ' hari tamat hari'); + } + }); + + test('calendar last week', function (assert) { + var i, m; + for (i = 2; i < 7; i++) { + m = moment().subtract({d: i}); + assert.equal(m.calendar(), m.format('dddd [lepas] [pukul] LT'), 'Hari ini - ' + i + ' hari waktu sekarang'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format('dddd [lepas] [pukul] LT'), 'Hari ini - ' + i + ' hari permulaan hari'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format('dddd [lepas] [pukul] LT'), 'Hari ini - ' + i + ' hari tamat hari'); + } + }); + + test('calendar all else', function (assert) { + var weeksAgo = moment().subtract({w: 1}), + weeksFromNow = moment().add({w: 1}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 minggu lepas'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'dalam 1 minggu'); + + weeksAgo = moment().subtract({w: 2}); + weeksFromNow = moment().add({w: 2}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 minggu lepas'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'dalam 2 minggu'); + }); + + test('weeks year starting sunday', function (assert) { + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 sepatutnya minggu 1'); + assert.equal(moment([2012, 0, 7]).week(), 2, 'Jan 7 2012 sepatutnya minggu 2'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 sepatutnya minggu 2'); + assert.equal(moment([2012, 0, 14]).week(), 3, 'Jan 14 2012 sepatutnya minggu 3'); + assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 sepatutnya minggu 3'); + }); + + test('weeks year starting monday', function (assert) { + assert.equal(moment([2006, 11, 31]).week(), 53, 'Dec 31 2006 sepatutnya minggu 53'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 sepatutnya minggu 1'); + assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 sepatutnya minggu 1'); + assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 sepatutnya minggu 1'); + assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 sepatutnya minggu 2'); + assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 sepatutnya minggu 2'); + }); + + test('weeks year starting tuesday', function (assert) { + assert.equal(moment([2007, 11, 30]).week(), 52, 'Dec 30 2007 sepatutnya minggu 52'); + assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 sepatutnya minggu 1'); + assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 sepatutnya minggu 1'); + assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 sepatutnya minggu 1'); + assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 sepatutnya minggu 2'); + assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 sepatutnya minggu 2'); + }); + + test('weeks year starting wednesday', function (assert) { + assert.equal(moment([2002, 11, 29]).week(), 52, 'Dec 29 2002 sepatutnya minggu 52'); + assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 sepatutnya minggu 1'); + assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 sepatutnya minggu 1'); + assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 sepatutnya minggu 1'); + assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 sepatutnya minggu 2'); + assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 sepatutnya minggu 2'); + }); + + test('weeks year starting thursday', function (assert) { + assert.equal(moment([2008, 11, 28]).week(), 52, 'Dec 28 2008 sepatutnya minggu 52'); + assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 sepatutnya minggu 1'); + assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 sepatutnya minggu 1'); + assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 sepatutnya minggu 1'); + assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 sepatutnya minggu 2'); + assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 sepatutnya minggu 2'); + }); + + test('weeks year starting friday', function (assert) { + assert.equal(moment([2009, 11, 27]).week(), 52, 'Dec 27 2009 sepatutnya minggu 52'); + assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 sepatutnya minggu 1'); + assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 sepatutnya minggu 1'); + assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 sepatutnya minggu 1'); + assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 sepatutnya minggu 2'); + assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 sepatutnya minggu 2'); + }); + + test('weeks year starting saturday', function (assert) { + assert.equal(moment([2010, 11, 26]).week(), 52, 'Dec 26 2010 sepatutnya minggu 52'); + assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 sepatutnya minggu 1'); + assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 sepatutnya minggu 1'); + assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 sepatutnya minggu 2'); + assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 sepatutnya minggu 2'); + }); + + test('weeks year starting sunday format', function (assert) { + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 sepatutnya minggu 1'); + assert.equal(moment([2012, 0, 7]).format('w ww wo'), '2 02 2', 'Jan 7 2012 sepatutnya minggu 2'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 sepatutnya minggu 2'); + assert.equal(moment([2012, 0, 14]).format('w ww wo'), '3 03 3', 'Jan 14 2012 sepatutnya minggu 3'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 sepatutnya minggu 3'); + }); + + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + +})); + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + /*global QUnit:false*/ + + var test = QUnit.test; + + var expect = QUnit.expect; + + function module (name, lifecycle) { + QUnit.module(name, { + setup : function () { + moment.locale('en'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + function localeModule (name, lifecycle) { + QUnit.module('locale:' + name, { + setup : function () { + moment.locale(name); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + moment.locale('en'); + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + localeModule('my'); + + test('parse', function (assert) { + var tests = 'ဇန်နဝါရီ ဇန်_ဖေဖော်ဝါရီ ဖေ_မတ် မတ်_ဧပြီ ပြီ_မေ မေ_ဇွန် ဇွန်_ဇူလိုင် လိုင်_သြဂုတ် သြ_စက်တင်ဘာ စက်_အောက်တိုဘာ အောက်_နိုဝင်ဘာ နို_ဒီဇင်ဘာ ဒီ'.split('_'), + i; + + function equalTest (input, mmm, i) { + assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); + } + for (i = 0; i < 12; i++) { + tests[i] = tests[i].split(' '); + equalTest(tests[i][0], 'MMM', i); + equalTest(tests[i][1], 'MMM', i); + equalTest(tests[i][0], 'MMMM', i); + equalTest(tests[i][1], 'MMMM', i); + equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); + } + }); + + test('format', function (assert) { + var a = [ + ['dddd, MMMM Do YYYY, h:mm:ss a', 'တနင်္ဂနွေ, ဖေဖော်ဝါရီ ၁၄ ၂၀၁၀, ၃:၂၅:၅၀ pm'], + ['ddd, hA', 'နွေ, ၃PM'], + ['M Mo MM MMMM MMM', '၂ ၂ ၀၂ ဖေဖော်ဝါရီ ဖေ'], + ['YYYY YY', '၂၀၁၀ ၁၀'], + ['D Do DD', '၁၄ ၁၄ ၁၄'], + ['d do dddd ddd dd', '၀ ၀ တနင်္ဂနွေ နွေ နွေ'], + ['DDD DDDo DDDD', '၄၅ ၄၅ ၀၄၅'], + ['w wo ww', '၆ ၆ ၀၆'], + ['h hh', '၃ ၀၃'], + ['H HH', '၁၅ ၁၅'], + ['m mm', '၂၅ ၂၅'], + ['s ss', '၅၀ ၅၀'], + ['a A', 'pm PM'], + ['[နှစ်၏] DDDo [ရက်မြောက်]', 'နှစ်၏ ၄၅ ရက်မြောက်'], + ['LTS', '၁၅:၂၅:၅၀'], + ['L', '၁၄/၀၂/၂၀၁၀'], + ['LL', '၁၄ ဖေဖော်ဝါရီ ၂၀၁၀'], + ['LLL', '၁၄ ဖေဖော်ဝါရီ ၂၀၁၀ ၁၅:၂၅'], + ['LLLL', 'တနင်္ဂနွေ ၁၄ ဖေဖော်ဝါရီ ၂၀၁၀ ၁၅:၂၅'], + ['l', '၁၄/၂/၂၀၁၀'], + ['ll', '၁၄ ဖေ ၂၀၁၀'], + ['lll', '၁၄ ဖေ ၂၀၁၀ ၁၅:၂၅'], + ['llll', 'နွေ ၁၄ ဖေ ၂၀၁၀ ၁၅:၂၅'] + ], + b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), + i; + for (i = 0; i < a.length; i++) { + assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); + } + }); + + test('format ordinal', function (assert) { + assert.equal(moment([2011, 0, 1]).format('DDDo'), '၁', '၁'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '၂', '၂'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '၃', '၃'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '၄', '၄'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '၅', '၅'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '၆', '၆'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '၇', '၇'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '၈', '၈'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '၉', '၉'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '၁၀', '၁၀'); + + assert.equal(moment([2011, 0, 11]).format('DDDo'), '၁၁', '၁၁'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '၁၂', '၁၂'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '၁၃', '၁၃'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '၁၄', '၁၄'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '၁၅', '၁၅'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '၁၆', '၁၆'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '၁၇', '၁၇'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '၁၈', '၁၈'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '၁၉', '၁၉'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '၂၀', '၂၀'); + + assert.equal(moment([2011, 0, 21]).format('DDDo'), '၂၁', '၂၁'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '၂၂', '၂၂'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '၂၃', '၂၃'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '၂၄', '၂၄'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '၂၅', '၂၅'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '၂၆', '၂၆'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '၂၇', '၂၇'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '၂၈', '၂၈'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '၂၉', '၂၉'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '၃၀', '၃၀'); + + assert.equal(moment([2011, 0, 31]).format('DDDo'), '၃၁', '၃၁'); + }); + + test('format month', function (assert) { + var expected = 'ဇန်နဝါရီ ဇန်_ဖေဖော်ဝါရီ ဖေ_မတ် မတ်_ဧပြီ ပြီ_မေ မေ_ဇွန် ဇွန်_ဇူလိုင် လိုင်_သြဂုတ် သြ_စက်တင်ဘာ စက်_အောက်တိုဘာ အောက်_နိုဝင်ဘာ နို_ဒီဇင်ဘာ ဒီ'.split('_'), + i; + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); + } + }); + + test('format week', function (assert) { + var expected = 'တနင်္ဂနွေ နွေ နွေ_တနင်္လာ လာ လာ_အင်္ဂါ ဂါ ဂါ_ဗုဒ္ဓဟူး ဟူး ဟူး_ကြာသပတေး ကြာ ကြာ_သောကြာ သော သော_စနေ နေ နေ'.split('_'), + i; + + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); + } + }); + + test('from', function (assert) { + var start = moment([2007, 1, 28]); + assert.equal(start.from(moment([2007, 1, 28]).add({ + s: 44 + }), true), 'စက္ကန်.အနည်းငယ်', '၄၄ စက္ကန်. = စက္ကန်.အနည်းငယ်'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + s: 45 + }), true), 'တစ်မိနစ်', '၄၅ စက္ကန်. = တစ်မိနစ်'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + s: 89 + }), true), 'တစ်မိနစ်', '၈၉ စက္ကန်. = တစ်မိနစ်'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + s: 90 + }), true), '၂ မိနစ်', '၉၀ စက္ကန်. = ၂ မိနစ်'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + m: 44 + }), true), '၄၄ မိနစ်', '၄၄ မိနစ် = ၄၄ မိနစ်'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + m: 45 + }), true), 'တစ်နာရီ', '၄၅ မိနစ် = ၁ နာရီ'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + m: 89 + }), true), 'တစ်နာရီ', '၈၉ မိနစ် = တစ်နာရီ'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + m: 90 + }), true), '၂ နာရီ', 'မိနစ် ၉၀= ၂ နာရီ'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + h: 5 + }), true), '၅ နာရီ', '၅ နာရီ= ၅ နာရီ'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + h: 21 + }), true), '၂၁ နာရီ', '၂၁ နာရီ =၂၁ နာရီ'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + h: 22 + }), true), 'တစ်ရက်', '၂၂ နာရီ =တစ်ရက်'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + h: 35 + }), true), 'တစ်ရက်', '၃၅ နာရီ =တစ်ရက်'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + h: 36 + }), true), '၂ ရက်', '၃၆ နာရီ = ၂ ရက်'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + d: 1 + }), true), 'တစ်ရက်', '၁ ရက်= တစ်ရက်'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + d: 5 + }), true), '၅ ရက်', '၅ ရက် = ၅ ရက်'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + d: 25 + }), true), '၂၅ ရက်', '၂၅ ရက်= ၂၅ ရက်'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + d: 26 + }), true), 'တစ်လ', '၂၆ ရက် = တစ်လ'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + d: 30 + }), true), 'တစ်လ', 'ရက် ၃၀ = တစ်လ'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + d: 43 + }), true), 'တစ်လ', '၄၃ ရက် = တစ်လ'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + d: 46 + }), true), '၂ လ', '၄၆ ရက် = ၂ လ'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + d: 74 + }), true), '၂ လ', '၇၅ ရက်= ၂ လ'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + d: 76 + }), true), '၃ လ', '၇၆ ရက် = ၃ လ'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + M: 1 + }), true), 'တစ်လ', '၁ လ = တစ်လ'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + M: 5 + }), true), '၅ လ', '၅ လ = ၅ လ'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + d: 345 + }), true), 'တစ်နှစ်', '၃၄၅ ရက် = တစ်နှစ်'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + d: 548 + }), true), '၂ နှစ်', '၅၄၈ ရက် = ၂ နှစ်'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + y: 1 + }), true), 'တစ်နှစ်', '၁ နှစ် = တစ်နှစ်'); + assert.equal(start.from(moment([2007, 1, 28]).add({ + y: 5 + }), true), '၅ နှစ်', '၅ နှစ် = ၅ နှစ်'); + }); + + test('suffix', function (assert) { + assert.equal(moment(30000).from(0), 'လာမည့် စက္ကန်.အနည်းငယ် မှာ', 'prefix'); + assert.equal(moment(0).from(30000), 'လွန်ခဲ့သော စက္ကန်.အနည်းငယ် က', 'suffix'); + }); + + test('now from now', function (assert) { + assert.equal(moment().fromNow(), 'လွန်ခဲ့သော စက္ကန်.အနည်းငယ် က', 'ယခုမှစပြီး အတိတ်တွင်ဖော်ပြသလိုဖော်ပြမည်'); + }); + + test('fromNow', function (assert) { + assert.equal(moment().add({ + s: 30 + }).fromNow(), 'လာမည့် စက္ကန်.အနည်းငယ် မှာ', 'လာမည့် စက္ကန်.အနည်းငယ် မှာ'); + assert.equal(moment().add({ + d: 5 + }).fromNow(), 'လာမည့် ၅ ရက် မှာ', 'လာမည့် ၅ ရက် မှာ'); + }); + + test('calendar day', function (assert) { + var a = moment().hours(2).minutes(0).seconds(0); + + assert.equal(moment(a).calendar(), 'ယနေ. ၀၂:၀၀ မှာ', 'ယနေ. ဒီအချိန်'); + assert.equal(moment(a).add({ + m: 25 + }).calendar(), 'ယနေ. ၀၂:၂၅ မှာ', 'ယခုမှ ၂၅ မိနစ်ပေါင်းထည့်'); + assert.equal(moment(a).add({ + h: 1 + }).calendar(), 'ယနေ. ၀၃:၀၀ မှာ', 'ယခုမှ ၁ နာရီပေါင်းထည့်'); + assert.equal(moment(a).add({ + d: 1 + }).calendar(), 'မနက်ဖြန် ၀၂:၀၀ မှာ', 'မနက်ဖြန် ဒီအချိန်'); + assert.equal(moment(a).subtract({ + h: 1 + }).calendar(), 'ယနေ. ၀၁:၀၀ မှာ', 'ယခုမှ ၁ နာရီနှုတ်'); + assert.equal(moment(a).subtract({ + d: 1 + }).calendar(), 'မနေ.က ၀၂:၀၀ မှာ', 'မနေ.က ဒီအချိန်'); + }); + + test('calendar next week', function (assert) { + var i, m; + for (i = 2; i < 7; i++) { + m = moment().add({ + d: i + }); + assert.equal(m.calendar(), m.format('dddd LT [မှာ]'), 'Today + ' + i + ' days current time'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format('dddd LT [မှာ]'), 'Today + ' + i + ' days beginning of day'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format('dddd LT [မှာ]'), 'Today + ' + i + ' days end of day'); + } + }); + + test('calendar last week', function (assert) { + var i, m; + + for (i = 2; i < 7; i++) { + m = moment().subtract({ + d: i + }); + assert.equal(m.calendar(), m.format('[ပြီးခဲ့သော] dddd LT [မှာ]'), 'Today - ' + i + ' days current time'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format('[ပြီးခဲ့သော] dddd LT [မှာ]'), 'Today - ' + i + ' days beginning of day'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format('[ပြီးခဲ့သော] dddd LT [မှာ]'), 'Today - ' + i + ' days end of day'); + } + }); + + test('calendar all else', function (assert) { + var weeksAgo = moment().subtract({ + w: 1 + }), + weeksFromNow = moment().add({ + w: 1 + }); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), 'လွန်ခဲ့သော ၁ ပတ်က'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), '၁ ပတ်အတွင်း'); + + weeksAgo = moment().subtract({ + w: 2 + }); + weeksFromNow = moment().add({ + w: 2 + }); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '၂ ပတ် အရင်က'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), '၂ ပတ် အတွင်း'); + }); + + test('weeks year starting sunday', function (assert) { + assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); + }); + + test('weeks year starting monday', function (assert) { + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); + assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); + assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); + }); + + test('weeks year starting tuesday', function (assert) { + assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); + assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); + assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); + assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); + assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); + }); + + test('weeks year starting wednesday', function (assert) { + assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); + assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); + assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); + assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); + assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); + }); + + test('weeks year starting thursday', function (assert) { + assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); + assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); + assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); + assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); + assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); + }); + + test('weeks year starting friday', function (assert) { + assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); + assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); + assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); + assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); + assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); + assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); + }); + + test('weeks year starting saturday', function (assert) { + assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); + assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); + assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); + assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); + assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); + assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); + }); + + test('weeks year starting sunday formatted', function (assert) { + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '၅၂ ၅၂ ၅၂', 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '၁ ၀၁ ၁', 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '၁ ၀၁ ၁', 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '၂ ၀၂ ၂', 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '၂ ၀၂ ၂', 'Jan 15 2012 should be week 2'); + }); + + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + +})); + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + /*global QUnit:false*/ + + var test = QUnit.test; + + var expect = QUnit.expect; + + function module (name, lifecycle) { + QUnit.module(name, { + setup : function () { + moment.locale('en'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + function localeModule (name, lifecycle) { + QUnit.module('locale:' + name, { + setup : function () { + moment.locale(name); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + moment.locale('en'); + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + localeModule('nb'); + + test('parse', function (assert) { + var tests = 'januar jan._februar feb._mars mars_april april_mai mai_juni juni_juli juli_august aug._september sep._oktober okt._november nov._desember des.'.split('_'), + i; + function equalTest(input, mmm, i) { + assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); + } + for (i = 0; i < 12; i++) { + tests[i] = tests[i].split(' '); + equalTest(tests[i][0], 'MMM', i); + equalTest(tests[i][1], 'MMM', i); + equalTest(tests[i][0], 'MMMM', i); + equalTest(tests[i][1], 'MMMM', i); + equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); + } + }); + + test('format', function (assert) { + var a = [ + ['dddd, MMMM Do YYYY, h:mm:ss a', 'søndag, februar 14. 2010, 3:25:50 pm'], + ['ddd, hA', 'sø., 3PM'], + ['M Mo MM MMMM MMM', '2 2. 02 februar feb.'], + ['YYYY YY', '2010 10'], + ['D Do DD', '14 14. 14'], + ['d do dddd ddd dd', '0 0. søndag sø. sø'], + ['DDD DDDo DDDD', '45 45. 045'], + ['w wo ww', '6 6. 06'], + ['h hh', '3 03'], + ['H HH', '15 15'], + ['m mm', '25 25'], + ['s ss', '50 50'], + ['a A', 'pm PM'], + ['[den] DDDo [dagen i året]', 'den 45. dagen i året'], + ['LTS', '15:25:50'], + ['L', '14.02.2010'], + ['LL', '14. februar 2010'], + ['LLL', '14. februar 2010 kl. 15:25'], + ['LLLL', 'søndag 14. februar 2010 kl. 15:25'], + ['l', '14.2.2010'], + ['ll', '14. feb. 2010'], + ['lll', '14. feb. 2010 kl. 15:25'], + ['llll', 'sø. 14. feb. 2010 kl. 15:25'] + ], + b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), + i; + for (i = 0; i < a.length; i++) { + assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); + } + }); + + test('format ordinal', function (assert) { + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); + + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); + + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); + + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); + }); + + test('format month', function (assert) { + var expected = 'januar jan._februar feb._mars mars_april april_mai mai_juni juni_juli juli_august aug._september sep._oktober okt._november nov._desember des.'.split('_'), i; + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); + } + }); + test('format week', function (assert) { + var expected = 'søndag sø. sø_mandag ma. ma_tirsdag ti. ti_onsdag on. on_torsdag to. to_fredag fr. fr_lørdag lø. lø'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -20503,71 +23841,70 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'beberapa saat', '44 saat = beberapa saat'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'seminit', '45 saat = seminit'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'seminit', '89 saat = seminit'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minit', '90 saat = 2 minit'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minit', '44 minit = 44 minit'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'sejam', '45 minit = sejam'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'sejam', '89 minit = sejam'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 jam', '90 minit = 2 jam'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 jam', '5 jam = 5 jam'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 jam', '21 jam = 21 jam'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'sehari', '22 jam = sehari'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'sehari', '35 jam = sehari'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 hari', '36 jam = 2 hari'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'sehari', '1 hari = sehari'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 hari', '5 hari = 5 hari'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 hari', '25 hari = 25 hari'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'sebulan', '26 hari = sebulan'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'sebulan', '30 hari = sebulan'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'sebulan', '45 hari = sebulan'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 bulan', '46 hari = 2 bulan'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 bulan', '75 hari = 2 bulan'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 bulan', '76 hari = 3 bulan'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'sebulan', '1 bulan = sebulan'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 bulan', '5 bulan = 5 bulan'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'setahun', '345 hari = setahun'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 tahun', '548 hari = 2 tahun'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'setahun', '1 tahun = setahun'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 tahun', '5 tahun = 5 tahun'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'noen sekunder', '44 sekunder = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'ett minutt', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'ett minutt', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutter', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutter', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'en time', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'en time', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 timer', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 timer', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 timer', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'en dag', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'en dag', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dager', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'en dag', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dager', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dager', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'en måned', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'en måned', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'en måned', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 måneder', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 måneder', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 måneder', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'en måned', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 måneder', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ett år', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 år', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'ett år', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 år', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'dalam beberapa saat', 'prefix'); - assert.equal(moment(0).from(30000), 'beberapa saat yang lepas', 'suffix'); + assert.equal(moment(30000).from(0), 'om noen sekunder', 'prefix'); + assert.equal(moment(0).from(30000), 'for noen sekunder siden', 'suffix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'beberapa saat yang lepas', 'waktu sekarang dari sekarang sepatutnya menunjukkan sebagai telah lepas'); + assert.equal(moment().fromNow(), 'for noen sekunder siden', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'dalam beberapa saat', 'dalam beberapa saat'); - assert.equal(moment().add({d: 5}).fromNow(), 'dalam 5 hari', 'dalam 5 hari'); + assert.equal(moment().add({s: 30}).fromNow(), 'om noen sekunder', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'om 5 dager', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'Hari ini pukul 02.00', 'hari ini pada waktu yang sama'); - assert.equal(moment(a).add({m: 25}).calendar(), 'Hari ini pukul 02.25', 'Sekarang tambah 25 minit'); - assert.equal(moment(a).add({h: 1}).calendar(), 'Hari ini pukul 03.00', 'Sekarang tambah 1 jam'); - assert.equal(moment(a).add({d: 1}).calendar(), 'Esok pukul 02.00', 'esok pada waktu yang sama'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'Hari ini pukul 01.00', 'Sekarang tolak 1 jam'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'Kelmarin pukul 02.00', 'kelmarin pada waktu yang sama'); + assert.equal(moment(a).calendar(), 'i dag kl. 02:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'i dag kl. 02:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'i dag kl. 03:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'i morgen kl. 02:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'i dag kl. 01:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'i går kl. 02:00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd [pukul] LT'), 'Hari ini + ' + i + ' hari waktu sekarang'); + assert.equal(m.calendar(), m.format('dddd [kl.] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [pukul] LT'), 'Hari ini + ' + i + ' hari permulaan hari'); + assert.equal(m.calendar(), m.format('dddd [kl.] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [pukul] LT'), 'Hari ini + ' + i + ' hari tamat hari'); + assert.equal(m.calendar(), m.format('dddd [kl.] LT'), 'Today + ' + i + ' days end of day'); } }); @@ -20575,11 +23912,11 @@ var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('dddd [lepas] [pukul] LT'), 'Hari ini - ' + i + ' hari waktu sekarang'); + assert.equal(m.calendar(), m.format('[forrige] dddd [kl.] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [lepas] [pukul] LT'), 'Hari ini - ' + i + ' hari permulaan hari'); + assert.equal(m.calendar(), m.format('[forrige] dddd [kl.] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [lepas] [pukul] LT'), 'Hari ini - ' + i + ' hari tamat hari'); + assert.equal(m.calendar(), m.format('[forrige] dddd [kl.] LT'), 'Today - ' + i + ' days end of day'); } }); @@ -20587,83 +23924,83 @@ var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 minggu lepas'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'dalam 1 minggu'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); weeksAgo = moment().subtract({w: 2}); weeksFromNow = moment().add({w: 2}); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 minggu lepas'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'dalam 2 minggu'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 sepatutnya minggu 1'); - assert.equal(moment([2012, 0, 7]).week(), 2, 'Jan 7 2012 sepatutnya minggu 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 sepatutnya minggu 2'); - assert.equal(moment([2012, 0, 14]).week(), 3, 'Jan 14 2012 sepatutnya minggu 3'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 sepatutnya minggu 3'); + assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 53, 'Dec 31 2006 sepatutnya minggu 53'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 sepatutnya minggu 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 sepatutnya minggu 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 sepatutnya minggu 1'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 sepatutnya minggu 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 sepatutnya minggu 2'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); + assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); + assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 30]).week(), 52, 'Dec 30 2007 sepatutnya minggu 52'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 sepatutnya minggu 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 sepatutnya minggu 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 sepatutnya minggu 1'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 sepatutnya minggu 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 sepatutnya minggu 2'); + assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); + assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); + assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); + assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); + assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 52, 'Dec 29 2002 sepatutnya minggu 52'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 sepatutnya minggu 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 sepatutnya minggu 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 sepatutnya minggu 1'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 sepatutnya minggu 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 sepatutnya minggu 2'); + assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); + assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); + assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); + assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); + assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 52, 'Dec 28 2008 sepatutnya minggu 52'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 sepatutnya minggu 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 sepatutnya minggu 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 sepatutnya minggu 1'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 sepatutnya minggu 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 sepatutnya minggu 2'); + assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); + assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); + assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); + assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); + assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 52, 'Dec 27 2009 sepatutnya minggu 52'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 sepatutnya minggu 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 sepatutnya minggu 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 sepatutnya minggu 1'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 sepatutnya minggu 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 sepatutnya minggu 2'); + assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); + assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); + assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); + assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); + assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); + assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 52, 'Dec 26 2010 sepatutnya minggu 52'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 sepatutnya minggu 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 sepatutnya minggu 1'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 sepatutnya minggu 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 sepatutnya minggu 2'); + assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); + assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); + assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); + assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); + assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); + assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); - test('weeks year starting sunday format', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 sepatutnya minggu 1'); - assert.equal(moment([2012, 0, 7]).format('w ww wo'), '2 02 2', 'Jan 7 2012 sepatutnya minggu 2'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 sepatutnya minggu 2'); - assert.equal(moment([2012, 0, 14]).format('w ww wo'), '3 03 3', 'Jan 14 2012 sepatutnya minggu 3'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 sepatutnya minggu 3'); + test('weeks year starting sunday formatted', function (assert) { + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); test('lenient ordinal parsing', function (assert) { @@ -20680,18 +24017,6 @@ } }); - test('meridiem invariant', function (assert) { - var h, m, t1, t2; - for (h = 0; h < 24; ++h) { - for (m = 0; m < 60; m += 15) { - t1 = moment.utc([2000, 0, 1, h, m]); - t2 = moment(t1.format('A h:mm'), 'A h:mm'); - assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), - 'meridiem at ' + t1.format('HH:mm')); - } - } - }); - test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { @@ -20716,8 +24041,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -20726,12 +24052,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -20749,8 +24077,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -20765,13 +24093,11 @@ }); } - localeModule('my'); + localeModule('ne'); test('parse', function (assert) { - var tests = 'ဇန်နဝါရီ ဇန်_ဖေဖော်ဝါရီ ဖေ_မတ် မတ်_ဧပြီ ပြီ_မေ မေ_ဇွန် ဇွန်_ဇူလိုင် လိုင်_သြဂုတ် သြ_စက်တင်ဘာ စက်_အောက်တိုဘာ အောက်_နိုဝင်ဘာ နို_ဒီဇင်ဘာ ဒီ'.split('_'), - i; - - function equalTest (input, mmm, i) { + var tests = 'जनवरी जन._फेब्रुवरी फेब्रु._मार्च मार्च_अप्रिल अप्रि._मई मई_जुन जुन_जुलाई जुलाई._अगष्ट अग._सेप्टेम्बर सेप्ट._अक्टोबर अक्टो._नोभेम्बर नोभे._डिसेम्बर डिसे.'.split('_'), i; + function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } for (i = 0; i < 12; i++) { @@ -20789,29 +24115,28 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss a', 'တနင်္ဂနွေ, ဖေဖော်ဝါရီ ၁၄ ၂၀၁၀, ၃:၂၅:၅၀ pm'], - ['ddd, hA', 'နွေ, ၃PM'], - ['M Mo MM MMMM MMM', '၂ ၂ ၀၂ ဖေဖော်ဝါရီ ဖေ'], - ['YYYY YY', '၂၀၁၀ ၁၀'], - ['D Do DD', '၁၄ ၁၄ ၁၄'], - ['d do dddd ddd dd', '၀ ၀ တနင်္ဂနွေ နွေ နွေ'], - ['DDD DDDo DDDD', '၄၅ ၄၅ ၀၄၅'], - ['w wo ww', '၆ ၆ ၀၆'], - ['h hh', '၃ ၀၃'], - ['H HH', '၁၅ ၁၅'], - ['m mm', '၂၅ ၂၅'], - ['s ss', '၅၀ ၅၀'], - ['a A', 'pm PM'], - ['[နှစ်၏] DDDo [ရက်မြောက်]', 'နှစ်၏ ၄၅ ရက်မြောက်'], - ['LTS', '၁၅:၂၅:၅၀'], - ['L', '၁၄/၀၂/၂၀၁၀'], - ['LL', '၁၄ ဖေဖော်ဝါရီ ၂၀၁၀'], - ['LLL', '၁၄ ဖေဖော်ဝါရီ ၂၀၁၀ ၁၅:၂၅'], - ['LLLL', 'တနင်္ဂနွေ ၁၄ ဖေဖော်ဝါရီ ၂၀၁၀ ၁၅:၂၅'], - ['l', '၁၄/၂/၂၀၁၀'], - ['ll', '၁၄ ဖေ ၂၀၁၀'], - ['lll', '၁၄ ဖေ ၂၀၁၀ ၁၅:၂၅'], - ['llll', 'နွေ ၁၄ ဖေ ၂၀၁၀ ၁၅:၂၅'] + ['dddd, Do MMMM YYYY, aको h:mm:ss बजे', 'आइतबार, १४ फेब्रुवरी २०१०, दिउँसोको ३:२५:५० बजे'], + ['ddd, aको h बजे', 'आइत., दिउँसोको ३ बजे'], + ['M Mo MM MMMM MMM', '२ २ ०२ फेब्रुवरी फेब्रु.'], + ['YYYY YY', '२०१० १०'], + ['D Do DD', '१४ १४ १४'], + ['d do dddd ddd dd', '० ० आइतबार आइत. आ.'], + ['DDD DDDo DDDD', '४५ ४५ ०४५'], + ['w wo ww', '८ ८ ०८'], + ['h hh', '३ ०३'], + ['H HH', '१५ १५'], + ['m mm', '२५ २५'], + ['s ss', '५० ५०'], + ['a A', 'दिउँसो दिउँसो'], + ['LTS', 'दिउँसोको ३:२५:५० बजे'], + ['L', '१४/०२/२०१०'], + ['LL', '१४ फेब्रुवरी २०१०'], + ['LLL', '१४ फेब्रुवरी २०१०, दिउँसोको ३:२५ बजे'], + ['LLLL', 'आइतबार, १४ फेब्रुवरी २०१०, दिउँसोको ३:२५ बजे'], + ['l', '१४/२/२०१०'], + ['ll', '१४ फेब्रु. २०१०'], + ['lll', '१४ फेब्रु. २०१०, दिउँसोको ३:२५ बजे'], + ['llll', 'आइत., १४ फेब्रु. २०१०, दिउँसोको ३:२५ बजे'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -20821,54 +24146,51 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '၁', '၁'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '၂', '၂'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '၃', '၃'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '၄', '၄'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '၅', '၅'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '၆', '၆'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '၇', '၇'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '၈', '၈'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '၉', '၉'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '၁၀', '၁၀'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '१', '१'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '२', '२'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '३', '३'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '४', '४'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '५', '५'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '६', '६'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '७', '७'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '८', '८'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '९', '९'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '१०', '१०'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '၁၁', '၁၁'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '၁၂', '၁၂'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '၁၃', '၁၃'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '၁၄', '၁၄'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '၁၅', '၁၅'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '၁၆', '၁၆'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '၁၇', '၁၇'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '၁၈', '၁၈'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '၁၉', '၁၉'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '၂၀', '၂၀'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '११', '११'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '१२', '१२'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '१३', '१३'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '१४', '१४'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '१५', '१५'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '१६', '१६'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '१७', '१७'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '१८', '१८'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '१९', '१९'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '२०', '२०'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '၂၁', '၂၁'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '၂၂', '၂၂'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '၂၃', '၂၃'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '၂၄', '၂၄'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '၂၅', '၂၅'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '၂၆', '၂၆'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '၂၇', '၂၇'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '၂၈', '၂၈'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '၂၉', '၂၉'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '၃၀', '၃၀'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '२१', '२१'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '२२', '२२'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '२३', '२३'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '२४', '२४'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '२५', '२५'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '२६', '२६'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '२७', '२७'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '२८', '२८'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '२९', '२९'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '३०', '३०'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '၃၁', '၃၁'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '३१', '३१'); }); test('format month', function (assert) { - var expected = 'ဇန်နဝါရီ ဇန်_ဖေဖော်ဝါရီ ဖေ_မတ် မတ်_ဧပြီ ပြီ_မေ မေ_ဇွန် ဇွန်_ဇူလိုင် လိုင်_သြဂုတ် သြ_စက်တင်ဘာ စက်_အောက်တိုဘာ အောက်_နိုဝင်ဘာ နို_ဒီဇင်ဘာ ဒီ'.split('_'), - i; + var expected = 'जनवरी जन._फेब्रुवरी फेब्रु._मार्च मार्च_अप्रिल अप्रि._मई मई_जुन जुन_जुलाई जुलाई._अगष्ट अग._सेप्टेम्बर सेप्ट._अक्टोबर अक्टो._नोभेम्बर नोभे._डिसेम्बर डिसे.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'တနင်္ဂနွေ နွေ နွေ_တနင်္လာ လာ လာ_အင်္ဂါ ဂါ ဂါ_ဗုဒ္ဓဟူး ဟူး ဟူး_ကြာသပတေး ကြာ ကြာ_သောကြာ သော သော_စနေ နေ နေ'.split('_'), - i; - + var expected = 'आइतबार आइत. आ._सोमबार सोम. सो._मङ्गलबार मङ्गल. मं._बुधबार बुध. बु._बिहिबार बिहि. बि._शुक्रबार शुक्र. शु._शनिबार शनि. श.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -20876,249 +24198,183 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({ - s: 44 - }), true), 'စက္ကန်.အနည်းငယ်', '၄၄ စက္ကန်. = စက္ကန်.အနည်းငယ်'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - s: 45 - }), true), 'တစ်မိနစ်', '၄၅ စက္ကန်. = တစ်မိနစ်'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - s: 89 - }), true), 'တစ်မိနစ်', '၈၉ စက္ကန်. = တစ်မိနစ်'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - s: 90 - }), true), '၂ မိနစ်', '၉၀ စက္ကန်. = ၂ မိနစ်'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - m: 44 - }), true), '၄၄ မိနစ်', '၄၄ မိနစ် = ၄၄ မိနစ်'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - m: 45 - }), true), 'တစ်နာရီ', '၄၅ မိနစ် = ၁ နာရီ'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - m: 89 - }), true), 'တစ်နာရီ', '၈၉ မိနစ် = တစ်နာရီ'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - m: 90 - }), true), '၂ နာရီ', 'မိနစ် ၉၀= ၂ နာရီ'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - h: 5 - }), true), '၅ နာရီ', '၅ နာရီ= ၅ နာရီ'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - h: 21 - }), true), '၂၁ နာရီ', '၂၁ နာရီ =၂၁ နာရီ'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - h: 22 - }), true), 'တစ်ရက်', '၂၂ နာရီ =တစ်ရက်'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - h: 35 - }), true), 'တစ်ရက်', '၃၅ နာရီ =တစ်ရက်'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - h: 36 - }), true), '၂ ရက်', '၃၆ နာရီ = ၂ ရက်'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - d: 1 - }), true), 'တစ်ရက်', '၁ ရက်= တစ်ရက်'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - d: 5 - }), true), '၅ ရက်', '၅ ရက် = ၅ ရက်'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - d: 25 - }), true), '၂၅ ရက်', '၂၅ ရက်= ၂၅ ရက်'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - d: 26 - }), true), 'တစ်လ', '၂၆ ရက် = တစ်လ'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - d: 30 - }), true), 'တစ်လ', 'ရက် ၃၀ = တစ်လ'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - d: 43 - }), true), 'တစ်လ', '၄၃ ရက် = တစ်လ'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - d: 46 - }), true), '၂ လ', '၄၆ ရက် = ၂ လ'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - d: 74 - }), true), '၂ လ', '၇၅ ရက်= ၂ လ'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - d: 76 - }), true), '၃ လ', '၇၆ ရက် = ၃ လ'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - M: 1 - }), true), 'တစ်လ', '၁ လ = တစ်လ'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - M: 5 - }), true), '၅ လ', '၅ လ = ၅ လ'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - d: 345 - }), true), 'တစ်နှစ်', '၃၄၅ ရက် = တစ်နှစ်'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - d: 548 - }), true), '၂ နှစ်', '၅၄၈ ရက် = ၂ နှစ်'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - y: 1 - }), true), 'တစ်နှစ်', '၁ နှစ် = တစ်နှစ်'); - assert.equal(start.from(moment([2007, 1, 28]).add({ - y: 5 - }), true), '၅ နှစ်', '၅ နှစ် = ၅ နှစ်'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'केही क्षण', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'एक मिनेट', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'एक मिनेट', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '२ मिनेट', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '४४ मिनेट', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'एक घण्टा', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'एक घण्टा', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '२ घण्टा', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '५ घण्टा', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '२१ घण्टा', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'एक दिन', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'एक दिन', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '२ दिन', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'एक दिन', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '५ दिन', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '२५ दिन', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'एक महिना', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'एक महिना', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'एक महिना', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '२ महिना', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '२ महिना', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '३ महिना', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'एक महिना', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '५ महिना', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'एक बर्ष', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '२ बर्ष', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'एक बर्ष', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '५ बर्ष', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'လာမည့် စက္ကန်.အနည်းငယ် မှာ', 'prefix'); - assert.equal(moment(0).from(30000), 'လွန်ခဲ့သော စက္ကန်.အနည်းငယ် က', 'suffix'); + assert.equal(moment(30000).from(0), 'केही क्षणमा', 'prefix'); + assert.equal(moment(0).from(30000), 'केही क्षण अगाडि', 'suffix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'လွန်ခဲ့သော စက္ကန်.အနည်းငယ် က', 'ယခုမှစပြီး အတိတ်တွင်ဖော်ပြသလိုဖော်ပြမည်'); + assert.equal(moment().fromNow(), 'केही क्षण अगाडि', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({ - s: 30 - }).fromNow(), 'လာမည့် စက္ကန်.အနည်းငယ် မှာ', 'လာမည့် စက္ကန်.အနည်းငယ် မှာ'); - assert.equal(moment().add({ - d: 5 - }).fromNow(), 'လာမည့် ၅ ရက် မှာ', 'လာမည့် ၅ ရက် မှာ'); + assert.equal(moment().add({s: 30}).fromNow(), 'केही क्षणमा', 'केही क्षणमा'); + assert.equal(moment().add({d: 5}).fromNow(), '५ दिनमा', '५ दिनमा'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'ယနေ. ၀၂:၀၀ မှာ', 'ယနေ. ဒီအချိန်'); - assert.equal(moment(a).add({ - m: 25 - }).calendar(), 'ယနေ. ၀၂:၂၅ မှာ', 'ယခုမှ ၂၅ မိနစ်ပေါင်းထည့်'); - assert.equal(moment(a).add({ - h: 1 - }).calendar(), 'ယနေ. ၀၃:၀၀ မှာ', 'ယခုမှ ၁ နာရီပေါင်းထည့်'); - assert.equal(moment(a).add({ - d: 1 - }).calendar(), 'မနက်ဖြန် ၀၂:၀၀ မှာ', 'မနက်ဖြန် ဒီအချိန်'); - assert.equal(moment(a).subtract({ - h: 1 - }).calendar(), 'ယနေ. ၀၁:၀၀ မှာ', 'ယခုမှ ၁ နာရီနှုတ်'); - assert.equal(moment(a).subtract({ - d: 1 - }).calendar(), 'မနေ.က ၀၂:၀၀ မှာ', 'မနေ.က ဒီအချိန်'); + assert.equal(moment(a).calendar(), 'आज रातिको २:०० बजे', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'आज रातिको २:२५ बजे', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'आज बिहानको ३:०० बजे', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'भोलि रातिको २:०० बजे', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'आज रातिको १:०० बजे', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'हिजो रातिको २:०० बजे', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { - m = moment().add({ - d: i - }); - assert.equal(m.calendar(), m.format('dddd LT [မှာ]'), 'Today + ' + i + ' days current time'); + m = moment().add({d: i}); + assert.equal(m.calendar(), m.format('[आउँदो] dddd[,] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd LT [မှာ]'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[आउँदो] dddd[,] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd LT [မှာ]'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[आउँदो] dddd[,] LT'), 'Today + ' + i + ' days end of day'); } }); test('calendar last week', function (assert) { var i, m; - for (i = 2; i < 7; i++) { - m = moment().subtract({ - d: i - }); - assert.equal(m.calendar(), m.format('[ပြီးခဲ့သော] dddd LT [မှာ]'), 'Today - ' + i + ' days current time'); + m = moment().subtract({d: i}); + assert.equal(m.calendar(), m.format('[गएको] dddd[,] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[ပြီးခဲ့သော] dddd LT [မှာ]'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[गएको] dddd[,] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[ပြီးခဲ့သော] dddd LT [မှာ]'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[गएको] dddd[,] LT'), 'Today - ' + i + ' days end of day'); } }); test('calendar all else', function (assert) { - var weeksAgo = moment().subtract({ - w: 1 - }), - weeksFromNow = moment().add({ - w: 1 - }); + var weeksAgo = moment().subtract({w: 1}), + weeksFromNow = moment().add({w: 1}); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), 'လွန်ခဲ့သော ၁ ပတ်က'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), '၁ ပတ်အတွင်း'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); - weeksAgo = moment().subtract({ - w: 2 - }); - weeksFromNow = moment().add({ - w: 2 - }); + weeksAgo = moment().subtract({w: 2}); + weeksFromNow = moment().add({w: 2}); - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '၂ ပတ် အရင်က'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), '၂ ပတ် အတွင်း'); + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); + }); + + test('meridiem', function (assert) { + assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), 'राति', 'before dawn'); + assert.equal(moment([2011, 2, 23, 9, 30]).format('a'), 'बिहान', 'morning'); + assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'दिउँसो', 'during day'); + assert.equal(moment([2011, 2, 23, 17, 30]).format('a'), 'साँझ', 'evening'); + assert.equal(moment([2011, 2, 23, 19, 30]).format('a'), 'साँझ', 'late evening'); + assert.equal(moment([2011, 2, 23, 21, 20]).format('a'), 'राति', 'night'); + + assert.equal(moment([2011, 2, 23, 2, 30]).format('A'), 'राति', 'before dawn'); + assert.equal(moment([2011, 2, 23, 9, 30]).format('A'), 'बिहान', 'morning'); + assert.equal(moment([2011, 2, 23, 14, 30]).format('A'), 'दिउँसो', 'during day'); + assert.equal(moment([2011, 2, 23, 17, 30]).format('A'), 'साँझ', 'evening'); + assert.equal(moment([2011, 2, 23, 19, 30]).format('A'), 'साँझ', 'late evening'); + assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'राति', 'night'); }); test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); }); test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); + assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); + assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); }); test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); + assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); + assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); + assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); + assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); + assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); }); test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); + assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); + assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); + assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); + assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); + assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); }); test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); + assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); + assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); + assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); + assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); + assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); + assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); + assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); + assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); + assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); + assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); + assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); + assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); + assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); + assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); }); + test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '၅၂ ၅၂ ၅၂', 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '၁ ၀၁ ၁', 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '၁ ၀၁ ၁', 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '၂ ၀၂ ၂', 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '၂ ၀၂ ၂', 'Jan 15 2012 should be week 2'); + assert.equal(moment([2011, 11, 26]).format('w ww wo'), '५३ ५३ ५३', 'Dec 26 2011 should be week 53'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '१ ०१ १', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '१ ०१ १', 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '२ ०२ २', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '२ ०२ २', 'Jan 9 2012 should be week 2'); }); test('lenient ordinal parsing', function (assert) { @@ -21148,6 +24404,18 @@ } }); + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { @@ -21159,8 +24427,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -21169,12 +24438,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -21192,8 +24463,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -21208,11 +24479,10 @@ }); } - localeModule('nb'); + localeModule('nl'); test('parse', function (assert) { - var tests = 'januar jan_februar feb_mars mar_april apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split('_'), - i; + var tests = 'januari jan._februari feb._maart mrt._april apr._mei mei._juni jun._juli jul._augustus aug._september sep._oktober okt._november nov._december dec.'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -21231,29 +24501,29 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss a', 'søndag, februar 14. 2010, 3:25:50 pm'], - ['ddd, hA', 'søn, 3PM'], - ['M Mo MM MMMM MMM', '2 2. 02 februar feb'], + ['dddd, MMMM Do YYYY, HH:mm:ss', 'zondag, februari 14de 2010, 15:25:50'], + ['ddd, HH', 'zo., 15'], + ['M Mo MM MMMM MMM', '2 2de 02 februari feb.'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14. 14'], - ['d do dddd ddd dd', '0 0. søndag søn sø'], - ['DDD DDDo DDDD', '45 45. 045'], - ['w wo ww', '6 6. 06'], + ['D Do DD', '14 14de 14'], + ['d do dddd ddd dd', '0 0de zondag zo. Zo'], + ['DDD DDDo DDDD', '45 45ste 045'], + ['w wo ww', '6 6de 06'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], ['a A', 'pm PM'], - ['[den] DDDo [dagen i året]', 'den 45. dagen i året'], - ['LTS', '15.25.50'], - ['L', '14.02.2010'], - ['LL', '14. februar 2010'], - ['LLL', '14. februar 2010 kl. 15.25'], - ['LLLL', 'søndag 14. februar 2010 kl. 15.25'], - ['l', '14.2.2010'], - ['ll', '14. feb 2010'], - ['lll', '14. feb 2010 kl. 15.25'], - ['llll', 'søn 14. feb 2010 kl. 15.25'] + ['[the] DDDo [day of the year]', 'the 45ste day of the year'], + ['LTS', '15:25:50'], + ['L', '14-02-2010'], + ['LL', '14 februari 2010'], + ['LLL', '14 februari 2010 15:25'], + ['LLLL', 'zondag 14 februari 2010 15:25'], + ['l', '14-2-2010'], + ['ll', '14 feb. 2010'], + ['lll', '14 feb. 2010 15:25'], + ['llll', 'zo. 14 feb. 2010 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -21263,51 +24533,51 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1ste', '1ste'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2de', '2de'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3de', '3de'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4de', '4de'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5de', '5de'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6de', '6de'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7de', '7de'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8ste', '8ste'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9de', '9de'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10de', '10de'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11de', '11de'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12de', '12de'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13de', '13de'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14de', '14de'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15de', '15de'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16de', '16de'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17de', '17de'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18de', '18de'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19de', '19de'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20ste', '20ste'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21ste', '21ste'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22ste', '22ste'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23ste', '23ste'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24ste', '24ste'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25ste', '25ste'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26ste', '26ste'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27ste', '27ste'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28ste', '28ste'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29ste', '29ste'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30ste', '30ste'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31ste', '31ste'); }); test('format month', function (assert) { - var expected = 'januar jan_februar feb_mars mar_april apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split('_'), i; + var expected = 'januari jan._februari feb._maart mrt._april apr._mei mei_juni jun._juli jul._augustus aug._september sep._oktober okt._november nov._december dec.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'søndag søn sø_mandag man ma_tirsdag tirs ti_onsdag ons on_torsdag tors to_fredag fre fr_lørdag lør lø'.split('_'), i; + var expected = 'zondag zo. Zo_maandag ma. Ma_dinsdag di. Di_woensdag wo. Wo_donderdag do. Do_vrijdag vr. Vr_zaterdag za. Za'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -21315,70 +24585,70 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'noen sekunder', '44 sekunder = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'ett minutt', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'ett minutt', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutter', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutter', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'en time', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'en time', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 timer', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 timer', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 timer', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'en dag', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'en dag', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dager', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'en dag', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dager', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dager', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'en måned', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'en måned', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'en måned', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 måneder', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 måneder', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 måneder', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'en måned', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 måneder', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ett år', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 år', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'ett år', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 år', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'een paar seconden', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'één minuut', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'één minuut', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minuten', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minuten', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'één uur', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'één uur', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 uur', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 uur', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 uur', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'één dag', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'één dag', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dagen', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'één dag', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dagen', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dagen', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'één maand', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'één maand', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'één maand', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 maanden', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 maanden', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 maanden', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'één maand', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 maanden', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'één jaar', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 jaar', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'één jaar', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 jaar', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'om noen sekunder', 'prefix'); - assert.equal(moment(0).from(30000), 'for noen sekunder siden', 'suffix'); + assert.equal(moment(30000).from(0), 'over een paar seconden', 'prefix'); + assert.equal(moment(0).from(30000), 'een paar seconden geleden', 'suffix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'for noen sekunder siden', 'now from now should display as in the past'); + assert.equal(moment().fromNow(), 'een paar seconden geleden', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'om noen sekunder', 'in a few seconds'); - assert.equal(moment().add({d: 5}).fromNow(), 'om 5 dager', 'in 5 days'); + assert.equal(moment().add({s: 30}).fromNow(), 'over een paar seconden', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'over 5 dagen', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'i dag kl. 2.00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'i dag kl. 2.25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'i dag kl. 3.00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'i morgen kl. 2.00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'i dag kl. 1.00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'i går kl. 2.00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'vandaag om 02:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'vandaag om 02:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'vandaag om 03:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'morgen om 02:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'vandaag om 01:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'gisteren om 02:00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd [kl.] LT'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [om] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [kl.] LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [om] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [kl.] LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [om] LT'), 'Today + ' + i + ' days end of day'); } }); @@ -21386,11 +24656,11 @@ var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('[forrige] dddd [kl.] LT'), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('[afgelopen] dddd [om] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[forrige] dddd [kl.] LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[afgelopen] dddd [om] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[forrige] dddd [kl.] LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[afgelopen] dddd [om] LT'), 'Today - ' + i + ' days end of day'); } }); @@ -21408,6 +24678,11 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); + test('month abbreviation', function (assert) { + assert.equal(moment([2012, 5, 23]).format('D-MMM-YYYY'), '23-jun-2012', 'format month abbreviation surrounded by dashes should not include a dot'); + assert.equal(moment([2012, 5, 23]).format('D MMM YYYY'), '23 jun. 2012', 'format month abbreviation not surrounded by dashes should include a dot'); + }); + test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); @@ -21470,11 +24745,11 @@ }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52ste', 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1ste', 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1ste', 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2de', 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2de', 'Jan 15 2012 should be week 2'); }); test('lenient ordinal parsing', function (assert) { @@ -21515,8 +24790,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -21525,12 +24801,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -21548,8 +24826,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -21564,10 +24842,10 @@ }); } - localeModule('ne'); + localeModule('nn'); test('parse', function (assert) { - var tests = 'जनवरी जन._फेब्रुवरी फेब्रु._मार्च मार्च_अप्रिल अप्रि._मई मई_जुन जुन_जुलाई जुलाई._अगष्ट अग._सेप्टेम्बर सेप्ट._अक्टोबर अक्टो._नोभेम्बर नोभे._डिसेम्बर डिसे.'.split('_'), i; + var tests = 'januar jan_februar feb_mars mar_april apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -21586,28 +24864,29 @@ test('format', function (assert) { var a = [ - ['dddd, Do MMMM YYYY, aको h:mm:ss बजे', 'आइतबार, १४ फेब्रुवरी २०१०, बेलुकाको ३:२५:५० बजे'], - ['ddd, aको h बजे', 'आइत., बेलुकाको ३ बजे'], - ['M Mo MM MMMM MMM', '२ २ ०२ फेब्रुवरी फेब्रु.'], - ['YYYY YY', '२०१० १०'], - ['D Do DD', '१४ १४ १४'], - ['d do dddd ddd dd', '० ० आइतबार आइत. आइ.'], - ['DDD DDDo DDDD', '४५ ४५ ०४५'], - ['w wo ww', '७ ७ ०७'], - ['h hh', '३ ०३'], - ['H HH', '१५ १५'], - ['m mm', '२५ २५'], - ['s ss', '५० ५०'], - ['a A', 'बेलुका बेलुका'], - ['LTS', 'बेलुकाको ३:२५:५० बजे'], - ['L', '१४/०२/२०१०'], - ['LL', '१४ फेब्रुवरी २०१०'], - ['LLL', '१४ फेब्रुवरी २०१०, बेलुकाको ३:२५ बजे'], - ['LLLL', 'आइतबार, १४ फेब्रुवरी २०१०, बेलुकाको ३:२५ बजे'], - ['l', '१४/२/२०१०'], - ['ll', '१४ फेब्रु. २०१०'], - ['lll', '१४ फेब्रु. २०१०, बेलुकाको ३:२५ बजे'], - ['llll', 'आइत., १४ फेब्रु. २०१०, बेलुकाको ३:२५ बजे'] + ['dddd, MMMM Do YYYY, h:mm:ss a', 'sundag, februar 14. 2010, 3:25:50 pm'], + ['ddd, hA', 'sun, 3PM'], + ['M Mo MM MMMM MMM', '2 2. 02 februar feb'], + ['YYYY YY', '2010 10'], + ['D Do DD', '14 14. 14'], + ['d do dddd ddd dd', '0 0. sundag sun su'], + ['DDD DDDo DDDD', '45 45. 045'], + ['w wo ww', '6 6. 06'], + ['h hh', '3 03'], + ['H HH', '15 15'], + ['m mm', '25 25'], + ['s ss', '50 50'], + ['a A', 'pm PM'], + ['[the] DDDo [day of the year]', 'the 45. day of the year'], + ['LTS', '15:25:50'], + ['L', '14.02.2010'], + ['LL', '14. februar 2010'], + ['LLL', '14. februar 2010 kl. 15:25'], + ['LLLL', 'sundag 14. februar 2010 kl. 15:25'], + ['l', '14.2.2010'], + ['ll', '14. feb 2010'], + ['lll', '14. feb 2010 kl. 15:25'], + ['llll', 'sun 14. feb 2010 kl. 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -21617,51 +24896,51 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '१', '१'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '२', '२'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '३', '३'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '४', '४'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '५', '५'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '६', '६'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '७', '७'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '८', '८'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '९', '९'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '१०', '१०'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '११', '११'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '१२', '१२'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '१३', '१३'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '१४', '१४'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '१५', '१५'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '१६', '१६'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '१७', '१७'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '१८', '१८'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '१९', '१९'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '२०', '२०'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '२१', '२१'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '२२', '२२'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '२३', '२३'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '२४', '२४'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '२५', '२५'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '२६', '२६'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '२७', '२७'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '२८', '२८'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '२९', '२९'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '३०', '३०'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '३१', '३१'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); test('format month', function (assert) { - var expected = 'जनवरी जन._फेब्रुवरी फेब्रु._मार्च मार्च_अप्रिल अप्रि._मई मई_जुन जुन_जुलाई जुलाई._अगष्ट अग._सेप्टेम्बर सेप्ट._अक्टोबर अक्टो._नोभेम्बर नोभे._डिसेम्बर डिसे.'.split('_'), i; + var expected = 'januar jan_februar feb_mars mar_april apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'आइतबार आइत. आइ._सोमबार सोम. सो._मङ्गलबार मङ्गल. मङ्_बुधबार बुध. बु._बिहिबार बिहि. बि._शुक्रबार शुक्र. शु._शनिबार शनि. श.'.split('_'), i; + var expected = 'sundag sun su_måndag mån må_tysdag tys ty_onsdag ons on_torsdag tor to_fredag fre fr_laurdag lau lø'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -21669,70 +24948,70 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'केही समय', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'एक मिनेट', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'एक मिनेट', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '२ मिनेट', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '४४ मिनेट', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'एक घण्टा', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'एक घण्टा', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '२ घण्टा', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '५ घण्टा', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '२१ घण्टा', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'एक दिन', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'एक दिन', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '२ दिन', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'एक दिन', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '५ दिन', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '२५ दिन', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'एक महिना', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'एक महिना', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'एक महिना', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '२ महिना', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '२ महिना', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '३ महिना', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'एक महिना', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '५ महिना', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'एक बर्ष', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '२ बर्ष', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'एक बर्ष', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '५ बर्ष', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'nokre sekund', '44 sekunder = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'eit minutt', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'eit minutt', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutt', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutt', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'ein time', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'ein time', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 timar', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 timar', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 timar', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'ein dag', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'ein dag', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dagar', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'ein dag', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dagar', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dagar', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'ein månad', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'ein månad', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'ein månad', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 månader', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 månader', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 månader', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'ein månad', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 månader', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'eit år', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 år', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'eit år', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 år', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'केही समयमा', 'prefix'); - assert.equal(moment(0).from(30000), 'केही समय अगाडी', 'suffix'); + assert.equal(moment(30000).from(0), 'om nokre sekund', 'prefix'); + assert.equal(moment(0).from(30000), 'for nokre sekund sidan', 'suffix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'केही समय अगाडी', 'now from now should display as in the past'); + assert.equal(moment().fromNow(), 'for nokre sekund sidan', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'केही समयमा', 'केही समयमा'); - assert.equal(moment().add({d: 5}).fromNow(), '५ दिनमा', '५ दिनमा'); + assert.equal(moment().add({s: 30}).fromNow(), 'om nokre sekund', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'om 5 dagar', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'आज रातीको २:०० बजे', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'आज रातीको २:२५ बजे', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'आज बिहानको ३:०० बजे', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'भोली रातीको २:०० बजे', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'आज रातीको १:०० बजे', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'हिजो रातीको २:०० बजे', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'I dag klokka 02:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'I dag klokka 02:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'I dag klokka 03:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'I morgon klokka 02:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'I dag klokka 01:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'I går klokka 02:00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('[आउँदो] dddd[,] LT'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [klokka] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[आउँदो] dddd[,] LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [klokka] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[आउँदो] dddd[,] LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [klokka] LT'), 'Today + ' + i + ' days end of day'); } }); @@ -21740,11 +25019,11 @@ var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('[गएको] dddd[,] LT'), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('[Føregåande] dddd [klokka] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[गएको] dddd[,] LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[Føregåande] dddd [klokka] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[गएको] dddd[,] LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[Føregåande] dddd [klokka] LT'), 'Today - ' + i + ' days end of day'); } }); @@ -21762,28 +25041,12 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('meridiem', function (assert) { - assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), 'राती', 'before dawn'); - assert.equal(moment([2011, 2, 23, 9, 30]).format('a'), 'बिहान', 'morning'); - assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'दिउँसो', 'during day'); - assert.equal(moment([2011, 2, 23, 17, 30]).format('a'), 'बेलुका', 'evening'); - assert.equal(moment([2011, 2, 23, 19, 30]).format('a'), 'साँझ', 'late evening'); - assert.equal(moment([2011, 2, 23, 21, 20]).format('a'), 'राती', 'night'); - - assert.equal(moment([2011, 2, 23, 2, 30]).format('A'), 'राती', 'before dawn'); - assert.equal(moment([2011, 2, 23, 9, 30]).format('A'), 'बिहान', 'morning'); - assert.equal(moment([2011, 2, 23, 14, 30]).format('A'), 'दिउँसो', 'during day'); - assert.equal(moment([2011, 2, 23, 17, 30]).format('A'), 'बेलुका', 'evening'); - assert.equal(moment([2011, 2, 23, 19, 30]).format('A'), 'साँझ', 'late evening'); - assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'राती', 'night'); - }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); + assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); test('weeks year starting monday', function (assert) { @@ -21818,33 +25081,33 @@ assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); + assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); + assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); + assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); + assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); + assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); + assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); + assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); + assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); + assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); + assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); + assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); + assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); + assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2011, 11, 26]).format('w ww wo'), '१ ०१ १', 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '१ ०१ १', 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '२ ०२ २', 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '२ ०२ २', 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '३ ०३ ३', 'Jan 9 2012 should be week 3'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); test('lenient ordinal parsing', function (assert) { @@ -21874,18 +25137,6 @@ } }); - test('meridiem invariant', function (assert) { - var h, m, t1, t2; - for (h = 0; h < 24; ++h) { - for (m = 0; m < 60; m += 15) { - t1 = moment.utc([2000, 0, 1, h, m]); - t2 = moment(t1.format('A h:mm'), 'A h:mm'); - assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), - 'meridiem at ' + t1.format('HH:mm')); - } - } - }); - test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { @@ -21897,8 +25148,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -21907,12 +25159,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -21930,8 +25184,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -21946,10 +25200,10 @@ }); } - localeModule('nl'); + localeModule('pl'); test('parse', function (assert) { - var tests = 'januari jan._februari feb._maart mrt._april apr._mei mei._juni jun._juli jul._augustus aug._september sep._oktober okt._november nov._december dec.'.split('_'), i; + var tests = 'styczeń stycznia sty_luty lutego lut_marzec marca mar_kwiecień kwietnia kwi_maj maja maj_czerwiec czerwca cze_lipiec lipca lip_sierpień sierpnia sie_wrzesień września wrz_październik października paź_listopad listopada lis_grudzień grudnia gru'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -21957,40 +25211,63 @@ tests[i] = tests[i].split(' '); equalTest(tests[i][0], 'MMM', i); equalTest(tests[i][1], 'MMM', i); + equalTest(tests[i][2], 'MMM', i); + equalTest(tests[i][0], 'MMMM', i); + equalTest(tests[i][1], 'MMMM', i); + equalTest(tests[i][2], 'MMMM', i); + equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][2].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); + equalTest(tests[i][2].toLocaleUpperCase(), 'MMMM', i); + } + }); + + test('parse strict', function (assert) { + var tests = 'styczeń stycznia sty_luty lutego lut_marzec marca mar_kwiecień kwietnia kwi_maj maja maj_czerwiec czerwca cze_lipiec lipca lip_sierpień sierpnia sie_wrzesień września wrz_październik października paź_listopad listopada lis_grudzień grudnia gru'.split('_'), i; + function equalTest(input, mmm, i) { + assert.equal(moment(input, mmm, true).month(), i, input + ' should be month ' + (i + 1)); + } + for (i = 0; i < 12; i++) { + tests[i] = tests[i].split(' '); equalTest(tests[i][0], 'MMMM', i); equalTest(tests[i][1], 'MMMM', i); + equalTest(tests[i][2], 'MMM', i); equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i); equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][2].toLocaleLowerCase(), 'MMM', i); equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); + equalTest(tests[i][2].toLocaleUpperCase(), 'MMM', i); } }); test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, HH:mm:ss', 'zondag, februari 14de 2010, 15:25:50'], - ['ddd, HH', 'zo., 15'], - ['M Mo MM MMMM MMM', '2 2de 02 februari feb.'], + ['dddd, MMMM Do YYYY, h:mm:ss a', 'niedziela, luty 14. 2010, 3:25:50 pm'], + ['ddd, hA', 'nie, 3PM'], + ['M Mo MM MMMM MMM', '2 2. 02 luty lut'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14de 14'], - ['d do dddd ddd dd', '0 0de zondag zo. Zo'], - ['DDD DDDo DDDD', '45 45ste 045'], - ['w wo ww', '6 6de 06'], + ['D Do DD', '14 14. 14'], + ['d do dddd ddd dd', '0 0. niedziela nie Nd'], + ['DDD DDDo DDDD', '45 45. 045'], + ['w wo ww', '6 6. 06'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], ['a A', 'pm PM'], - ['[the] DDDo [day of the year]', 'the 45ste day of the year'], + ['[the] DDDo [day of the year]', 'the 45. day of the year'], ['LTS', '15:25:50'], - ['L', '14-02-2010'], - ['LL', '14 februari 2010'], - ['LLL', '14 februari 2010 15:25'], - ['LLLL', 'zondag 14 februari 2010 15:25'], - ['l', '14-2-2010'], - ['ll', '14 feb. 2010'], - ['lll', '14 feb. 2010 15:25'], - ['llll', 'zo. 14 feb. 2010 15:25'] + ['L', '14.02.2010'], + ['LL', '14 lutego 2010'], + ['LLL', '14 lutego 2010 15:25'], + ['LLLL', 'niedziela, 14 lutego 2010 15:25'], + ['l', '14.2.2010'], + ['ll', '14 lut 2010'], + ['lll', '14 lut 2010 15:25'], + ['llll', 'nie, 14 lut 2010 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -22000,51 +25277,51 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1ste', '1ste'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2de', '2de'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3de', '3de'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4de', '4de'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5de', '5de'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6de', '6de'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7de', '7de'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8ste', '8ste'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9de', '9de'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10de', '10de'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11de', '11de'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12de', '12de'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13de', '13de'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14de', '14de'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15de', '15de'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16de', '16de'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17de', '17de'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18de', '18de'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19de', '19de'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20ste', '20ste'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21ste', '21ste'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22ste', '22ste'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23ste', '23ste'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24ste', '24ste'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25ste', '25ste'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26ste', '26ste'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27ste', '27ste'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28ste', '28ste'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29ste', '29ste'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30ste', '30ste'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31ste', '31ste'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); test('format month', function (assert) { - var expected = 'januari jan._februari feb._maart mrt._april apr._mei mei_juni jun._juli jul._augustus aug._september sep._oktober okt._november nov._december dec.'.split('_'), i; + var expected = 'styczeń sty_luty lut_marzec mar_kwiecień kwi_maj maj_czerwiec cze_lipiec lip_sierpień sie_wrzesień wrz_październik paź_listopad lis_grudzień gru'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'zondag zo. Zo_maandag ma. Ma_dinsdag di. Di_woensdag wo. Wo_donderdag do. Do_vrijdag vr. Vr_zaterdag za. Za'.split('_'), i; + var expected = 'niedziela nie Nd_poniedziałek pon Pn_wtorek wt Wt_środa śr Śr_czwartek czw Cz_piątek pt Pt_sobota sb So'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -22052,82 +25329,103 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'een paar seconden', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'één minuut', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'één minuut', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minuten', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minuten', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'één uur', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'één uur', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 uur', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 uur', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 uur', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'één dag', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'één dag', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dagen', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'één dag', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dagen', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dagen', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'één maand', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'één maand', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'één maand', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 maanden', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 maanden', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 maanden', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'één maand', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 maanden', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'één jaar', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 jaar', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'één jaar', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 jaar', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'kilka sekund', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'minuta', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'minuta', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minuty', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minuty', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'godzina', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'godzina', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 godziny', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 godzin', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 godzin', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), '1 dzień', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), '1 dzień', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dni', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), '1 dzień', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dni', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dni', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'miesiąc', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'miesiąc', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'miesiąc', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 miesiące', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 miesiące', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 miesiące', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'miesiąc', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 miesięcy', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'rok', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 lata', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'rok', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 lat', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 112}), true), '112 lat', '112 years = 112 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 122}), true), '122 lata', '122 years = 122 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 213}), true), '213 lat', '213 years = 213 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 223}), true), '223 lata', '223 years = 223 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'over een paar seconden', 'prefix'); - assert.equal(moment(0).from(30000), 'een paar seconden geleden', 'suffix'); + assert.equal(moment(30000).from(0), 'za kilka sekund', 'prefix'); + assert.equal(moment(0).from(30000), 'kilka sekund temu', 'suffix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'een paar seconden geleden', 'now from now should display as in the past'); + assert.equal(moment().fromNow(), 'kilka sekund temu', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'over een paar seconden', 'in a few seconds'); - assert.equal(moment().add({d: 5}).fromNow(), 'over 5 dagen', 'in 5 days'); + assert.equal(moment().add({s: 30}).fromNow(), 'za kilka sekund', 'in a few seconds'); + assert.equal(moment().add({h: 1}).fromNow(), 'za godzinę', 'in an hour'); + assert.equal(moment().add({d: 5}).fromNow(), 'za 5 dni', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'vandaag om 02:00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'vandaag om 02:25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'vandaag om 03:00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'morgen om 02:00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'vandaag om 01:00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'gisteren om 02:00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'Dziś o 02:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'Dziś o 02:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'Dziś o 03:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'Jutro o 02:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'Dziś o 01:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'Wczoraj o 02:00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd [om] LT'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('[W] dddd [o] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [om] LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[W] dddd [o] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [om] LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[W] dddd [o] LT'), 'Today + ' + i + ' days end of day'); } }); test('calendar last week', function (assert) { var i, m; + + function makeFormat(d) { + switch (d.day()) { + case 0: + return '[W zeszłą niedzielę o] LT'; + case 3: + return '[W zeszłą środę o] LT'; + case 6: + return '[W zeszłą sobotę o] LT'; + default: + return '[W zeszły] dddd [o] LT'; + } + } + for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('[afgelopen] dddd [om] LT'), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days current time'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[afgelopen] dddd [om] LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days beginning of day'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[afgelopen] dddd [om] LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days end of day'); } }); @@ -22145,11 +25443,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('month abbreviation', function (assert) { - assert.equal(moment([2012, 5, 23]).format('D-MMM-YYYY'), '23-jun-2012', 'format month abbreviation surrounded by dashes should not include a dot'); - assert.equal(moment([2012, 5, 23]).format('D MMM YYYY'), '23 jun. 2012', 'format month abbreviation not surrounded by dashes should include a dot'); - }); - test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); @@ -22212,11 +25505,11 @@ }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52ste', 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1ste', 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1ste', 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2de', 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2de', 'Jan 15 2012 should be week 2'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); test('lenient ordinal parsing', function (assert) { @@ -22257,8 +25550,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -22267,12 +25561,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -22290,8 +25586,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -22306,13 +25602,15 @@ }); } - localeModule('nn'); + localeModule('pt-br'); test('parse', function (assert) { - var tests = 'januar jan_februar feb_mars mar_april apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split('_'), i; + var tests = 'janeiro jan_fevereiro fev_março mar_abril abr_maio mai_junho jun_julho jul_agosto ago_setembro set_outubro out_novembro nov_dezembro dez'.split('_'), i; + function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } + for (i = 0; i < 12; i++) { tests[i] = tests[i].split(' '); equalTest(tests[i][0], 'MMM', i); @@ -22328,29 +25626,29 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss a', 'sundag, februar 14. 2010, 3:25:50 pm'], - ['ddd, hA', 'sun, 3PM'], - ['M Mo MM MMMM MMM', '2 2. 02 februar feb'], + ['dddd, MMMM Do YYYY, h:mm:ss a', 'Domingo, Fevereiro 14º 2010, 3:25:50 pm'], + ['ddd, hA', 'Dom, 3PM'], + ['M Mo MM MMMM MMM', '2 2º 02 Fevereiro Fev'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14. 14'], - ['d do dddd ddd dd', '0 0. sundag sun su'], - ['DDD DDDo DDDD', '45 45. 045'], - ['w wo ww', '6 6. 06'], + ['D Do DD', '14 14º 14'], + ['d do dddd ddd', '0 0º Domingo Dom'], + ['DDD DDDo DDDD', '45 45º 045'], + ['w wo ww', '8 8º 08'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], ['a A', 'pm PM'], - ['[the] DDDo [day of the year]', 'the 45. day of the year'], + ['[the] DDDo [day of the year]', 'the 45º day of the year'], ['LTS', '15:25:50'], - ['L', '14.02.2010'], - ['LL', '14 februar 2010'], - ['LLL', '14 februar 2010 15:25'], - ['LLLL', 'sundag 14 februar 2010 15:25'], - ['l', '14.2.2010'], - ['ll', '14 feb 2010'], - ['lll', '14 feb 2010 15:25'], - ['llll', 'sun 14 feb 2010 15:25'] + ['L', '14/02/2010'], + ['LL', '14 de Fevereiro de 2010'], + ['LLL', '14 de Fevereiro de 2010 às 15:25'], + ['LLLL', 'Domingo, 14 de Fevereiro de 2010 às 15:25'], + ['l', '14/2/2010'], + ['ll', '14 de Fev de 2010'], + ['lll', '14 de Fev de 2010 às 15:25'], + ['llll', 'Dom, 14 de Fev de 2010 às 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -22360,122 +25658,118 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º'); }); test('format month', function (assert) { - var expected = 'januar jan_februar feb_mars mar_april apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split('_'), i; + var expected = 'Janeiro Jan_Fevereiro Fev_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'sundag sun su_måndag mån må_tysdag tys ty_onsdag ons on_torsdag tor to_fredag fre fr_laurdag lau lø'.split('_'), i; + var expected = 'Domingo Dom_Segunda-Feira Seg_Terça-Feira Ter_Quarta-Feira Qua_Quinta-Feira Qui_Sexta-Feira Sex_Sábado Sáb'.split('_'), i; for (i = 0; i < expected.length; i++) { - assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); + assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]); } }); test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'nokre sekund', '44 sekunder = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'eit minutt', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'eit minutt', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutt', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutt', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'ein time', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'ein time', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 timar', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 timar', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 timar', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'ein dag', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'ein dag', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dagar', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'ein dag', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dagar', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dagar', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'ein månad', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'ein månad', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'ein månad', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 månader', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 månader', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 månader', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'ein månad', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 månader', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'eit år', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 år', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'eit år', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 år', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'poucos segundos', '44 seconds = seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'um minuto', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'um minuto', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutos', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutos', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'uma hora', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'uma hora', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 horas', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 horas', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 horas', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'um dia', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'um dia', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dias', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'um dia', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dias', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dias', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'um mês', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'um mês', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'um mês', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 meses', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 meses', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 meses', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'um mês', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 meses', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'um ano', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 anos', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'um ano', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 anos', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'om nokre sekund', 'prefix'); - assert.equal(moment(0).from(30000), 'for nokre sekund sidan', 'suffix'); - }); - - test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'for nokre sekund sidan', 'now from now should display as in the past'); + assert.equal(moment(30000).from(0), 'em poucos segundos', 'prefix'); + assert.equal(moment(0).from(30000), 'poucos segundos atrás', 'suffix'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'om nokre sekund', 'in a few seconds'); - assert.equal(moment().add({d: 5}).fromNow(), 'om 5 dagar', 'in 5 days'); + assert.equal(moment().add({s: 30}).fromNow(), 'em poucos segundos', 'in seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'em 5 dias', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'I dag klokka 02:00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'I dag klokka 02:25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'I dag klokka 03:00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'I morgon klokka 02:00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'I dag klokka 01:00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'I går klokka 02:00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'Hoje às 02:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'Hoje às 02:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'Hoje às 03:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'Amanhã às 02:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'Hoje às 01:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'Ontem às 02:00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd [klokka] LT'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [às] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [klokka] LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [às] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [klokka] LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [às] LT'), 'Today + ' + i + ' days end of day'); } }); @@ -22483,11 +25777,11 @@ var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('[Føregåande] dddd [klokka] LT'), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[Føregåande] dddd [klokka] LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[Føregåande] dddd [klokka] LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), 'Today - ' + i + ' days end of day'); } }); @@ -22506,72 +25800,72 @@ }); test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); }); test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); + assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); + assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); }); test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); + assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); + assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); + assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); + assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); }); test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); + assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); + assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); + assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); + assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); }); test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); + assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); + assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); + assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); + assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); + assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); + assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); + assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); + assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); + assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); + assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); + assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); + assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); + assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); }); - test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); + test('weeks year starting sunday format', function (assert) { + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1º', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1º', 'Jan 7 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2º', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2º', 'Jan 14 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3º', 'Jan 15 2012 should be week 3'); }); test('lenient ordinal parsing', function (assert) { @@ -22612,8 +25906,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -22622,12 +25917,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -22645,8 +25942,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -22661,10 +25958,10 @@ }); } - localeModule('pl'); + localeModule('pt'); test('parse', function (assert) { - var tests = 'styczeń stycznia sty_luty lutego lut_marzec marca mar_kwiecień kwietnia kwi_maj maja maj_czerwiec czerwca cze_lipiec lipca lip_sierpień sierpnia sie_wrzesień września wrz_październik października paź_listopad listopada lis_grudzień grudnia gru'.split('_'), i; + var tests = 'Janeiro Jan_Fevereiro Fev_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -22672,63 +25969,40 @@ tests[i] = tests[i].split(' '); equalTest(tests[i][0], 'MMM', i); equalTest(tests[i][1], 'MMM', i); - equalTest(tests[i][2], 'MMM', i); - equalTest(tests[i][0], 'MMMM', i); - equalTest(tests[i][1], 'MMMM', i); - equalTest(tests[i][2], 'MMMM', i); - equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i); - equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); - equalTest(tests[i][2].toLocaleLowerCase(), 'MMMM', i); - equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); - equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); - equalTest(tests[i][2].toLocaleUpperCase(), 'MMMM', i); - } - }); - - test('parse strict', function (assert) { - var tests = 'styczeń stycznia sty_luty lutego lut_marzec marca mar_kwiecień kwietnia kwi_maj maja maj_czerwiec czerwca cze_lipiec lipca lip_sierpień sierpnia sie_wrzesień września wrz_październik października paź_listopad listopada lis_grudzień grudnia gru'.split('_'), i; - function equalTest(input, mmm, i) { - assert.equal(moment(input, mmm, true).month(), i, input + ' should be month ' + (i + 1)); - } - for (i = 0; i < 12; i++) { - tests[i] = tests[i].split(' '); equalTest(tests[i][0], 'MMMM', i); equalTest(tests[i][1], 'MMMM', i); - equalTest(tests[i][2], 'MMM', i); equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i); equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); - equalTest(tests[i][2].toLocaleLowerCase(), 'MMM', i); equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); - equalTest(tests[i][2].toLocaleUpperCase(), 'MMM', i); } }); test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss a', 'niedziela, luty 14. 2010, 3:25:50 pm'], - ['ddd, hA', 'nie, 3PM'], - ['M Mo MM MMMM MMM', '2 2. 02 luty lut'], + ['dddd, MMMM Do YYYY, h:mm:ss a', 'Domingo, Fevereiro 14º 2010, 3:25:50 pm'], + ['ddd, hA', 'Dom, 3PM'], + ['M Mo MM MMMM MMM', '2 2º 02 Fevereiro Fev'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14. 14'], - ['d do dddd ddd dd', '0 0. niedziela nie N'], - ['DDD DDDo DDDD', '45 45. 045'], - ['w wo ww', '6 6. 06'], + ['D Do DD', '14 14º 14'], + ['d do dddd ddd', '0 0º Domingo Dom'], + ['DDD DDDo DDDD', '45 45º 045'], + ['w wo ww', '6 6º 06'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], ['a A', 'pm PM'], - ['[the] DDDo [day of the year]', 'the 45. day of the year'], + ['[the] DDDo [day of the year]', 'the 45º day of the year'], ['LTS', '15:25:50'], - ['L', '14.02.2010'], - ['LL', '14 lutego 2010'], - ['LLL', '14 lutego 2010 15:25'], - ['LLLL', 'niedziela, 14 lutego 2010 15:25'], - ['l', '14.2.2010'], - ['ll', '14 lut 2010'], - ['lll', '14 lut 2010 15:25'], - ['llll', 'nie, 14 lut 2010 15:25'] + ['L', '14/02/2010'], + ['LL', '14 de Fevereiro de 2010'], + ['LLL', '14 de Fevereiro de 2010 15:25'], + ['LLLL', 'Domingo, 14 de Fevereiro de 2010 15:25'], + ['l', '14/2/2010'], + ['ll', '14 de Fev de 2010'], + ['lll', '14 de Fev de 2010 15:25'], + ['llll', 'Dom, 14 de Fev de 2010 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -22738,51 +26012,51 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º'); }); test('format month', function (assert) { - var expected = 'styczeń sty_luty lut_marzec mar_kwiecień kwi_maj maj_czerwiec cze_lipiec lip_sierpień sie_wrzesień wrz_październik paź_listopad lis_grudzień gru'.split('_'), i; + var expected = 'Janeiro Jan_Fevereiro Fev_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'niedziela nie N_poniedziałek pon Pn_wtorek wt Wt_środa śr Śr_czwartek czw Cz_piątek pt Pt_sobota sb So'.split('_'), i; + var expected = 'Domingo Dom Dom_Segunda-Feira Seg 2ª_Terça-Feira Ter 3ª_Quarta-Feira Qua 4ª_Quinta-Feira Qui 5ª_Sexta-Feira Sex 6ª_Sábado Sáb Sáb'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -22790,103 +26064,78 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'kilka sekund', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'minuta', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'minuta', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minuty', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minuty', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'godzina', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'godzina', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 godziny', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 godzin', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 godzin', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), '1 dzień', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), '1 dzień', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dni', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), '1 dzień', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dni', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dni', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'miesiąc', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'miesiąc', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'miesiąc', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 miesiące', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 miesiące', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 miesiące', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'miesiąc', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 miesięcy', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'rok', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 lata', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'rok', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 lat', '5 years = 5 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 112}), true), '112 lat', '112 years = 112 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 122}), true), '122 lata', '122 years = 122 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 213}), true), '213 lat', '213 years = 213 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 223}), true), '223 lata', '223 years = 223 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'segundos', '44 seconds = seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'um minuto', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'um minuto', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutos', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutos', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'uma hora', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'uma hora', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 horas', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 horas', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 horas', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'um dia', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'um dia', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dias', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'um dia', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dias', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dias', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'um mês', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'um mês', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'um mês', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 meses', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 meses', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 meses', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'um mês', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 meses', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'um ano', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 anos', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'um ano', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 anos', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'za kilka sekund', 'prefix'); - assert.equal(moment(0).from(30000), 'kilka sekund temu', 'suffix'); - }); - - test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'kilka sekund temu', 'now from now should display as in the past'); + assert.equal(moment(30000).from(0), 'em segundos', 'prefix'); + assert.equal(moment(0).from(30000), 'há segundos', 'suffix'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'za kilka sekund', 'in a few seconds'); - assert.equal(moment().add({h: 1}).fromNow(), 'za godzinę', 'in an hour'); - assert.equal(moment().add({d: 5}).fromNow(), 'za 5 dni', 'in 5 days'); + assert.equal(moment().add({s: 30}).fromNow(), 'em segundos', 'in seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'em 5 dias', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'Dziś o 02:00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'Dziś o 02:25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'Dziś o 03:00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'Jutro o 02:00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'Dziś o 01:00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'Wczoraj o 02:00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'Hoje às 02:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'Hoje às 02:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'Hoje às 03:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'Amanhã às 02:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'Hoje às 01:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'Ontem às 02:00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('[W] dddd [o] LT'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [às] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[W] dddd [o] LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [às] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[W] dddd [o] LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [às] LT'), 'Today + ' + i + ' days end of day'); } }); test('calendar last week', function (assert) { var i, m; - - function makeFormat(d) { - switch (d.day()) { - case 0: - return '[W zeszłą niedzielę o] LT'; - case 3: - return '[W zeszłą środę o] LT'; - case 6: - return '[W zeszłą sobotę o] LT'; - default: - return '[W zeszły] dddd [o] LT'; - } - } - for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days current time'); - + assert.equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days beginning of day'); - + assert.equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), 'Today - ' + i + ' days end of day'); } }); @@ -22966,11 +26215,11 @@ }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52º', 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1º', 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1º', 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2º', 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2º', 'Jan 15 2012 should be week 2'); }); test('lenient ordinal parsing', function (assert) { @@ -23011,8 +26260,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -23021,12 +26271,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -23044,8 +26296,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -23060,15 +26312,13 @@ }); } - localeModule('pt-br'); + localeModule('ro'); test('parse', function (assert) { - var tests = 'janeiro jan_fevereiro fev_março mar_abril abr_maio mai_junho jun_julho jul_agosto ago_setembro set_outubro out_novembro nov_dezembro dez'.split('_'), i; - + var tests = 'ianuarie ian._februarie febr._martie mart._aprilie apr._mai mai_iunie iun._iulie iul._august aug._septembrie sept._octombrie oct._noiembrie nov._decembrie dec.'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } - for (i = 0; i < 12; i++) { tests[i] = tests[i].split(' '); equalTest(tests[i][0], 'MMM', i); @@ -23084,29 +26334,29 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss a', 'Domingo, Fevereiro 14º 2010, 3:25:50 pm'], - ['ddd, hA', 'Dom, 3PM'], - ['M Mo MM MMMM MMM', '2 2º 02 Fevereiro Fev'], - ['YYYY YY', '2010 10'], - ['D Do DD', '14 14º 14'], - ['d do dddd ddd', '0 0º Domingo Dom'], - ['DDD DDDo DDDD', '45 45º 045'], - ['w wo ww', '8 8º 08'], - ['h hh', '3 03'], - ['H HH', '15 15'], - ['m mm', '25 25'], - ['s ss', '50 50'], - ['a A', 'pm PM'], - ['[the] DDDo [day of the year]', 'the 45º day of the year'], - ['LTS', '15:25:50'], - ['L', '14/02/2010'], - ['LL', '14 de Fevereiro de 2010'], - ['LLL', '14 de Fevereiro de 2010 às 15:25'], - ['LLLL', 'Domingo, 14 de Fevereiro de 2010 às 15:25'], - ['l', '14/2/2010'], - ['ll', '14 de Fev de 2010'], - ['lll', '14 de Fev de 2010 às 15:25'], - ['llll', 'Dom, 14 de Fev de 2010 às 15:25'] + ['dddd, MMMM Do YYYY, h:mm:ss A', 'duminică, februarie 14 2010, 3:25:50 PM'], + ['ddd, hA', 'Dum, 3PM'], + ['M Mo MM MMMM MMM', '2 2 02 februarie febr.'], + ['YYYY YY', '2010 10'], + ['D Do DD', '14 14 14'], + ['d do dddd ddd dd', '0 0 duminică Dum Du'], + ['DDD DDDo DDDD', '45 45 045'], + ['w wo ww', '7 7 07'], + ['h hh', '3 03'], + ['H HH', '15 15'], + ['m mm', '25 25'], + ['s ss', '50 50'], + ['a A', 'pm PM'], + ['[a] DDDo[a zi a anului]', 'a 45a zi a anului'], + ['LTS', '15:25:50'], + ['L', '14.02.2010'], + ['LL', '14 februarie 2010'], + ['LLL', '14 februarie 2010 15:25'], + ['LLLL', 'duminică, 14 februarie 2010 15:25'], + ['l', '14.2.2010'], + ['ll', '14 febr. 2010'], + ['lll', '14 febr. 2010 15:25'], + ['llll', 'Dum, 14 febr. 2010 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -23116,118 +26366,130 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31'); }); test('format month', function (assert) { - var expected = 'Janeiro Jan_Fevereiro Fev_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez'.split('_'), i; + var expected = 'ianuarie ian._februarie febr._martie mart._aprilie apr._mai mai_iunie iun._iulie iul._august aug._septembrie sept._octombrie oct._noiembrie nov._decembrie dec.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'Domingo Dom_Segunda-Feira Seg_Terça-Feira Ter_Quarta-Feira Qua_Quinta-Feira Qui_Sexta-Feira Sex_Sábado Sáb'.split('_'), i; + var expected = 'duminică Dum Du_luni Lun Lu_marți Mar Ma_miercuri Mie Mi_joi Joi Jo_vineri Vin Vi_sâmbătă Sâm Sâ'.split('_'), i; for (i = 0; i < expected.length; i++) { - assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]); + assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'poucos segundos', '44 seconds = seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'um minuto', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'um minuto', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutos', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutos', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'uma hora', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'uma hora', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 horas', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 horas', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 horas', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'um dia', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'um dia', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dias', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'um dia', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dias', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dias', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'um mês', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'um mês', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'um mês', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 meses', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 meses', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 meses', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'um mês', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 meses', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'um ano', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 anos', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'um ano', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 anos', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'câteva secunde', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'un minut', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'un minut', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minute', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 de minute', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'o oră', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'o oră', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 ore', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 ore', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 de ore', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'o zi', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'o zi', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 zile', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'o zi', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 zile', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 de zile', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'o lună', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'o lună', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'o lună', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 luni', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 luni', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 luni', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'o lună', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 luni', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'un an', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 ani', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'un an', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 ani', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 19}), true), '19 ani', '19 years = 19 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 20}), true), '20 de ani', '20 years = 20 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 100}), true), '100 de ani', '100 years = 100 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 101}), true), '101 ani', '101 years = 101 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 119}), true), '119 ani', '119 years = 119 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 120}), true), '120 de ani', '120 years = 120 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 219}), true), '219 ani', '219 years = 219 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 220}), true), '220 de ani', '220 years = 220 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'em poucos segundos', 'prefix'); - assert.equal(moment(0).from(30000), 'poucos segundos atrás', 'suffix'); + assert.equal(moment(30000).from(0), 'peste câteva secunde', 'prefix'); + assert.equal(moment(0).from(30000), 'câteva secunde în urmă', 'suffix'); + }); + + test('now from now', function (assert) { + assert.equal(moment().fromNow(), 'câteva secunde în urmă', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'em poucos segundos', 'in seconds'); - assert.equal(moment().add({d: 5}).fromNow(), 'em 5 dias', 'in 5 days'); + assert.equal(moment().add({s: 30}).fromNow(), 'peste câteva secunde', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'peste 5 zile', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'Hoje às 02:00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'Hoje às 02:25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'Hoje às 03:00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'Amanhã às 02:00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'Hoje às 01:00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'Ontem às 02:00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'azi la 2:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'azi la 2:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'azi la 3:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'mâine la 2:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'azi la 1:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'ieri la 2:00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd [às] LT'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [la] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [às] LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [la] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [às] LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [la] LT'), 'Today + ' + i + ' days end of day'); } }); @@ -23235,11 +26497,11 @@ var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('[fosta] dddd [la] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[fosta] dddd [la] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[fosta] dddd [la] LT'), 'Today - ' + i + ' days end of day'); } }); @@ -23258,72 +26520,72 @@ }); test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); + assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); + assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); + assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); + assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); + assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); + assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); + assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); + assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); + assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); + assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); + assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); + assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); + assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); + assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); + assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); + assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); + assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); + assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); + assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); + assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); + assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); + assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); + assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); - test('weeks year starting sunday format', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1º', 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1º', 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2º', 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2º', 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3º', 'Jan 15 2012 should be week 3'); + test('weeks year starting sunday formatted', function (assert) { + assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1', 'Dec 26 2011 should be week 1'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2', 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3', 'Jan 9 2012 should be week 3'); }); test('lenient ordinal parsing', function (assert) { @@ -23364,8 +26626,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -23374,12 +26637,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -23397,8 +26662,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -23413,13 +26678,16 @@ }); } - localeModule('pt'); + localeModule('ru'); test('parse', function (assert) { - var tests = 'Janeiro Jan_Fevereiro Fev_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez'.split('_'), i; + var tests = 'Январь янв_Февраль фев_Март март_Апрель апр_Май май_Июнь июнь_Июль июль_Август авг_Сентябрь сен_Октябрь окт_Ноябрь ноя_Декабрь дек'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } + function equalTestStrict(input, mmm, monthIndex) { + assert.equal(moment(input, mmm, true).month(), monthIndex, input + ' ' + mmm + ' should be strict month ' + (monthIndex + 1)); + } for (i = 0; i < 12; i++) { tests[i] = tests[i].split(' '); equalTest(tests[i][0], 'MMM', i); @@ -23430,34 +26698,45 @@ equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); + + equalTestStrict(tests[i][1], 'MMM', i); + equalTestStrict(tests[i][0], 'MMMM', i); + equalTestStrict(tests[i][1].toLocaleLowerCase(), 'MMM', i); + equalTestStrict(tests[i][1].toLocaleUpperCase(), 'MMM', i); + equalTestStrict(tests[i][0].toLocaleLowerCase(), 'MMMM', i); + equalTestStrict(tests[i][0].toLocaleUpperCase(), 'MMMM', i); } }); + test('parse exceptional case', function (assert) { + assert.equal(moment('11 Мая 1989', ['DD MMMM YYYY']).format('DD-MM-YYYY'), '11-05-1989'); + }); + test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss a', 'Domingo, Fevereiro 14º 2010, 3:25:50 pm'], - ['ddd, hA', 'Dom, 3PM'], - ['M Mo MM MMMM MMM', '2 2º 02 Fevereiro Fev'], + ['dddd, Do MMMM YYYY, HH:mm:ss', 'Воскресенье, 14-го Февраля 2010, 15:25:50'], + ['ddd, h A', 'Вс, 3 дня'], + ['M Mo MM MMMM MMM', '2 2-й 02 Февраль фев'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14º 14'], - ['d do dddd ddd', '0 0º Domingo Dom'], - ['DDD DDDo DDDD', '45 45º 045'], - ['w wo ww', '6 6º 06'], + ['D Do DD', '14 14-го 14'], + ['d do dddd ddd dd', '0 0-й Воскресенье Вс Вс'], + ['DDD DDDo DDDD', '45 45-й 045'], + ['w wo ww', '7 7-я 07'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], - ['a A', 'pm PM'], - ['[the] DDDo [day of the year]', 'the 45º day of the year'], + ['a A', 'дня дня'], + ['DDDo [день года]', '45-й день года'], ['LTS', '15:25:50'], - ['L', '14/02/2010'], - ['LL', '14 de Fevereiro de 2010'], - ['LLL', '14 de Fevereiro de 2010 15:25'], - ['LLLL', 'Domingo, 14 de Fevereiro de 2010 15:25'], - ['l', '14/2/2010'], - ['ll', '14 de Fev de 2010'], - ['lll', '14 de Fev de 2010 15:25'], - ['llll', 'Dom, 14 de Fev de 2010 15:25'] + ['L', '14.02.2010'], + ['LL', '14 Февраля 2010 г.'], + ['LLL', '14 Февраля 2010 г., 15:25'], + ['LLLL', 'Воскресенье, 14 Февраля 2010 г., 15:25'], + ['l', '14.2.2010'], + ['ll', '14 фев 2010 г.'], + ['lll', '14 фев 2010 г., 15:25'], + ['llll', 'Вс, 14 фев 2010 г., 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -23466,52 +26745,111 @@ } }); + test('format meridiem', function (assert) { + assert.equal(moment([2012, 11, 28, 0, 0]).format('A'), 'ночи', 'night'); + assert.equal(moment([2012, 11, 28, 3, 59]).format('A'), 'ночи', 'night'); + assert.equal(moment([2012, 11, 28, 4, 0]).format('A'), 'утра', 'morning'); + assert.equal(moment([2012, 11, 28, 11, 59]).format('A'), 'утра', 'morning'); + assert.equal(moment([2012, 11, 28, 12, 0]).format('A'), 'дня', 'afternoon'); + assert.equal(moment([2012, 11, 28, 16, 59]).format('A'), 'дня', 'afternoon'); + assert.equal(moment([2012, 11, 28, 17, 0]).format('A'), 'вечера', 'evening'); + assert.equal(moment([2012, 11, 28, 23, 59]).format('A'), 'вечера', 'evening'); + }); + test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-й', '1-й'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-й', '2-й'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-й', '3-й'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4-й', '4-й'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5-й', '5-й'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6-й', '6-й'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7-й', '7-й'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8-й', '8-й'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9-й', '9-й'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10-й', '10-й'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11-й', '11-й'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12-й', '12-й'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13-й', '13-й'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14-й', '14-й'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15-й', '15-й'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16-й', '16-й'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17-й', '17-й'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18-й', '18-й'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19-й', '19-й'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20-й', '20-й'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21-й', '21-й'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22-й', '22-й'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23-й', '23-й'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24-й', '24-й'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25-й', '25-й'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26-й', '26-й'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27-й', '27-й'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28-й', '28-й'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29-й', '29-й'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30-й', '30-й'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-й', '31-й'); }); test('format month', function (assert) { - var expected = 'Janeiro Jan_Fevereiro Fev_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez'.split('_'), i; + var expected = 'Январь янв_Февраль фев_Март март_Апрель апр_Май май_Июнь июнь_Июль июль_Август авг_Сентябрь сен_Октябрь окт_Ноябрь ноя_Декабрь дек'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); + test('format month case', function (assert) { + var months = { + 'nominative': 'Январь_Февраль_Март_Апрель_Май_Июнь_Июль_Август_Сентябрь_Октябрь_Ноябрь_Декабрь'.split('_'), + 'accusative': 'Января_Февраля_Марта_Апреля_Мая_Июня_Июля_Августа_Сентября_Октября_Ноября_Декабря'.split('_') + }, i; + for (i = 0; i < 12; i++) { + assert.equal(moment([2011, i, 1]).format('D MMMM'), '1 ' + months.accusative[i], '1 ' + months.accusative[i]); + assert.equal(moment([2011, i, 1]).format('MMMM'), months.nominative[i], '1 ' + months.nominative[i]); + } + }); + + test('format month short case', function (assert) { + var monthsShort = { + 'nominative': 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'), + 'accusative': 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_') + }, i; + for (i = 0; i < 12; i++) { + assert.equal(moment([2011, i, 1]).format('D MMM'), '1 ' + monthsShort.accusative[i], '1 ' + monthsShort.accusative[i]); + assert.equal(moment([2011, i, 1]).format('MMM'), monthsShort.nominative[i], '1 ' + monthsShort.nominative[i]); + } + }); + + test('format month case with escaped symbols', function (assert) { + var months = { + 'nominative': 'Январь_Февраль_Март_Апрель_Май_Июнь_Июль_Август_Сентябрь_Октябрь_Ноябрь_Декабрь'.split('_'), + 'accusative': 'Января_Февраля_Марта_Апреля_Мая_Июня_Июля_Августа_Сентября_Октября_Ноября_Декабря'.split('_') + }, i; + for (i = 0; i < 12; i++) { + assert.equal(moment([2013, i, 1]).format('D[] MMMM'), '1 ' + months.accusative[i], '1 ' + months.accusative[i]); + assert.equal(moment([2013, i, 1]).format('[]D[] []MMMM[]'), '1 ' + months.accusative[i] + '', '1 ' + months.accusative[i] + ''); + assert.equal(moment([2013, i, 1]).format('D[-й день] MMMM'), '1-й день ' + months.accusative[i], '1-й день ' + months.accusative[i]); + assert.equal(moment([2013, i, 1]).format('D, MMMM'), '1, ' + months.nominative[i], '1, ' + months.nominative[i]); + } + }); + + test('format month short case with escaped symbols', function (assert) { + var monthsShort = { + 'nominative': 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'), + 'accusative': 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_') + }, i; + for (i = 0; i < 12; i++) { + assert.equal(moment([2013, i, 1]).format('D[] MMM'), '1 ' + monthsShort.accusative[i], '1 ' + monthsShort.accusative[i]); + assert.equal(moment([2013, i, 1]).format('[]D[] []MMM[]'), '1 ' + monthsShort.accusative[i] + '', '1 ' + monthsShort.accusative[i] + ''); + assert.equal(moment([2013, i, 1]).format('D[-й день] MMM'), '1-й день ' + monthsShort.accusative[i], '1-й день ' + monthsShort.accusative[i]); + assert.equal(moment([2013, i, 1]).format('D, MMM'), '1, ' + monthsShort.nominative[i], '1, ' + monthsShort.nominative[i]); + } + }); + test('format week', function (assert) { - var expected = 'Domingo Dom Dom_Segunda-Feira Seg 2ª_Terça-Feira Ter 3ª_Quarta-Feira Qua 4ª_Quinta-Feira Qui 5ª_Sexta-Feira Sex 6ª_Sábado Sáb Sáb'.split('_'), i; + var expected = 'Воскресенье Вс Вс_Понедельник Пн Пн_Вторник Вт Вт_Среда Ср Ср_Четверг Чт Чт_Пятница Пт Пт_Суббота Сб Сб'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -23519,78 +26857,155 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'segundos', '44 seconds = seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'um minuto', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'um minuto', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutos', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutos', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'uma hora', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'uma hora', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 horas', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 horas', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 horas', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'um dia', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'um dia', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dias', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'um dia', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dias', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dias', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'um mês', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'um mês', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'um mês', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 meses', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 meses', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 meses', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'um mês', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 meses', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'um ano', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 anos', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'um ano', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 anos', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'несколько секунд', '44 seconds = seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'минута', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'минута', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 минуты', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 31}), true), '31 минута', '31 minutes = 31 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 минуты', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'час', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'час', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 часа', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 часов', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 час', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'день', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'день', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 дня', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'день', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 дней', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 11}), true), '11 дней', '11 days = 11 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 21}), true), '21 день', '21 days = 21 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 дней', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'месяц', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'месяц', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'месяц', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 месяца', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 месяца', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 месяца', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'месяц', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 месяцев', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'год', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 года', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'год', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 лет', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'em segundos', 'prefix'); - assert.equal(moment(0).from(30000), 'há segundos', 'suffix'); + assert.equal(moment(30000).from(0), 'через несколько секунд', 'prefix'); + assert.equal(moment(0).from(30000), 'несколько секунд назад', 'suffix'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'em segundos', 'in seconds'); - assert.equal(moment().add({d: 5}).fromNow(), 'em 5 dias', 'in 5 days'); + assert.equal(moment().add({s: 30}).fromNow(), 'через несколько секунд', 'in seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'через 5 дней', 'in 5 days'); + assert.equal(moment().add({m: 31}).fromNow(), 'через 31 минуту', 'in 31 minutes = in 31 minutes'); + assert.equal(moment().subtract({m: 31}).fromNow(), '31 минуту назад', '31 minutes ago = 31 minutes ago'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'Hoje às 02:00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'Hoje às 02:25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'Hoje às 03:00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'Amanhã às 02:00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'Hoje às 01:00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'Ontem às 02:00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'Сегодня в 02:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'Сегодня в 02:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'Сегодня в 03:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'Завтра в 02:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'Сегодня в 01:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'Вчера в 02:00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { - var i, m; + var i, m, now; + + function makeFormatNext(d) { + switch (d.day()) { + case 0: + return '[В следующее] dddd [в] LT'; + case 1: + case 2: + case 4: + return '[В следующий] dddd [в] LT'; + case 3: + case 5: + case 6: + return '[В следующую] dddd [в] LT'; + } + } + + function makeFormatThis(d) { + if (d.day() === 2) { + return '[Во] dddd [в] LT'; + } + else { + return '[В] dddd [в] LT'; + } + } + + now = moment().startOf('week'); for (i = 2; i < 7; i++) { - m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd [às] LT'), 'Today + ' + i + ' days current time'); + m = moment(now).add({d: i}); + assert.equal(m.calendar(now), m.format(makeFormatThis(m)), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [às] LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(now), m.format(makeFormatThis(m)), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [às] LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(now), m.format(makeFormatThis(m)), 'Today + ' + i + ' days end of day'); + } + + now = moment().endOf('week'); + for (i = 2; i < 7; i++) { + m = moment(now).add({d: i}); + assert.equal(m.calendar(now), m.format(makeFormatNext(m)), 'Today + ' + i + ' days current time'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(now), m.format(makeFormatNext(m)), 'Today + ' + i + ' days beginning of day'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(now), m.format(makeFormatNext(m)), 'Today + ' + i + ' days end of day'); } }); test('calendar last week', function (assert) { - var i, m; + var i, m, now; + + function makeFormatLast(d) { + switch (d.day()) { + case 0: + return '[В прошлое] dddd [в] LT'; + case 1: + case 2: + case 4: + return '[В прошлый] dddd [в] LT'; + case 3: + case 5: + case 6: + return '[В прошлую] dddd [в] LT'; + } + } + + function makeFormatThis(d) { + if (d.day() === 2) { + return '[Во] dddd [в] LT'; + } + else { + return '[В] dddd [в] LT'; + } + } + + now = moment().startOf('week'); for (i = 2; i < 7; i++) { - m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), 'Today - ' + i + ' days current time'); + m = moment(now).subtract({d: i}); + assert.equal(m.calendar(now), m.format(makeFormatLast(m)), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(now), m.format(makeFormatLast(m)), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(now), m.format(makeFormatLast(m)), 'Today - ' + i + ' days end of day'); + } + + now = moment().endOf('week'); + for (i = 2; i < 7; i++) { + m = moment(now).subtract({d: i}); + assert.equal(m.calendar(now), m.format(makeFormatThis(m)), 'Today - ' + i + ' days current time'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(now), m.format(makeFormatThis(m)), 'Today - ' + i + ' days beginning of day'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(now), m.format(makeFormatThis(m)), 'Today - ' + i + ' days end of day'); } }); @@ -23609,11 +27024,11 @@ }); test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); + assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); test('weeks year starting monday', function (assert) { @@ -23648,33 +27063,33 @@ assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); + assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); + assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); + assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); + assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); + assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); + assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); + assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); + assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); + assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); + assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); + assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52º', 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1º', 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1º', 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2º', 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2º', 'Jan 15 2012 should be week 2'); + assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-я', 'Dec 26 2011 should be week 1'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-я', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2-я', 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2-я', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-я', 'Jan 9 2012 should be week 3'); }); test('lenient ordinal parsing', function (assert) { @@ -23715,8 +27130,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -23725,12 +27141,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -23748,8 +27166,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -23764,13 +27182,16 @@ }); } - localeModule('ro'); + localeModule('se'); test('parse', function (assert) { - var tests = 'ianuarie ian._februarie febr._martie mart._aprilie apr._mai mai_iunie iun._iulie iul._august aug._septembrie sept._octombrie oct._noiembrie nov._decembrie dec.'.split('_'), i; + var i, + tests = 'ođđajagemánnu ođđj_guovvamánnu guov_njukčamánnu njuk_cuoŋománnu cuo_miessemánnu mies_geassemánnu geas_suoidnemánnu suoi_borgemánnu borg_čakčamánnu čakč_golggotmánnu golg_skábmamánnu skáb_juovlamánnu juov'.split('_'); + function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } + for (i = 0; i < 12; i++) { tests[i] = tests[i].split(' '); equalTest(tests[i][0], 'MMM', i); @@ -23786,83 +27207,88 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss A', 'duminică, februarie 14 2010, 3:25:50 PM'], - ['ddd, hA', 'Dum, 3PM'], - ['M Mo MM MMMM MMM', '2 2 02 februarie febr.'], - ['YYYY YY', '2010 10'], - ['D Do DD', '14 14 14'], - ['d do dddd ddd dd', '0 0 duminică Dum Du'], - ['DDD DDDo DDDD', '45 45 045'], - ['w wo ww', '7 7 07'], - ['h hh', '3 03'], - ['H HH', '15 15'], - ['m mm', '25 25'], - ['s ss', '50 50'], - ['a A', 'pm PM'], - ['[a] DDDo[a zi a anului]', 'a 45a zi a anului'], - ['LTS', '15:25:50'], - ['L', '14.02.2010'], - ['LL', '14 februarie 2010'], - ['LLL', '14 februarie 2010 15:25'], - ['LLLL', 'duminică, 14 februarie 2010 15:25'], - ['l', '14.2.2010'], - ['ll', '14 febr. 2010'], - ['lll', '14 febr. 2010 15:25'], - ['llll', 'Dum, 14 febr. 2010 15:25'] + ['dddd, MMMM Do YYYY, h:mm:ss a', 'sotnabeaivi, guovvamánnu 14. 2010, 3:25:50 pm'], + ['ddd, hA', 'sotn, 3PM'], + ['M Mo MM MMMM MMM', '2 2. 02 guovvamánnu guov'], + ['YYYY YY', '2010 10'], + ['D Do DD', '14 14. 14'], + ['d do dddd ddd dd', '0 0. sotnabeaivi sotn s'], + ['DDD DDDo DDDD', '45 45. 045'], + ['w wo ww', '6 6. 06'], + ['h hh', '3 03'], + ['H HH', '15 15'], + ['m mm', '25 25'], + ['s ss', '50 50'], + ['a A', 'pm PM'], + ['[jagi] DDDo [beaivi]', 'jagi 45. beaivi'], + ['LTS', '15:25:50'], + ['L', '14.02.2010'], + ['LL', 'guovvamánnu 14. b. 2010'], + ['LLL', 'guovvamánnu 14. b. 2010 ti. 15:25'], + ['LLLL', 'sotnabeaivi, guovvamánnu 14. b. 2010 ti. 15:25'], + ['l', '14.2.2010'], + ['ll', 'guov 14. b. 2010'], + ['lll', 'guov 14. b. 2010 ti. 15:25'], + ['llll', 'sotn, guov 14. b. 2010 ti. 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; + for (i = 0; i < a.length; i++) { assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); } }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10'); - - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); + + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); test('format month', function (assert) { - var expected = 'ianuarie ian._februarie febr._martie mart._aprilie apr._mai mai_iunie iun._iulie iul._august aug._septembrie sept._octombrie oct._noiembrie nov._decembrie dec.'.split('_'), i; + var i, + expected = 'ođđajagemánnu ođđj_guovvamánnu guov_njukčamánnu njuk_cuoŋománnu cuo_miessemánnu mies_geassemánnu geas_suoidnemánnu suoi_borgemánnu borg_čakčamánnu čakč_golggotmánnu golg_skábmamánnu skáb_juovlamánnu juov'.split('_'); + for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); test('format week', function (assert) { - var expected = 'duminică Dum Du_luni Lun Lu_marți Mar Ma_miercuri Mie Mi_joi Joi Jo_vineri Vin Vi_sâmbătă Sâm Sâ'.split('_'), i; + var i, + expected = 'sotnabeaivi sotn s_vuossárga vuos v_maŋŋebárga maŋ m_gaskavahkku gask g_duorastat duor d_bearjadat bear b_lávvardat láv L'.split('_'); + for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -23870,90 +27296,85 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'câteva secunde', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'un minut', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'un minut', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minute', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 de minute', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'o oră', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'o oră', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 ore', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 ore', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 de ore', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'o zi', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'o zi', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 zile', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'o zi', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 zile', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 de zile', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'o lună', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'o lună', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'o lună', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 luni', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 luni', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 luni', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'o lună', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 luni', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'un an', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 ani', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'un an', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 ani', '5 years = 5 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 19}), true), '19 ani', '19 years = 19 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 20}), true), '20 de ani', '20 years = 20 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 100}), true), '100 de ani', '100 years = 100 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 101}), true), '101 ani', '101 years = 101 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 119}), true), '119 ani', '119 years = 119 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 120}), true), '120 de ani', '120 years = 120 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 219}), true), '219 ani', '219 years = 219 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 220}), true), '220 de ani', '220 years = 220 years'); + + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'moadde sekunddat', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'okta minuhta', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'okta minuhta', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minuhtat', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minuhtat', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'okta diimmu', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'okta diimmu', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 diimmut', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 diimmut', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 diimmut', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'okta beaivi', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'okta beaivi', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 beaivvit', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'okta beaivi', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 beaivvit', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 beaivvit', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'okta mánnu', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'okta mánnu', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'okta mánnu', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 mánut', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 mánut', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 mánut', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'okta mánnu', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 mánut', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'okta jahki', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 jagit', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'okta jahki', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 jagit', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'peste câteva secunde', 'prefix'); - assert.equal(moment(0).from(30000), 'câteva secunde în urmă', 'suffix'); + assert.equal(moment(30000).from(0), 'moadde sekunddat geažes', 'prefix'); + assert.equal(moment(0).from(30000), 'maŋit moadde sekunddat', 'suffix'); }); test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'câteva secunde în urmă', 'now from now should display as in the past'); + assert.equal(moment().fromNow(), 'maŋit moadde sekunddat', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'peste câteva secunde', 'in a few seconds'); - assert.equal(moment().add({d: 5}).fromNow(), 'peste 5 zile', 'in 5 days'); + assert.equal(moment().add({s: 30}).fromNow(), 'moadde sekunddat geažes', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), '5 beaivvit geažes', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'azi la 2:00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'azi la 2:25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'azi la 3:00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'mâine la 2:00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'azi la 1:00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'ieri la 2:00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'otne ti 02:00', 'Today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'otne ti 02:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'otne ti 03:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'ihttin ti 02:00', 'Tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'otne ti 01:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'ikte ti 02:00', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; + for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd [la] LT'), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd [ti] LT'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd [la] LT'), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd [ti] LT'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd [la] LT'), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd [ti] LT'), 'Today + ' + i + ' days end of day'); } }); test('calendar last week', function (assert) { var i, m; + for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('[fosta] dddd [la] LT'), 'Today - ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('[ovddit] dddd [ti] LT'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[fosta] dddd [la] LT'), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[ovddit] dddd [ti] LT'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[fosta] dddd [la] LT'), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[ovddit] dddd [ti] LT'), 'Today - ' + i + ' days end of day'); } }); @@ -23972,11 +27393,11 @@ }); test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); + assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); test('weeks year starting monday', function (assert) { @@ -24011,33 +27432,33 @@ assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); + assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); + assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); + assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); + assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); + assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); + assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); + assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); + assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); + assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); + assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); + assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); + assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); + assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1', 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2', 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3', 'Jan 9 2012 should be week 3'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); test('lenient ordinal parsing', function (assert) { @@ -24078,8 +27499,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -24088,12 +27510,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -24111,8 +27535,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -24127,10 +27551,11 @@ }); } - localeModule('ru'); + localeModule('si'); + /*jshint -W100*/ test('parse', function (assert) { - var tests = 'январь янв_февраль фев_март март_апрель апр_май май_июнь июнь_июль июль_август авг_сентябрь сен_октябрь окт_ноябрь ноя_декабрь дек'.split('_'), i; + var tests = 'ජනවාරි ජන_පෙබරවාරි පෙබ_මාර්තු මාර්_අප්‍රේල් අප්_මැයි මැයි_ජූනි ජූනි_ජූලි ජූලි_අගෝස්තු අගෝ_සැප්තැම්බර් සැප්_ඔක්තෝබර් ඔක්_නොවැම්බර් නොවැ_දෙසැම්බර් දෙසැ'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -24147,35 +27572,32 @@ } }); - test('parse exceptional case', function (assert) { - assert.equal(moment('11 мая 1989', ['DD MMMM YYYY']).format('DD-MM-YYYY'), '11-05-1989'); - }); - test('format', function (assert) { var a = [ - ['dddd, Do MMMM YYYY, HH:mm:ss', 'воскресенье, 14-го февраля 2010, 15:25:50'], - ['ddd, h A', 'вс, 3 дня'], - ['M Mo MM MMMM MMM', '2 2-й 02 февраль фев'], + ['YYYY MMMM Do dddd, a h:mm:ss', '2010 පෙබරවාරි 14 වැනි ඉරිදා, ප.ව. 3:25:50'], + ['YYYY MMMM Do dddd, a h:mm:ss', '2010 පෙබරවාරි 14 වැනි ඉරිදා, ප.ව. 3:25:50'], + ['ddd, A h', 'ඉරි, පස් වරු 3'], + ['M Mo MM MMMM MMM', '2 2 වැනි 02 පෙබරවාරි පෙබ'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14-го 14'], - ['d do dddd ddd dd', '0 0-й воскресенье вс вс'], - ['DDD DDDo DDDD', '45 45-й 045'], - ['w wo ww', '7 7-я 07'], + ['D Do DD', '14 14 වැනි 14'], + ['d do dddd ddd dd', '0 0 වැනි ඉරිදා ඉරි ඉ'], + ['DDD DDDo DDDD', '45 45 වැනි 045'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], - ['a A', 'дня дня'], - ['DDDo [день года]', '45-й день года'], - ['LTS', '15:25:50'], - ['L', '14.02.2010'], - ['LL', '14 февраля 2010 г.'], - ['LLL', '14 февраля 2010 г., 15:25'], - ['LLLL', 'воскресенье, 14 февраля 2010 г., 15:25'], - ['l', '14.2.2010'], - ['ll', '14 фев 2010 г.'], - ['lll', '14 фев 2010 г., 15:25'], - ['llll', 'вс, 14 фев 2010 г., 15:25'] + ['a A', 'ප.ව. පස් වරු'], + ['[වසරේ] DDDo [දිනය]', 'වසරේ 45 වැනි දිනය'], + ['LTS', 'ප.ව. 3:25:50'], + ['LT', 'ප.ව. 3:25'], + ['L', '2010/02/14'], + ['LL', '2010 පෙබරවාරි 14'], + ['LLL', '2010 පෙබරවාරි 14, ප.ව. 3:25'], + ['LLLL', '2010 පෙබරවාරි 14 වැනි ඉරිදා, ප.ව. 3:25:50'], + ['l', '2010/2/14'], + ['ll', '2010 පෙබ 14'], + ['lll', '2010 පෙබ 14, ප.ව. 3:25'], + ['llll', '2010 පෙබ 14 වැනි ඉරි, ප.ව. 3:25:50'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -24184,111 +27606,52 @@ } }); - test('format meridiem', function (assert) { - assert.equal(moment([2012, 11, 28, 0, 0]).format('A'), 'ночи', 'night'); - assert.equal(moment([2012, 11, 28, 3, 59]).format('A'), 'ночи', 'night'); - assert.equal(moment([2012, 11, 28, 4, 0]).format('A'), 'утра', 'morning'); - assert.equal(moment([2012, 11, 28, 11, 59]).format('A'), 'утра', 'morning'); - assert.equal(moment([2012, 11, 28, 12, 0]).format('A'), 'дня', 'afternoon'); - assert.equal(moment([2012, 11, 28, 16, 59]).format('A'), 'дня', 'afternoon'); - assert.equal(moment([2012, 11, 28, 17, 0]).format('A'), 'вечера', 'evening'); - assert.equal(moment([2012, 11, 28, 23, 59]).format('A'), 'вечера', 'evening'); - }); - test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-й', '1-й'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-й', '2-й'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-й', '3-й'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4-й', '4-й'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5-й', '5-й'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6-й', '6-й'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7-й', '7-й'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8-й', '8-й'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9-й', '9-й'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10-й', '10-й'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1 වැනි', '1 වැනි'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2 වැනි', '2 වැනි'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3 වැනි', '3 වැනි'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4 වැනි', '4 වැනි'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5 වැනි', '5 වැනි'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6 වැනි', '6 වැනි'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7 වැනි', '7 වැනි'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8 වැනි', '8 වැනි'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9 වැනි', '9 වැනි'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10 වැනි', '10 වැනි'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11-й', '11-й'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12-й', '12-й'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13-й', '13-й'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14-й', '14-й'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15-й', '15-й'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16-й', '16-й'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17-й', '17-й'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18-й', '18-й'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19-й', '19-й'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20-й', '20-й'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11 වැනි', '11 වැනි'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12 වැනි', '12 වැනි'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13 වැනි', '13 වැනි'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14 වැනි', '14 වැනි'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15 වැනි', '15 වැනි'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16 වැනි', '16 වැනි'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17 වැනි', '17 වැනි'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18 වැනි', '18 වැනි'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19 වැනි', '19 වැනි'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20 වැනි', '20 වැනි'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21-й', '21-й'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22-й', '22-й'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23-й', '23-й'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24-й', '24-й'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25-й', '25-й'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26-й', '26-й'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27-й', '27-й'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28-й', '28-й'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29-й', '29-й'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30-й', '30-й'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21 වැනි', '21 වැනි'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22 වැනි', '22 වැනි'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23 වැනි', '23 වැනි'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24 වැනි', '24 වැනි'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25 වැනි', '25 වැනි'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26 වැනි', '26 වැනි'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27 වැනි', '27 වැනි'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28 වැනි', '28 වැනි'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29 වැනි', '29 වැනි'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30 වැනි', '30 වැනි'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-й', '31-й'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31 වැනි', '31 වැනි'); }); test('format month', function (assert) { - var expected = 'январь янв_февраль фев_март март_апрель апр_май май_июнь июнь_июль июль_август авг_сентябрь сен_октябрь окт_ноябрь ноя_декабрь дек'.split('_'), i; + var expected = 'ජනවාරි ජන_පෙබරවාරි පෙබ_මාර්තු මාර්_අප්‍රේල් අප්_මැයි මැයි_ජූනි ජූනි_ජූලි ජූලි_අගෝස්තු අගෝ_සැප්තැම්බර් සැප්_ඔක්තෝබර් ඔක්_නොවැම්බර් නොවැ_දෙසැම්බර් දෙසැ'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); - test('format month case', function (assert) { - var months = { - 'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'), - 'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_') - }, i; - for (i = 0; i < 12; i++) { - assert.equal(moment([2011, i, 1]).format('D MMMM'), '1 ' + months.accusative[i], '1 ' + months.accusative[i]); - assert.equal(moment([2011, i, 1]).format('MMMM'), months.nominative[i], '1 ' + months.nominative[i]); - } - }); - - test('format month short case', function (assert) { - var monthsShort = { - 'nominative': 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'), - 'accusative': 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_') - }, i; - for (i = 0; i < 12; i++) { - assert.equal(moment([2011, i, 1]).format('D MMM'), '1 ' + monthsShort.accusative[i], '1 ' + monthsShort.accusative[i]); - assert.equal(moment([2011, i, 1]).format('MMM'), monthsShort.nominative[i], '1 ' + monthsShort.nominative[i]); - } - }); - - test('format month case with escaped symbols', function (assert) { - var months = { - 'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'), - 'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_') - }, i; - for (i = 0; i < 12; i++) { - assert.equal(moment([2013, i, 1]).format('D[] MMMM'), '1 ' + months.accusative[i], '1 ' + months.accusative[i]); - assert.equal(moment([2013, i, 1]).format('[]D[] []MMMM[]'), '1 ' + months.accusative[i] + '', '1 ' + months.accusative[i] + ''); - assert.equal(moment([2013, i, 1]).format('D[-й день] MMMM'), '1-й день ' + months.accusative[i], '1-й день ' + months.accusative[i]); - assert.equal(moment([2013, i, 1]).format('D, MMMM'), '1, ' + months.nominative[i], '1, ' + months.nominative[i]); - } - }); - - test('format month short case with escaped symbols', function (assert) { - var monthsShort = { - 'nominative': 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'), - 'accusative': 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_') - }, i; - for (i = 0; i < 12; i++) { - assert.equal(moment([2013, i, 1]).format('D[] MMM'), '1 ' + monthsShort.accusative[i], '1 ' + monthsShort.accusative[i]); - assert.equal(moment([2013, i, 1]).format('[]D[] []MMM[]'), '1 ' + monthsShort.accusative[i] + '', '1 ' + monthsShort.accusative[i] + ''); - assert.equal(moment([2013, i, 1]).format('D[-й день] MMM'), '1-й день ' + monthsShort.accusative[i], '1-й день ' + monthsShort.accusative[i]); - assert.equal(moment([2013, i, 1]).format('D, MMM'), '1, ' + monthsShort.nominative[i], '1, ' + monthsShort.nominative[i]); - } - }); - test('format week', function (assert) { - var expected = 'воскресенье вс вс_понедельник пн пн_вторник вт вт_среда ср ср_четверг чт чт_пятница пт пт_суббота сб сб'.split('_'), i; + var expected = 'ඉරිදා ඉරි ඉ_සඳුදා සඳු ස_අඟහරුවාදා අඟ අ_බදාදා බදා බ_බ්‍රහස්පතින්දා බ්‍රහ බ්‍ර_සිකුරාදා සිකු සි_සෙනසුරාදා සෙන සෙ'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -24296,128 +27659,83 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'несколько секунд', '44 seconds = seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'минута', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'минута', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 минуты', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 31}), true), '31 минута', '31 minutes = 31 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 минуты', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'час', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'час', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 часа', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 часов', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 час', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'день', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'день', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 дня', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'день', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 дней', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 11}), true), '11 дней', '11 days = 11 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 21}), true), '21 день', '21 days = 21 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 дней', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'месяц', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'месяц', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'месяц', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 месяца', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 месяца', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 месяца', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'месяц', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 месяцев', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'год', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 года', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'год', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 лет', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'තත්පර කිහිපය', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'මිනිත්තුව', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'මිනිත්තුව', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), 'මිනිත්තු 2', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), 'මිනිත්තු 44', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'පැය', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'පැය', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), 'පැය 2', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), 'පැය 5', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), 'පැය 21', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'දිනය', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'දිනය', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), 'දින 2', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'දිනය', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), 'දින 5', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), 'දින 25', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'මාසය', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'මාසය', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'මාසය', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), 'මාස 2', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), 'මාස 2', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), 'මාස 3', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'මාසය', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), 'මාස 5', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'වසර', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), 'වසර 2', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'වසර', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), 'වසර 5', '5 years = 5 years'); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'через несколько секунд', 'prefix'); - assert.equal(moment(0).from(30000), 'несколько секунд назад', 'suffix'); + assert.equal(moment(30000).from(0), 'තත්පර කිහිපයකින්', 'prefix'); + assert.equal(moment(0).from(30000), 'තත්පර කිහිපයකට පෙර', 'suffix'); + }); + + test('now from now', function (assert) { + assert.equal(moment().fromNow(), 'තත්පර කිහිපයකට පෙර', 'now from now should display as in the past'); }); test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'через несколько секунд', 'in seconds'); - assert.equal(moment().add({d: 5}).fromNow(), 'через 5 дней', 'in 5 days'); - assert.equal(moment().add({m: 31}).fromNow(), 'через 31 минуту', 'in 31 minutes = in 31 minutes'); - assert.equal(moment().subtract({m: 31}).fromNow(), '31 минуту назад', '31 minutes ago = 31 minutes ago'); + assert.equal(moment().add({s: 30}).fromNow(), 'තත්පර කිහිපයකින්', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'දින 5කින්', 'in 5 days'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'Сегодня в 02:00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'Сегодня в 02:25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'Сегодня в 03:00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'Завтра в 02:00', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'Сегодня в 01:00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'Вчера в 02:00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'අද පෙ.ව. 2:00ට', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'අද පෙ.ව. 2:25ට', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'අද පෙ.ව. 3:00ට', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'හෙට පෙ.ව. 2:00ට', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'අද පෙ.ව. 1:00ට', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'ඊයේ පෙ.ව. 2:00ට', 'yesterday at the same time'); }); test('calendar next week', function (assert) { var i, m; - function makeFormat(d) { - return d.day() === 2 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT'; - } - for (i = 2; i < 7; i++) { m = moment().add({d: i}); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today + ' + i + ' days current time'); + assert.equal(m.calendar(), m.format('dddd LT[ට]'), 'Today + ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today + ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('dddd LT[ට]'), 'Today + ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today + ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('dddd LT[ට]'), 'Today + ' + i + ' days end of day'); } }); test('calendar last week', function (assert) { - var i, m, now; - - function makeFormatLast(d) { - switch (d.day()) { - case 0: - return '[В прошлое] dddd [в] LT'; - case 1: - case 2: - case 4: - return '[В прошлый] dddd [в] LT'; - case 3: - case 5: - case 6: - return '[В прошлую] dddd [в] LT'; - } - } - - function makeFormatThis(d) { - switch (d.day()) { - case 2: - return '[Во] dddd [в] LT'; - case 0: - case 1: - case 3: - case 4: - case 5: - case 6: - return '[В] dddd [в] LT'; - } - } - - now = moment().startOf('week'); - for (i = 2; i < 7; i++) { - m = moment(now).subtract({d: i}); - assert.equal(m.calendar(now), m.format(makeFormatLast(m)), 'Today - ' + i + ' days current time'); - m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(now), m.format(makeFormatLast(m)), 'Today - ' + i + ' days beginning of day'); - m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(now), m.format(makeFormatLast(m)), 'Today - ' + i + ' days end of day'); - } + var i, m; - now = moment().endOf('week'); for (i = 2; i < 7; i++) { - m = moment(now).subtract({d: i}); - assert.equal(m.calendar(now), m.format(makeFormatThis(m)), 'Today - ' + i + ' days current time'); + m = moment().subtract({d: i}); + assert.equal(m.calendar(), m.format('[පසුගිය] dddd LT[ට]'), 'Today - ' + i + ' days current time'); m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(now), m.format(makeFormatThis(m)), 'Today - ' + i + ' days beginning of day'); + assert.equal(m.calendar(), m.format('[පසුගිය] dddd LT[ට]'), 'Today - ' + i + ' days beginning of day'); m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(now), m.format(makeFormatThis(m)), 'Today - ' + i + ' days end of day'); + assert.equal(m.calendar(), m.format('[පසුගිය] dddd LT[ට]'), 'Today - ' + i + ' days end of day'); } }); @@ -24435,75 +27753,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - - test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-я', 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-я', 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2-я', 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2-я', 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-я', 'Jan 9 2012 should be week 3'); - }); - test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { @@ -24542,8 +27791,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -24552,301 +27802,14 @@ var test = QUnit.test; - function module (name, lifecycle) { - QUnit.module(name, { - setup : function () { - moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); - }; - if (lifecycle && lifecycle.setup) { - lifecycle.setup(); - } - }, - teardown : function () { - if (lifecycle && lifecycle.teardown) { - lifecycle.teardown(); - } - } - }); - } - - function localeModule (name, lifecycle) { - QUnit.module('locale:' + name, { - setup : function () { - moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); - }; - if (lifecycle && lifecycle.setup) { - lifecycle.setup(); - } - }, - teardown : function () { - moment.locale('en'); - if (lifecycle && lifecycle.teardown) { - lifecycle.teardown(); - } - } - }); - } - - localeModule('si'); - - /*jshint -W100*/ - test('parse', function (assert) { - var tests = 'ජනවාරි ජන_පෙබරවාරි පෙබ_මාර්තු මාර්_අප්‍රේල් අප්_මැයි මැයි_ජූනි ජූනි_ජූලි ජූලි_අගෝස්තු අගෝ_සැප්තැම්බර් සැප්_ඔක්තෝබර් ඔක්_නොවැම්බර් නොවැ_දෙසැම්බර් දෙසැ'.split('_'), i; - function equalTest(input, mmm, i) { - assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); - } - for (i = 0; i < 12; i++) { - tests[i] = tests[i].split(' '); - equalTest(tests[i][0], 'MMM', i); - equalTest(tests[i][1], 'MMM', i); - equalTest(tests[i][0], 'MMMM', i); - equalTest(tests[i][1], 'MMMM', i); - equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i); - equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); - equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); - equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); - } - }); - - test('format', function (assert) { - var a = [ - ['YYYY MMMM Do dddd, a h:mm:ss', '2010 පෙබරවාරි 14 වැනි ඉරිදා, ප.ව. 3:25:50'], - ['YYYY MMMM Do dddd, a h:mm:ss', '2010 පෙබරවාරි 14 වැනි ඉරිදා, ප.ව. 3:25:50'], - ['ddd, A h', 'ඉරි, පස් වරු 3'], - ['M Mo MM MMMM MMM', '2 2 වැනි 02 පෙබරවාරි පෙබ'], - ['YYYY YY', '2010 10'], - ['D Do DD', '14 14 වැනි 14'], - ['d do dddd ddd dd', '0 0 වැනි ඉරිදා ඉරි ඉ'], - ['DDD DDDo DDDD', '45 45 වැනි 045'], - ['h hh', '3 03'], - ['H HH', '15 15'], - ['m mm', '25 25'], - ['s ss', '50 50'], - ['a A', 'ප.ව. පස් වරු'], - ['[වසරේ] DDDo [දිනය]', 'වසරේ 45 වැනි දිනය'], - ['LTS', 'ප.ව. 3:25:50'], - ['LT', 'ප.ව. 3:25'], - ['L', '2010/02/14'], - ['LL', '2010 පෙබරවාරි 14'], - ['LLL', '2010 පෙබරවාරි 14, ප.ව. 3:25'], - ['LLLL', '2010 පෙබරවාරි 14 වැනි ඉරිදා, ප.ව. 3:25:50'], - ['l', '2010/2/14'], - ['ll', '2010 පෙබ 14'], - ['lll', '2010 පෙබ 14, ප.ව. 3:25'], - ['llll', '2010 පෙබ 14 වැනි ඉරි, ප.ව. 3:25:50'] - ], - b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), - i; - for (i = 0; i < a.length; i++) { - assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); - } - }); - - test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1 වැනි', '1 වැනි'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2 වැනි', '2 වැනි'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3 වැනි', '3 වැනි'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4 වැනි', '4 වැනි'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5 වැනි', '5 වැනි'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6 වැනි', '6 වැනි'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7 වැනි', '7 වැනි'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8 වැනි', '8 වැනි'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9 වැනි', '9 වැනි'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10 වැනි', '10 වැනි'); - - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11 වැනි', '11 වැනි'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12 වැනි', '12 වැනි'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13 වැනි', '13 වැනි'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14 වැනි', '14 වැනි'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15 වැනි', '15 වැනි'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16 වැනි', '16 වැනි'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17 වැනි', '17 වැනි'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18 වැනි', '18 වැනි'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19 වැනි', '19 වැනි'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20 වැනි', '20 වැනි'); - - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21 වැනි', '21 වැනි'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22 වැනි', '22 වැනි'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23 වැනි', '23 වැනි'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24 වැනි', '24 වැනි'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25 වැනි', '25 වැනි'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26 වැනි', '26 වැනි'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27 වැනි', '27 වැනි'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28 වැනි', '28 වැනි'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29 වැනි', '29 වැනි'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30 වැනි', '30 වැනි'); - - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31 වැනි', '31 වැනි'); - }); - - test('format month', function (assert) { - var expected = 'ජනවාරි ජන_පෙබරවාරි පෙබ_මාර්තු මාර්_අප්‍රේල් අප්_මැයි මැයි_ජූනි ජූනි_ජූලි ජූලි_අගෝස්තු අගෝ_සැප්තැම්බර් සැප්_ඔක්තෝබර් ඔක්_නොවැම්බර් නොවැ_දෙසැම්බර් දෙසැ'.split('_'), i; - for (i = 0; i < expected.length; i++) { - assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); - } - }); - - test('format week', function (assert) { - var expected = 'ඉරිදා ඉරි ඉ_සඳුදා සඳු ස_අඟහරුවාදා අඟ අ_බදාදා බදා බ_බ්‍රහස්පතින්දා බ්‍රහ බ්‍ර_සිකුරාදා සිකු සි_සෙනසුරාදා සෙන සෙ'.split('_'), i; - for (i = 0; i < expected.length; i++) { - assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); - } - }); - - test('from', function (assert) { - var start = moment([2007, 1, 28]); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'තත්පර කිහිපය', '44 seconds = a few seconds'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'මිනිත්තුව', '45 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'මිනිත්තුව', '89 seconds = a minute'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), 'මිනිත්තු 2', '90 seconds = 2 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), 'මිනිත්තු 44', '44 minutes = 44 minutes'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'පැය', '45 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'පැය', '89 minutes = an hour'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), 'පැය 2', '90 minutes = 2 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), 'පැය 5', '5 hours = 5 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), 'පැය 21', '21 hours = 21 hours'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'දිනය', '22 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'දිනය', '35 hours = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), 'දින 2', '36 hours = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'දිනය', '1 day = a day'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), 'දින 5', '5 days = 5 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), 'දින 25', '25 days = 25 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'මාසය', '26 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'මාසය', '30 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'මාසය', '43 days = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), 'මාස 2', '46 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), 'මාස 2', '75 days = 2 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), 'මාස 3', '76 days = 3 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'මාසය', '1 month = a month'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), 'මාස 5', '5 months = 5 months'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'වසර', '345 days = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), 'වසර 2', '548 days = 2 years'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'වසර', '1 year = a year'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), 'වසර 5', '5 years = 5 years'); - }); - - test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'තත්පර කිහිපයකින්', 'prefix'); - assert.equal(moment(0).from(30000), 'තත්පර කිහිපයකට පෙර', 'suffix'); - }); - - test('now from now', function (assert) { - assert.equal(moment().fromNow(), 'තත්පර කිහිපයකට පෙර', 'now from now should display as in the past'); - }); - - test('fromNow', function (assert) { - assert.equal(moment().add({s: 30}).fromNow(), 'තත්පර කිහිපයකින්', 'in a few seconds'); - assert.equal(moment().add({d: 5}).fromNow(), 'දින 5කින්', 'in 5 days'); - }); - - test('calendar day', function (assert) { - var a = moment().hours(2).minutes(0).seconds(0); - - assert.equal(moment(a).calendar(), 'අද පෙ.ව. 2:00ට', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'අද පෙ.ව. 2:25ට', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'අද පෙ.ව. 3:00ට', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'හෙට පෙ.ව. 2:00ට', 'tomorrow at the same time'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'අද පෙ.ව. 1:00ට', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'ඊයේ පෙ.ව. 2:00ට', 'yesterday at the same time'); - }); - - test('calendar next week', function (assert) { - var i, m; - for (i = 2; i < 7; i++) { - m = moment().add({d: i}); - assert.equal(m.calendar(), m.format('dddd LT[ට]'), 'Today + ' + i + ' days current time'); - m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('dddd LT[ට]'), 'Today + ' + i + ' days beginning of day'); - m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('dddd LT[ට]'), 'Today + ' + i + ' days end of day'); - } - }); - - test('calendar last week', function (assert) { - var i, m; - - for (i = 2; i < 7; i++) { - m = moment().subtract({d: i}); - assert.equal(m.calendar(), m.format('[පසුගිය] dddd LT[ට]'), 'Today - ' + i + ' days current time'); - m.hours(0).minutes(0).seconds(0).milliseconds(0); - assert.equal(m.calendar(), m.format('[පසුගිය] dddd LT[ට]'), 'Today - ' + i + ' days beginning of day'); - m.hours(23).minutes(59).seconds(59).milliseconds(999); - assert.equal(m.calendar(), m.format('[පසුගිය] dddd LT[ට]'), 'Today - ' + i + ' days end of day'); - } - }); - - test('calendar all else', function (assert) { - var weeksAgo = moment().subtract({w: 1}), - weeksFromNow = moment().add({w: 1}); - - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); - - weeksAgo = moment().subtract({w: 2}); - weeksFromNow = moment().add({w: 2}); - - assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); - assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); - }); - - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - -})); - -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : - typeof define === 'function' && define.amd ? define(['../../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - /*global QUnit:false*/ - - var test = QUnit.test; + var expect = QUnit.expect; function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -24864,8 +27827,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -25274,8 +28237,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -25284,12 +28248,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -25307,8 +28273,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -25753,8 +28719,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -25763,12 +28730,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -25786,8 +28755,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -26124,8 +29093,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -26134,12 +29104,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -26157,8 +29129,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -26514,8 +29486,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -26524,12 +29497,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -26547,8 +29522,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -26904,8 +29879,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -26914,12 +29890,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -26937,8 +29915,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -27259,8 +30237,367 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + /*global QUnit:false*/ + + var test = QUnit.test; + + var expect = QUnit.expect; + + function module (name, lifecycle) { + QUnit.module(name, { + setup : function () { + moment.locale('en'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + function localeModule (name, lifecycle) { + QUnit.module('locale:' + name, { + setup : function () { + moment.locale(name); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + moment.locale('en'); + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + localeModule('sw'); + + test('parse', function (assert) { + var tests = 'Januari Jan_Februari Feb_Machi Mac_Aprili Apr_Mei Mei_Juni Jun_Julai Jul_Agosti Ago_Septemba Sep_Oktoba Okt_Novemba Nov_Desemba Des'.split('_'), i; + function equalTest(input, mmm, i) { + assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); + } + for (i = 0; i < 12; i++) { + tests[i] = tests[i].split(' '); + equalTest(tests[i][0], 'MMM', i); + equalTest(tests[i][1], 'MMM', i); + equalTest(tests[i][0], 'MMMM', i); + equalTest(tests[i][1], 'MMMM', i); + equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); + } + }); + + test('format', function (assert) { + var a = [ + ['dddd, MMMM Do YYYY, h:mm:ss a', 'Jumapili, Februari 14 2010, 3:25:50 pm'], + ['ddd, hA', 'Jpl, 3PM'], + ['M Mo MM MMMM MMM', '2 2 02 Februari Feb'], + ['YYYY YY', '2010 10'], + ['D Do DD', '14 14 14'], + ['d do dddd ddd dd', '0 0 Jumapili Jpl J2'], + ['DDD DDDo DDDD', '45 45 045'], + ['w wo ww', '7 7 07'], + ['h hh', '3 03'], + ['H HH', '15 15'], + ['m mm', '25 25'], + ['s ss', '50 50'], + ['a A', 'pm PM'], + ['[siku] DDDo [ya mwaka]', 'siku 45 ya mwaka'], + ['LTS', '15:25:50'], + ['L', '14.02.2010'], + ['LL', '14 Februari 2010'], + ['LLL', '14 Februari 2010 15:25'], + ['LLLL', 'Jumapili, 14 Februari 2010 15:25'], + ['l', '14.2.2010'], + ['ll', '14 Feb 2010'], + ['lll', '14 Feb 2010 15:25'], + ['llll', 'Jpl, 14 Feb 2010 15:25'] + ], + b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), + i; + for (i = 0; i < a.length; i++) { + assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); + } + }); + + test('format ordinal', function (assert) { + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10'); + + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20'); + + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30'); + + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31'); + }); + + test('format month', function (assert) { + var expected = 'Januari Jan_Februari Feb_Machi Mac_Aprili Apr_Mei Mei_Juni Jun_Julai Jul_Agosti Ago_Septemba Sep_Oktoba Okt_Novemba Nov_Desemba Des'.split('_'), i; + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); + } + }); + + test('format week', function (assert) { + var expected = 'Jumapili Jpl J2_Jumatatu Jtat J3_Jumanne Jnne J4_Jumatano Jtan J5_Alhamisi Alh Al_Ijumaa Ijm Ij_Jumamosi Jmos J1'.split('_'), i; + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); + } + }); + + test('from', function (assert) { + var start = moment([2007, 1, 28]); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'hivi punde', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'dakika moja', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'dakika moja', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), 'dakika 2', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), 'dakika 44', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'saa limoja', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'saa limoja', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), 'masaa 2', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), 'masaa 5', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), 'masaa 21', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'siku moja', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'siku moja', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), 'masiku 2', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'siku moja', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), 'masiku 5', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), 'masiku 25', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'mwezi mmoja', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'mwezi mmoja', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'mwezi mmoja', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), 'miezi 2', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), 'miezi 2', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), 'miezi 3', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'mwezi mmoja', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), 'miezi 5', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'mwaka mmoja', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), 'miaka 2', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'mwaka mmoja', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), 'miaka 5', '5 years = 5 years'); + }); + + test('suffix', function (assert) { + assert.equal(moment(30000).from(0), 'hivi punde baadaye', 'prefix'); + assert.equal(moment(0).from(30000), 'tokea hivi punde', 'suffix'); + }); + + test('now from now', function (assert) { + assert.equal(moment().fromNow(), 'tokea hivi punde', 'now from now should display as in the past'); + }); + + test('fromNow', function (assert) { + assert.equal(moment().add({s: 30}).fromNow(), 'hivi punde baadaye', 'in a few seconds'); + assert.equal(moment().add({d: 5}).fromNow(), 'masiku 5 baadaye', 'in 5 days'); + }); + + test('calendar day', function (assert) { + var a = moment().hours(2).minutes(0).seconds(0); + assert.equal(moment(a).calendar(), 'leo saa 02:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'leo saa 02:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'leo saa 03:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'kesho saa 02:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'leo saa 01:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'jana 02:00', 'yesterday at the same time'); + }); + + test('calendar next week', function (assert) { + var i, m; + for (i = 2; i < 7; i++) { + m = moment().add({d: i}); + assert.equal(m.calendar(), m.format('[wiki ijayo] dddd [saat] LT'), 'Today + ' + i + ' days current time'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format('[wiki ijayo] dddd [saat] LT'), 'Today + ' + i + ' days beginning of day'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format('[wiki ijayo] dddd [saat] LT'), 'Today + ' + i + ' days end of day'); + } + }); + + test('calendar last week', function (assert) { + var i, m; + + for (i = 2; i < 7; i++) { + m = moment().subtract({d: i}); + assert.equal(m.calendar(), m.format('[wiki iliyopita] dddd [saat] LT'), 'Today - ' + i + ' days current time'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format('[wiki iliyopita] dddd [saat] LT'), 'Today - ' + i + ' days beginning of day'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format('[wiki iliyopita] dddd [saat] LT'), 'Today - ' + i + ' days end of day'); + } + }); + + test('calendar all else', function (assert) { + var weeksAgo = moment().subtract({w: 1}), + weeksFromNow = moment().add({w: 1}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); + + weeksAgo = moment().subtract({w: 2}); + weeksFromNow = moment().add({w: 2}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); + }); + + test('weeks year starting sunday', function (assert) { + assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); + }); + + test('weeks year starting monday', function (assert) { + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); + assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); + assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); + }); + + test('weeks year starting tuesday', function (assert) { + assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); + assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); + assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); + assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); + assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); + }); + + test('weeks year starting wednesday', function (assert) { + assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); + assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); + assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); + assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); + assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); + }); + + test('weeks year starting thursday', function (assert) { + assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); + assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); + assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); + assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); + assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); + }); + + test('weeks year starting friday', function (assert) { + assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); + assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); + assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); + assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); + assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); + }); + + test('weeks year starting saturday', function (assert) { + assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); + assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); + assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); + assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); + assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); + }); + + test('weeks year starting sunday format', function (assert) { + assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1', 'Dec 26 2011 should be week 1'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2', 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3', 'Jan 9 2012 should be week 3'); + }); + + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + +})); + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -27269,12 +30606,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -27292,8 +30631,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -27330,29 +30669,29 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss a', 'ஞாயிற்றுக்கிழமை, பிப்ரவரி 14வது 2010, 3:25:50 எற்பாடு'], - ['ddd, hA', 'ஞாயிறு, 3 எற்பாடு'], - ['M Mo MM MMMM MMM', '2 2வது 02 பிப்ரவரி பிப்ரவரி'], - ['YYYY YY', '2010 10'], - ['D Do DD', '14 14வது 14'], - ['d do dddd ddd dd', '0 0வது ஞாயிற்றுக்கிழமை ஞாயிறு ஞா'], - ['DDD DDDo DDDD', '45 45வது 045'], - ['w wo ww', '8 8வது 08'], - ['h hh', '3 03'], - ['H HH', '15 15'], - ['m mm', '25 25'], - ['s ss', '50 50'], + ['dddd, MMMM Do YYYY, h:mm:ss a', 'ஞாயிற்றுக்கிழமை, பிப்ரவரி ௧௪வது ௨௦௧௦, ௩:௨௫:௫௦ எற்பாடு'], + ['ddd, hA', 'ஞாயிறு, ௩ எற்பாடு'], + ['M Mo MM MMMM MMM', '௨ ௨வது ௦௨ பிப்ரவரி பிப்ரவரி'], + ['YYYY YY', '௨௦௧௦ ௧௦'], + ['D Do DD', '௧௪ ௧௪வது ௧௪'], + ['d do dddd ddd dd', '௦ ௦வது ஞாயிற்றுக்கிழமை ஞாயிறு ஞா'], + ['DDD DDDo DDDD', '௪௫ ௪௫வது ௦௪௫'], + ['w wo ww', '௮ ௮வது ௦௮'], + ['h hh', '௩ ௦௩'], + ['H HH', '௧௫ ௧௫'], + ['m mm', '௨௫ ௨௫'], + ['s ss', '௫௦ ௫௦'], ['a A', ' எற்பாடு எற்பாடு'], - ['[ஆண்டின்] DDDo [நாள்]', 'ஆண்டின் 45வது நாள்'], - ['LTS', '15:25:50'], - ['L', '14/02/2010'], - ['LL', '14 பிப்ரவரி 2010'], - ['LLL', '14 பிப்ரவரி 2010, 15:25'], - ['LLLL', 'ஞாயிற்றுக்கிழமை, 14 பிப்ரவரி 2010, 15:25'], - ['l', '14/2/2010'], - ['ll', '14 பிப்ரவரி 2010'], - ['lll', '14 பிப்ரவரி 2010, 15:25'], - ['llll', 'ஞாயிறு, 14 பிப்ரவரி 2010, 15:25'] + ['[ஆண்டின்] DDDo [நாள்]', 'ஆண்டின் ௪௫வது நாள்'], + ['LTS', '௧௫:௨௫:௫௦'], + ['L', '௧௪/௦௨/௨௦௧௦'], + ['LL', '௧௪ பிப்ரவரி ௨௦௧௦'], + ['LLL', '௧௪ பிப்ரவரி ௨௦௧௦, ௧௫:௨௫'], + ['LLLL', 'ஞாயிற்றுக்கிழமை, ௧௪ பிப்ரவரி ௨௦௧௦, ௧௫:௨௫'], + ['l', '௧௪/௨/௨௦௧௦'], + ['ll', '௧௪ பிப்ரவரி ௨௦௧௦'], + ['lll', '௧௪ பிப்ரவரி ௨௦௧௦, ௧௫:௨௫'], + ['llll', 'ஞாயிறு, ௧௪ பிப்ரவரி ௨௦௧௦, ௧௫:௨௫'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -27362,40 +30701,40 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1வது', '1வது'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2வது', '2வது'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3வது', '3வது'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4வது', '4வது'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5வது', '5வது'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6வது', '6வது'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7வது', '7வது'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8வது', '8வது'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9வது', '9வது'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10வது', '10வது'); - - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11வது', '11வது'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12வது', '12வது'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13வது', '13வது'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14வது', '14வது'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15வது', '15வது'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16வது', '16வது'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17வது', '17வது'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18வது', '18வது'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19வது', '19வது'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20வது', '20வது'); - - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21வது', '21வது'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22வது', '22வது'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23வது', '23வது'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24வது', '24வது'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25வது', '25வது'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26வது', '26வது'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27வது', '27வது'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28வது', '28வது'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29வது', '29வது'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30வது', '30வது'); - - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31வது', '31வது'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '௧வது', '௧வது'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '௨வது', '௨வது'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '௩வது', '௩வது'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '௪வது', '௪வது'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '௫வது', '௫வது'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '௬வது', '௬வது'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '௭வது', '௭வது'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '௮வது', '௮வது'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '௯வது', '௯வது'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '௧௦வது', '௧௦வது'); + + assert.equal(moment([2011, 0, 11]).format('DDDo'), '௧௧வது', '௧௧வது'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '௧௨வது', '௧௨வது'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '௧௩வது', '௧௩வது'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '௧௪வது', '௧௪வது'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '௧௫வது', '௧௫வது'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '௧௬வது', '௧௬வது'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '௧௭வது', '௧௭வது'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '௧௮வது', '௧௮வது'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '௧௯வது', '௧௯வது'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '௨௦வது', '௨௦வது'); + + assert.equal(moment([2011, 0, 21]).format('DDDo'), '௨௧வது', '௨௧வது'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '௨௨வது', '௨௨வது'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '௨௩வது', '௨௩வது'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '௨௪வது', '௨௪வது'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '௨௫வது', '௨௫வது'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '௨௬வது', '௨௬வது'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '௨௭வது', '௨௭வது'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '௨௮வது', '௨௮வது'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '௨௯வது', '௨௯வது'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '௩௦வது', '௩௦வது'); + + assert.equal(moment([2011, 0, 31]).format('DDDo'), '௩௧வது', '௩௧வது'); }); test('format month', function (assert) { @@ -27417,31 +30756,31 @@ assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'ஒரு சில விநாடிகள்', '44 விநாடிகள் = ஒரு சில விநாடிகள்'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'ஒரு நிமிடம்', '45 விநாடிகள் = ஒரு நிமிடம்'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'ஒரு நிமிடம்', '89 விநாடிகள் = ஒரு நிமிடம்'); - assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 நிமிடங்கள்', '90 விநாடிகள் = 2 நிமிடங்கள்'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 நிமிடங்கள்', '44 நிமிடங்கள் = 44 நிமிடங்கள்'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '௨ நிமிடங்கள்', '90 விநாடிகள் = ௨ நிமிடங்கள்'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '௪௪ நிமிடங்கள்', '44 நிமிடங்கள் = 44 நிமிடங்கள்'); assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'ஒரு மணி நேரம்', '45 நிமிடங்கள் = ஒரு மணி நேரம்'); assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'ஒரு மணி நேரம்', '89 நிமிடங்கள் = ஒரு மணி நேரம்'); - assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 மணி நேரம்', '90 நிமிடங்கள் = 2 மணி நேரம்'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 மணி நேரம்', '5 மணி நேரம் = 5 மணி நேரம்'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 மணி நேரம்', '21 மணி நேரம் = 21 மணி நேரம்'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'ஒரு நாள்', '22 மணி நேரம் = ஒரு நாள்'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'ஒரு நாள்', '35 மணி நேரம் = ஒரு நாள்'); - assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 நாட்கள்', '36 மணி நேரம் = 2 days'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'ஒரு நாள்', '1 நாள் = ஒரு நாள்'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 நாட்கள்', '5 நாட்கள் = 5 நாட்கள்'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 நாட்கள்', '25 நாட்கள் = 25 நாட்கள்'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'ஒரு மாதம்', '26 நாட்கள் = ஒரு மாதம்'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'ஒரு மாதம்', '30 நாட்கள் = ஒரு மாதம்'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '௨ மணி நேரம்', '90 நிமிடங்கள் = ௨ மணி நேரம்'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '௫ மணி நேரம்', '5 மணி நேரம் = 5 மணி நேரம்'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '௨௧ மணி நேரம்', '௨௧ மணி நேரம் = ௨௧ மணி நேரம்'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'ஒரு நாள்', '௨௨ மணி நேரம் = ஒரு நாள்'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'ஒரு நாள்', '௩5 மணி நேரம் = ஒரு நாள்'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '௨ நாட்கள்', '௩6 மணி நேரம் = ௨ days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'ஒரு நாள்', '௧ நாள் = ஒரு நாள்'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '௫ நாட்கள்', '5 நாட்கள் = 5 நாட்கள்'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '௨௫ நாட்கள்', '௨5 நாட்கள் = ௨5 நாட்கள்'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'ஒரு மாதம்', '௨6 நாட்கள் = ஒரு மாதம்'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'ஒரு மாதம்', '௩0 நாட்கள் = ஒரு மாதம்'); assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'ஒரு மாதம்', '45 நாட்கள் = ஒரு மாதம்'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 மாதங்கள்', '46 நாட்கள் = 2 மாதங்கள்'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 மாதங்கள்', '75 நாட்கள் = 2 மாதங்கள்'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 மாதங்கள்', '76 நாட்கள் = 3 மாதங்கள்'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'ஒரு மாதம்', '1 மாதம் = ஒரு மாதம்'); - assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 மாதங்கள்', '5 மாதங்கள் = 5 மாதங்கள்'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ஒரு வருடம்', '345 நாட்கள் = ஒரு வருடம்'); - assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 ஆண்டுகள்', '548 நாட்கள் = 2 ஆண்டுகள்'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'ஒரு வருடம்', '1 வருடம் = ஒரு வருடம்'); - assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 ஆண்டுகள்', '5 ஆண்டுகள் = 5 ஆண்டுகள்'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '௨ மாதங்கள்', '46 நாட்கள் = ௨ மாதங்கள்'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '௨ மாதங்கள்', '75 நாட்கள் = ௨ மாதங்கள்'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '௩ மாதங்கள்', '76 நாட்கள் = ௩ மாதங்கள்'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'ஒரு மாதம்', '௧ மாதம் = ஒரு மாதம்'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '௫ மாதங்கள்', '5 மாதங்கள் = 5 மாதங்கள்'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ஒரு வருடம்', '௩45 நாட்கள் = ஒரு வருடம்'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '௨ ஆண்டுகள்', '548 நாட்கள் = ௨ ஆண்டுகள்'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'ஒரு வருடம்', '௧ வருடம் = ஒரு வருடம்'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '௫ ஆண்டுகள்', '5 ஆண்டுகள் = 5 ஆண்டுகள்'); }); test('suffix', function (assert) { @@ -27455,18 +30794,18 @@ test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'ஒரு சில விநாடிகள் இல்', 'ஒரு சில விநாடிகள் இல்'); - assert.equal(moment().add({d: 5}).fromNow(), '5 நாட்கள் இல்', '5 நாட்கள் இல்'); + assert.equal(moment().add({d: 5}).fromNow(), '௫ நாட்கள் இல்', '5 நாட்கள் இல்'); }); test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'இன்று 02:00', 'இன்று 02:00'); - assert.equal(moment(a).add({m: 25}).calendar(), 'இன்று 02:25', 'இன்று 02:25'); - assert.equal(moment(a).add({h: 1}).calendar(), 'இன்று 03:00', 'இன்று 03:00'); - assert.equal(moment(a).add({d: 1}).calendar(), 'நாளை 02:00', 'நாளை 02:00'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'இன்று 01:00', 'இன்று 01:00'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'நேற்று 02:00', 'நேற்று 02:00'); + assert.equal(moment(a).calendar(), 'இன்று ௦௨:௦௦', 'இன்று 02:00'); + assert.equal(moment(a).add({m: 25}).calendar(), 'இன்று ௦௨:௨௫', 'இன்று 02:25'); + assert.equal(moment(a).add({h: 1}).calendar(), 'இன்று ௦௩:௦௦', 'இன்று 03:00'); + assert.equal(moment(a).add({d: 1}).calendar(), 'நாளை ௦௨:௦௦', 'நாளை 02:00'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'இன்று ௦௧:௦௦', 'இன்று 0௧:00'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'நேற்று ௦௨:௦௦', 'நேற்று 02:00'); }); test('calendar next week', function (assert) { @@ -27629,8 +30968,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -27639,12 +30979,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -27662,8 +31004,394 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + moment.locale('en'); + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + localeModule('te'); + + test('parse', function (assert) { + var tests = 'జనవరి జన._ఫిబ్రవరి ఫిబ్ర._మార్చి మార్చి_ఏప్రిల్ ఏప్రి._మే మే_జూన్ జూన్_జూలై జూలై_ఆగస్టు ఆగ._సెప్టెంబర్ సెప్._అక్టోబర్ అక్టో._నవంబర్ నవ._డిసెంబర్ డిసె.'.split('_'), i; + function equalTest(input, mmm, i) { + assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); + } + for (i = 0; i < 12; i++) { + tests[i] = tests[i].split(' '); + equalTest(tests[i][0], 'MMM', i); + equalTest(tests[i][1], 'MMM', i); + equalTest(tests[i][0], 'MMMM', i); + equalTest(tests[i][1], 'MMMM', i); + equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); + } + }); + + test('format', function (assert) { + var a = [ + ['dddd, Do తేదీ MMMM YYYY, a h:mm:ss', 'ఆదివారం, 14వ తేదీ ఫిబ్రవరి 2010, మధ్యాహ్నం 3:25:50'], + ['ddd, a h గంటలు', 'ఆది, మధ్యాహ్నం 3 గంటలు'], + ['M Mo నెల MM MMMM MMM', '2 2వ నెల 02 ఫిబ్రవరి ఫిబ్ర.'], + ['YYYY YY', '2010 10'], + ['D Do DD', '14 14వ 14'], + ['d do dddd ddd dd', '0 0వ ఆదివారం ఆది ఆ'], + ['DDD DDDo DDDD', '45 45వ 045'], + ['w wo ww', '8 8వ 08'], + ['h hh', '3 03'], + ['H HH', '15 15'], + ['m mm', '25 25'], + ['s ss', '50 50'], + ['a A', 'మధ్యాహ్నం మధ్యాహ్నం'], + ['LTS', 'మధ్యాహ్నం 3:25:50'], + ['L', '14/02/2010'], + ['LL', '14 ఫిబ్రవరి 2010'], + ['LLL', '14 ఫిబ్రవరి 2010, మధ్యాహ్నం 3:25'], + ['LLLL', 'ఆదివారం, 14 ఫిబ్రవరి 2010, మధ్యాహ్నం 3:25'], + ['l', '14/2/2010'], + ['ll', '14 ఫిబ్ర. 2010'], + ['lll', '14 ఫిబ్ర. 2010, మధ్యాహ్నం 3:25'], + ['llll', 'ఆది, 14 ఫిబ్ర. 2010, మధ్యాహ్నం 3:25'] + ], + b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), + i; + for (i = 0; i < a.length; i++) { + assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); + } + }); + + test('format ordinal', function (assert) { + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1వ', '1వ'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2వ', '2వ'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3వ', '3వ'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4వ', '4వ'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5వ', '5వ'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6వ', '6వ'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7వ', '7వ'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8వ', '8వ'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9వ', '9వ'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10వ', '10వ'); + + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11వ', '11వ'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12వ', '12వ'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13వ', '13వ'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14వ', '14వ'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15వ', '15వ'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16వ', '16వ'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17వ', '17వ'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18వ', '18వ'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19వ', '19వ'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20వ', '20వ'); + + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21వ', '21వ'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22వ', '22వ'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23వ', '23వ'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24వ', '24వ'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25వ', '25వ'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26వ', '26వ'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27వ', '27వ'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28వ', '28వ'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29వ', '29వ'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30వ', '30వ'); + + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31వ', '31వ'); + }); + + test('format month', function (assert) { + var expected = 'జనవరి జన._ఫిబ్రవరి ఫిబ్ర._మార్చి మార్చి_ఏప్రిల్ ఏప్రి._మే మే_జూన్ జూన్_జూలై జూలై_ఆగస్టు ఆగ._సెప్టెంబర్ సెప్._అక్టోబర్ అక్టో._నవంబర్ నవ._డిసెంబర్ డిసె.'.split('_'), i; + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); + } + }); + + test('format week', function (assert) { + var expected = 'ఆదివారం ఆది ఆ_సోమవారం సోమ సో_మంగళవారం మంగళ మం_బుధవారం బుధ బు_గురువారం గురు గు_శుక్రవారం శుక్ర శు_శనివారం శని శ'.split('_'), i; + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); + } + }); + + test('from', function (assert) { + var start = moment([2007, 1, 28]); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'కొన్ని క్షణాలు', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'ఒక నిమిషం', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'ఒక నిమిషం', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 నిమిషాలు', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 నిమిషాలు', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'ఒక గంట', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'ఒక గంట', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 గంటలు', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 గంటలు', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 గంటలు', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'ఒక రోజు', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'ఒక రోజు', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 రోజులు', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'ఒక రోజు', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 రోజులు', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 రోజులు', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'ఒక నెల', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'ఒక నెల', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'ఒక నెల', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 నెలలు', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 నెలలు', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 నెలలు', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'ఒక నెల', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 నెలలు', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ఒక సంవత్సరం', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 సంవత్సరాలు', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'ఒక సంవత్సరం', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 సంవత్సరాలు', '5 years = 5 years'); + }); + + test('suffix', function (assert) { + assert.equal(moment(30000).from(0), 'కొన్ని క్షణాలు లో', 'prefix'); + assert.equal(moment(0).from(30000), 'కొన్ని క్షణాలు క్రితం', 'suffix'); + }); + + test('now from now', function (assert) { + assert.equal(moment().fromNow(), 'కొన్ని క్షణాలు క్రితం', 'now from now should display as in the past'); + }); + + test('fromNow', function (assert) { + assert.equal(moment().add({s: 30}).fromNow(), 'కొన్ని క్షణాలు లో', 'కొన్ని క్షణాలు లో'); + assert.equal(moment().add({d: 5}).fromNow(), '5 రోజులు లో', '5 రోజులు లో'); + }); + + test('calendar day', function (assert) { + var a = moment().hours(2).minutes(0).seconds(0); + + assert.equal(moment(a).calendar(), 'నేడు రాత్రి 2:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'నేడు రాత్రి 2:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 3}).calendar(), 'నేడు ఉదయం 5:00', 'Now plus 3 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'రేపు రాత్రి 2:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'నేడు రాత్రి 1:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'నిన్న రాత్రి 2:00', 'yesterday at the same time'); + }); + + test('calendar next week', function (assert) { + var i, m; + for (i = 2; i < 7; i++) { + m = moment().add({d: i}); + assert.equal(m.calendar(), m.format('dddd[,] LT'), 'Today + ' + i + ' days current time'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format('dddd[,] LT'), 'Today + ' + i + ' days beginning of day'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format('dddd[,] LT'), 'Today + ' + i + ' days end of day'); + } + }); + + test('calendar last week', function (assert) { + var i, m; + + for (i = 2; i < 7; i++) { + m = moment().subtract({d: i}); + assert.equal(m.calendar(), m.format('[గత] dddd[,] LT'), 'Today - ' + i + ' days current time'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format('[గత] dddd[,] LT'), 'Today - ' + i + ' days beginning of day'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format('[గత] dddd[,] LT'), 'Today - ' + i + ' days end of day'); + } + }); + + test('calendar all else', function (assert) { + var weeksAgo = moment().subtract({w: 1}), + weeksFromNow = moment().add({w: 1}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); + + weeksAgo = moment().subtract({w: 2}); + weeksFromNow = moment().add({w: 2}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); + }); + + test('meridiem invariant', function (assert) { + assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), 'రాత్రి', 'before dawn'); + assert.equal(moment([2011, 2, 23, 9, 30]).format('a'), 'ఉదయం', 'morning'); + assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'మధ్యాహ్నం', 'during day'); + assert.equal(moment([2011, 2, 23, 17, 30]).format('a'), 'సాయంత్రం', 'evening'); + assert.equal(moment([2011, 2, 23, 19, 30]).format('a'), 'సాయంత్రం', 'late evening'); + assert.equal(moment([2011, 2, 23, 21, 20]).format('a'), 'రాత్రి', 'night'); + + assert.equal(moment([2011, 2, 23, 2, 30]).format('A'), 'రాత్రి', 'before dawn'); + assert.equal(moment([2011, 2, 23, 9, 30]).format('A'), 'ఉదయం', 'morning'); + assert.equal(moment([2011, 2, 23, 14, 30]).format('A'), 'మధ్యాహ్నం', ' during day'); + assert.equal(moment([2011, 2, 23, 17, 30]).format('A'), 'సాయంత్రం', 'evening'); + assert.equal(moment([2011, 2, 23, 19, 30]).format('A'), 'సాయంత్రం', 'late evening'); + assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'రాత్రి', 'night'); + }); + + test('weeks year starting sunday', function (assert) { + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); + }); + + test('weeks year starting monday', function (assert) { + assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); + assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); + }); + + test('weeks year starting tuesday', function (assert) { + assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); + assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); + assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); + assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); + assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); + }); + + test('weeks year starting wednesday', function (assert) { + assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); + assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); + assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); + assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); + assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); + }); + + test('weeks year starting thursday', function (assert) { + assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); + assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); + assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); + assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); + assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); + }); + + test('weeks year starting friday', function (assert) { + assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); + assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); + assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); + assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); + assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); + }); + + test('weeks year starting saturday', function (assert) { + assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); + assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); + assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); + assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); + }); + + test('weeks year starting sunday formatted', function (assert) { + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1వ', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1వ', 'Jan 7 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2వ', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2వ', 'Jan 14 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3వ', 'Jan 15 2012 should be week 3'); + }); + + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('meridiem', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + +})); + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + /*global QUnit:false*/ + + var test = QUnit.test; + + var expect = QUnit.expect; + + function module (name, lifecycle) { + QUnit.module(name, { + setup : function () { + moment.locale('en'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + function localeModule (name, lifecycle) { + QUnit.module('locale:' + name, { + setup : function () { + moment.locale(name); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -27947,8 +31675,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -27957,12 +31686,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -27980,8 +31711,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -28301,8 +32032,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -28311,12 +32043,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -28334,8 +32068,382 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + moment.locale('en'); + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + localeModule('tlh'); + + //Current parsing method doesn't allow parsing correctly months 10, 11 and 12. + /* + * test('parse', function (assert) { + var tests = 'tera’ jar wa’.jar wa’_tera’ jar cha’.jar cha’_tera’ jar wej.jar wej_tera’ jar loS.jar loS_tera’ jar vagh.jar vagh_tera’ jar jav.jar jav_tera’ jar Soch.jar Soch_tera’ jar chorgh.jar chorgh_tera’ jar Hut.jar Hut_tera’ jar wa’maH.jar wa’maH_tera’ jar wa’maH wa’.jar wa’maH wa’_tera’ jar wa’maH cha’.jar wa’maH cha’'.split('_'), i; + function equalTest(input, mmm, i) { + assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); + } + for (i = 0; i < 12; i++) { + tests[i] = tests[i].split('.'); + equalTest(tests[i][0], 'MMM', i); + equalTest(tests[i][1], 'MMM', i); + equalTest(tests[i][0], 'MMMM', i); + equalTest(tests[i][1], 'MMMM', i); + equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); + } + }); + */ + test('format', function (assert) { + var a = [ + ['dddd, MMMM Do YYYY, h:mm:ss a', 'lojmItjaj, tera’ jar cha’ 14. 2010, 3:25:50 pm'], + ['ddd, hA', 'lojmItjaj, 3PM'], + ['M Mo MM MMMM MMM', '2 2. 02 tera’ jar cha’ jar cha’'], + ['YYYY YY', '2010 10'], + ['D Do DD', '14 14. 14'], + ['d do dddd ddd dd', '0 0. lojmItjaj lojmItjaj lojmItjaj'], + ['DDD DDDo DDDD', '45 45. 045'], + ['w wo ww', '6 6. 06'], + ['h hh', '3 03'], + ['H HH', '15 15'], + ['m mm', '25 25'], + ['s ss', '50 50'], + ['a A', 'pm PM'], + ['[DIS jaj] DDDo', 'DIS jaj 45.'], + ['LTS', '15:25:50'], + ['L', '14.02.2010'], + ['LL', '14 tera’ jar cha’ 2010'], + ['LLL', '14 tera’ jar cha’ 2010 15:25'], + ['LLLL', 'lojmItjaj, 14 tera’ jar cha’ 2010 15:25'], + ['l', '14.2.2010'], + ['ll', '14 jar cha’ 2010'], + ['lll', '14 jar cha’ 2010 15:25'], + ['llll', 'lojmItjaj, 14 jar cha’ 2010 15:25'] + ], + b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), + i; + for (i = 0; i < a.length; i++) { + assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); + } + }); + + test('format ordinal', function (assert) { + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); + + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); + + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); + + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); + }); + + test('format month', function (assert) { + var expected = 'tera’ jar wa’ jar wa’_tera’ jar cha’ jar cha’_tera’ jar wej jar wej_tera’ jar loS jar loS_tera’ jar vagh jar vagh_tera’ jar jav jar jav_tera’ jar Soch jar Soch_tera’ jar chorgh jar chorgh_tera’ jar Hut jar Hut_tera’ jar wa’maH jar wa’maH_tera’ jar wa’maH wa’ jar wa’maH wa’_tera’ jar wa’maH cha’ jar wa’maH cha’'.split('_'), i; + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); + } + }); + + test('format week', function (assert) { + var expected = 'lojmItjaj lojmItjaj lojmItjaj_DaSjaj DaSjaj DaSjaj_povjaj povjaj povjaj_ghItlhjaj ghItlhjaj ghItlhjaj_loghjaj loghjaj loghjaj_buqjaj buqjaj buqjaj_ghInjaj ghInjaj ghInjaj'.split('_'), i; + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); + } + }); + + test('from', function (assert) { + var start = moment([2007, 1, 28]); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'puS lup', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'wa’ tup', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'wa’ tup', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), 'cha’ tup', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), 'loSmaH loS tup', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'wa’ rep', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'wa’ rep', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), 'cha’ rep', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), 'vagh rep', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), 'cha’maH wa’ rep', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'wa’ jaj', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'wa’ jaj', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), 'cha’ jaj', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'wa’ jaj', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), 'vagh jaj', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), 'cha’maH vagh jaj', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'wa’ jar', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'wa’ jar', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'wa’ jar', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), 'cha’ jar', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), 'cha’ jar', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), 'wej jar', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'wa’ jar', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), 'vagh jar', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'wa’ DIS', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), 'cha’ DIS', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'wa’ DIS', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), 'vagh DIS', '5 years = 5 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 112}), true), 'wa’vatlh wa’maH cha’ DIS', '112 years = 112 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 122}), true), 'wa’vatlh cha’maH cha’ DIS', '122 years = 122 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 213}), true), 'cha’vatlh wa’maH wej DIS', '213 years = 213 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 223}), true), 'cha’vatlh cha’maH wej DIS', '223 years = 223 years'); + }); + + test('suffix', function (assert) { + assert.equal(moment(30000).from(0), 'puS lup pIq', 'suffix'); + assert.equal(moment(0).from(30000), 'puS lup ret', 'suffix'); + }); + + test('now from now', function (assert) { + assert.equal(moment().fromNow(), 'puS lup ret', 'now from now should display as in the past'); + }); + + test('fromNow', function (assert) { + assert.equal(moment().add({s: 30}).fromNow(), 'puS lup pIq', 'in a few seconds'); + assert.equal(moment().add({h: 1}).fromNow(), 'wa’ rep pIq', 'in an hour'); + assert.equal(moment().add({d: 5}).fromNow(), 'vagh leS', 'in 5 days'); + assert.equal(moment().add({M: 2}).fromNow(), 'cha’ waQ', 'in 2 months'); + assert.equal(moment().add({y: 1}).fromNow(), 'wa’ nem', 'in a year'); + assert.equal(moment().add({s: -30}).fromNow(), 'puS lup ret', 'a few seconds ago'); + assert.equal(moment().add({h: -1}).fromNow(), 'wa’ rep ret', 'an hour ago'); + assert.equal(moment().add({d: -5}).fromNow(), 'vagh Hu’', '5 days ago'); + assert.equal(moment().add({M: -2}).fromNow(), 'cha’ wen', '2 months ago'); + assert.equal(moment().add({y: -1}).fromNow(), 'wa’ ben', 'a year ago'); + }); + + test('calendar day', function (assert) { + var a = moment().hours(2).minutes(0).seconds(0); + + assert.equal(moment(a).calendar(), 'DaHjaj 02:00', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'DaHjaj 02:25', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'DaHjaj 03:00', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'wa’leS 02:00', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'DaHjaj 01:00', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'wa’Hu’ 02:00', 'yesterday at the same time'); + }); + + test('calendar next week', function (assert) { + var i, m; + for (i = 2; i < 7; i++) { + m = moment().add({d: i}); + assert.equal(m.calendar(), m.format('LLL'), 'Today + ' + i + ' days current time'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format('LLL'), 'Today + ' + i + ' days beginning of day'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format('LLL'), 'Today + ' + i + ' days end of day'); + } + }); + + test('calendar last week', function (assert) { + var i, m; + for (i = 2; i < 7; i++) { + m = moment().subtract({d: i}); + assert.equal(m.calendar(), m.format('LLL'), 'Today - ' + i + ' days current time'); + + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format('LLL'), 'Today - ' + i + ' days beginning of day'); + + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format('LLL'), 'Today - ' + i + ' days end of day'); + } + }); + + test('calendar all else', function (assert) { + var weeksAgo = moment().subtract({w: 1}), + weeksFromNow = moment().add({w: 1}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); + + weeksAgo = moment().subtract({w: 2}); + weeksFromNow = moment().add({w: 2}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); + }); + + test('weeks year starting sunday', function (assert) { + assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); + }); + + test('weeks year starting monday', function (assert) { + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); + assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); + assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); + }); + + test('weeks year starting tuesday', function (assert) { + assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); + assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); + assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); + assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); + assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); + }); + + test('weeks year starting wednesday', function (assert) { + assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); + assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); + assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); + assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); + assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); + }); + + test('weeks year starting thursday', function (assert) { + assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); + assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); + assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); + assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); + assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); + }); + + test('weeks year starting friday', function (assert) { + assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); + assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); + assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); + assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); + assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); + assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); + }); + + test('weeks year starting saturday', function (assert) { + assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); + assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); + assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); + assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); + assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); + assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); + }); + + test('weeks year starting sunday formatted', function (assert) { + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); + }); + + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + +})); + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + /*global QUnit:false*/ + + var test = QUnit.test; + + var expect = QUnit.expect; + + function module (name, lifecycle) { + QUnit.module(name, { + setup : function () { + moment.locale('en'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + function localeModule (name, lifecycle) { + QUnit.module('locale:' + name, { + setup : function () { + moment.locale(name); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -28667,8 +32775,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -28677,12 +32786,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -28700,8 +32811,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -29026,8 +33137,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -29036,12 +33148,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -29059,8 +33173,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -29379,8 +33493,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -29389,12 +33504,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -29412,8 +33529,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -29732,8 +33849,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -29742,12 +33860,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -29765,8 +33885,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -30120,8 +34240,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -30130,12 +34251,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -30153,8 +34276,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -30172,7 +34295,7 @@ localeModule('uz'); test('parse', function (assert) { - var tests = 'январь янв_февраль фев_март мар_апрель апр_май май_июнь июнь_июль июль_август авг_сентябрь сен_октябрь окт_ноябрь ноя_декабрь дек'.split('_'), i; + var tests = 'январ янв_феврал фев_март мар_апрел апр_май май_июн июн_июл июл_август авг_сентябр сен_октябр окт_ноябр ноя_декабр дек'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -30191,9 +34314,9 @@ test('format', function (assert) { var a = [ - ['dddd, Do-MMMM YYYY, h:mm:ss', 'Якшанба, 14-февраль 2010, 3:25:50'], + ['dddd, Do-MMMM YYYY, h:mm:ss', 'Якшанба, 14-феврал 2010, 3:25:50'], ['ddd, h:mm', 'Якш, 3:25'], - ['M Mo MM MMMM MMM', '2 2 02 февраль фев'], + ['M Mo MM MMMM MMM', '2 2 02 феврал фев'], ['YYYY YY', '2010 10'], ['D Do DD', '14 14 14'], ['d do dddd ddd dd', '0 0 Якшанба Якш Як'], @@ -30207,9 +34330,9 @@ ['[йилнинг] DDDo-[куни]', 'йилнинг 45-куни'], ['LTS', '15:25:50'], ['L', '14/02/2010'], - ['LL', '14 февраль 2010'], - ['LLL', '14 февраль 2010 15:25'], - ['LLLL', '14 февраль 2010, Якшанба 15:25'], + ['LL', '14 феврал 2010'], + ['LLL', '14 феврал 2010 15:25'], + ['LLLL', '14 феврал 2010, Якшанба 15:25'], ['l', '14/2/2010'], ['ll', '14 фев 2010'], ['lll', '14 фев 2010 15:25'], @@ -30260,7 +34383,7 @@ }); test('format month', function (assert) { - var expected = 'январь янв_февраль фев_март мар_апрель апр_май май_июнь июн_июль июл_август авг_сентябрь сен_октябрь окт_ноябрь ноя_декабрь дек'.split('_'), i; + var expected = 'январ янв_феврал фев_март мар_апрел апр_май май_июн июн_июл июл_август авг_сентябр сен_октябр окт_ноябр ноя_декабр дек'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } @@ -30322,7 +34445,7 @@ test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'Бугун соат 02:00 да', 'today at the same time'); + assert.equal(moment(a).calendar(), 'Бугун соат 02:00 да', 'today at the same time'); assert.equal(moment(a).add({m: 25}).calendar(), 'Бугун соат 02:25 да', 'Now plus 25 min'); assert.equal(moment(a).add({h: 1}).calendar(), 'Бугун соат 03:00 да', 'Now plus 1 hour'); assert.equal(moment(a).add({d: 1}).calendar(), 'Эртага 02:00 да', 'tomorrow at the same time'); @@ -30476,8 +34599,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -30486,12 +34610,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -30509,8 +34635,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -30842,8 +34968,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -30852,12 +34979,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -30875,8 +35004,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -31196,8 +35325,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -31206,12 +35336,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -31229,8 +35361,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -31543,8 +35675,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -31553,12 +35686,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -31576,8 +35711,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -31889,7 +36024,7 @@ // Detect Safari bug and bail. Hours on 13th March 2011 are shifted // with 1 ahead. if (new Date(2011, 2, 13, 5, 0, 0).getHours() !== 5) { - assert.expect(0); + expect(0); return; } @@ -31917,8 +36052,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -31927,12 +36063,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -31950,8 +36088,75 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + moment.locale('en'); + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + // These tests are for locale independent features + // locale dependent tests would be in locale test folder + module('calendar'); + + test('passing a function', function (assert) { + var a = moment().hours(2).minutes(0).seconds(0); + assert.equal(moment(a).calendar(null, { + 'sameDay': function () { + return 'h:mmA'; + } + }), '2:00AM', 'should equate'); + }); + +})); + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + /*global QUnit:false*/ + + var test = QUnit.test; + + var expect = QUnit.expect; + + function module (name, lifecycle) { + QUnit.module(name, { + setup : function () { + moment.locale('en'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + function localeModule (name, lifecycle) { + QUnit.module('locale:' + name, { + setup : function () { + moment.locale(name); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -31979,6 +36184,11 @@ assert.equal(+moment(new Date(2010, 1, 14, 15, 25, 50, 125)), +moment([2010, 1, 14, 15, 25, 50, 125]), 'constructing with array === constructing with new Date()'); }); + test('array with invalid arguments', function (assert) { + assert.ok(!moment([2010, null, null]).isValid(), '[2010, null, null]'); + assert.ok(!moment([1945, null, null]).isValid(), '[1945, null, null] (pre-1970)'); + }); + test('array copying', function (assert) { var importantArray = [2009, 11]; moment(importantArray); @@ -32388,6 +36598,10 @@ '-' + pad(-hourOffset) + ':' + pad(-minOffset), tz2 = tz.replace(':', ''), tz3 = tz2.slice(0, 3), + //Tz3 removes minutes digit so will break the tests when parsed if they all use the same minutes digit + minutesForTz3 = pad((4 + minOffset) % 60), + minute = pad(4 + minOffset), + formats = [ ['2011-10-08', '2011-10-08T00:00:00.000' + tz], ['2011-10-08T18', '2011-10-08T18:00:00.000' + tz], @@ -32397,8 +36611,8 @@ ['2011-10-08T18:04:20' + tz, '2011-10-08T18:04:20.000' + tz], ['2011-10-08T18:04' + tz2, '2011-10-08T18:04:00.000' + tz], ['2011-10-08T18:04:20' + tz2, '2011-10-08T18:04:20.000' + tz], - ['2011-10-08T18:04' + tz3, '2011-10-08T18:04:00.000' + tz], - ['2011-10-08T18:04:20' + tz3, '2011-10-08T18:04:20.000' + tz], + ['2011-10-08T18:04' + tz3, '2011-10-08T18:' + minutesForTz3 + ':00.000' + tz], + ['2011-10-08T18:04:20' + tz3, '2011-10-08T18:' + minutesForTz3 + ':20.000' + tz], ['2011-10-08T18:04:20.1' + tz2, '2011-10-08T18:04:20.100' + tz], ['2011-10-08T18:04:20.11' + tz2, '2011-10-08T18:04:20.110' + tz], ['2011-10-08T18:04:20.111' + tz2, '2011-10-08T18:04:20.111' + tz], @@ -32409,8 +36623,8 @@ ['2011-10-08 18:04:20' + tz, '2011-10-08T18:04:20.000' + tz], ['2011-10-08 18:04' + tz2, '2011-10-08T18:04:00.000' + tz], ['2011-10-08 18:04:20' + tz2, '2011-10-08T18:04:20.000' + tz], - ['2011-10-08 18:04' + tz3, '2011-10-08T18:04:00.000' + tz], - ['2011-10-08 18:04:20' + tz3, '2011-10-08T18:04:20.000' + tz], + ['2011-10-08 18:04' + tz3, '2011-10-08T18:' + minutesForTz3 + ':00.000' + tz], + ['2011-10-08 18:04:20' + tz3, '2011-10-08T18:' + minutesForTz3 + ':20.000' + tz], ['2011-10-08 18:04:20.1' + tz2, '2011-10-08T18:04:20.100' + tz], ['2011-10-08 18:04:20.11' + tz2, '2011-10-08T18:04:20.110' + tz], ['2011-10-08 18:04:20.111' + tz2, '2011-10-08T18:04:20.111' + tz], @@ -32423,8 +36637,8 @@ ['2011-W40-6T18:04:20' + tz, '2011-10-08T18:04:20.000' + tz], ['2011-W40-6T18:04' + tz2, '2011-10-08T18:04:00.000' + tz], ['2011-W40-6T18:04:20' + tz2, '2011-10-08T18:04:20.000' + tz], - ['2011-W40-6T18:04' + tz3, '2011-10-08T18:04:00.000' + tz], - ['2011-W40-6T18:04:20' + tz3, '2011-10-08T18:04:20.000' + tz], + ['2011-W40-6T18:04' + tz3, '2011-10-08T18:' + minutesForTz3 + ':00.000' + tz], + ['2011-W40-6T18:04:20' + tz3, '2011-10-08T18:' + minutesForTz3 + ':20.000' + tz], ['2011-W40-6T18:04:20.1' + tz2, '2011-10-08T18:04:20.100' + tz], ['2011-W40-6T18:04:20.11' + tz2, '2011-10-08T18:04:20.110' + tz], ['2011-W40-6T18:04:20.111' + tz2, '2011-10-08T18:04:20.111' + tz], @@ -32435,8 +36649,8 @@ ['2011-W40-6 18:04:20' + tz, '2011-10-08T18:04:20.000' + tz], ['2011-W40-6 18:04' + tz2, '2011-10-08T18:04:00.000' + tz], ['2011-W40-6 18:04:20' + tz2, '2011-10-08T18:04:20.000' + tz], - ['2011-W40-6 18:04' + tz3, '2011-10-08T18:04:00.000' + tz], - ['2011-W40-6 18:04:20' + tz3, '2011-10-08T18:04:20.000' + tz], + ['2011-W40-6 18:04' + tz3, '2011-10-08T18:' + minutesForTz3 + ':00.000' + tz], + ['2011-W40-6 18:04:20' + tz3, '2011-10-08T18:' + minutesForTz3 + ':20.000' + tz], ['2011-W40-6 18:04:20.1' + tz2, '2011-10-08T18:04:20.100' + tz], ['2011-W40-6 18:04:20.11' + tz2, '2011-10-08T18:04:20.110' + tz], ['2011-W40-6 18:04:20.111' + tz2, '2011-10-08T18:04:20.111' + tz], @@ -32448,8 +36662,8 @@ ['2011-281T18:04:20' + tz, '2011-10-08T18:04:20.000' + tz], ['2011-281T18:04' + tz2, '2011-10-08T18:04:00.000' + tz], ['2011-281T18:04:20' + tz2, '2011-10-08T18:04:20.000' + tz], - ['2011-281T18:04' + tz3, '2011-10-08T18:04:00.000' + tz], - ['2011-281T18:04:20' + tz3, '2011-10-08T18:04:20.000' + tz], + ['2011-281T18:04' + tz3, '2011-10-08T18:' + minutesForTz3 + ':00.000' + tz], + ['2011-281T18:04:20' + tz3, '2011-10-08T18:' + minutesForTz3 + ':20.000' + tz], ['2011-281T18:04:20.1' + tz2, '2011-10-08T18:04:20.100' + tz], ['2011-281T18:04:20.11' + tz2, '2011-10-08T18:04:20.110' + tz], ['2011-281T18:04:20.111' + tz2, '2011-10-08T18:04:20.111' + tz], @@ -32460,17 +36674,106 @@ ['2011-281 18:04:20' + tz, '2011-10-08T18:04:20.000' + tz], ['2011-281 18:04' + tz2, '2011-10-08T18:04:00.000' + tz], ['2011-281 18:04:20' + tz2, '2011-10-08T18:04:20.000' + tz], - ['2011-281 18:04' + tz3, '2011-10-08T18:04:00.000' + tz], - ['2011-281 18:04:20' + tz3, '2011-10-08T18:04:20.000' + tz], + ['2011-281 18:04' + tz3, '2011-10-08T18:' + minutesForTz3 + ':00.000' + tz], + ['2011-281 18:04:20' + tz3, '2011-10-08T18:' + minutesForTz3 + ':20.000' + tz], ['2011-281 18:04:20.1' + tz2, '2011-10-08T18:04:20.100' + tz], ['2011-281 18:04:20.11' + tz2, '2011-10-08T18:04:20.110' + tz], - ['2011-281 18:04:20.111' + tz2, '2011-10-08T18:04:20.111' + tz] + ['2011-281 18:04:20.111' + tz2, '2011-10-08T18:04:20.111' + tz], + ['20111008T18', '2011-10-08T18:00:00.000' + tz], + ['20111008T1804', '2011-10-08T18:04:00.000' + tz], + ['20111008T180420', '2011-10-08T18:04:20.000' + tz], + ['20111008T1804' + tz, '2011-10-08T18:04:00.000' + tz], + ['20111008T180420' + tz, '2011-10-08T18:04:20.000' + tz], + ['20111008T1804' + tz2, '2011-10-08T18:04:00.000' + tz], + ['20111008T180420' + tz2, '2011-10-08T18:04:20.000' + tz], + ['20111008T1804' + tz3, '2011-10-08T18:' + minutesForTz3 + ':00.000' + tz], + ['20111008T180420' + tz3, '2011-10-08T18:' + minutesForTz3 + ':20.000' + tz], + ['20111008T180420,1' + tz2, '2011-10-08T18:04:20.100' + tz], + ['20111008T180420,11' + tz2, '2011-10-08T18:04:20.110' + tz], + ['20111008T180420,111' + tz2, '2011-10-08T18:04:20.111' + tz], + ['20111008 18', '2011-10-08T18:00:00.000' + tz], + ['20111008 1804', '2011-10-08T18:04:00.000' + tz], + ['20111008 180420', '2011-10-08T18:04:20.000' + tz], + ['20111008 1804' + tz, '2011-10-08T18:04:00.000' + tz], + ['20111008 180420' + tz, '2011-10-08T18:04:20.000' + tz], + ['20111008 1804' + tz2, '2011-10-08T18:04:00.000' + tz], + ['20111008 180420' + tz2, '2011-10-08T18:04:20.000' + tz], + ['20111008 1804' + tz3, '2011-10-08T18:' + minutesForTz3 + ':00.000' + tz], + ['20111008 180420' + tz3, '2011-10-08T18:' + minutesForTz3 + ':20.000' + tz], + ['20111008 180420,1' + tz2, '2011-10-08T18:04:20.100' + tz], + ['20111008 180420,11' + tz2, '2011-10-08T18:04:20.110' + tz], + ['20111008 180420,111' + tz2, '2011-10-08T18:04:20.111' + tz], + ['2011W40', '2011-10-03T00:00:00.000' + tz], + ['2011W406', '2011-10-08T00:00:00.000' + tz], + ['2011W406T18', '2011-10-08T18:00:00.000' + tz], + ['2011W406T1804', '2011-10-08T18:04:00.000' + tz], + ['2011W406T180420', '2011-10-08T18:04:20.000' + tz], + ['2011W406 1804' + tz2, '2011-10-08T18:04:00.000' + tz], + ['2011W406T1804' + tz, '2011-10-08T18:04:00.000' + tz], + ['2011W406T180420' + tz, '2011-10-08T18:04:20.000' + tz], + ['2011W406T1804' + tz2, '2011-10-08T18:04:00.000' + tz], + ['2011W406T180420' + tz2, '2011-10-08T18:04:20.000' + tz], + ['2011W406T1804' + tz3, '2011-10-08T18:' + minutesForTz3 + ':00.000' + tz], + ['2011W406T180420' + tz3, '2011-10-08T18:' + minutesForTz3 + ':20.000' + tz], + ['2011W406T180420,1' + tz2, '2011-10-08T18:04:20.100' + tz], + ['2011W406T180420,11' + tz2, '2011-10-08T18:04:20.110' + tz], + ['2011W406T180420,111' + tz2, '2011-10-08T18:04:20.111' + tz], + ['2011W406 18', '2011-10-08T18:00:00.000' + tz], + ['2011W406 1804', '2011-10-08T18:04:00.000' + tz], + ['2011W406 180420', '2011-10-08T18:04:20.000' + tz], + ['2011W406 1804' + tz, '2011-10-08T18:04:00.000' + tz], + ['2011W406 180420' + tz, '2011-10-08T18:04:20.000' + tz], + ['2011W406 180420' + tz2, '2011-10-08T18:04:20.000' + tz], + ['2011W406 1804' + tz3, '2011-10-08T18:' + minutesForTz3 + ':00.000' + tz], + ['2011W406 180420' + tz3, '2011-10-08T18:' + minutesForTz3 + ':20.000' + tz], + ['2011W406 180420,1' + tz2, '2011-10-08T18:04:20.100' + tz], + ['2011W406 180420,11' + tz2, '2011-10-08T18:04:20.110' + tz], + ['2011W406 180420,111' + tz2, '2011-10-08T18:04:20.111' + tz], + ['2011281', '2011-10-08T00:00:00.000' + tz], + ['2011281T18', '2011-10-08T18:00:00.000' + tz], + ['2011281T1804', '2011-10-08T18:04:00.000' + tz], + ['2011281T180420', '2011-10-08T18:04:20.000' + tz], + ['2011281T1804' + tz, '2011-10-08T18:04:00.000' + tz], + ['2011281T180420' + tz, '2011-10-08T18:04:20.000' + tz], + ['2011281T1804' + tz2, '2011-10-08T18:04:00.000' + tz], + ['2011281T180420' + tz2, '2011-10-08T18:04:20.000' + tz], + ['2011281T1804' + tz3, '2011-10-08T18:' + minutesForTz3 + ':00.000' + tz], + ['2011281T180420' + tz3, '2011-10-08T18:' + minutesForTz3 + ':20.000' + tz], + ['2011281T180420,1' + tz2, '2011-10-08T18:04:20.100' + tz], + ['2011281T180420,11' + tz2, '2011-10-08T18:04:20.110' + tz], + ['2011281T180420,111' + tz2, '2011-10-08T18:04:20.111' + tz], + ['2011281 18', '2011-10-08T18:00:00.000' + tz], + ['2011281 1804', '2011-10-08T18:04:00.000' + tz], + ['2011281 180420', '2011-10-08T18:04:20.000' + tz], + ['2011281 1804' + tz, '2011-10-08T18:04:00.000' + tz], + ['2011281 180420' + tz, '2011-10-08T18:04:20.000' + tz], + ['2011281 1804' + tz2, '2011-10-08T18:04:00.000' + tz], + ['2011281 180420' + tz2, '2011-10-08T18:04:20.000' + tz], + ['2011281 1804' + tz3, '2011-10-08T18:' + minutesForTz3 + ':00.000' + tz], + ['2011281 180420' + tz3, '2011-10-08T18:' + minutesForTz3 + ':20.000' + tz], + ['2011281 180420,1' + tz2, '2011-10-08T18:04:20.100' + tz], + ['2011281 180420,11' + tz2, '2011-10-08T18:04:20.110' + tz], + ['2011281 180420,111' + tz2, '2011-10-08T18:04:20.111' + tz] ], i; for (i = 0; i < formats.length; i++) { - assert.equal(moment(formats[i][0]).format('YYYY-MM-DDTHH:mm:ss.SSSZ'), formats[i][1], 'moment should be able to parse ISO ' + formats[i][0]); + assert.equal(moment(formats[i][0]).format('YYYY-MM-DDTHH:mm:ss.SSSZ'), + formats[i][1], 'moment should be able to parse ISO ' + formats[i][0]); + assert.equal(moment(formats[i][0], moment.ISO_8601).format('YYYY-MM-DDTHH:mm:ss.SSSZ'), + formats[i][1], 'moment should be able to parse specified ISO ' + formats[i][0]); + assert.equal(moment(formats[i][0], moment.ISO_8601, true).format('YYYY-MM-DDTHH:mm:ss.SSSZ'), + formats[i][1], 'moment should be able to parse specified strict ISO ' + formats[i][0]); } }); + test('non iso 8601 strings', function (assert) { + assert.ok(!moment('2015-10T10:15', moment.ISO_8601, true).isValid(), 'incomplete date with time'); + assert.ok(!moment('2015-W10T10:15', moment.ISO_8601, true).isValid(), 'incomplete week date with time'); + assert.ok(!moment('201510', moment.ISO_8601, true).isValid(), 'basic YYYYMM is not allowed'); + assert.ok(!moment('2015W10T1015', moment.ISO_8601, true).isValid(), 'incomplete week date with time (basic)'); + assert.ok(!moment('2015-10-08T1015', moment.ISO_8601, true).isValid(), 'mixing extended and basic format'); + assert.ok(!moment('20151008T10:15', moment.ISO_8601, true).isValid(), 'mixing basic and extended format'); + }); + test('parsing iso week year/week/weekday', function (assert) { assert.equal(moment.utc('2007-W01').format(), '2007-01-01T00:00:00+00:00', '2008 week 1 (1st Jan Mon)'); assert.equal(moment.utc('2008-W01').format(), '2007-12-31T00:00:00+00:00', '2008 week 1 (1st Jan Tue)'); @@ -32845,6 +37148,10 @@ assert.equal(moment(['2014', '7', '31']).isValid(), true, 'string array + isValid'); }); + test('object with strings', function (assert) { + assert.equal(moment({year: '2014', month: '7', day: '31'}).isValid(), true, 'string object + isValid'); + }); + test('utc with array of formats', function (assert) { assert.equal(moment.utc('2014-01-01', ['YYYY-MM-DD', 'YYYY-MM']).format(), '2014-01-01T00:00:00+00:00', 'moment.utc works with array of formats'); }); @@ -32876,10 +37183,40 @@ assert.equal(moment('123456789', 'SSSSSSSSS').millisecond(), 123); }); + test('hmm', function (assert) { + assert.equal(moment('123', 'hmm', true).format('HH:mm:ss'), '01:23:00', '123 with hmm'); + assert.equal(moment('123a', 'hmmA', true).format('HH:mm:ss'), '01:23:00', '123a with hmmA'); + assert.equal(moment('123p', 'hmmA', true).format('HH:mm:ss'), '13:23:00', '123p with hmmA'); + + assert.equal(moment('1234', 'hmm', true).format('HH:mm:ss'), '12:34:00', '1234 with hmm'); + assert.equal(moment('1234a', 'hmmA', true).format('HH:mm:ss'), '00:34:00', '1234a with hmmA'); + assert.equal(moment('1234p', 'hmmA', true).format('HH:mm:ss'), '12:34:00', '1234p with hmmA'); + + assert.equal(moment('12345', 'hmmss', true).format('HH:mm:ss'), '01:23:45', '12345 with hmmss'); + assert.equal(moment('12345a', 'hmmssA', true).format('HH:mm:ss'), '01:23:45', '12345a with hmmssA'); + assert.equal(moment('12345p', 'hmmssA', true).format('HH:mm:ss'), '13:23:45', '12345p with hmmssA'); + assert.equal(moment('112345', 'hmmss', true).format('HH:mm:ss'), '11:23:45', '112345 with hmmss'); + assert.equal(moment('112345a', 'hmmssA', true).format('HH:mm:ss'), '11:23:45', '112345a with hmmssA'); + assert.equal(moment('112345p', 'hmmssA', true).format('HH:mm:ss'), '23:23:45', '112345p with hmmssA'); + + assert.equal(moment('023', 'Hmm', true).format('HH:mm:ss'), '00:23:00', '023 with Hmm'); + assert.equal(moment('123', 'Hmm', true).format('HH:mm:ss'), '01:23:00', '123 with Hmm'); + assert.equal(moment('1234', 'Hmm', true).format('HH:mm:ss'), '12:34:00', '1234 with Hmm'); + assert.equal(moment('1534', 'Hmm', true).format('HH:mm:ss'), '15:34:00', '1234 with Hmm'); + assert.equal(moment('12345', 'Hmmss', true).format('HH:mm:ss'), '01:23:45', '12345 with Hmmss'); + assert.equal(moment('112345', 'Hmmss', true).format('HH:mm:ss'), '11:23:45', '112345 with Hmmss'); + assert.equal(moment('172345', 'Hmmss', true).format('HH:mm:ss'), '17:23:45', '112345 with Hmmss'); + }); + + test('Y token', function (assert) { + assert.equal(moment('1-1-2010', 'M-D-Y', true).year(), 2010, 'parsing Y'); + }); + })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -32888,12 +37225,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -32911,8 +37250,94 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + moment.locale('en'); + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + module('creation data'); + + test('valid date', function (assert) { + var dat = moment('1992-10-22'); + var orig = dat.creationData(); + + assert.equal(dat.isValid(), true, '1992-10-22 is valid'); + assert.equal(orig.input, '1992-10-22', 'original input is not correct.'); + assert.equal(orig.format, 'YYYY-MM-DD', 'original format is defined.'); + assert.equal(orig.locale._abbr, 'en', 'default locale is en'); + assert.equal(orig.isUTC, false, 'not a UTC date'); + }); + + test('valid date at fr locale', function (assert) { + var dat = moment('1992-10-22', 'YYYY-MM-DD', 'fr'); + var orig = dat.creationData(); + + assert.equal(orig.locale._abbr, 'fr', 'locale is fr'); + }); + + test('valid date with formats', function (assert) { + var dat = moment('29-06-1995', ['MM-DD-YYYY', 'DD-MM', 'DD-MM-YYYY']); + var orig = dat.creationData(); + + assert.equal(orig.format, 'DD-MM-YYYY', 'DD-MM-YYYY format is defined.'); + }); + + test('strict', function (assert) { + assert.ok(moment('2015-01-02', 'YYYY-MM-DD', true).creationData().strict, 'strict is true'); + assert.ok(!moment('2015-01-02', 'YYYY-MM-DD').creationData().strict, 'strict is true'); + }); + +})); + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + /*global QUnit:false*/ + + var test = QUnit.test; + + var expect = QUnit.expect; + + function module (name, lifecycle) { + QUnit.module(name, { + setup : function () { + moment.locale('en'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + function localeModule (name, lifecycle) { + QUnit.module('locale:' + name, { + setup : function () { + moment.locale(name); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -32954,8 +37379,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -32964,12 +37390,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -32987,8 +37415,140 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + moment.locale('en'); + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + function hasOwnProp(a, b) { + return Object.prototype.hasOwnProperty.call(a, b); + } + + function extend(a, b) { + for (var i in b) { + if (hasOwnProp(b, i)) { + a[i] = b[i]; + } + } + + if (hasOwnProp(b, 'toString')) { + a.toString = b.toString; + } + + if (hasOwnProp(b, 'valueOf')) { + a.valueOf = b.valueOf; + } + + return a; + } + + var hookCallback; + + function hooks () { + return hookCallback.apply(null, arguments); + } + + // This is done to register the method called with moment() + // without creating circular dependencies. + function setHookCallback (callback) { + hookCallback = callback; + } + + function isUndefined(input) { + return input === void 0; + } + + function warn(msg) { + if (hooks.suppressDeprecationWarnings === false && + (typeof console !== 'undefined') && console.warn) { + console.warn('Deprecation warning: ' + msg); + } + } + + function deprecate(msg, fn) { + var firstTime = true; + + return extend(function () { + if (firstTime) { + warn(msg + '\nArguments: ' + Array.prototype.slice.call(arguments).join(', ') + '\n' + (new Error()).stack); + firstTime = false; + } + return fn.apply(this, arguments); + }, fn); + } + + var deprecations = {}; + + function deprecateSimple(name, msg) { + if (!deprecations[name]) { + warn(msg); + deprecations[name] = true; + } + } + + hooks.suppressDeprecationWarnings = false; + + module('deprecate'); + + test('deprecate', function (assert) { + var fn = function () {}; + var deprecatedFn = deprecate('testing deprecation', fn); + deprecatedFn(); + + expect(0); + }); + +})); + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + /*global QUnit:false*/ + + var test = QUnit.test; + + var expect = QUnit.expect; + + function module (name, lifecycle) { + QUnit.module(name, { + setup : function () { + moment.locale('en'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + function localeModule (name, lifecycle) { + QUnit.module('locale:' + name, { + setup : function () { + moment.locale(name); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -33042,7 +37602,7 @@ assert.equal(moment(1000).diff(500), 500, '1 second - 0.5 seconds = 500'); assert.equal(moment(0).diff(1000), -1000, '0 - 1 second = -1000'); assert.equal(moment(new Date(1000)).diff(1000), 0, '1 second - 1 second = 0'); - var oneHourDate = new Date(), + var oneHourDate = new Date(2015, 5, 21), nowDate = new Date(+oneHourDate); oneHourDate.setHours(oneHourDate.getHours() + 1); assert.equal(moment(oneHourDate).diff(nowDate), 60 * 60 * 1000, '1 hour from now = 3600000'); @@ -33237,8 +37797,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -33247,12 +37808,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -33270,8 +37833,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -33465,6 +38028,13 @@ assert.equal(moment.duration('1.02:03:04.9999999').minutes(), 3, '3 minutes'); assert.equal(moment.duration('1.02:03:04.9999999').seconds(), 4, '4 seconds'); assert.equal(moment.duration('1.02:03:04.9999999').milliseconds(), 999, '999 milliseconds'); + + assert.equal(moment.duration('1 02:03:04.9999999').years(), 0, '0 years'); + assert.equal(moment.duration('1 02:03:04.9999999').days(), 1, '1 day'); + assert.equal(moment.duration('1 02:03:04.9999999').hours(), 2, '2 hours'); + assert.equal(moment.duration('1 02:03:04.9999999').minutes(), 3, '3 minutes'); + assert.equal(moment.duration('1 02:03:04.9999999').seconds(), 4, '4 seconds'); + assert.equal(moment.duration('1 02:03:04.9999999').milliseconds(), 999, '999 milliseconds'); }); test('instatiation from serialized C# TimeSpan without days', function (assert) { @@ -33909,8 +38479,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -33919,12 +38490,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -33942,8 +38515,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -34003,8 +38576,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -34013,12 +38587,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -34036,8 +38612,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -34382,25 +38958,57 @@ assert.equal(moment([2000, 0, 2]).format('[Q]Q-YYYY'), 'Q1-2000', 'Jan 2 2000 is Q1'); }); + test('quarter ordinal formats', function (assert) { + assert.equal(moment([1985, 1, 4]).format('Qo'), '1st', 'Feb 4 1985 is 1st quarter'); + assert.equal(moment([2029, 8, 18]).format('Qo'), '3rd', 'Sep 18 2029 is 3rd quarter'); + assert.equal(moment([2013, 3, 24]).format('Qo'), '2nd', 'Apr 24 2013 is 2nd quarter'); + assert.equal(moment([2015, 2, 5]).format('Qo'), '1st', 'Mar 5 2015 is 1st quarter'); + assert.equal(moment([1970, 0, 2]).format('Qo'), '1st', 'Jan 2 1970 is 1st quarter'); + assert.equal(moment([2001, 11, 12]).format('Qo'), '4th', 'Dec 12 2001 is 4th quarter'); + assert.equal(moment([2000, 0, 2]).format('Qo [quarter] YYYY'), '1st quarter 2000', 'Jan 2 2000 is 1st quarter'); + }); + test('full expanded format is returned from abbreviated formats', function (assert) { - var locales = ''; + function forEach(ar, fn) { + if (ar.forEach) { + return ar.forEach(fn); + } else { + // IE8 + for (var i = 0; i < ar.length; i += 1) { + fn(ar[i]); + } + } + } + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } - locales += 'af ar-ma ar-sa ar-tn ar az be bg bn bo br bs'; - locales += 'ca cs cv cy da de-at de el en-au en-ca en-gb'; - locales += 'en eo es et eu fa fi fo fr-ca fr fy gl he hi'; - locales += 'hr hu hy-am id is it ja jv ka km ko lb lt lv'; - locales += 'me mk ml mr ms-my my nb ne nl nn pl pt-rb pt'; - locales += 'ro ru si sk sl sq sr-cyrl sr sv ta th tl-ph'; - locales += 'tr tzm-latn tzm uk uz vi zh-cn zh-tw'; + var locales = + 'ar-sa ar-tn ar az be bg bn bo br bs ca cs cv cy da de-at de dv el ' + + 'en-au en-ca en-gb en-ie en-nz eo es et eu fa fi fo fr-ca fr-ch fr fy ' + + 'gd gl he hi hr hu hy-am id is it ja jv ka kk km ko lb lo lt lv me mk ml ' + + 'mr ms-my ms my nb ne nl nn pl pt-br pt ro ru se si sk sl sq sr-cyrl ' + + 'sr sv sw ta te th tl-ph tlh tr tzl tzm-latn tzm uk uz vi zh-cn zh-tw'; - locales.split(' ').forEach(function (locale) { + forEach(locales.split(' '), function (locale) { var data, tokens; data = moment().locale(locale).localeData()._longDateFormat; - tokens = Object.keys(data); - tokens.forEach(function (token) { + tokens = objectKeys(data); + forEach(tokens, function (token) { // Check each format string to make sure it does not contain any // tokens that need to be expanded. - tokens.forEach(function (i) { + forEach(tokens, function (i) { // strip escaped sequences var format = data[i].replace(/(\[[^\]]*\])/g, ''); assert.equal(false, !!~format.indexOf(token), 'locale ' + locale + ' contains ' + token + ' in ' + i); @@ -34423,10 +39031,42 @@ assert.equal(m.format('SSSSSSSSS'), '123000000'); }); + test('hmm and hmmss', function (assert) { + assert.equal(moment('12:34:56', 'HH:mm:ss').format('hmm'), '1234'); + assert.equal(moment('01:34:56', 'HH:mm:ss').format('hmm'), '134'); + assert.equal(moment('13:34:56', 'HH:mm:ss').format('hmm'), '134'); + + assert.equal(moment('12:34:56', 'HH:mm:ss').format('hmmss'), '123456'); + assert.equal(moment('01:34:56', 'HH:mm:ss').format('hmmss'), '13456'); + assert.equal(moment('13:34:56', 'HH:mm:ss').format('hmmss'), '13456'); + }); + + test('Hmm and Hmmss', function (assert) { + assert.equal(moment('12:34:56', 'HH:mm:ss').format('Hmm'), '1234'); + assert.equal(moment('01:34:56', 'HH:mm:ss').format('Hmm'), '134'); + assert.equal(moment('13:34:56', 'HH:mm:ss').format('Hmm'), '1334'); + + assert.equal(moment('12:34:56', 'HH:mm:ss').format('Hmmss'), '123456'); + assert.equal(moment('01:34:56', 'HH:mm:ss').format('Hmmss'), '13456'); + assert.equal(moment('08:34:56', 'HH:mm:ss').format('Hmmss'), '83456'); + assert.equal(moment('18:34:56', 'HH:mm:ss').format('Hmmss'), '183456'); + }); + + test('Y token', function (assert) { + assert.equal(moment('2010-01-01', 'YYYY-MM-DD', true).format('Y'), '2010', 'format 2010 with Y'); + assert.equal(moment('-123-01-01', 'Y-MM-DD', true).format('Y'), '-123', 'format -123 with Y'); + assert.equal(moment('12345-01-01', 'Y-MM-DD', true).format('Y'), '+12345', 'format 12345 with Y'); + assert.equal(moment('0-01-01', 'Y-MM-DD', true).format('Y'), '0', 'format 0 with Y'); + assert.equal(moment('1-01-01', 'Y-MM-DD', true).format('Y'), '1', 'format 1 with Y'); + assert.equal(moment('9999-01-01', 'Y-MM-DD', true).format('Y'), '9999', 'format 9999 with Y'); + assert.equal(moment('10000-01-01', 'Y-MM-DD', true).format('Y'), '+10000', 'format 10000 with Y'); + }); + })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -34435,12 +39075,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -34458,8 +39100,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -34526,8 +39168,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -34536,12 +39179,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -34559,8 +39204,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -34813,8 +39458,89 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + /*global QUnit:false*/ + + var test = QUnit.test; + + var expect = QUnit.expect; + + function module (name, lifecycle) { + QUnit.module(name, { + setup : function () { + moment.locale('en'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + function localeModule (name, lifecycle) { + QUnit.module('locale:' + name, { + setup : function () { + moment.locale(name); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + moment.locale('en'); + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + module('instanceof'); + + test('instanceof', function (assert) { + var mm = moment([2010, 0, 1]); + + var extend = function (a, b) { + var i; + for (i in b) { + a[i] = b[i]; + } + return a; + }; + + assert.equal(moment() instanceof moment, true, 'simple moment object'); + assert.equal(extend({}, moment()) instanceof moment, false, 'extended moment object'); + assert.equal(moment(null) instanceof moment, true, 'invalid moment object'); + + assert.equal(new Date() instanceof moment, false, 'date object is not moment object'); + assert.equal(Object instanceof moment, false, 'Object is not moment object'); + assert.equal('foo' instanceof moment, false, 'string is not moment object'); + assert.equal(1 instanceof moment, false, 'number is not moment object'); + assert.equal(NaN instanceof moment, false, 'NaN is not moment object'); + assert.equal(null instanceof moment, false, 'null is not moment object'); + assert.equal(undefined instanceof moment, false, 'undefined is not moment object'); + }); + +})); + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -34823,12 +39549,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -34846,8 +39574,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -34887,10 +39615,163 @@ assert.ok(isNaN(m.valueOf())); }); + test('invalid operations', function (assert) { + var invalids = [ + moment.invalid(), + moment('xyz', 'l'), + moment('2015-01-35', 'YYYY-MM-DD'), + moment('2015-01-25 a', 'YYYY-MM-DD', true) + ], + i, + invalid, + valid = moment(); + + for (i = 0; i < invalids.length; ++i) { + invalid = invalids[i]; + + assert.ok(!invalid.clone().add(5, 'hours').isValid(), 'invalid.add is invalid'); + assert.equal(invalid.calendar(), 'Invalid date', 'invalid.calendar is \'Invalid date\''); + assert.ok(!invalid.clone().isValid(), 'invalid.clone is invalid'); + assert.ok(isNaN(invalid.diff(valid)), 'invalid.diff(valid) is NaN'); + assert.ok(isNaN(valid.diff(invalid)), 'valid.diff(invalid) is NaN'); + assert.ok(isNaN(invalid.diff(invalid)), 'invalid.diff(invalid) is NaN'); + assert.ok(!invalid.clone().endOf('month').isValid(), 'invalid.endOf is invalid'); + assert.equal(invalid.format(), 'Invalid date', 'invalid.format is \'Invalid date\''); + assert.equal(invalid.from(), 'Invalid date'); + assert.equal(invalid.from(valid), 'Invalid date'); + assert.equal(valid.from(invalid), 'Invalid date'); + assert.equal(invalid.fromNow(), 'Invalid date'); + assert.equal(invalid.to(), 'Invalid date'); + assert.equal(invalid.to(valid), 'Invalid date'); + assert.equal(valid.to(invalid), 'Invalid date'); + assert.equal(invalid.toNow(), 'Invalid date'); + assert.ok(isNaN(invalid.get('year')), 'invalid.get is NaN'); + // TODO invalidAt + assert.ok(!invalid.isAfter(valid)); + assert.ok(!valid.isAfter(invalid)); + assert.ok(!invalid.isAfter(invalid)); + assert.ok(!invalid.isBefore(valid)); + assert.ok(!valid.isBefore(invalid)); + assert.ok(!invalid.isBefore(invalid)); + assert.ok(!invalid.isBetween(valid, valid)); + assert.ok(!valid.isBetween(invalid, valid)); + assert.ok(!valid.isBetween(valid, invalid)); + assert.ok(!invalid.isSame(invalid)); + assert.ok(!invalid.isSame(valid)); + assert.ok(!valid.isSame(invalid)); + assert.ok(!invalid.isValid()); + assert.equal(invalid.locale(), 'en'); + assert.equal(invalid.localeData()._abbr, 'en'); + assert.ok(!invalid.clone().max(valid).isValid()); + assert.ok(!valid.clone().max(invalid).isValid()); + assert.ok(!invalid.clone().max(invalid).isValid()); + assert.ok(!invalid.clone().min(valid).isValid()); + assert.ok(!valid.clone().min(invalid).isValid()); + assert.ok(!invalid.clone().min(invalid).isValid()); + assert.ok(!moment.min(invalid, valid).isValid()); + assert.ok(!moment.min(valid, invalid).isValid()); + assert.ok(!moment.max(invalid, valid).isValid()); + assert.ok(!moment.max(valid, invalid).isValid()); + assert.ok(!invalid.clone().set('year', 2005).isValid()); + assert.ok(!invalid.clone().startOf('month').isValid()); + + assert.ok(!invalid.clone().subtract(5, 'days').isValid()); + assert.deepEqual(invalid.toArray(), [NaN, NaN, NaN, NaN, NaN, NaN, NaN]); + assert.deepEqual(invalid.toObject(), { + years: NaN, + months: NaN, + date: NaN, + hours: NaN, + minutes: NaN, + seconds: NaN, + milliseconds: NaN + }); + assert.ok(moment.isDate(invalid.toDate())); + assert.ok(isNaN(invalid.toDate().valueOf())); + assert.equal(invalid.toJSON(), 'null'); + assert.equal(invalid.toString(), 'Invalid date'); + assert.ok(isNaN(invalid.unix())); + assert.ok(isNaN(invalid.valueOf())); + + assert.ok(isNaN(invalid.year())); + assert.ok(isNaN(invalid.weekYear())); + assert.ok(isNaN(invalid.isoWeekYear())); + assert.ok(isNaN(invalid.quarter())); + assert.ok(isNaN(invalid.quarters())); + assert.ok(isNaN(invalid.month())); + assert.ok(isNaN(invalid.daysInMonth())); + assert.ok(isNaN(invalid.week())); + assert.ok(isNaN(invalid.weeks())); + assert.ok(isNaN(invalid.isoWeek())); + assert.ok(isNaN(invalid.isoWeeks())); + assert.ok(isNaN(invalid.weeksInYear())); + assert.ok(isNaN(invalid.isoWeeksInYear())); + assert.ok(isNaN(invalid.date())); + assert.ok(isNaN(invalid.day())); + assert.ok(isNaN(invalid.days())); + assert.ok(isNaN(invalid.weekday())); + assert.ok(isNaN(invalid.isoWeekday())); + assert.ok(isNaN(invalid.dayOfYear())); + assert.ok(isNaN(invalid.hour())); + assert.ok(isNaN(invalid.hours())); + assert.ok(isNaN(invalid.minute())); + assert.ok(isNaN(invalid.minutes())); + assert.ok(isNaN(invalid.second())); + assert.ok(isNaN(invalid.seconds())); + assert.ok(isNaN(invalid.millisecond())); + assert.ok(isNaN(invalid.milliseconds())); + assert.ok(isNaN(invalid.utcOffset())); + + assert.ok(!invalid.clone().year(2001).isValid()); + assert.ok(!invalid.clone().weekYear(2001).isValid()); + assert.ok(!invalid.clone().isoWeekYear(2001).isValid()); + assert.ok(!invalid.clone().quarter(1).isValid()); + assert.ok(!invalid.clone().quarters(1).isValid()); + assert.ok(!invalid.clone().month(1).isValid()); + assert.ok(!invalid.clone().week(1).isValid()); + assert.ok(!invalid.clone().weeks(1).isValid()); + assert.ok(!invalid.clone().isoWeek(1).isValid()); + assert.ok(!invalid.clone().isoWeeks(1).isValid()); + assert.ok(!invalid.clone().date(1).isValid()); + assert.ok(!invalid.clone().day(1).isValid()); + assert.ok(!invalid.clone().days(1).isValid()); + assert.ok(!invalid.clone().weekday(1).isValid()); + assert.ok(!invalid.clone().isoWeekday(1).isValid()); + assert.ok(!invalid.clone().dayOfYear(1).isValid()); + assert.ok(!invalid.clone().hour(1).isValid()); + assert.ok(!invalid.clone().hours(1).isValid()); + assert.ok(!invalid.clone().minute(1).isValid()); + assert.ok(!invalid.clone().minutes(1).isValid()); + assert.ok(!invalid.clone().second(1).isValid()); + assert.ok(!invalid.clone().seconds(1).isValid()); + assert.ok(!invalid.clone().millisecond(1).isValid()); + assert.ok(!invalid.clone().milliseconds(1).isValid()); + assert.ok(!invalid.clone().utcOffset(1).isValid()); + + assert.ok(!invalid.clone().utc().isValid()); + assert.ok(!invalid.clone().local().isValid()); + assert.ok(!invalid.clone().parseZone('05:30').isValid()); + assert.ok(!invalid.hasAlignedHourOffset()); + assert.ok(!invalid.isDST()); + assert.ok(!invalid.isDSTShifted()); + assert.ok(!invalid.isLocal()); + assert.ok(!invalid.isUtcOffset()); + assert.ok(!invalid.isUtc()); + assert.ok(!invalid.isUTC()); + + assert.ok(!invalid.isLeapYear()); + + assert.equal(moment.duration({from: invalid, to: valid}).asMilliseconds(), 0); + assert.equal(moment.duration({from: valid, to: invalid}).asMilliseconds(), 0); + assert.equal(moment.duration({from: invalid, to: invalid}).asMilliseconds(), 0); + } + }); + })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -34899,12 +39780,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -34922,8 +39805,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -35115,8 +39998,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -35125,12 +40009,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -35148,8 +40034,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -35341,8 +40227,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -35351,12 +40238,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -35374,8 +40263,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -35610,8 +40499,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -35620,12 +40510,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -35643,8 +40535,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -35683,8 +40575,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -35693,12 +40586,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -35716,8 +40611,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -35775,8 +40670,212 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + /*global QUnit:false*/ + + var test = QUnit.test; + + var expect = QUnit.expect; + + function module (name, lifecycle) { + QUnit.module(name, { + setup : function () { + moment.locale('en'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + function localeModule (name, lifecycle) { + QUnit.module('locale:' + name, { + setup : function () { + moment.locale(name); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + moment.locale('en'); + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + module('is same'); + + test('is same without units', function (assert) { + var m = moment(new Date(2011, 3, 2, 3, 4, 5, 10)), mCopy = moment(m); + assert.equal(m.isSame(moment(new Date(2012, 3, 2, 3, 5, 5, 10))), false, 'year is later'); + assert.equal(m.isSame(moment(new Date(2010, 3, 2, 3, 3, 5, 10))), false, 'year is earlier'); + assert.equal(m.isSame(moment(new Date(2011, 4, 2, 3, 4, 5, 10))), false, 'month is later'); + assert.equal(m.isSame(moment(new Date(2011, 2, 2, 3, 4, 5, 10))), false, 'month is earlier'); + assert.equal(m.isSame(moment(new Date(2011, 3, 3, 3, 4, 5, 10))), false, 'day is later'); + assert.equal(m.isSame(moment(new Date(2011, 3, 1, 3, 4, 5, 10))), false, 'day is earlier'); + assert.equal(m.isSame(moment(new Date(2011, 3, 2, 4, 4, 5, 10))), false, 'hour is later'); + assert.equal(m.isSame(moment(new Date(2011, 3, 2, 2, 4, 5, 10))), false, 'hour is earlier'); + assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 5, 5, 10))), false, 'minute is later'); + assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 3, 5, 10))), false, 'minute is earlier'); + assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 6, 10))), false, 'second is later'); + assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 4, 11))), false, 'second is earlier'); + assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 5, 10))), true, 'millisecond match'); + assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 5, 11))), false, 'millisecond is later'); + assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 5, 9))), false, 'millisecond is earlier'); + assert.equal(m.isSame(m), true, 'moments are the same as themselves'); + assert.equal(+m, +mCopy, 'isSame second should not change moment'); + }); + + test('is same year', function (assert) { + var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m); + assert.equal(m.isSame(moment(new Date(2011, 5, 6, 7, 8, 9, 10)), 'year'), true, 'year match'); + assert.equal(m.isSame(moment(new Date(2011, 5, 6, 7, 8, 9, 10)), 'years'), true, 'plural should work'); + assert.equal(m.isSame(moment(new Date(2012, 5, 6, 7, 8, 9, 10)), 'year'), false, 'year mismatch'); + assert.equal(m.isSame(moment(new Date(2011, 0, 1, 0, 0, 0, 0)), 'year'), true, 'exact start of year'); + assert.equal(m.isSame(moment(new Date(2011, 11, 31, 23, 59, 59, 999)), 'year'), true, 'exact end of year'); + assert.equal(m.isSame(moment(new Date(2012, 0, 1, 0, 0, 0, 0)), 'year'), false, 'start of next year'); + assert.equal(m.isSame(moment(new Date(2010, 11, 31, 23, 59, 59, 999)), 'year'), false, 'end of previous year'); + assert.equal(m.isSame(m, 'year'), true, 'same moments are in the same year'); + assert.equal(+m, +mCopy, 'isSame year should not change moment'); + }); + + test('is same month', function (assert) { + var m = moment(new Date(2011, 2, 3, 4, 5, 6, 7)), mCopy = moment(m); + assert.equal(m.isSame(moment(new Date(2011, 2, 6, 7, 8, 9, 10)), 'month'), true, 'month match'); + assert.equal(m.isSame(moment(new Date(2011, 2, 6, 7, 8, 9, 10)), 'months'), true, 'plural should work'); + assert.equal(m.isSame(moment(new Date(2012, 2, 6, 7, 8, 9, 10)), 'month'), false, 'year mismatch'); + assert.equal(m.isSame(moment(new Date(2011, 5, 6, 7, 8, 9, 10)), 'month'), false, 'month mismatch'); + assert.equal(m.isSame(moment(new Date(2011, 2, 1, 0, 0, 0, 0)), 'month'), true, 'exact start of month'); + assert.equal(m.isSame(moment(new Date(2011, 2, 31, 23, 59, 59, 999)), 'month'), true, 'exact end of month'); + assert.equal(m.isSame(moment(new Date(2011, 3, 1, 0, 0, 0, 0)), 'month'), false, 'start of next month'); + assert.equal(m.isSame(moment(new Date(2011, 1, 27, 23, 59, 59, 999)), 'month'), false, 'end of previous month'); + assert.equal(m.isSame(m, 'month'), true, 'same moments are in the same month'); + assert.equal(+m, +mCopy, 'isSame month should not change moment'); + }); + + test('is same day', function (assert) { + var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 7, 8, 9, 10)), 'day'), true, 'day match'); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 7, 8, 9, 10)), 'days'), true, 'plural should work'); + assert.equal(m.isSame(moment(new Date(2012, 1, 2, 7, 8, 9, 10)), 'day'), false, 'year mismatch'); + assert.equal(m.isSame(moment(new Date(2011, 2, 2, 7, 8, 9, 10)), 'day'), false, 'month mismatch'); + assert.equal(m.isSame(moment(new Date(2011, 1, 3, 7, 8, 9, 10)), 'day'), false, 'day mismatch'); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 0, 0, 0, 0)), 'day'), true, 'exact start of day'); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 23, 59, 59, 999)), 'day'), true, 'exact end of day'); + assert.equal(m.isSame(moment(new Date(2011, 1, 3, 0, 0, 0, 0)), 'day'), false, 'start of next day'); + assert.equal(m.isSame(moment(new Date(2011, 1, 1, 23, 59, 59, 999)), 'day'), false, 'end of previous day'); + assert.equal(m.isSame(m, 'day'), true, 'same moments are in the same day'); + assert.equal(+m, +mCopy, 'isSame day should not change moment'); + }); + + test('is same hour', function (assert) { + var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 8, 9, 10)), 'hour'), true, 'hour match'); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 8, 9, 10)), 'hours'), true, 'plural should work'); + assert.equal(m.isSame(moment(new Date(2012, 1, 2, 3, 8, 9, 10)), 'hour'), false, 'year mismatch'); + assert.equal(m.isSame(moment(new Date(2011, 2, 2, 3, 8, 9, 10)), 'hour'), false, 'month mismatch'); + assert.equal(m.isSame(moment(new Date(2011, 1, 3, 3, 8, 9, 10)), 'hour'), false, 'day mismatch'); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 4, 8, 9, 10)), 'hour'), false, 'hour mismatch'); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 0, 0, 0)), 'hour'), true, 'exact start of hour'); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 59, 59, 999)), 'hour'), true, 'exact end of hour'); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 4, 0, 0, 0)), 'hour'), false, 'start of next hour'); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 2, 59, 59, 999)), 'hour'), false, 'end of previous hour'); + assert.equal(m.isSame(m, 'hour'), true, 'same moments are in the same hour'); + assert.equal(+m, +mCopy, 'isSame hour should not change moment'); + }); + + test('is same minute', function (assert) { + var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 9, 10)), 'minute'), true, 'minute match'); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 9, 10)), 'minutes'), true, 'plural should work'); + assert.equal(m.isSame(moment(new Date(2012, 1, 2, 3, 4, 9, 10)), 'minute'), false, 'year mismatch'); + assert.equal(m.isSame(moment(new Date(2011, 2, 2, 3, 4, 9, 10)), 'minute'), false, 'month mismatch'); + assert.equal(m.isSame(moment(new Date(2011, 1, 3, 3, 4, 9, 10)), 'minute'), false, 'day mismatch'); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 4, 4, 9, 10)), 'minute'), false, 'hour mismatch'); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 5, 9, 10)), 'minute'), false, 'minute mismatch'); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 0, 0)), 'minute'), true, 'exact start of minute'); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 59, 999)), 'minute'), true, 'exact end of minute'); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 5, 0, 0)), 'minute'), false, 'start of next minute'); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 3, 59, 999)), 'minute'), false, 'end of previous minute'); + assert.equal(m.isSame(m, 'minute'), true, 'same moments are in the same minute'); + assert.equal(+m, +mCopy, 'isSame minute should not change moment'); + }); + + test('is same second', function (assert) { + var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 5, 10)), 'second'), true, 'second match'); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 5, 10)), 'seconds'), true, 'plural should work'); + assert.equal(m.isSame(moment(new Date(2012, 1, 2, 3, 4, 5, 10)), 'second'), false, 'year mismatch'); + assert.equal(m.isSame(moment(new Date(2011, 2, 2, 3, 4, 5, 10)), 'second'), false, 'month mismatch'); + assert.equal(m.isSame(moment(new Date(2011, 1, 3, 3, 4, 5, 10)), 'second'), false, 'day mismatch'); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 4, 4, 5, 10)), 'second'), false, 'hour mismatch'); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 5, 5, 10)), 'second'), false, 'minute mismatch'); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 6, 10)), 'second'), false, 'second mismatch'); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 5, 0)), 'second'), true, 'exact start of second'); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 5, 999)), 'second'), true, 'exact end of second'); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 6, 0)), 'second'), false, 'start of next second'); + assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 4, 999)), 'second'), false, 'end of previous second'); + assert.equal(m.isSame(m, 'second'), true, 'same moments are in the same second'); + assert.equal(+m, +mCopy, 'isSame second should not change moment'); + }); + + test('is same millisecond', function (assert) { + var m = moment(new Date(2011, 3, 2, 3, 4, 5, 10)), mCopy = moment(m); + assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 5, 10)), 'millisecond'), true, 'millisecond match'); + assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 5, 10)), 'milliseconds'), true, 'plural should work'); + assert.equal(m.isSame(moment(new Date(2012, 3, 2, 3, 4, 5, 10)), 'millisecond'), false, 'year is later'); + assert.equal(m.isSame(moment(new Date(2010, 3, 2, 3, 4, 5, 10)), 'millisecond'), false, 'year is earlier'); + assert.equal(m.isSame(moment(new Date(2011, 4, 2, 3, 4, 5, 10)), 'millisecond'), false, 'month is later'); + assert.equal(m.isSame(moment(new Date(2011, 2, 2, 3, 4, 5, 10)), 'millisecond'), false, 'month is earlier'); + assert.equal(m.isSame(moment(new Date(2011, 3, 3, 3, 4, 5, 10)), 'millisecond'), false, 'day is later'); + assert.equal(m.isSame(moment(new Date(2011, 3, 1, 1, 4, 5, 10)), 'millisecond'), false, 'day is earlier'); + assert.equal(m.isSame(moment(new Date(2011, 3, 2, 4, 4, 5, 10)), 'millisecond'), false, 'hour is later'); + assert.equal(m.isSame(moment(new Date(2011, 3, 1, 4, 1, 5, 10)), 'millisecond'), false, 'hour is earlier'); + assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 5, 5, 10)), 'millisecond'), false, 'minute is later'); + assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 3, 5, 10)), 'millisecond'), false, 'minute is earlier'); + assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 6, 10)), 'millisecond'), false, 'second is later'); + assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 4, 5)), 'millisecond'), false, 'second is earlier'); + assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 6, 11)), 'millisecond'), false, 'millisecond is later'); + assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 4, 9)), 'millisecond'), false, 'millisecond is earlier'); + assert.equal(m.isSame(m, 'millisecond'), true, 'same moments are in the same millisecond'); + assert.equal(+m, +mCopy, 'isSame millisecond should not change moment'); + }); + + test('is same with utc offset moments', function (assert) { + assert.ok(moment.parseZone('2013-02-01T-05:00').isSame(moment('2013-02-01'), 'year'), 'zoned vs local moment'); + assert.ok(moment('2013-02-01').isSame(moment('2013-02-01').utcOffset('-05:00'), 'year'), 'local vs zoned moment'); + assert.ok(moment.parseZone('2013-02-01T-05:00').isSame(moment.parseZone('2013-02-01T-06:30'), 'year'), + 'zoned vs (differently) zoned moment'); + }); + + test('is same with invalid moments', function (assert) { + assert.equal(moment.invalid().isSame(moment.invalid()), false, 'invalid moments are not considered equal'); + }); + +})); + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -35785,12 +40884,248 @@ var test = QUnit.test; + var expect = QUnit.expect; + + function module (name, lifecycle) { + QUnit.module(name, { + setup : function () { + moment.locale('en'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + function localeModule (name, lifecycle) { + QUnit.module('locale:' + name, { + setup : function () { + moment.locale(name); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + moment.locale('en'); + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + module('is same or after'); + + test('is same or after without units', function (assert) { + var m = moment(new Date(2011, 3, 2, 3, 4, 5, 10)), mCopy = moment(m); + assert.equal(m.isSameOrAfter(moment(new Date(2012, 3, 2, 3, 5, 5, 10))), false, 'year is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2010, 3, 2, 3, 3, 5, 10))), true, 'year is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 4, 2, 3, 4, 5, 10))), false, 'month is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 2, 2, 3, 4, 5, 10))), true, 'month is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 3, 3, 3, 4, 5, 10))), false, 'day is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 3, 1, 3, 4, 5, 10))), true, 'day is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 3, 2, 4, 4, 5, 10))), false, 'hour is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 3, 2, 2, 4, 5, 10))), true, 'hour is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 3, 2, 3, 5, 5, 10))), false, 'minute is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 3, 2, 3, 3, 5, 10))), true, 'minute is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 3, 2, 3, 4, 6, 10))), false, 'second is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 3, 2, 3, 4, 4, 11))), true, 'second is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 3, 2, 3, 4, 5, 10))), true, 'millisecond match'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 3, 2, 3, 4, 5, 11))), false, 'millisecond is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 3, 2, 3, 4, 5, 9))), true, 'millisecond is earlier'); + assert.equal(m.isSameOrAfter(m), true, 'moments are the same as themselves'); + assert.equal(+m, +mCopy, 'isSameOrAfter second should not change moment'); + }); + + test('is same or after year', function (assert) { + var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 5, 6, 7, 8, 9, 10)), 'year'), true, 'year match'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 5, 6, 7, 8, 9, 10)), 'years'), true, 'plural should work'); + assert.equal(m.isSameOrAfter(moment(new Date(2012, 5, 6, 7, 8, 9, 10)), 'year'), false, 'year is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2010, 5, 6, 7, 8, 9, 10)), 'year'), true, 'year is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 0, 1, 0, 0, 0, 0)), 'year'), true, 'exact start of year'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 11, 31, 23, 59, 59, 999)), 'year'), true, 'exact end of year'); + assert.equal(m.isSameOrAfter(moment(new Date(2012, 0, 1, 0, 0, 0, 0)), 'year'), false, 'start of next year'); + assert.equal(m.isSameOrAfter(moment(new Date(2010, 11, 31, 23, 59, 59, 999)), 'year'), true, 'end of previous year'); + assert.equal(m.isSameOrAfter(m, 'year'), true, 'same moments are in the same year'); + assert.equal(+m, +mCopy, 'isSameOrAfter year should not change moment'); + }); + + test('is same or after month', function (assert) { + var m = moment(new Date(2011, 2, 3, 4, 5, 6, 7)), mCopy = moment(m); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 2, 6, 7, 8, 9, 10)), 'month'), true, 'month match'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 2, 6, 7, 8, 9, 10)), 'months'), true, 'plural should work'); + assert.equal(m.isSameOrAfter(moment(new Date(2012, 2, 6, 7, 8, 9, 10)), 'month'), false, 'year is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2010, 2, 6, 7, 8, 9, 10)), 'month'), true, 'year is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 5, 6, 7, 8, 9, 10)), 'month'), false, 'month is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 6, 7, 8, 9, 10)), 'month'), true, 'month is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 2, 1, 0, 0, 0, 0)), 'month'), true, 'exact start of month'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 2, 31, 23, 59, 59, 999)), 'month'), true, 'exact end of month'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 3, 1, 0, 0, 0, 0)), 'month'), false, 'start of next month'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 27, 23, 59, 59, 999)), 'month'), true, 'end of previous month'); + assert.equal(m.isSameOrAfter(m, 'month'), true, 'same moments are in the same month'); + assert.equal(+m, +mCopy, 'isSameOrAfter month should not change moment'); + }); + + test('is same or after day', function (assert) { + var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 7, 8, 9, 10)), 'day'), true, 'day match'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 7, 8, 9, 10)), 'days'), true, 'plural should work'); + assert.equal(m.isSameOrAfter(moment(new Date(2012, 1, 2, 7, 8, 9, 10)), 'day'), false, 'year is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2010, 1, 2, 7, 8, 9, 10)), 'day'), true, 'year is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 2, 2, 7, 8, 9, 10)), 'day'), false, 'month is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2010, 12, 2, 7, 8, 9, 10)), 'day'), true, 'month is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 3, 7, 8, 9, 10)), 'day'), false, 'day is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 1, 7, 8, 9, 10)), 'day'), true, 'day is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 0, 0, 0, 0)), 'day'), true, 'exact start of day'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 23, 59, 59, 999)), 'day'), true, 'exact end of day'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 3, 0, 0, 0, 0)), 'day'), false, 'start of next day'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 1, 23, 59, 59, 999)), 'day'), true, 'end of previous day'); + assert.equal(m.isSameOrAfter(m, 'day'), true, 'same moments are in the same day'); + assert.equal(+m, +mCopy, 'isSameOrAfter day should not change moment'); + }); + + test('is same or after hour', function (assert) { + var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 3, 8, 9, 10)), 'hour'), true, 'hour match'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 3, 8, 9, 10)), 'hours'), true, 'plural should work'); + assert.equal(m.isSameOrAfter(moment(new Date(2012, 1, 2, 3, 8, 9, 10)), 'hour'), false, 'year is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2010, 1, 2, 3, 8, 9, 10)), 'hour'), true, 'year is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 2, 2, 3, 8, 9, 10)), 'hour'), false, 'month is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2010, 12, 2, 3, 8, 9, 10)), 'hour'), true, 'month is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 3, 3, 8, 9, 10)), 'hour'), false, 'day is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 1, 3, 8, 9, 10)), 'hour'), true, 'day is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 4, 8, 9, 10)), 'hour'), false, 'hour is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 2, 8, 9, 10)), 'hour'), true, 'hour is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 3, 0, 0, 0)), 'hour'), true, 'exact start of hour'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 3, 59, 59, 999)), 'hour'), true, 'exact end of hour'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 4, 0, 0, 0)), 'hour'), false, 'start of next hour'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 2, 59, 59, 999)), 'hour'), true, 'end of previous hour'); + assert.equal(m.isSameOrAfter(m, 'hour'), true, 'same moments are in the same hour'); + assert.equal(+m, +mCopy, 'isSameOrAfter hour should not change moment'); + }); + + test('is same or after minute', function (assert) { + var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 3, 4, 9, 10)), 'minute'), true, 'minute match'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 3, 4, 9, 10)), 'minutes'), true, 'plural should work'); + assert.equal(m.isSameOrAfter(moment(new Date(2012, 1, 2, 3, 4, 9, 10)), 'minute'), false, 'year is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2010, 1, 2, 3, 4, 9, 10)), 'minute'), true, 'year is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 2, 2, 3, 4, 9, 10)), 'minute'), false, 'month is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2010, 12, 2, 3, 4, 9, 10)), 'minute'), true, 'month is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 3, 3, 4, 9, 10)), 'minute'), false, 'day is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 1, 3, 4, 9, 10)), 'minute'), true, 'day is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 4, 4, 9, 10)), 'minute'), false, 'hour is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 2, 4, 9, 10)), 'minute'), true, 'hour is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 3, 5, 9, 10)), 'minute'), false, 'minute is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 3, 3, 9, 10)), 'minute'), true, 'minute is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 3, 4, 0, 0)), 'minute'), true, 'exact start of minute'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 3, 4, 59, 999)), 'minute'), true, 'exact end of minute'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 3, 5, 0, 0)), 'minute'), false, 'start of next minute'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 3, 3, 59, 999)), 'minute'), true, 'end of previous minute'); + assert.equal(m.isSameOrAfter(m, 'minute'), true, 'same moments are in the same minute'); + assert.equal(+m, +mCopy, 'isSameOrAfter minute should not change moment'); + }); + + test('is same or after second', function (assert) { + var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 3, 4, 5, 10)), 'second'), true, 'second match'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 3, 4, 5, 10)), 'seconds'), true, 'plural should work'); + assert.equal(m.isSameOrAfter(moment(new Date(2012, 1, 2, 3, 4, 5, 10)), 'second'), false, 'year is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2010, 1, 2, 3, 4, 5, 10)), 'second'), true, 'year is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 2, 2, 3, 4, 5, 10)), 'second'), false, 'month is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2010, 12, 2, 3, 4, 5, 10)), 'second'), true, 'month is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 3, 3, 4, 5, 10)), 'second'), false, 'day is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 1, 3, 4, 5, 10)), 'second'), true, 'day is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 4, 4, 5, 10)), 'second'), false, 'hour is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 2, 4, 5, 10)), 'second'), true, 'hour is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 3, 5, 5, 10)), 'second'), false, 'minute is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 3, 3, 5, 10)), 'second'), true, 'minute is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 3, 4, 6, 10)), 'second'), false, 'second is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 3, 4, 4, 10)), 'second'), true, 'second is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 3, 4, 5, 0)), 'second'), true, 'exact start of second'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 3, 4, 5, 999)), 'second'), true, 'exact end of second'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 3, 4, 6, 0)), 'second'), false, 'start of next second'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 1, 2, 3, 4, 4, 999)), 'second'), true, 'end of previous second'); + assert.equal(m.isSameOrAfter(m, 'second'), true, 'same moments are in the same second'); + assert.equal(+m, +mCopy, 'isSameOrAfter second should not change moment'); + }); + + test('is same or after millisecond', function (assert) { + var m = moment(new Date(2011, 3, 2, 3, 4, 5, 10)), mCopy = moment(m); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 3, 2, 3, 4, 5, 10)), 'millisecond'), true, 'millisecond match'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 3, 2, 3, 4, 5, 10)), 'milliseconds'), true, 'plural should work'); + assert.equal(m.isSameOrAfter(moment(new Date(2012, 3, 2, 3, 4, 5, 10)), 'millisecond'), false, 'year is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2010, 3, 2, 3, 4, 5, 10)), 'millisecond'), true, 'year is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 4, 2, 3, 4, 5, 10)), 'millisecond'), false, 'month is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 2, 2, 3, 4, 5, 10)), 'millisecond'), true, 'month is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 3, 3, 3, 4, 5, 10)), 'millisecond'), false, 'day is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 3, 1, 1, 4, 5, 10)), 'millisecond'), true, 'day is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 3, 2, 4, 4, 5, 10)), 'millisecond'), false, 'hour is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 3, 1, 4, 1, 5, 10)), 'millisecond'), true, 'hour is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 3, 2, 3, 5, 5, 10)), 'millisecond'), false, 'minute is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 3, 2, 3, 3, 5, 10)), 'millisecond'), true, 'minute is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 3, 2, 3, 4, 6, 10)), 'millisecond'), false, 'second is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 3, 2, 3, 4, 4, 5)), 'millisecond'), true, 'second is earlier'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 3, 2, 3, 4, 6, 11)), 'millisecond'), false, 'millisecond is later'); + assert.equal(m.isSameOrAfter(moment(new Date(2011, 3, 2, 3, 4, 4, 9)), 'millisecond'), true, 'millisecond is earlier'); + assert.equal(m.isSameOrAfter(m, 'millisecond'), true, 'same moments are in the same millisecond'); + assert.equal(+m, +mCopy, 'isSameOrAfter millisecond should not change moment'); + }); + + test('is same or after with utc offset moments', function (assert) { + assert.ok(moment.parseZone('2013-02-01T-05:00').isSameOrAfter(moment('2013-02-01'), 'year'), 'zoned vs local moment'); + assert.ok(moment('2013-02-01').isSameOrAfter(moment('2013-02-01').utcOffset('-05:00'), 'year'), 'local vs zoned moment'); + assert.ok(moment.parseZone('2013-02-01T-05:00').isSameOrAfter(moment.parseZone('2013-02-01T-06:30'), 'year'), + 'zoned vs (differently) zoned moment'); + }); + + test('is same or after with invalid moments', function (assert) { + var m = moment(), invalid = moment.invalid(); + assert.equal(invalid.isSameOrAfter(invalid), false, 'invalid moments are not considered equal'); + assert.equal(m.isSameOrAfter(invalid), false, 'valid moment is not after invalid moment'); + assert.equal(invalid.isSameOrAfter(m), false, 'invalid moment is not after valid moment'); + assert.equal(m.isSameOrAfter(invalid, 'year'), false, 'invalid moment year'); + assert.equal(m.isSameOrAfter(invalid, 'month'), false, 'invalid moment month'); + assert.equal(m.isSameOrAfter(invalid, 'day'), false, 'invalid moment day'); + assert.equal(m.isSameOrAfter(invalid, 'hour'), false, 'invalid moment hour'); + assert.equal(m.isSameOrAfter(invalid, 'minute'), false, 'invalid moment minute'); + assert.equal(m.isSameOrAfter(invalid, 'second'), false, 'invalid moment second'); + assert.equal(m.isSameOrAfter(invalid, 'milliseconds'), false, 'invalid moment milliseconds'); + }); + +})); + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + /*global QUnit:false*/ + + var test = QUnit.test; + + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -35808,8 +41143,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -35824,159 +41159,191 @@ }); } - module('is same'); + module('is same or before'); - test('is same without units', function (assert) { + test('is same or before without units', function (assert) { var m = moment(new Date(2011, 3, 2, 3, 4, 5, 10)), mCopy = moment(m); - assert.equal(m.isSame(moment(new Date(2012, 3, 2, 3, 5, 5, 10))), false, 'year is later'); - assert.equal(m.isSame(moment(new Date(2010, 3, 2, 3, 3, 5, 10))), false, 'year is earlier'); - assert.equal(m.isSame(moment(new Date(2011, 4, 2, 3, 4, 5, 10))), false, 'month is later'); - assert.equal(m.isSame(moment(new Date(2011, 2, 2, 3, 4, 5, 10))), false, 'month is earlier'); - assert.equal(m.isSame(moment(new Date(2011, 3, 3, 3, 4, 5, 10))), false, 'day is later'); - assert.equal(m.isSame(moment(new Date(2011, 3, 1, 3, 4, 5, 10))), false, 'day is earlier'); - assert.equal(m.isSame(moment(new Date(2011, 3, 2, 4, 4, 5, 10))), false, 'hour is later'); - assert.equal(m.isSame(moment(new Date(2011, 3, 2, 2, 4, 5, 10))), false, 'hour is earlier'); - assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 5, 5, 10))), false, 'minute is later'); - assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 3, 5, 10))), false, 'minute is earlier'); - assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 6, 10))), false, 'second is later'); - assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 4, 11))), false, 'second is earlier'); - assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 5, 10))), true, 'millisecond match'); - assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 5, 11))), false, 'millisecond is later'); - assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 5, 9))), false, 'millisecond is earlier'); - assert.equal(m.isSame(m), true, 'moments are the same as themselves'); - assert.equal(+m, +mCopy, 'isSame second should not change moment'); - }); - - test('is same year', function (assert) { + assert.equal(m.isSameOrBefore(moment(new Date(2012, 3, 2, 3, 5, 5, 10))), true, 'year is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2010, 3, 2, 3, 3, 5, 10))), false, 'year is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 4, 2, 3, 4, 5, 10))), true, 'month is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 2, 2, 3, 4, 5, 10))), false, 'month is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 3, 3, 3, 4, 5, 10))), true, 'day is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 3, 1, 3, 4, 5, 10))), false, 'day is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 3, 2, 4, 4, 5, 10))), true, 'hour is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 3, 2, 2, 4, 5, 10))), false, 'hour is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 3, 2, 3, 5, 5, 10))), true, 'minute is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 3, 2, 3, 3, 5, 10))), false, 'minute is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 3, 2, 3, 4, 6, 10))), true, 'second is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 3, 2, 3, 4, 4, 11))), false, 'second is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 3, 2, 3, 4, 5, 10))), true, 'millisecond match'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 3, 2, 3, 4, 5, 11))), true, 'millisecond is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 3, 2, 3, 4, 5, 9))), false, 'millisecond is earlier'); + assert.equal(m.isSameOrBefore(m), true, 'moments are the same as themselves'); + assert.equal(+m, +mCopy, 'isSameOrBefore second should not change moment'); + }); + + test('is same or before year', function (assert) { var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m); - assert.equal(m.isSame(moment(new Date(2011, 5, 6, 7, 8, 9, 10)), 'year'), true, 'year match'); - assert.equal(m.isSame(moment(new Date(2011, 5, 6, 7, 8, 9, 10)), 'years'), true, 'plural should work'); - assert.equal(m.isSame(moment(new Date(2012, 5, 6, 7, 8, 9, 10)), 'year'), false, 'year mismatch'); - assert.equal(m.isSame(moment(new Date(2011, 0, 1, 0, 0, 0, 0)), 'year'), true, 'exact start of year'); - assert.equal(m.isSame(moment(new Date(2011, 11, 31, 23, 59, 59, 999)), 'year'), true, 'exact end of year'); - assert.equal(m.isSame(moment(new Date(2012, 0, 1, 0, 0, 0, 0)), 'year'), false, 'start of next year'); - assert.equal(m.isSame(moment(new Date(2010, 11, 31, 23, 59, 59, 999)), 'year'), false, 'end of previous year'); - assert.equal(m.isSame(m, 'year'), true, 'same moments are in the same year'); - assert.equal(+m, +mCopy, 'isSame year should not change moment'); - }); - - test('is same month', function (assert) { + assert.equal(m.isSameOrBefore(moment(new Date(2011, 5, 6, 7, 8, 9, 10)), 'year'), true, 'year match'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 5, 6, 7, 8, 9, 10)), 'years'), true, 'plural should work'); + assert.equal(m.isSameOrBefore(moment(new Date(2012, 5, 6, 7, 8, 9, 10)), 'year'), true, 'year is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2010, 5, 6, 7, 8, 9, 10)), 'year'), false, 'year is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 0, 1, 0, 0, 0, 0)), 'year'), true, 'exact start of year'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 11, 31, 23, 59, 59, 999)), 'year'), true, 'exact end of year'); + assert.equal(m.isSameOrBefore(moment(new Date(2012, 0, 1, 0, 0, 0, 0)), 'year'), true, 'start of next year'); + assert.equal(m.isSameOrBefore(moment(new Date(2010, 11, 31, 23, 59, 59, 999)), 'year'), false, 'end of previous year'); + assert.equal(m.isSameOrBefore(m, 'year'), true, 'same moments are in the same year'); + assert.equal(+m, +mCopy, 'isSameOrBefore year should not change moment'); + }); + + test('is same or before month', function (assert) { var m = moment(new Date(2011, 2, 3, 4, 5, 6, 7)), mCopy = moment(m); - assert.equal(m.isSame(moment(new Date(2011, 2, 6, 7, 8, 9, 10)), 'month'), true, 'month match'); - assert.equal(m.isSame(moment(new Date(2011, 2, 6, 7, 8, 9, 10)), 'months'), true, 'plural should work'); - assert.equal(m.isSame(moment(new Date(2012, 2, 6, 7, 8, 9, 10)), 'month'), false, 'year mismatch'); - assert.equal(m.isSame(moment(new Date(2011, 5, 6, 7, 8, 9, 10)), 'month'), false, 'month mismatch'); - assert.equal(m.isSame(moment(new Date(2011, 2, 1, 0, 0, 0, 0)), 'month'), true, 'exact start of month'); - assert.equal(m.isSame(moment(new Date(2011, 2, 31, 23, 59, 59, 999)), 'month'), true, 'exact end of month'); - assert.equal(m.isSame(moment(new Date(2011, 3, 1, 0, 0, 0, 0)), 'month'), false, 'start of next month'); - assert.equal(m.isSame(moment(new Date(2011, 1, 27, 23, 59, 59, 999)), 'month'), false, 'end of previous month'); - assert.equal(m.isSame(m, 'month'), true, 'same moments are in the same month'); - assert.equal(+m, +mCopy, 'isSame month should not change moment'); - }); - - test('is same day', function (assert) { + assert.equal(m.isSameOrBefore(moment(new Date(2011, 2, 6, 7, 8, 9, 10)), 'month'), true, 'month match'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 2, 6, 7, 8, 9, 10)), 'months'), true, 'plural should work'); + assert.equal(m.isSameOrBefore(moment(new Date(2012, 2, 6, 7, 8, 9, 10)), 'month'), true, 'year is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2010, 2, 6, 7, 8, 9, 10)), 'month'), false, 'year is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 5, 6, 7, 8, 9, 10)), 'month'), true, 'month is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 6, 7, 8, 9, 10)), 'month'), false, 'month is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 2, 1, 0, 0, 0, 0)), 'month'), true, 'exact start of month'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 2, 31, 23, 59, 59, 999)), 'month'), true, 'exact end of month'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 3, 1, 0, 0, 0, 0)), 'month'), true, 'start of next month'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 27, 23, 59, 59, 999)), 'month'), false, 'end of previous month'); + assert.equal(m.isSameOrBefore(m, 'month'), true, 'same moments are in the same month'); + assert.equal(+m, +mCopy, 'isSameOrBefore month should not change moment'); + }); + + test('is same or before day', function (assert) { var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 7, 8, 9, 10)), 'day'), true, 'day match'); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 7, 8, 9, 10)), 'days'), true, 'plural should work'); - assert.equal(m.isSame(moment(new Date(2012, 1, 2, 7, 8, 9, 10)), 'day'), false, 'year mismatch'); - assert.equal(m.isSame(moment(new Date(2011, 2, 2, 7, 8, 9, 10)), 'day'), false, 'month mismatch'); - assert.equal(m.isSame(moment(new Date(2011, 1, 3, 7, 8, 9, 10)), 'day'), false, 'day mismatch'); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 0, 0, 0, 0)), 'day'), true, 'exact start of day'); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 23, 59, 59, 999)), 'day'), true, 'exact end of day'); - assert.equal(m.isSame(moment(new Date(2011, 1, 3, 0, 0, 0, 0)), 'day'), false, 'start of next day'); - assert.equal(m.isSame(moment(new Date(2011, 1, 1, 23, 59, 59, 999)), 'day'), false, 'end of previous day'); - assert.equal(m.isSame(m, 'day'), true, 'same moments are in the same day'); - assert.equal(+m, +mCopy, 'isSame day should not change moment'); - }); - - test('is same hour', function (assert) { + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 7, 8, 9, 10)), 'day'), true, 'day match'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 7, 8, 9, 10)), 'days'), true, 'plural should work'); + assert.equal(m.isSameOrBefore(moment(new Date(2012, 1, 2, 7, 8, 9, 10)), 'day'), true, 'year is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2010, 1, 2, 7, 8, 9, 10)), 'day'), false, 'year is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 2, 2, 7, 8, 9, 10)), 'day'), true, 'month is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2010, 12, 2, 7, 8, 9, 10)), 'day'), false, 'month is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 3, 7, 8, 9, 10)), 'day'), true, 'day is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 1, 7, 8, 9, 10)), 'day'), false, 'day is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 0, 0, 0, 0)), 'day'), true, 'exact start of day'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 23, 59, 59, 999)), 'day'), true, 'exact end of day'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 3, 0, 0, 0, 0)), 'day'), true, 'start of next day'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 1, 23, 59, 59, 999)), 'day'), false, 'end of previous day'); + assert.equal(m.isSameOrBefore(m, 'day'), true, 'same moments are in the same day'); + assert.equal(+m, +mCopy, 'isSameOrBefore day should not change moment'); + }); + + test('is same or before hour', function (assert) { var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 8, 9, 10)), 'hour'), true, 'hour match'); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 8, 9, 10)), 'hours'), true, 'plural should work'); - assert.equal(m.isSame(moment(new Date(2012, 1, 2, 3, 8, 9, 10)), 'hour'), false, 'year mismatch'); - assert.equal(m.isSame(moment(new Date(2011, 2, 2, 3, 8, 9, 10)), 'hour'), false, 'month mismatch'); - assert.equal(m.isSame(moment(new Date(2011, 1, 3, 3, 8, 9, 10)), 'hour'), false, 'day mismatch'); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 4, 8, 9, 10)), 'hour'), false, 'hour mismatch'); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 0, 0, 0)), 'hour'), true, 'exact start of hour'); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 59, 59, 999)), 'hour'), true, 'exact end of hour'); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 4, 0, 0, 0)), 'hour'), false, 'start of next hour'); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 2, 59, 59, 999)), 'hour'), false, 'end of previous hour'); - assert.equal(m.isSame(m, 'hour'), true, 'same moments are in the same hour'); - assert.equal(+m, +mCopy, 'isSame hour should not change moment'); - }); - - test('is same minute', function (assert) { + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 3, 8, 9, 10)), 'hour'), true, 'hour match'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 3, 8, 9, 10)), 'hours'), true, 'plural should work'); + assert.equal(m.isSameOrBefore(moment(new Date(2012, 1, 2, 3, 8, 9, 10)), 'hour'), true, 'year is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2010, 1, 2, 3, 8, 9, 10)), 'hour'), false, 'year is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 2, 2, 3, 8, 9, 10)), 'hour'), true, 'month is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2010, 12, 2, 3, 8, 9, 10)), 'hour'), false, 'month is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 3, 3, 8, 9, 10)), 'hour'), true, 'day is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 1, 3, 8, 9, 10)), 'hour'), false, 'day is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 4, 8, 9, 10)), 'hour'), true, 'hour is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 2, 8, 9, 10)), 'hour'), false, 'hour is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 3, 0, 0, 0)), 'hour'), true, 'exact start of hour'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 3, 59, 59, 999)), 'hour'), true, 'exact end of hour'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 4, 0, 0, 0)), 'hour'), true, 'start of next hour'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 2, 59, 59, 999)), 'hour'), false, 'end of previous hour'); + assert.equal(m.isSameOrBefore(m, 'hour'), true, 'same moments are in the same hour'); + assert.equal(+m, +mCopy, 'isSameOrBefore hour should not change moment'); + }); + + test('is same or before minute', function (assert) { var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 9, 10)), 'minute'), true, 'minute match'); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 9, 10)), 'minutes'), true, 'plural should work'); - assert.equal(m.isSame(moment(new Date(2012, 1, 2, 3, 4, 9, 10)), 'minute'), false, 'year mismatch'); - assert.equal(m.isSame(moment(new Date(2011, 2, 2, 3, 4, 9, 10)), 'minute'), false, 'month mismatch'); - assert.equal(m.isSame(moment(new Date(2011, 1, 3, 3, 4, 9, 10)), 'minute'), false, 'day mismatch'); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 4, 4, 9, 10)), 'minute'), false, 'hour mismatch'); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 5, 9, 10)), 'minute'), false, 'minute mismatch'); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 0, 0)), 'minute'), true, 'exact start of minute'); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 59, 999)), 'minute'), true, 'exact end of minute'); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 5, 0, 0)), 'minute'), false, 'start of next minute'); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 3, 59, 999)), 'minute'), false, 'end of previous minute'); - assert.equal(m.isSame(m, 'minute'), true, 'same moments are in the same minute'); - assert.equal(+m, +mCopy, 'isSame minute should not change moment'); - }); - - test('is same second', function (assert) { + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 3, 4, 9, 10)), 'minute'), true, 'minute match'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 3, 4, 9, 10)), 'minutes'), true, 'plural should work'); + assert.equal(m.isSameOrBefore(moment(new Date(2012, 1, 2, 3, 4, 9, 10)), 'minute'), true, 'year is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2010, 1, 2, 3, 4, 9, 10)), 'minute'), false, 'year is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 2, 2, 3, 4, 9, 10)), 'minute'), true, 'month is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2010, 12, 2, 3, 4, 9, 10)), 'minute'), false, 'month is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 3, 3, 4, 9, 10)), 'minute'), true, 'day is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 1, 3, 4, 9, 10)), 'minute'), false, 'day is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 4, 4, 9, 10)), 'minute'), true, 'hour is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 2, 4, 9, 10)), 'minute'), false, 'hour is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 3, 5, 9, 10)), 'minute'), true, 'minute is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 3, 3, 9, 10)), 'minute'), false, 'minute is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 3, 4, 0, 0)), 'minute'), true, 'exact start of minute'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 3, 4, 59, 999)), 'minute'), true, 'exact end of minute'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 3, 5, 0, 0)), 'minute'), true, 'start of next minute'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 3, 3, 59, 999)), 'minute'), false, 'end of previous minute'); + assert.equal(m.isSameOrBefore(m, 'minute'), true, 'same moments are in the same minute'); + assert.equal(+m, +mCopy, 'isSameOrBefore minute should not change moment'); + }); + + test('is same or before second', function (assert) { var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 5, 10)), 'second'), true, 'second match'); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 5, 10)), 'seconds'), true, 'plural should work'); - assert.equal(m.isSame(moment(new Date(2012, 1, 2, 3, 4, 5, 10)), 'second'), false, 'year mismatch'); - assert.equal(m.isSame(moment(new Date(2011, 2, 2, 3, 4, 5, 10)), 'second'), false, 'month mismatch'); - assert.equal(m.isSame(moment(new Date(2011, 1, 3, 3, 4, 5, 10)), 'second'), false, 'day mismatch'); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 4, 4, 5, 10)), 'second'), false, 'hour mismatch'); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 5, 5, 10)), 'second'), false, 'minute mismatch'); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 6, 10)), 'second'), false, 'second mismatch'); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 5, 0)), 'second'), true, 'exact start of second'); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 5, 999)), 'second'), true, 'exact end of second'); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 6, 0)), 'second'), false, 'start of next second'); - assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 4, 999)), 'second'), false, 'end of previous second'); - assert.equal(m.isSame(m, 'second'), true, 'same moments are in the same second'); - assert.equal(+m, +mCopy, 'isSame second should not change moment'); - }); - - test('is same millisecond', function (assert) { + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 3, 4, 5, 10)), 'second'), true, 'second match'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 3, 4, 5, 10)), 'seconds'), true, 'plural should work'); + assert.equal(m.isSameOrBefore(moment(new Date(2012, 1, 2, 3, 4, 5, 10)), 'second'), true, 'year is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2010, 1, 2, 3, 4, 5, 10)), 'second'), false, 'year is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 2, 2, 3, 4, 5, 10)), 'second'), true, 'month is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2010, 12, 2, 3, 4, 5, 10)), 'second'), false, 'month is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 3, 3, 4, 5, 10)), 'second'), true, 'day is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 1, 3, 4, 5, 10)), 'second'), false, 'day is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 4, 4, 5, 10)), 'second'), true, 'hour is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 2, 4, 5, 10)), 'second'), false, 'hour is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 3, 5, 5, 10)), 'second'), true, 'minute is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 3, 3, 5, 10)), 'second'), false, 'minute is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 3, 4, 6, 10)), 'second'), true, 'second is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 3, 4, 4, 10)), 'second'), false, 'second is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 3, 4, 5, 0)), 'second'), true, 'exact start of second'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 3, 4, 5, 999)), 'second'), true, 'exact end of second'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 3, 4, 6, 0)), 'second'), true, 'start of next second'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 1, 2, 3, 4, 4, 999)), 'second'), false, 'end of previous second'); + assert.equal(m.isSameOrBefore(m, 'second'), true, 'same moments are in the same second'); + assert.equal(+m, +mCopy, 'isSameOrBefore second should not change moment'); + }); + + test('is same or before millisecond', function (assert) { var m = moment(new Date(2011, 3, 2, 3, 4, 5, 10)), mCopy = moment(m); - assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 5, 10)), 'millisecond'), true, 'millisecond match'); - assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 5, 10)), 'milliseconds'), true, 'plural should work'); - assert.equal(m.isSame(moment(new Date(2012, 3, 2, 3, 4, 5, 10)), 'millisecond'), false, 'year is later'); - assert.equal(m.isSame(moment(new Date(2010, 3, 2, 3, 4, 5, 10)), 'millisecond'), false, 'year is earlier'); - assert.equal(m.isSame(moment(new Date(2011, 4, 2, 3, 4, 5, 10)), 'millisecond'), false, 'month is later'); - assert.equal(m.isSame(moment(new Date(2011, 2, 2, 3, 4, 5, 10)), 'millisecond'), false, 'month is earlier'); - assert.equal(m.isSame(moment(new Date(2011, 3, 3, 3, 4, 5, 10)), 'millisecond'), false, 'day is later'); - assert.equal(m.isSame(moment(new Date(2011, 3, 1, 1, 4, 5, 10)), 'millisecond'), false, 'day is earlier'); - assert.equal(m.isSame(moment(new Date(2011, 3, 2, 4, 4, 5, 10)), 'millisecond'), false, 'hour is later'); - assert.equal(m.isSame(moment(new Date(2011, 3, 1, 4, 1, 5, 10)), 'millisecond'), false, 'hour is earlier'); - assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 5, 5, 10)), 'millisecond'), false, 'minute is later'); - assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 3, 5, 10)), 'millisecond'), false, 'minute is earlier'); - assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 6, 10)), 'millisecond'), false, 'second is later'); - assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 4, 5)), 'millisecond'), false, 'second is earlier'); - assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 6, 11)), 'millisecond'), false, 'millisecond is later'); - assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 4, 9)), 'millisecond'), false, 'millisecond is earlier'); - assert.equal(m.isSame(m, 'millisecond'), true, 'same moments are in the same millisecond'); - assert.equal(+m, +mCopy, 'isSame millisecond should not change moment'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 3, 2, 3, 4, 5, 10)), 'millisecond'), true, 'millisecond match'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 3, 2, 3, 4, 5, 10)), 'milliseconds'), true, 'plural should work'); + assert.equal(m.isSameOrBefore(moment(new Date(2012, 3, 2, 3, 4, 5, 10)), 'millisecond'), true, 'year is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2010, 3, 2, 3, 4, 5, 10)), 'millisecond'), false, 'year is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 4, 2, 3, 4, 5, 10)), 'millisecond'), true, 'month is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 2, 2, 3, 4, 5, 10)), 'millisecond'), false, 'month is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 3, 3, 3, 4, 5, 10)), 'millisecond'), true, 'day is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 3, 1, 1, 4, 5, 10)), 'millisecond'), false, 'day is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 3, 2, 4, 4, 5, 10)), 'millisecond'), true, 'hour is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 3, 1, 4, 1, 5, 10)), 'millisecond'), false, 'hour is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 3, 2, 3, 5, 5, 10)), 'millisecond'), true, 'minute is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 3, 2, 3, 3, 5, 10)), 'millisecond'), false, 'minute is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 3, 2, 3, 4, 6, 10)), 'millisecond'), true, 'second is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 3, 2, 3, 4, 4, 5)), 'millisecond'), false, 'second is earlier'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 3, 2, 3, 4, 6, 11)), 'millisecond'), true, 'millisecond is later'); + assert.equal(m.isSameOrBefore(moment(new Date(2011, 3, 2, 3, 4, 4, 9)), 'millisecond'), false, 'millisecond is earlier'); + assert.equal(m.isSameOrBefore(m, 'millisecond'), true, 'same moments are in the same millisecond'); + assert.equal(+m, +mCopy, 'isSameOrBefore millisecond should not change moment'); }); test('is same with utc offset moments', function (assert) { - assert.ok(moment.parseZone('2013-02-01T-05:00').isSame(moment('2013-02-01'), 'year'), 'zoned vs local moment'); - assert.ok(moment('2013-02-01').isSame(moment('2013-02-01').utcOffset('-05:00'), 'year'), 'local vs zoned moment'); - assert.ok(moment.parseZone('2013-02-01T-05:00').isSame(moment.parseZone('2013-02-01T-06:30'), 'year'), + assert.ok(moment.parseZone('2013-02-01T-05:00').isSameOrBefore(moment('2013-02-01'), 'year'), 'zoned vs local moment'); + assert.ok(moment('2013-02-01').isSameOrBefore(moment('2013-02-01').utcOffset('-05:00'), 'year'), 'local vs zoned moment'); + assert.ok(moment.parseZone('2013-02-01T-05:00').isSameOrBefore(moment.parseZone('2013-02-01T-06:30'), 'year'), 'zoned vs (differently) zoned moment'); }); test('is same with invalid moments', function (assert) { - assert.equal(moment.invalid().isSame(moment.invalid()), false, 'invalid moments are not considered equal'); + var m = moment(), invalid = moment.invalid(); + assert.equal(invalid.isSameOrBefore(invalid), false, 'invalid moments are not considered equal'); + assert.equal(m.isSameOrBefore(invalid), false, 'valid moment is not before invalid moment'); + assert.equal(invalid.isSameOrBefore(m), false, 'invalid moment is not before valid moment'); + assert.equal(m.isSameOrBefore(invalid, 'year'), false, 'invalid moment year'); + assert.equal(m.isSameOrBefore(invalid, 'month'), false, 'invalid moment month'); + assert.equal(m.isSameOrBefore(invalid, 'day'), false, 'invalid moment day'); + assert.equal(m.isSameOrBefore(invalid, 'hour'), false, 'invalid moment hour'); + assert.equal(m.isSameOrBefore(invalid, 'minute'), false, 'invalid moment minute'); + assert.equal(m.isSameOrBefore(invalid, 'second'), false, 'invalid moment second'); + assert.equal(m.isSameOrBefore(invalid, 'milliseconds'), false, 'invalid moment milliseconds'); }); })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -35985,12 +41352,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -36008,8 +41377,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -36113,8 +41482,8 @@ ], i; for (i = 0; i < tests.length; i++) { - assert.equal(moment(tests[i]).isValid(), false, tests[i] + ' should be invalid'); - assert.equal(moment.utc(tests[i]).isValid(), false, tests[i] + ' should be invalid'); + assert.equal(moment(tests[i], moment.ISO_8601).isValid(), false, tests[i] + ' should be invalid'); + assert.equal(moment.utc(tests[i], moment.ISO_8601).isValid(), false, tests[i] + ' should be invalid'); } }); @@ -36126,12 +41495,33 @@ '2010-01-40T24:01+00:00', '2010-01-40T23:60+00:00', '2010-01-40T23:59:60+00:00', - '2010-01-40T23:59:59.9999+00:00' + '2010-01-40T23:59:59.9999+00:00', + '2010-01-40T23:59:59,9999+00:00' ], i; for (i = 0; i < tests.length; i++) { - assert.equal(moment(tests[i]).isValid(), false, tests[i] + ' should be invalid'); - assert.equal(moment.utc(tests[i]).isValid(), false, tests[i] + ' should be invalid'); + assert.equal(moment(tests[i], moment.ISO_8601).isValid(), false, tests[i] + ' should be invalid'); + assert.equal(moment.utc(tests[i], moment.ISO_8601).isValid(), false, tests[i] + ' should be invalid'); + } + }); + + test('valid string iso 8601 - not strict', function (assert) { + var tests = [ + '2010-01-30 00:00:00,000Z', + '20100101', + '20100130', + '20100130T23+00:00', + '20100130T2359+0000', + '20100130T235959+0000', + '20100130T235959,999+0000', + '20100130T235959,999-0700', + '20100130T000000,000+0700', + '20100130 000000,000Z' + ]; + + for (var i = 0; i < tests.length; i++) { + assert.equal(moment(tests[i]).isValid(), true, tests[i] + ' should be valid in normal'); + assert.equal(moment.utc(tests[i]).isValid(), true, tests[i] + ' should be valid in normal'); } }); @@ -36145,6 +41535,8 @@ '2010-01-30T23:59:59.999+00:00', '2010-01-30T23:59:59.999-07:00', '2010-01-30T00:00:00.000+07:00', + '2010-01-30T23:59:59.999-07', + '2010-01-30T00:00:00.000+07', '2010-01-30 00:00:00.000Z' ], i; @@ -36278,8 +41670,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -36288,12 +41681,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -36311,8 +41706,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -36338,8 +41733,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -36348,12 +41744,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -36371,8 +41769,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -36467,8 +41865,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -36477,12 +41876,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -36500,8 +41901,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -36656,7 +42057,7 @@ assert.equal(moment.localeData().months(jan), 'January', 'no arguments returns global'); assert.equal(moment.localeData('zh-cn').months(jan), '一月', 'a string returns the locale based on key'); - assert.equal(moment.localeData(moment().locale('es')).months(jan), 'Enero', 'if you pass in a moment it uses the moment\'s locale'); + assert.equal(moment.localeData(moment().locale('es')).months(jan), 'enero', 'if you pass in a moment it uses the moment\'s locale'); }); test('library deprecations', function (assert) { @@ -36690,7 +42091,7 @@ moment.locale('en'); assert.equal(moment([2012, 5, 6]).format('MMMM'), 'June', 'Normally default to global'); - assert.equal(moment([2012, 5, 6]).locale('es').format('MMMM'), 'Junio', 'Use the instance specific locale'); + assert.equal(moment([2012, 5, 6]).locale('es').format('MMMM'), 'junio', 'Use the instance specific locale'); assert.equal(moment([2012, 5, 6]).format('MMMM'), 'June', 'Using an instance specific locale does not affect other moments'); }); @@ -36714,9 +42115,9 @@ test('instance locale persists with manipulation', function (assert) { moment.locale('en'); - assert.equal(moment([2012, 5, 6]).locale('es').add({days: 1}).format('MMMM'), 'Junio', 'With addition'); - assert.equal(moment([2012, 5, 6]).locale('es').day(0).format('MMMM'), 'Junio', 'With day getter'); - assert.equal(moment([2012, 5, 6]).locale('es').endOf('day').format('MMMM'), 'Junio', 'With endOf'); + assert.equal(moment([2012, 5, 6]).locale('es').add({days: 1}).format('MMMM'), 'junio', 'With addition'); + assert.equal(moment([2012, 5, 6]).locale('es').day(0).format('MMMM'), 'junio', 'With day getter'); + assert.equal(moment([2012, 5, 6]).locale('es').endOf('day').format('MMMM'), 'junio', 'With endOf'); }); test('instance locale persists with cloning', function (assert) { @@ -36726,8 +42127,8 @@ b = a.clone(), c = moment(a); - assert.equal(b.format('MMMM'), 'Junio', 'using moment.fn.clone()'); - assert.equal(b.format('MMMM'), 'Junio', 'using moment()'); + assert.equal(b.format('MMMM'), 'junio', 'using moment.fn.clone()'); + assert.equal(b.format('MMMM'), 'junio', 'using moment()'); }); test('duration locale method', function (assert) { @@ -36966,10 +42367,44 @@ 'preserve global locale in case of bad locale id'); }); + + // TODO: Enable this after fixing pl months parse hack hack + // test('monthsParseExact', function (assert) { + // var locale = 'test-months-parse-exact'; + + // moment.defineLocale(locale, { + // monthsParseExact: true, + // months: 'A_AA_AAA_B_B B_BB B_C_C-C_C,C2C_D_D+D_D`D*D'.split('_'), + // monthsShort: 'E_EE_EEE_F_FF_FFF_G_GG_GGG_H_HH_HHH'.split('_') + // }); + + // assert.equal(moment('A', 'MMMM', true).month(), 0, 'parse long month 0 with MMMM'); + // assert.equal(moment('AA', 'MMMM', true).month(), 1, 'parse long month 1 with MMMM'); + // assert.equal(moment('AAA', 'MMMM', true).month(), 2, 'parse long month 2 with MMMM'); + // assert.equal(moment('B B', 'MMMM', true).month(), 4, 'parse long month 4 with MMMM'); + // assert.equal(moment('BB B', 'MMMM', true).month(), 5, 'parse long month 5 with MMMM'); + // assert.equal(moment('C-C', 'MMMM', true).month(), 7, 'parse long month 7 with MMMM'); + // assert.equal(moment('C,C2C', 'MMMM', true).month(), 8, 'parse long month 8 with MMMM'); + // assert.equal(moment('D+D', 'MMMM', true).month(), 10, 'parse long month 10 with MMMM'); + // assert.equal(moment('D`D*D', 'MMMM', true).month(), 11, 'parse long month 11 with MMMM'); + + // assert.equal(moment('E', 'MMM', true).month(), 0, 'parse long month 0 with MMM'); + // assert.equal(moment('EE', 'MMM', true).month(), 1, 'parse long month 1 with MMM'); + // assert.equal(moment('EEE', 'MMM', true).month(), 2, 'parse long month 2 with MMM'); + + // assert.equal(moment('A', 'MMM').month(), 0, 'non-strict parse long month 0 with MMM'); + // assert.equal(moment('AA', 'MMM').month(), 1, 'non-strict parse long month 1 with MMM'); + // assert.equal(moment('AAA', 'MMM').month(), 2, 'non-strict parse long month 2 with MMM'); + // assert.equal(moment('E', 'MMMM').month(), 0, 'non-strict parse short month 0 with MMMM'); + // assert.equal(moment('EE', 'MMMM').month(), 1, 'non-strict parse short month 1 with MMMM'); + // assert.equal(moment('EEE', 'MMMM').month(), 2, 'non-strict parse short month 2 with MMMM'); + // }); + })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -36978,12 +42413,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -37001,8 +42438,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -37065,8 +42502,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -37075,12 +42513,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -37098,8 +42538,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -37140,8 +42580,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -37150,12 +42591,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -37173,8 +42616,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -37220,8 +42663,117 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + /*global QUnit:false*/ + + var test = QUnit.test; + + var expect = QUnit.expect; + + function module (name, lifecycle) { + QUnit.module(name, { + setup : function () { + moment.locale('en'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + function localeModule (name, lifecycle) { + QUnit.module('locale:' + name, { + setup : function () { + moment.locale(name); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + moment.locale('en'); + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + module('now'); + + test('now', function (assert) { + var startOfTest = new Date().valueOf(), + momentNowTime = moment.now(), + afterMomentCreationTime = new Date().valueOf(); + + assert.ok(startOfTest <= momentNowTime, 'moment now() time should be now, not in the past'); + assert.ok(momentNowTime <= afterMomentCreationTime, 'moment now() time should be now, not in the future'); + }); + + test('now - Date mocked', function (assert) { + // We need to test mocking the global Date object, so disable 'Read Only' jshint check + /* jshint -W020 */ + var RealDate = Date, + customTimeMs = moment('2015-01-01T01:30:00.000Z').valueOf(); + + function MockDate() { + return new RealDate(customTimeMs); + } + + MockDate.now = function () { + return new MockDate().valueOf(); + }; + + MockDate.prototype = RealDate.prototype; + + Date = MockDate; + + try { + assert.equal(moment().valueOf(), customTimeMs, 'moment now() time should use the global Date object'); + } finally { + Date = RealDate; + } + }); + + test('now - custom value', function (assert) { + var customTimeStr = '2015-01-01T01:30:00.000Z', + customTime = moment(customTimeStr, moment.ISO_8601).valueOf(), + oldFn = moment.now; + + moment.now = function () { + return customTime; + }; + + try { + assert.ok(moment().toISOString() === customTimeStr, 'moment() constructor should use the function defined by moment.now, but it did not'); + assert.ok(moment.utc().toISOString() === customTimeStr, 'moment() constructor should use the function defined by moment.now, but it did not'); + assert.ok(moment.utc([]).toISOString() === '2015-01-01T00:00:00.000Z', 'moment() constructor should fall back to the date defined by moment.now when an empty array is given, but it did not'); + } finally { + moment.now = oldFn; + } + }); + +})); + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -37230,12 +42782,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -37253,8 +42807,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -37437,8 +42991,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -37447,12 +43002,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -37470,8 +43027,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -37556,8 +43113,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -37566,12 +43124,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -37589,8 +43149,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -37706,8 +43266,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -37716,12 +43277,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -37739,8 +43302,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -37834,10 +43397,21 @@ }); test('custom thresholds', function (assert) { + var a; + + // Seconds to minute threshold, under 30 + moment.relativeTimeThreshold('s', 25); + + a = moment(); + a.subtract(24, 'seconds'); + assert.equal(a.fromNow(), 'a few seconds ago', 'Below custom seconds to minute threshold, s < 30'); + a.subtract(1, 'seconds'); + assert.equal(a.fromNow(), 'a minute ago', 'Above custom seconds to minute threshold, s < 30'); + // Seconds to minutes threshold moment.relativeTimeThreshold('s', 55); - var a = moment(); + a = moment(); a.subtract(54, 'seconds'); assert.equal(a.fromNow(), 'a few seconds ago', 'Below custom seconds to minutes threshold'); a.subtract(1, 'seconds'); @@ -37891,8 +43465,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -37901,12 +43476,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -37924,8 +43501,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -38298,8 +43875,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -38308,12 +43886,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -38331,8 +43911,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -38363,8 +43943,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -38373,12 +43954,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -38396,8 +43979,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -38434,8 +44017,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -38444,12 +44028,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -38467,8 +44053,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -38561,8 +44147,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -38571,12 +44158,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -38594,8 +44183,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -38636,6 +44225,10 @@ assert.equal(m.clone().utcOffset(-90).utcOffset(), -90, 'utcOffset -90'); assert.equal(m.clone().utcOffset('-01:30').utcOffset(), -90, 'utcOffset +01:30 is 90'); assert.equal(m.clone().utcOffset('-0130').utcOffset(), -90, 'utcOffset +0130 is 90'); + assert.equal(m.clone().utcOffset('+00:10').utcOffset(), 10, 'utcOffset +00:10 is 10'); + assert.equal(m.clone().utcOffset('-00:10').utcOffset(), -10, 'utcOffset +00:10 is 10'); + assert.equal(m.clone().utcOffset('+0010').utcOffset(), 10, 'utcOffset +0010 is 10'); + assert.equal(m.clone().utcOffset('-0010').utcOffset(), -10, 'utcOffset +0010 is 10'); }); test('utcOffset shorthand hours -> minutes', function (assert) { @@ -39175,8 +44768,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -39185,12 +44779,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -39208,8 +44804,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -39306,19 +44902,54 @@ test('week numbers 2012/2013', function (assert) { moment.locale('dow: 6, doy: 12', {week: {dow: 6, doy: 12}}); - assert.equal(52, moment('2012-12-28', 'YYYY-MM-DD').week()); // 51 -- should be 52? - assert.equal(1, moment('2012-12-29', 'YYYY-MM-DD').week()); // 52 -- should be 1 - assert.equal(1, moment('2013-01-01', 'YYYY-MM-DD').week()); // 52 -- should be 1 - assert.equal(2, moment('2013-01-08', 'YYYY-MM-DD').week()); // 53 -- should be 2 - assert.equal(2, moment('2013-01-11', 'YYYY-MM-DD').week()); // 53 -- should be 2 - assert.equal(3, moment('2013-01-12', 'YYYY-MM-DD').week()); // 1 -- should be 3 - assert.equal(52, moment().weeksInYear(2012)); // 52 + assert.equal(52, moment('2012-12-28', 'YYYY-MM-DD').week(), '2012-12-28 is week 52'); // 51 -- should be 52? + assert.equal(1, moment('2012-12-29', 'YYYY-MM-DD').week(), '2012-12-29 is week 1'); // 52 -- should be 1 + assert.equal(1, moment('2013-01-01', 'YYYY-MM-DD').week(), '2013-01-01 is week 1'); // 52 -- should be 1 + assert.equal(2, moment('2013-01-08', 'YYYY-MM-DD').week(), '2013-01-08 is week 2'); // 53 -- should be 2 + assert.equal(2, moment('2013-01-11', 'YYYY-MM-DD').week(), '2013-01-11 is week 2'); // 53 -- should be 2 + assert.equal(3, moment('2013-01-12', 'YYYY-MM-DD').week(), '2013-01-12 is week 3'); // 1 -- should be 3 + assert.equal(52, moment('2012-01-01', 'YYYY-MM-DD').weeksInYear(), 'weeks in 2012 are 52'); // 52 + }); + + test('week year overflows', function (assert) { + assert.equal('2005-01-01', moment.utc('2004-W53-6', moment.ISO_8601, true).format('YYYY-MM-DD'), '2004-W53-6 is 1st Jan 2005'); + assert.equal('2007-12-31', moment.utc('2008-W01-1', moment.ISO_8601, true).format('YYYY-MM-DD'), '2008-W01-1 is 31st Dec 2007'); + }); + + test('weeks overflow', function (assert) { + assert.equal(7, moment.utc('2004-W54-1', moment.ISO_8601, true).parsingFlags().overflow, '2004 has only 53 weeks'); + assert.equal(7, moment.utc('2004-W00-1', moment.ISO_8601, true).parsingFlags().overflow, 'there is no 0th week'); + }); + + test('weekday overflow', function (assert) { + assert.equal(8, moment.utc('2004-W30-0', moment.ISO_8601, true).parsingFlags().overflow, 'there is no 0 iso weekday'); + assert.equal(8, moment.utc('2004-W30-8', moment.ISO_8601, true).parsingFlags().overflow, 'there is no 8 iso weekday'); + assert.equal(8, moment.utc('2004-w30-7', 'gggg-[w]ww-e', true).parsingFlags().overflow, 'there is no 7 \'e\' weekday'); + assert.equal(8, moment.utc('2004-w30-7', 'gggg-[w]ww-d', true).parsingFlags().overflow, 'there is no 7 \'d\' weekday'); + }); + + test('week year setter works', function (assert) { + for (var year = 2000; year <= 2020; year += 1) { + assert.equal(moment.utc('2012-12-31T00:00:00.000Z').isoWeekYear(year).isoWeekYear(), year, 'setting iso-week-year to ' + year); + assert.equal(moment.utc('2012-12-31T00:00:00.000Z').weekYear(year).weekYear(), year, 'setting week-year to ' + year); + } + + assert.equal(moment.utc('2004-W53-1', moment.ISO_8601, true).isoWeekYear(2013).format('GGGG-[W]WW-E'), '2013-W52-1', '2004-W53-1 to 2013'); + assert.equal(moment.utc('2004-W53-1', moment.ISO_8601, true).isoWeekYear(2020).format('GGGG-[W]WW-E'), '2020-W53-1', '2004-W53-1 to 2020'); + assert.equal(moment.utc('2005-W52-1', moment.ISO_8601, true).isoWeekYear(2004).format('GGGG-[W]WW-E'), '2004-W52-1', '2005-W52-1 to 2004'); + assert.equal(moment.utc('2013-W30-4', moment.ISO_8601, true).isoWeekYear(2015).format('GGGG-[W]WW-E'), '2015-W30-4', '2013-W30-4 to 2015'); + + assert.equal(moment.utc('2005-w53-0', 'gggg-[w]ww-e', true).weekYear(2013).format('gggg-[w]ww-e'), '2013-w52-0', '2005-w53-0 to 2013'); + assert.equal(moment.utc('2005-w53-0', 'gggg-[w]ww-e', true).weekYear(2016).format('gggg-[w]ww-e'), '2016-w53-0', '2005-w53-0 to 2016'); + assert.equal(moment.utc('2004-w52-0', 'gggg-[w]ww-e', true).weekYear(2005).format('gggg-[w]ww-e'), '2005-w52-0', '2004-w52-0 to 2005'); + assert.equal(moment.utc('2013-w30-4', 'gggg-[w]ww-e', true).weekYear(2015).format('gggg-[w]ww-e'), '2015-w30-4', '2013-w30-4 to 2015'); }); })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -39327,12 +44958,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -39350,8 +44983,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -39498,8 +45131,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -39508,12 +45142,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -39531,8 +45167,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -39771,8 +45407,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -39781,12 +45418,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -39804,8 +45443,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -39907,8 +45546,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -39917,12 +45557,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -39940,8 +45582,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -40047,8 +45689,9 @@ })); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; @@ -40057,12 +45700,14 @@ var test = QUnit.test; + var expect = QUnit.expect; + function module (name, lifecycle) { QUnit.module(name, { setup : function () { moment.locale('en'); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -40080,8 +45725,8 @@ QUnit.module('locale:' + name, { setup : function () { moment.locale(name); - moment.createFromInputFallback = function () { - throw new Error('input not handled by moment'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); @@ -40145,6 +45790,9 @@ zone.zone('2013-03-07T07:00:00+0100'); assert.equal(zone.zone(), -60, 'set the zone with a string that uses the +0000 syntax'); + zone.zone('2013-03-07T07:00:00+02'); + assert.equal(zone.zone(), -120, 'set the zone with a string that uses the +00 syntax'); + zone.zone('03-07-2013T07:00:00-08:00'); assert.equal(zone.zone(), 480, 'set the zone with a string with a non-ISO 8601 date'); }); diff --git a/bower_components/moment/moment.js b/bower_components/moment/moment.js index 23cd3ed..c003e95 100644 --- a/bower_components/moment/moment.js +++ b/bower_components/moment/moment.js @@ -1,10 +1,10 @@ //! moment.js -//! version : 2.10.6 +//! version : 2.11.1 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com -(function (global, factory) { +;(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.moment = factory() @@ -121,39 +121,45 @@ return m; } + function isUndefined(input) { + return input === void 0; + } + + // Plugins that add properties should also add the key here (null value), + // so we can properly clone ourselves. var momentProperties = utils_hooks__hooks.momentProperties = []; function copyConfig(to, from) { var i, prop, val; - if (typeof from._isAMomentObject !== 'undefined') { + if (!isUndefined(from._isAMomentObject)) { to._isAMomentObject = from._isAMomentObject; } - if (typeof from._i !== 'undefined') { + if (!isUndefined(from._i)) { to._i = from._i; } - if (typeof from._f !== 'undefined') { + if (!isUndefined(from._f)) { to._f = from._f; } - if (typeof from._l !== 'undefined') { + if (!isUndefined(from._l)) { to._l = from._l; } - if (typeof from._strict !== 'undefined') { + if (!isUndefined(from._strict)) { to._strict = from._strict; } - if (typeof from._tzm !== 'undefined') { + if (!isUndefined(from._tzm)) { to._tzm = from._tzm; } - if (typeof from._isUTC !== 'undefined') { + if (!isUndefined(from._isUTC)) { to._isUTC = from._isUTC; } - if (typeof from._offset !== 'undefined') { + if (!isUndefined(from._offset)) { to._offset = from._offset; } - if (typeof from._pf !== 'undefined') { + if (!isUndefined(from._pf)) { to._pf = getParsingFlags(from); } - if (typeof from._locale !== 'undefined') { + if (!isUndefined(from._locale)) { to._locale = from._locale; } @@ -161,7 +167,7 @@ for (i in momentProperties) { prop = momentProperties[i]; val = from[prop]; - if (typeof val !== 'undefined') { + if (!isUndefined(val)) { to[prop] = val; } } @@ -208,6 +214,7 @@ return value; } + // compare two arrays, return the number of differences function compareArrays(array1, array2, dontConvert) { var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), @@ -225,6 +232,7 @@ function Locale() { } + // internal storage for locale config files var locales = {}; var globalLocale; @@ -262,7 +270,7 @@ function loadLocale(name) { var oldLocale = null; // TODO: Find a better way to register and load all the locales in Node - if (!locales[name] && typeof module !== 'undefined' && + if (!locales[name] && (typeof module !== 'undefined') && module && module.exports) { try { oldLocale = globalLocale._abbr; @@ -281,7 +289,7 @@ function locale_locales__getSetGlobalLocale (key, values) { var data; if (key) { - if (typeof values === 'undefined') { + if (isUndefined(values)) { data = locale_locales__getLocale(key); } else { @@ -366,6 +374,10 @@ return normalizedInput; } + function isFunction(input) { + return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; + } + function makeGetSet (unit, keepTime) { return function (value) { if (value != null) { @@ -379,11 +391,14 @@ } function get_set__get (mom, unit) { - return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit](); + return mom.isValid() ? + mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN; } function get_set__set (mom, unit, value) { - return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); + if (mom.isValid()) { + mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); + } } // MOMENTS @@ -396,7 +411,7 @@ } } else { units = normalizeUnits(units); - if (typeof this[units] === 'function') { + if (isFunction(this[units])) { return this[units](value); } } @@ -411,7 +426,7 @@ Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; } - var formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; + var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g; @@ -507,6 +522,8 @@ var match4 = /\d{4}/; // 0000 - 9999 var match6 = /[+-]?\d{6}/; // -999999 - 999999 var match1to2 = /\d\d?/; // 0 - 99 + var match3to4 = /\d\d\d\d?/; // 999 - 9999 + var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999 var match1to3 = /\d{1,3}/; // 0 - 999 var match1to4 = /\d{1,4}/; // 0 - 9999 var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999 @@ -515,23 +532,19 @@ var matchSigned = /[+-]?\d+/; // -inf - inf var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z + var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123 // any word (or two) characters or numbers including two/three word month in arabic. + // includes scottish gaelic two word and hyphenated months var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i; - var regexes = {}; - - function isFunction (sth) { - // https://github.com/moment/moment/issues/2325 - return typeof sth === 'function' && - Object.prototype.toString.call(sth) === '[object Function]'; - } + var regexes = {}; function addRegexToken (token, regex, strictRegex) { - regexes[token] = isFunction(regex) ? regex : function (isStrict) { + regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) { return (isStrict && strictRegex) ? strictRegex : regex; }; } @@ -546,9 +559,13 @@ // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript function unescapeFormat(s) { - return s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { + return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { return p1 || p2 || p3 || p4; - }).replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); + })); + } + + function regexEscape(s) { + return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); } var tokens = {}; @@ -588,6 +605,8 @@ var MINUTE = 4; var SECOND = 5; var MILLISECOND = 6; + var WEEK = 7; + var WEEKDAY = 8; function daysInMonth(year, month) { return new Date(Date.UTC(year, month + 1, 0)).getUTCDate(); @@ -615,8 +634,12 @@ addRegexToken('M', match1to2); addRegexToken('MM', match1to2, match2); - addRegexToken('MMM', matchWord); - addRegexToken('MMMM', matchWord); + addRegexToken('MMM', function (isStrict, locale) { + return locale.monthsShortRegex(isStrict); + }); + addRegexToken('MMMM', function (isStrict, locale) { + return locale.monthsRegex(isStrict); + }); addParseToken(['M', 'MM'], function (input, array) { array[MONTH] = toInt(input) - 1; @@ -634,14 +657,17 @@ // LOCALES + var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/; var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'); - function localeMonths (m) { - return this._months[m.month()]; + function localeMonths (m, format) { + return isArray(this._months) ? this._months[m.month()] : + this._months[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; } var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'); - function localeMonthsShort (m) { - return this._monthsShort[m.month()]; + function localeMonthsShort (m, format) { + return isArray(this._monthsShort) ? this._monthsShort[m.month()] : + this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; } function localeMonthsParse (monthName, format, strict) { @@ -680,6 +706,11 @@ function setMonth (mom, value) { var dayOfMonth; + if (!mom.isValid()) { + // No op + return mom; + } + // TODO: Move this out of here! if (typeof value === 'string') { value = mom.localeData().monthsParse(value); @@ -708,6 +739,72 @@ return daysInMonth(this.year(), this.month()); } + var defaultMonthsShortRegex = matchWord; + function monthsShortRegex (isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, '_monthsRegex')) { + computeMonthsParse.call(this); + } + if (isStrict) { + return this._monthsShortStrictRegex; + } else { + return this._monthsShortRegex; + } + } else { + return this._monthsShortStrictRegex && isStrict ? + this._monthsShortStrictRegex : this._monthsShortRegex; + } + } + + var defaultMonthsRegex = matchWord; + function monthsRegex (isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, '_monthsRegex')) { + computeMonthsParse.call(this); + } + if (isStrict) { + return this._monthsStrictRegex; + } else { + return this._monthsRegex; + } + } else { + return this._monthsStrictRegex && isStrict ? + this._monthsStrictRegex : this._monthsRegex; + } + } + + function computeMonthsParse () { + function cmpLenRev(a, b) { + return b.length - a.length; + } + + var shortPieces = [], longPieces = [], mixedPieces = [], + i, mom; + for (i = 0; i < 12; i++) { + // make the regex if we don't have it already + mom = create_utc__createUTC([2000, i]); + shortPieces.push(this.monthsShort(mom, '')); + longPieces.push(this.months(mom, '')); + mixedPieces.push(this.months(mom, '')); + mixedPieces.push(this.monthsShort(mom, '')); + } + // Sorting makes sure if one month (or abbr) is a prefix of another it + // will match the longer piece. + shortPieces.sort(cmpLenRev); + longPieces.sort(cmpLenRev); + mixedPieces.sort(cmpLenRev); + for (i = 0; i < 12; i++) { + shortPieces[i] = regexEscape(shortPieces[i]); + longPieces[i] = regexEscape(longPieces[i]); + mixedPieces[i] = regexEscape(mixedPieces[i]); + } + + this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); + this._monthsShortRegex = this._monthsRegex; + this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')$', 'i'); + this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')$', 'i'); + } + function checkOverflow (m) { var overflow; var a = m._a; @@ -725,6 +822,12 @@ if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { overflow = DATE; } + if (getParsingFlags(m)._overflowWeeks && overflow === -1) { + overflow = WEEK; + } + if (getParsingFlags(m)._overflowWeekday && overflow === -1) { + overflow = WEEKDAY; + } getParsingFlags(m).overflow = overflow; } @@ -733,7 +836,8 @@ } function warn(msg) { - if (utils_hooks__hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) { + if (utils_hooks__hooks.suppressDeprecationWarnings === false && + (typeof console !== 'undefined') && console.warn) { console.warn('Deprecation warning: ' + msg); } } @@ -743,7 +847,7 @@ return extend(function () { if (firstTime) { - warn(msg + '\n' + (new Error()).stack); + warn(msg + '\nArguments: ' + Array.prototype.slice.call(arguments).join(', ') + '\n' + (new Error()).stack); firstTime = false; } return fn.apply(this, arguments); @@ -761,22 +865,39 @@ utils_hooks__hooks.suppressDeprecationWarnings = false; - var from_string__isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/; + // iso 8601 regex + // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) + var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/; + var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/; + + var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/; var isoDates = [ - ['YYYYYY-MM-DD', /[+-]\d{6}-\d{2}-\d{2}/], - ['YYYY-MM-DD', /\d{4}-\d{2}-\d{2}/], - ['GGGG-[W]WW-E', /\d{4}-W\d{2}-\d/], - ['GGGG-[W]WW', /\d{4}-W\d{2}/], - ['YYYY-DDD', /\d{4}-\d{3}/] + ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], + ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], + ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], + ['GGGG-[W]WW', /\d{4}-W\d\d/, false], + ['YYYY-DDD', /\d{4}-\d{3}/], + ['YYYY-MM', /\d{4}-\d\d/, false], + ['YYYYYYMMDD', /[+-]\d{10}/], + ['YYYYMMDD', /\d{8}/], + // YYYYMM is NOT allowed by the standard + ['GGGG[W]WWE', /\d{4}W\d{3}/], + ['GGGG[W]WW', /\d{4}W\d{2}/, false], + ['YYYYDDD', /\d{7}/] ]; // iso time formats and regexes var isoTimes = [ - ['HH:mm:ss.SSSS', /(T| )\d\d:\d\d:\d\d\.\d+/], - ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/], - ['HH:mm', /(T| )\d\d:\d\d/], - ['HH', /(T| )\d\d/] + ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], + ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], + ['HH:mm:ss', /\d\d:\d\d:\d\d/], + ['HH:mm', /\d\d:\d\d/], + ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], + ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], + ['HHmmss', /\d\d\d\d\d\d/], + ['HHmm', /\d\d\d\d/], + ['HH', /\d\d/] ]; var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i; @@ -785,26 +906,49 @@ function configFromISO(config) { var i, l, string = config._i, - match = from_string__isoRegex.exec(string); + match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), + allowTime, dateFormat, timeFormat, tzFormat; if (match) { getParsingFlags(config).iso = true; + for (i = 0, l = isoDates.length; i < l; i++) { - if (isoDates[i][1].exec(string)) { - config._f = isoDates[i][0]; + if (isoDates[i][1].exec(match[1])) { + dateFormat = isoDates[i][0]; + allowTime = isoDates[i][2] !== false; break; } } - for (i = 0, l = isoTimes.length; i < l; i++) { - if (isoTimes[i][1].exec(string)) { - // match[6] should be 'T' or space - config._f += (match[6] || ' ') + isoTimes[i][0]; - break; + if (dateFormat == null) { + config._isValid = false; + return; + } + if (match[3]) { + for (i = 0, l = isoTimes.length; i < l; i++) { + if (isoTimes[i][1].exec(match[3])) { + // match[2] should be 'T' or space + timeFormat = (match[2] || ' ') + isoTimes[i][0]; + break; + } } + if (timeFormat == null) { + config._isValid = false; + return; + } + } + if (!allowTime && timeFormat != null) { + config._isValid = false; + return; } - if (string.match(matchOffset)) { - config._f += 'Z'; + if (match[4]) { + if (tzRegex.exec(match[4])) { + tzFormat = 'Z'; + } else { + config._isValid = false; + return; + } } + config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); configFromStringAndFormat(config); } else { config._isValid = false; @@ -842,8 +986,8 @@ //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply var date = new Date(y, m, d, h, M, s, ms); - //the date constructor doesn't accept years < 1970 - if (y < 1970) { + //the date constructor remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0 && isFinite(date.getFullYear())) { date.setFullYear(y); } return date; @@ -851,12 +995,21 @@ function createUTCDate (y) { var date = new Date(Date.UTC.apply(null, arguments)); - if (y < 1970) { + + //the Date.UTC function remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) { date.setUTCFullYear(y); } return date; } + // FORMATTING + + addFormatToken('Y', 0, 0, function () { + var y = this.year(); + return y <= 9999 ? '' + y : '+' + y; + }); + addFormatToken(0, ['YY', 2], 0, function () { return this.year() % 100; }); @@ -884,6 +1037,9 @@ addParseToken('YY', function (input, array) { array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input); }); + addParseToken('Y', function (input, array) { + array[YEAR] = parseInt(input, 10); + }); // HELPERS @@ -909,124 +1065,66 @@ return isLeapYear(this.year()); } - addFormatToken('w', ['ww', 2], 'wo', 'week'); - addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); - - // ALIASES - - addUnitAlias('week', 'w'); - addUnitAlias('isoWeek', 'W'); - - // PARSING - - addRegexToken('w', match1to2); - addRegexToken('ww', match1to2, match2); - addRegexToken('W', match1to2); - addRegexToken('WW', match1to2, match2); - - addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { - week[token.substr(0, 1)] = toInt(input); - }); - - // HELPERS + // start-of-first-week - start-of-year + function firstWeekOffset(year, dow, doy) { + var // first-week day -- which january is always in the first week (4 for iso, 1 for other) + fwd = 7 + dow - doy, + // first-week day local weekday -- which local weekday is fwd + fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; - // firstDayOfWeek 0 = sun, 6 = sat - // the day of the week that starts the week - // (usually sunday or monday) - // firstDayOfWeekOfYear 0 = sun, 6 = sat - // the first week is the week that contains the first - // of this day of the week - // (eg. ISO weeks use thursday (4)) - function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) { - var end = firstDayOfWeekOfYear - firstDayOfWeek, - daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(), - adjustedMoment; - - - if (daysToDayOfWeek > end) { - daysToDayOfWeek -= 7; - } + return -fwdlw + fwd - 1; + } - if (daysToDayOfWeek < end - 7) { - daysToDayOfWeek += 7; + //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday + function dayOfYearFromWeeks(year, week, weekday, dow, doy) { + var localWeekday = (7 + weekday - dow) % 7, + weekOffset = firstWeekOffset(year, dow, doy), + dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, + resYear, resDayOfYear; + + if (dayOfYear <= 0) { + resYear = year - 1; + resDayOfYear = daysInYear(resYear) + dayOfYear; + } else if (dayOfYear > daysInYear(year)) { + resYear = year + 1; + resDayOfYear = dayOfYear - daysInYear(year); + } else { + resYear = year; + resDayOfYear = dayOfYear; } - adjustedMoment = local__createLocal(mom).add(daysToDayOfWeek, 'd'); return { - week: Math.ceil(adjustedMoment.dayOfYear() / 7), - year: adjustedMoment.year() + year: resYear, + dayOfYear: resDayOfYear }; } - // LOCALES + function weekOfYear(mom, dow, doy) { + var weekOffset = firstWeekOffset(mom.year(), dow, doy), + week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, + resWeek, resYear; - function localeWeek (mom) { - return weekOfYear(mom, this._week.dow, this._week.doy).week; - } - - var defaultLocaleWeek = { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - }; - - function localeFirstDayOfWeek () { - return this._week.dow; - } - - function localeFirstDayOfYear () { - return this._week.doy; - } - - // MOMENTS - - function getSetWeek (input) { - var week = this.localeData().week(this); - return input == null ? week : this.add((input - week) * 7, 'd'); - } - - function getSetISOWeek (input) { - var week = weekOfYear(this, 1, 4).week; - return input == null ? week : this.add((input - week) * 7, 'd'); - } - - addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); - - // ALIASES - - addUnitAlias('dayOfYear', 'DDD'); - - // PARSING - - addRegexToken('DDD', match1to3); - addRegexToken('DDDD', match3); - addParseToken(['DDD', 'DDDD'], function (input, array, config) { - config._dayOfYear = toInt(input); - }); - - // HELPERS - - //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday - function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) { - var week1Jan = 6 + firstDayOfWeek - firstDayOfWeekOfYear, janX = createUTCDate(year, 0, 1 + week1Jan), d = janX.getUTCDay(), dayOfYear; - if (d < firstDayOfWeek) { - d += 7; + if (week < 1) { + resYear = mom.year() - 1; + resWeek = week + weeksInYear(resYear, dow, doy); + } else if (week > weeksInYear(mom.year(), dow, doy)) { + resWeek = week - weeksInYear(mom.year(), dow, doy); + resYear = mom.year() + 1; + } else { + resYear = mom.year(); + resWeek = week; } - weekday = weekday != null ? 1 * weekday : firstDayOfWeek; - - dayOfYear = 1 + week1Jan + 7 * (week - 1) - d + weekday; - return { - year: dayOfYear > 0 ? year : year - 1, - dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear + week: resWeek, + year: resYear }; } - // MOMENTS - - function getSetDayOfYear (input) { - var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; - return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); + function weeksInYear(year, dow, doy) { + var weekOffset = firstWeekOffset(year, dow, doy), + weekOffsetNext = firstWeekOffset(year + 1, dow, doy); + return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; } // Pick the first defined of two or three arguments. @@ -1041,11 +1139,12 @@ } function currentDateArray(config) { - var now = new Date(); + // hooks is actually the exported moment object + var nowValue = new Date(utils_hooks__hooks.now()); if (config._useUTC) { - return [now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()]; + return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()]; } - return [now.getFullYear(), now.getMonth(), now.getDate()]; + return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; } // convert an array to a date. @@ -1115,7 +1214,7 @@ } function dayOfYearFromWeekInfo(config) { - var w, weekYear, week, weekday, dow, doy, temp; + var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow; w = config._w; if (w.GG != null || w.W != null || w.E != null) { @@ -1129,6 +1228,9 @@ weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year); week = defaults(w.W, 1); weekday = defaults(w.E, 1); + if (weekday < 1 || weekday > 7) { + weekdayOverflow = true; + } } else { dow = config._locale._week.dow; doy = config._locale._week.doy; @@ -1139,23 +1241,32 @@ if (w.d != null) { // weekday -- low day numbers are considered next week weekday = w.d; - if (weekday < dow) { - ++week; + if (weekday < 0 || weekday > 6) { + weekdayOverflow = true; } } else if (w.e != null) { // local weekday -- counting starts from begining of week weekday = w.e + dow; + if (w.e < 0 || w.e > 6) { + weekdayOverflow = true; + } } else { // default to begining of week weekday = dow; } } - temp = dayOfYearFromWeeks(weekYear, week, weekday, doy, dow); - - config._a[YEAR] = temp.year; - config._dayOfYear = temp.dayOfYear; + if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { + getParsingFlags(config)._overflowWeeks = true; + } else if (weekdayOverflow != null) { + getParsingFlags(config)._overflowWeekday = true; + } else { + temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); + config._a[YEAR] = temp.year; + config._dayOfYear = temp.dayOfYear; + } } + // constant that refers to the ISO standard utils_hooks__hooks.ISO_8601 = function () {}; // date from string and format string @@ -1180,6 +1291,8 @@ for (i = 0; i < tokens.length; i++) { token = tokens[i]; parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; + // console.log('token', token, 'parsedInput', parsedInput, + // 'regex', getParseRegexForToken(token, config)); if (parsedInput) { skipped = string.substr(0, string.indexOf(parsedInput)); if (skipped.length > 0) { @@ -1248,6 +1361,7 @@ } } + // date from string and array of format strings function configFromStringAndArray(config) { var tempConfig, bestMoment, @@ -1298,7 +1412,9 @@ } var i = normalizeObjectUnits(config._i); - config._a = [i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond]; + config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) { + return obj && parseInt(obj, 10); + }); configFromArray(config); } @@ -1340,13 +1456,17 @@ configFromInput(config); } + if (!valid__isValid(config)) { + config._d = null; + } + return config; } function configFromInput(config) { var input = config._i; if (input === undefined) { - config._d = new Date(); + config._d = new Date(utils_hooks__hooks.now()); } else if (isDate(input)) { config._d = new Date(+input); } else if (typeof input === 'string') { @@ -1393,7 +1513,11 @@ 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', function () { var other = local__createLocal.apply(null, arguments); - return other < this ? this : other; + if (this.isValid() && other.isValid()) { + return other < this ? this : other; + } else { + return valid__createInvalid(); + } } ); @@ -1401,7 +1525,11 @@ 'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', function () { var other = local__createLocal.apply(null, arguments); - return other > this ? this : other; + if (this.isValid() && other.isValid()) { + return other > this ? this : other; + } else { + return valid__createInvalid(); + } } ); @@ -1440,6 +1568,10 @@ return pickBy('isAfter', args); } + var now = function () { + return Date.now ? Date.now() : +(new Date()); + }; + function Duration (duration) { var normalizedInput = normalizeObjectUnits(duration), years = normalizedInput.year || 0, @@ -1479,6 +1611,8 @@ return obj instanceof Duration; } + // FORMATTING + function offset (token, separator) { addFormatToken(token, 0, 0, function () { var offset = this.utcOffset(); @@ -1496,11 +1630,11 @@ // PARSING - addRegexToken('Z', matchOffset); - addRegexToken('ZZ', matchOffset); + addRegexToken('Z', matchShortOffset); + addRegexToken('ZZ', matchShortOffset); addParseToken(['Z', 'ZZ'], function (input, array, config) { config._useUTC = true; - config._tzm = offsetFromString(input); + config._tzm = offsetFromString(matchShortOffset, input); }); // HELPERS @@ -1510,8 +1644,8 @@ // '-1530' > ['-15', '30'] var chunkOffset = /([\+\-]|\d\d)/gi; - function offsetFromString(string) { - var matches = ((string || '').match(matchOffset) || []); + function offsetFromString(matcher, string) { + var matches = ((string || '').match(matcher) || []); var chunk = matches[matches.length - 1] || []; var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; var minutes = +(parts[1] * 60) + toInt(parts[2]); @@ -1561,11 +1695,13 @@ function getSetOffset (input, keepLocalTime) { var offset = this._offset || 0, localAdjust; + if (!this.isValid()) { + return input != null ? this : NaN; + } if (input != null) { if (typeof input === 'string') { - input = offsetFromString(input); - } - if (Math.abs(input) < 16) { + input = offsetFromString(matchShortOffset, input); + } else if (Math.abs(input) < 16) { input = input * 60; } if (!this._isUTC && keepLocalTime) { @@ -1625,12 +1761,15 @@ if (this._tzm) { this.utcOffset(this._tzm); } else if (typeof this._i === 'string') { - this.utcOffset(offsetFromString(this._i)); + this.utcOffset(offsetFromString(matchOffset, this._i)); } return this; } function hasAlignedHourOffset (input) { + if (!this.isValid()) { + return false; + } input = input ? local__createLocal(input).utcOffset() : 0; return (this.utcOffset() - input) % 60 === 0; @@ -1644,7 +1783,7 @@ } function isDaylightSavingTimeShifted () { - if (typeof this._isDSTShifted !== 'undefined') { + if (!isUndefined(this._isDSTShifted)) { return this._isDSTShifted; } @@ -1665,22 +1804,23 @@ } function isLocal () { - return !this._isUTC; + return this.isValid() ? !this._isUTC : false; } function isUtcOffset () { - return this._isUTC; + return this.isValid() ? this._isUTC : false; } function isUtc () { - return this._isUTC && this._offset === 0; + return this.isValid() ? this._isUTC && this._offset === 0 : false; } - var aspNetRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/; + // ASP.NET json date format regex + var aspNetRegex = /(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/; // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere - var create__isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/; + var isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/; function create__createDuration (input, key) { var duration = input, @@ -1713,7 +1853,7 @@ s : toInt(match[SECOND]) * sign, ms : toInt(match[MILLISECOND]) * sign }; - } else if (!!(match = create__isoRegex.exec(input))) { + } else if (!!(match = isoRegex.exec(input))) { sign = (match[1] === '-') ? -1 : 1; duration = { y : parseIso(match[2], sign), @@ -1770,6 +1910,10 @@ function momentsDifference(base, other) { var res; + if (!(base.isValid() && other.isValid())) { + return {milliseconds: 0, months: 0}; + } + other = cloneWithOffset(other, base); if (base.isBefore(other)) { res = positiveMomentsDifference(base, other); @@ -1782,6 +1926,7 @@ return res; } + // TODO: remove 'name' arg after deprecation is removed function createAdder(direction, name) { return function (val, period) { var dur, tmp; @@ -1802,6 +1947,12 @@ var milliseconds = duration._milliseconds, days = duration._days, months = duration._months; + + if (!mom.isValid()) { + // No op + return; + } + updateOffset = updateOffset == null ? true : updateOffset; if (milliseconds) { @@ -1833,7 +1984,10 @@ diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse'; - return this.format(formats && formats[format] || this.localeData().calendar(format, this, local__createLocal(now))); + + var output = formats && (isFunction(formats[format]) ? formats[format]() : formats[format]); + + return this.format(output || this.localeData().calendar(format, this, local__createLocal(now))); } function clone () { @@ -1841,26 +1995,28 @@ } function isAfter (input, units) { - var inputMs; - units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); + var localInput = isMoment(input) ? input : local__createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); if (units === 'millisecond') { - input = isMoment(input) ? input : local__createLocal(input); - return +this > +input; + return +this > +localInput; } else { - inputMs = isMoment(input) ? +input : +local__createLocal(input); - return inputMs < +this.clone().startOf(units); + return +localInput < +this.clone().startOf(units); } } function isBefore (input, units) { - var inputMs; - units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); + var localInput = isMoment(input) ? input : local__createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); if (units === 'millisecond') { - input = isMoment(input) ? input : local__createLocal(input); - return +this < +input; + return +this < +localInput; } else { - inputMs = isMoment(input) ? +input : +local__createLocal(input); - return +this.clone().endOf(units) < inputMs; + return +this.clone().endOf(units) < +localInput; } } @@ -1869,22 +2025,45 @@ } function isSame (input, units) { - var inputMs; + var localInput = isMoment(input) ? input : local__createLocal(input), + inputMs; + if (!(this.isValid() && localInput.isValid())) { + return false; + } units = normalizeUnits(units || 'millisecond'); if (units === 'millisecond') { - input = isMoment(input) ? input : local__createLocal(input); - return +this === +input; + return +this === +localInput; } else { - inputMs = +local__createLocal(input); + inputMs = +localInput; return +(this.clone().startOf(units)) <= inputMs && inputMs <= +(this.clone().endOf(units)); } } + function isSameOrAfter (input, units) { + return this.isSame(input, units) || this.isAfter(input,units); + } + + function isSameOrBefore (input, units) { + return this.isSame(input, units) || this.isBefore(input,units); + } + function diff (input, units, asFloat) { - var that = cloneWithOffset(input, this), - zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4, + var that, + zoneDelta, delta, output; + if (!this.isValid()) { + return NaN; + } + + that = cloneWithOffset(input, this); + + if (!that.isValid()) { + return NaN; + } + + zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; + units = normalizeUnits(units); if (units === 'year' || units === 'month' || units === 'quarter') { @@ -1935,7 +2114,7 @@ function moment_format__toISOString () { var m = this.clone().utc(); if (0 < m.year() && m.year() <= 9999) { - if ('function' === typeof Date.prototype.toISOString) { + if (isFunction(Date.prototype.toISOString)) { // native implementation is ~50x faster, use it when we can return this.toDate().toISOString(); } else { @@ -1952,10 +2131,13 @@ } function from (time, withoutSuffix) { - if (!this.isValid()) { + if (this.isValid() && + ((isMoment(time) && time.isValid()) || + local__createLocal(time).isValid())) { + return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); + } else { return this.localeData().invalidDate(); } - return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); } function fromNow (withoutSuffix) { @@ -1963,16 +2145,22 @@ } function to (time, withoutSuffix) { - if (!this.isValid()) { + if (this.isValid() && + ((isMoment(time) && time.isValid()) || + local__createLocal(time).isValid())) { + return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); + } else { return this.localeData().invalidDate(); } - return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); } function toNow (withoutSuffix) { return this.to(local__createLocal(), withoutSuffix); } + // If passed a locale key, it will set the locale for this + // instance. Otherwise, it will return the locale configuration + // variables for this instance. function locale (key) { var newLocaleData; @@ -2083,6 +2271,11 @@ }; } + function toJSON () { + // JSON.stringify(new Date(NaN)) === 'null' + return this.isValid() ? this.toISOString() : 'null'; + } + function moment_valid__isValid () { return valid__isValid(this); } @@ -2095,6 +2288,18 @@ return getParsingFlags(this).overflow; } + function creationData() { + return { + input: this._i, + format: this._f, + locale: this._locale, + isUTC: this._isUTC, + strict: this._strict + }; + } + + // FORMATTING + addFormatToken(0, ['gg', 2], 0, function () { return this.weekYear() % 100; }); @@ -2136,22 +2341,20 @@ week[token] = utils_hooks__hooks.parseTwoDigitYear(input); }); - // HELPERS - - function weeksInYear(year, dow, doy) { - return weekOfYear(local__createLocal([year, 11, 31 + dow - doy]), dow, doy).week; - } - // MOMENTS function getSetWeekYear (input) { - var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year; - return input == null ? year : this.add((input - year), 'y'); + return getSetWeekYearHelper.call(this, + input, + this.week(), + this.weekday(), + this.localeData()._week.dow, + this.localeData()._week.doy); } function getSetISOWeekYear (input) { - var year = weekOfYear(this, 1, 4).year; - return input == null ? year : this.add((input - year), 'y'); + return getSetWeekYearHelper.call(this, + input, this.isoWeek(), this.isoWeekday(), 1, 4); } function getISOWeeksInYear () { @@ -2163,7 +2366,33 @@ return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); } - addFormatToken('Q', 0, 0, 'quarter'); + function getSetWeekYearHelper(input, week, weekday, dow, doy) { + var weeksTarget; + if (input == null) { + return weekOfYear(this, dow, doy).year; + } else { + weeksTarget = weeksInYear(input, dow, doy); + if (week > weeksTarget) { + week = weeksTarget; + } + return setWeekAll.call(this, input, week, weekday, dow, doy); + } + } + + function setWeekAll(weekYear, week, weekday, dow, doy) { + var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), + date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); + + // console.log("got", weekYear, week, weekday, "set", date.toISOString()); + this.year(date.getUTCFullYear()); + this.month(date.getUTCMonth()); + this.date(date.getUTCDate()); + return this; + } + + // FORMATTING + + addFormatToken('Q', 0, 'Qo', 'quarter'); // ALIASES @@ -2182,6 +2411,62 @@ return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); } + // FORMATTING + + addFormatToken('w', ['ww', 2], 'wo', 'week'); + addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); + + // ALIASES + + addUnitAlias('week', 'w'); + addUnitAlias('isoWeek', 'W'); + + // PARSING + + addRegexToken('w', match1to2); + addRegexToken('ww', match1to2, match2); + addRegexToken('W', match1to2); + addRegexToken('WW', match1to2, match2); + + addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { + week[token.substr(0, 1)] = toInt(input); + }); + + // HELPERS + + // LOCALES + + function localeWeek (mom) { + return weekOfYear(mom, this._week.dow, this._week.doy).week; + } + + var defaultLocaleWeek = { + dow : 0, // Sunday is the first day of the week. + doy : 6 // The week that contains Jan 1st is the first week of the year. + }; + + function localeFirstDayOfWeek () { + return this._week.dow; + } + + function localeFirstDayOfYear () { + return this._week.doy; + } + + // MOMENTS + + function getSetWeek (input) { + var week = this.localeData().week(this); + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + function getSetISOWeek (input) { + var week = weekOfYear(this, 1, 4).week; + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + // FORMATTING + addFormatToken('D', ['DD', 2], 'Do', 'date'); // ALIASES @@ -2205,6 +2490,8 @@ var getSetDayOfMonth = makeGetSet('Date', true); + // FORMATTING + addFormatToken('d', 0, 'do', 'day'); addFormatToken('dd', 0, 0, function (format) { @@ -2237,8 +2524,8 @@ addRegexToken('ddd', matchWord); addRegexToken('dddd', matchWord); - addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config) { - var weekday = config._locale.weekdaysParse(input); + addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { + var weekday = config._locale.weekdaysParse(input, token, config._strict); // if we didn't get a weekday name, mark the date as invalid if (weekday != null) { week.d = weekday; @@ -2273,8 +2560,9 @@ // LOCALES var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'); - function localeWeekdays (m) { - return this._weekdays[m.day()]; + function localeWeekdays (m, format) { + return isArray(this._weekdays) ? this._weekdays[m.day()] : + this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()]; } var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'); @@ -2287,20 +2575,37 @@ return this._weekdaysMin[m.day()]; } - function localeWeekdaysParse (weekdayName) { + function localeWeekdaysParse (weekdayName, format, strict) { var i, mom, regex; - this._weekdaysParse = this._weekdaysParse || []; + if (!this._weekdaysParse) { + this._weekdaysParse = []; + this._minWeekdaysParse = []; + this._shortWeekdaysParse = []; + this._fullWeekdaysParse = []; + } for (i = 0; i < 7; i++) { // make the regex if we don't have it already + + mom = local__createLocal([2000, 1]).day(i); + if (strict && !this._fullWeekdaysParse[i]) { + this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i'); + this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i'); + this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i'); + } if (!this._weekdaysParse[i]) { - mom = local__createLocal([2000, 1]).day(i); regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex - if (this._weekdaysParse[i].test(weekdayName)) { + if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { return i; } } @@ -2309,6 +2614,9 @@ // MOMENTS function getSetDayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); if (input != null) { input = parseWeekday(input, this.localeData()); @@ -2319,20 +2627,73 @@ } function getSetLocaleDayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; return input == null ? weekday : this.add(input - weekday, 'd'); } function getSetISODayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } // behaves the same as moment#day except // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) // as a setter, sunday should belong to the previous week. return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7); } - addFormatToken('H', ['HH', 2], 0, 'hour'); - addFormatToken('h', ['hh', 2], 0, function () { + // FORMATTING + + addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); + + // ALIASES + + addUnitAlias('dayOfYear', 'DDD'); + + // PARSING + + addRegexToken('DDD', match1to3); + addRegexToken('DDDD', match3); + addParseToken(['DDD', 'DDDD'], function (input, array, config) { + config._dayOfYear = toInt(input); + }); + + // HELPERS + + // MOMENTS + + function getSetDayOfYear (input) { + var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; + return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); + } + + // FORMATTING + + function hFormat() { return this.hours() % 12 || 12; + } + + addFormatToken('H', ['HH', 2], 0, 'hour'); + addFormatToken('h', ['hh', 2], 0, hFormat); + + addFormatToken('hmm', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); + }); + + addFormatToken('hmmss', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + + zeroFill(this.seconds(), 2); + }); + + addFormatToken('Hmm', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2); + }); + + addFormatToken('Hmmss', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2) + + zeroFill(this.seconds(), 2); }); function meridiem (token, lowercase) { @@ -2361,6 +2722,11 @@ addRegexToken('HH', match1to2, match2); addRegexToken('hh', match1to2, match2); + addRegexToken('hmm', match3to4); + addRegexToken('hmmss', match5to6); + addRegexToken('Hmm', match3to4); + addRegexToken('Hmmss', match5to6); + addParseToken(['H', 'HH'], HOUR); addParseToken(['a', 'A'], function (input, array, config) { config._isPm = config._locale.isPM(input); @@ -2370,6 +2736,32 @@ array[HOUR] = toInt(input); getParsingFlags(config).bigHour = true; }); + addParseToken('hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); + getParsingFlags(config).bigHour = true; + }); + addParseToken('hmmss', function (input, array, config) { + var pos1 = input.length - 4; + var pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); + getParsingFlags(config).bigHour = true; + }); + addParseToken('Hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); + }); + addParseToken('Hmmss', function (input, array, config) { + var pos1 = input.length - 4; + var pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); + }); // LOCALES @@ -2397,6 +2789,8 @@ // this rule. var getSetHour = makeGetSet('Hours', true); + // FORMATTING + addFormatToken('m', ['mm', 2], 0, 'minute'); // ALIASES @@ -2413,6 +2807,8 @@ var getSetMinute = makeGetSet('Minutes', false); + // FORMATTING + addFormatToken('s', ['ss', 2], 0, 'second'); // ALIASES @@ -2429,6 +2825,8 @@ var getSetSecond = makeGetSet('Seconds', false); + // FORMATTING + addFormatToken('S', 0, 0, function () { return ~~(this.millisecond() / 100); }); @@ -2484,6 +2882,8 @@ var getSetMillisecond = makeGetSet('Milliseconds', false); + // FORMATTING + addFormatToken('z', 0, 0, 'zoneAbbr'); addFormatToken('zz', 0, 0, 'zoneName'); @@ -2499,40 +2899,43 @@ var momentPrototype__proto = Moment.prototype; - momentPrototype__proto.add = add_subtract__add; - momentPrototype__proto.calendar = moment_calendar__calendar; - momentPrototype__proto.clone = clone; - momentPrototype__proto.diff = diff; - momentPrototype__proto.endOf = endOf; - momentPrototype__proto.format = format; - momentPrototype__proto.from = from; - momentPrototype__proto.fromNow = fromNow; - momentPrototype__proto.to = to; - momentPrototype__proto.toNow = toNow; - momentPrototype__proto.get = getSet; - momentPrototype__proto.invalidAt = invalidAt; - momentPrototype__proto.isAfter = isAfter; - momentPrototype__proto.isBefore = isBefore; - momentPrototype__proto.isBetween = isBetween; - momentPrototype__proto.isSame = isSame; - momentPrototype__proto.isValid = moment_valid__isValid; - momentPrototype__proto.lang = lang; - momentPrototype__proto.locale = locale; - momentPrototype__proto.localeData = localeData; - momentPrototype__proto.max = prototypeMax; - momentPrototype__proto.min = prototypeMin; - momentPrototype__proto.parsingFlags = parsingFlags; - momentPrototype__proto.set = getSet; - momentPrototype__proto.startOf = startOf; - momentPrototype__proto.subtract = add_subtract__subtract; - momentPrototype__proto.toArray = toArray; - momentPrototype__proto.toObject = toObject; - momentPrototype__proto.toDate = toDate; - momentPrototype__proto.toISOString = moment_format__toISOString; - momentPrototype__proto.toJSON = moment_format__toISOString; - momentPrototype__proto.toString = toString; - momentPrototype__proto.unix = unix; - momentPrototype__proto.valueOf = to_type__valueOf; + momentPrototype__proto.add = add_subtract__add; + momentPrototype__proto.calendar = moment_calendar__calendar; + momentPrototype__proto.clone = clone; + momentPrototype__proto.diff = diff; + momentPrototype__proto.endOf = endOf; + momentPrototype__proto.format = format; + momentPrototype__proto.from = from; + momentPrototype__proto.fromNow = fromNow; + momentPrototype__proto.to = to; + momentPrototype__proto.toNow = toNow; + momentPrototype__proto.get = getSet; + momentPrototype__proto.invalidAt = invalidAt; + momentPrototype__proto.isAfter = isAfter; + momentPrototype__proto.isBefore = isBefore; + momentPrototype__proto.isBetween = isBetween; + momentPrototype__proto.isSame = isSame; + momentPrototype__proto.isSameOrAfter = isSameOrAfter; + momentPrototype__proto.isSameOrBefore = isSameOrBefore; + momentPrototype__proto.isValid = moment_valid__isValid; + momentPrototype__proto.lang = lang; + momentPrototype__proto.locale = locale; + momentPrototype__proto.localeData = localeData; + momentPrototype__proto.max = prototypeMax; + momentPrototype__proto.min = prototypeMin; + momentPrototype__proto.parsingFlags = parsingFlags; + momentPrototype__proto.set = getSet; + momentPrototype__proto.startOf = startOf; + momentPrototype__proto.subtract = add_subtract__subtract; + momentPrototype__proto.toArray = toArray; + momentPrototype__proto.toObject = toObject; + momentPrototype__proto.toDate = toDate; + momentPrototype__proto.toISOString = moment_format__toISOString; + momentPrototype__proto.toJSON = toJSON; + momentPrototype__proto.toString = toString; + momentPrototype__proto.unix = unix; + momentPrototype__proto.valueOf = to_type__valueOf; + momentPrototype__proto.creationData = creationData; // Year momentPrototype__proto.year = getSetYear; @@ -2618,7 +3021,7 @@ function locale_calendar__calendar (key, mom, now) { var output = this._calendar[key]; - return typeof output === 'function' ? output.call(mom, now) : output; + return isFunction(output) ? output.call(mom, now) : output; } var defaultLongDateFormat = { @@ -2680,21 +3083,21 @@ function relative__relativeTime (number, withoutSuffix, string, isFuture) { var output = this._relativeTime[string]; - return (typeof output === 'function') ? + return (isFunction(output)) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number); } function pastFuture (diff, output) { var format = this._relativeTime[diff > 0 ? 'future' : 'past']; - return typeof format === 'function' ? format(output) : format.replace(/%s/i, output); + return isFunction(format) ? format(output) : format.replace(/%s/i, output); } function locale_set__set (config) { var prop, i; for (i in config) { prop = config[i]; - if (typeof prop === 'function') { + if (isFunction(prop)) { this[i] = prop; } else { this['_' + i] = prop; @@ -2724,11 +3127,15 @@ prototype__proto.set = locale_set__set; // Month - prototype__proto.months = localeMonths; - prototype__proto._months = defaultLocaleMonths; - prototype__proto.monthsShort = localeMonthsShort; - prototype__proto._monthsShort = defaultLocaleMonthsShort; - prototype__proto.monthsParse = localeMonthsParse; + prototype__proto.months = localeMonths; + prototype__proto._months = defaultLocaleMonths; + prototype__proto.monthsShort = localeMonthsShort; + prototype__proto._monthsShort = defaultLocaleMonthsShort; + prototype__proto.monthsParse = localeMonthsParse; + prototype__proto._monthsRegex = defaultMonthsRegex; + prototype__proto.monthsRegex = monthsRegex; + prototype__proto._monthsShortRegex = defaultMonthsShortRegex; + prototype__proto.monthsShortRegex = monthsShortRegex; // Week prototype__proto.week = localeWeek; @@ -3016,15 +3423,15 @@ var years = round(duration.as('y')); var a = seconds < thresholds.s && ['s', seconds] || - minutes === 1 && ['m'] || + minutes <= 1 && ['m'] || minutes < thresholds.m && ['mm', minutes] || - hours === 1 && ['h'] || + hours <= 1 && ['h'] || hours < thresholds.h && ['hh', hours] || - days === 1 && ['d'] || + days <= 1 && ['d'] || days < thresholds.d && ['dd', days] || - months === 1 && ['M'] || + months <= 1 && ['M'] || months < thresholds.M && ['MM', months] || - years === 1 && ['y'] || ['yy', years]; + years <= 1 && ['y'] || ['yy', years]; a[2] = withoutSuffix; a[3] = +posNegDuration > 0; @@ -3145,6 +3552,8 @@ // Side effect imports + // FORMATTING + addFormatToken('X', 0, 0, 'unix'); addFormatToken('x', 0, 0, 'valueOf'); @@ -3162,13 +3571,14 @@ // Side effect imports - utils_hooks__hooks.version = '2.10.6'; + utils_hooks__hooks.version = '2.11.1'; setHookCallback(local__createLocal); utils_hooks__hooks.fn = momentPrototype; utils_hooks__hooks.min = min; utils_hooks__hooks.max = max; + utils_hooks__hooks.now = now; utils_hooks__hooks.utc = create_utc__createUTC; utils_hooks__hooks.unix = moment__createUnix; utils_hooks__hooks.months = lists__listMonths; @@ -3187,6 +3597,7 @@ utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort; utils_hooks__hooks.normalizeUnits = normalizeUnits; utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold; + utils_hooks__hooks.prototype = momentPrototype; var _moment = utils_hooks__hooks; diff --git a/bower_components/moment/src/lib/create/check-overflow.js b/bower_components/moment/src/lib/create/check-overflow.js index 88a62ae..41b539f 100644 --- a/bower_components/moment/src/lib/create/check-overflow.js +++ b/bower_components/moment/src/lib/create/check-overflow.js @@ -1,5 +1,5 @@ import { daysInMonth } from '../units/month'; -import { YEAR, MONTH, DATE, HOUR, MINUTE, SECOND, MILLISECOND } from '../units/constants'; +import { YEAR, MONTH, DATE, HOUR, MINUTE, SECOND, MILLISECOND, WEEK, WEEKDAY } from '../units/constants'; import getParsingFlags from '../create/parsing-flags'; export default function checkOverflow (m) { @@ -19,6 +19,12 @@ export default function checkOverflow (m) { if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { overflow = DATE; } + if (getParsingFlags(m)._overflowWeeks && overflow === -1) { + overflow = WEEK; + } + if (getParsingFlags(m)._overflowWeekday && overflow === -1) { + overflow = WEEKDAY; + } getParsingFlags(m).overflow = overflow; } diff --git a/bower_components/moment/src/lib/create/date-from-array.js b/bower_components/moment/src/lib/create/date-from-array.js index 349eebc..180f55c 100644 --- a/bower_components/moment/src/lib/create/date-from-array.js +++ b/bower_components/moment/src/lib/create/date-from-array.js @@ -3,8 +3,8 @@ export function createDate (y, m, d, h, M, s, ms) { //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply var date = new Date(y, m, d, h, M, s, ms); - //the date constructor doesn't accept years < 1970 - if (y < 1970) { + //the date constructor remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0 && isFinite(date.getFullYear())) { date.setFullYear(y); } return date; @@ -12,7 +12,9 @@ export function createDate (y, m, d, h, M, s, ms) { export function createUTCDate (y) { var date = new Date(Date.UTC.apply(null, arguments)); - if (y < 1970) { + + //the Date.UTC function remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) { date.setUTCFullYear(y); } return date; diff --git a/bower_components/moment/src/lib/create/from-anything.js b/bower_components/moment/src/lib/create/from-anything.js index 5a69dc5..7b92587 100644 --- a/bower_components/moment/src/lib/create/from-anything.js +++ b/bower_components/moment/src/lib/create/from-anything.js @@ -6,6 +6,7 @@ import { Moment, isMoment } from '../moment/constructor'; import { getLocale } from '../locale/locales'; import { hooks } from '../utils/hooks'; import checkOverflow from './check-overflow'; +import { isValid } from './valid'; import { configFromStringAndArray } from './from-string-and-array'; import { configFromStringAndFormat } from './from-string-and-format'; @@ -50,13 +51,17 @@ export function prepareConfig (config) { configFromInput(config); } + if (!isValid(config)) { + config._d = null; + } + return config; } function configFromInput(config) { var input = config._i; if (input === undefined) { - config._d = new Date(); + config._d = new Date(hooks.now()); } else if (isDate(input)) { config._d = new Date(+input); } else if (typeof input === 'string') { diff --git a/bower_components/moment/src/lib/create/from-array.js b/bower_components/moment/src/lib/create/from-array.js index c4239cb..25dbc28 100644 --- a/bower_components/moment/src/lib/create/from-array.js +++ b/bower_components/moment/src/lib/create/from-array.js @@ -1,18 +1,19 @@ +import { hooks } from '../utils/hooks'; import { createDate, createUTCDate } from './date-from-array'; import { daysInYear } from '../units/year'; -import { weekOfYear } from '../units/week'; -import { dayOfYearFromWeeks } from '../units/day-of-year'; +import { weekOfYear, weeksInYear, dayOfYearFromWeeks } from '../units/week-calendar-utils'; import { YEAR, MONTH, DATE, HOUR, MINUTE, SECOND, MILLISECOND } from '../units/constants'; import { createLocal } from './local'; import defaults from '../utils/defaults'; import getParsingFlags from './parsing-flags'; function currentDateArray(config) { - var now = new Date(); + // hooks is actually the exported moment object + var nowValue = new Date(hooks.now()); if (config._useUTC) { - return [now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()]; + return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()]; } - return [now.getFullYear(), now.getMonth(), now.getDate()]; + return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; } // convert an array to a date. @@ -82,7 +83,7 @@ export function configFromArray (config) { } function dayOfYearFromWeekInfo(config) { - var w, weekYear, week, weekday, dow, doy, temp; + var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow; w = config._w; if (w.GG != null || w.W != null || w.E != null) { @@ -96,6 +97,9 @@ function dayOfYearFromWeekInfo(config) { weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year); week = defaults(w.W, 1); weekday = defaults(w.E, 1); + if (weekday < 1 || weekday > 7) { + weekdayOverflow = true; + } } else { dow = config._locale._week.dow; doy = config._locale._week.doy; @@ -106,19 +110,27 @@ function dayOfYearFromWeekInfo(config) { if (w.d != null) { // weekday -- low day numbers are considered next week weekday = w.d; - if (weekday < dow) { - ++week; + if (weekday < 0 || weekday > 6) { + weekdayOverflow = true; } } else if (w.e != null) { // local weekday -- counting starts from begining of week weekday = w.e + dow; + if (w.e < 0 || w.e > 6) { + weekdayOverflow = true; + } } else { // default to begining of week weekday = dow; } } - temp = dayOfYearFromWeeks(weekYear, week, weekday, doy, dow); - - config._a[YEAR] = temp.year; - config._dayOfYear = temp.dayOfYear; + if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { + getParsingFlags(config)._overflowWeeks = true; + } else if (weekdayOverflow != null) { + getParsingFlags(config)._overflowWeekday = true; + } else { + temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); + config._a[YEAR] = temp.year; + config._dayOfYear = temp.dayOfYear; + } } diff --git a/bower_components/moment/src/lib/create/from-object.js b/bower_components/moment/src/lib/create/from-object.js index af8e082..c0bfe9f 100644 --- a/bower_components/moment/src/lib/create/from-object.js +++ b/bower_components/moment/src/lib/create/from-object.js @@ -1,5 +1,6 @@ import { normalizeObjectUnits } from '../units/aliases'; import { configFromArray } from './from-array'; +import map from '../utils/map'; export function configFromObject(config) { if (config._d) { @@ -7,7 +8,9 @@ export function configFromObject(config) { } var i = normalizeObjectUnits(config._i); - config._a = [i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond]; + config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) { + return obj && parseInt(obj, 10); + }); configFromArray(config); } diff --git a/bower_components/moment/src/lib/create/from-string-and-format.js b/bower_components/moment/src/lib/create/from-string-and-format.js index ae48b90..87eecaf 100644 --- a/bower_components/moment/src/lib/create/from-string-and-format.js +++ b/bower_components/moment/src/lib/create/from-string-and-format.js @@ -33,6 +33,8 @@ export function configFromStringAndFormat(config) { for (i = 0; i < tokens.length; i++) { token = tokens[i]; parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; + // console.log('token', token, 'parsedInput', parsedInput, + // 'regex', getParseRegexForToken(token, config)); if (parsedInput) { skipped = string.substr(0, string.indexOf(parsedInput)); if (skipped.length > 0) { diff --git a/bower_components/moment/src/lib/create/from-string.js b/bower_components/moment/src/lib/create/from-string.js index 4a7163b..6852049 100644 --- a/bower_components/moment/src/lib/create/from-string.js +++ b/bower_components/moment/src/lib/create/from-string.js @@ -1,4 +1,3 @@ -import { matchOffset } from '../parse/regex'; import { configFromStringAndFormat } from './from-string-and-format'; import { hooks } from '../utils/hooks'; import { deprecate } from '../utils/deprecate'; @@ -6,22 +5,37 @@ import getParsingFlags from './parsing-flags'; // iso 8601 regex // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) -var isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/; +var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/; +var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/; + +var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/; var isoDates = [ - ['YYYYYY-MM-DD', /[+-]\d{6}-\d{2}-\d{2}/], - ['YYYY-MM-DD', /\d{4}-\d{2}-\d{2}/], - ['GGGG-[W]WW-E', /\d{4}-W\d{2}-\d/], - ['GGGG-[W]WW', /\d{4}-W\d{2}/], - ['YYYY-DDD', /\d{4}-\d{3}/] + ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], + ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], + ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], + ['GGGG-[W]WW', /\d{4}-W\d\d/, false], + ['YYYY-DDD', /\d{4}-\d{3}/], + ['YYYY-MM', /\d{4}-\d\d/, false], + ['YYYYYYMMDD', /[+-]\d{10}/], + ['YYYYMMDD', /\d{8}/], + // YYYYMM is NOT allowed by the standard + ['GGGG[W]WWE', /\d{4}W\d{3}/], + ['GGGG[W]WW', /\d{4}W\d{2}/, false], + ['YYYYDDD', /\d{7}/] ]; // iso time formats and regexes var isoTimes = [ - ['HH:mm:ss.SSSS', /(T| )\d\d:\d\d:\d\d\.\d+/], - ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/], - ['HH:mm', /(T| )\d\d:\d\d/], - ['HH', /(T| )\d\d/] + ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], + ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], + ['HH:mm:ss', /\d\d:\d\d:\d\d/], + ['HH:mm', /\d\d:\d\d/], + ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], + ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], + ['HHmmss', /\d\d\d\d\d\d/], + ['HHmm', /\d\d\d\d/], + ['HH', /\d\d/] ]; var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i; @@ -30,26 +44,49 @@ var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i; export function configFromISO(config) { var i, l, string = config._i, - match = isoRegex.exec(string); + match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), + allowTime, dateFormat, timeFormat, tzFormat; if (match) { getParsingFlags(config).iso = true; + for (i = 0, l = isoDates.length; i < l; i++) { - if (isoDates[i][1].exec(string)) { - config._f = isoDates[i][0]; + if (isoDates[i][1].exec(match[1])) { + dateFormat = isoDates[i][0]; + allowTime = isoDates[i][2] !== false; break; } } - for (i = 0, l = isoTimes.length; i < l; i++) { - if (isoTimes[i][1].exec(string)) { - // match[6] should be 'T' or space - config._f += (match[6] || ' ') + isoTimes[i][0]; - break; + if (dateFormat == null) { + config._isValid = false; + return; + } + if (match[3]) { + for (i = 0, l = isoTimes.length; i < l; i++) { + if (isoTimes[i][1].exec(match[3])) { + // match[2] should be 'T' or space + timeFormat = (match[2] || ' ') + isoTimes[i][0]; + break; + } } + if (timeFormat == null) { + config._isValid = false; + return; + } + } + if (!allowTime && timeFormat != null) { + config._isValid = false; + return; } - if (string.match(matchOffset)) { - config._f += 'Z'; + if (match[4]) { + if (tzRegex.exec(match[4])) { + tzFormat = 'Z'; + } else { + config._isValid = false; + return; + } } + config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); configFromStringAndFormat(config); } else { config._isValid = false; diff --git a/bower_components/moment/src/lib/duration/create.js b/bower_components/moment/src/lib/duration/create.js index 15f05de..a79feea 100644 --- a/bower_components/moment/src/lib/duration/create.js +++ b/bower_components/moment/src/lib/duration/create.js @@ -6,7 +6,7 @@ import { cloneWithOffset } from '../units/offset'; import { createLocal } from '../create/local'; // ASP.NET json date format regex -var aspNetRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/; +var aspNetRegex = /(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/; // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere @@ -100,6 +100,10 @@ function positiveMomentsDifference(base, other) { function momentsDifference(base, other) { var res; + if (!(base.isValid() && other.isValid())) { + return {milliseconds: 0, months: 0}; + } + other = cloneWithOffset(other, base); if (base.isBefore(other)) { res = positiveMomentsDifference(base, other); diff --git a/bower_components/moment/src/lib/duration/humanize.js b/bower_components/moment/src/lib/duration/humanize.js index d6dd83b..eb03311 100644 --- a/bower_components/moment/src/lib/duration/humanize.js +++ b/bower_components/moment/src/lib/duration/humanize.js @@ -24,15 +24,15 @@ function relativeTime (posNegDuration, withoutSuffix, locale) { var years = round(duration.as('y')); var a = seconds < thresholds.s && ['s', seconds] || - minutes === 1 && ['m'] || + minutes <= 1 && ['m'] || minutes < thresholds.m && ['mm', minutes] || - hours === 1 && ['h'] || + hours <= 1 && ['h'] || hours < thresholds.h && ['hh', hours] || - days === 1 && ['d'] || + days <= 1 && ['d'] || days < thresholds.d && ['dd', days] || - months === 1 && ['M'] || + months <= 1 && ['M'] || months < thresholds.M && ['MM', months] || - years === 1 && ['y'] || ['yy', years]; + years <= 1 && ['y'] || ['yy', years]; a[2] = withoutSuffix; a[3] = +posNegDuration > 0; diff --git a/bower_components/moment/src/lib/format/format.js b/bower_components/moment/src/lib/format/format.js index 5378170..a2b755d 100644 --- a/bower_components/moment/src/lib/format/format.js +++ b/bower_components/moment/src/lib/format/format.js @@ -1,6 +1,6 @@ import zeroFill from '../utils/zero-fill'; -export var formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; +export var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g; diff --git a/bower_components/moment/src/lib/locale/calendar.js b/bower_components/moment/src/lib/locale/calendar.js index 22545b9..e9cad6d 100644 --- a/bower_components/moment/src/lib/locale/calendar.js +++ b/bower_components/moment/src/lib/locale/calendar.js @@ -7,7 +7,9 @@ export var defaultCalendar = { sameElse : 'L' }; +import isFunction from '../utils/is-function'; + export function calendar (key, mom, now) { var output = this._calendar[key]; - return typeof output === 'function' ? output.call(mom, now) : output; + return isFunction(output) ? output.call(mom, now) : output; } diff --git a/bower_components/moment/src/lib/locale/locales.js b/bower_components/moment/src/lib/locale/locales.js index a32e5ac..00114cf 100644 --- a/bower_components/moment/src/lib/locale/locales.js +++ b/bower_components/moment/src/lib/locale/locales.js @@ -1,4 +1,5 @@ import isArray from '../utils/is-array'; +import isUndefined from '../utils/is-undefined'; import compareArrays from '../utils/compare-arrays'; import { Locale } from './constructor'; @@ -40,7 +41,7 @@ function chooseLocale(names) { function loadLocale(name) { var oldLocale = null; // TODO: Find a better way to register and load all the locales in Node - if (!locales[name] && typeof module !== 'undefined' && + if (!locales[name] && (typeof module !== 'undefined') && module && module.exports) { try { oldLocale = globalLocale._abbr; @@ -59,7 +60,7 @@ function loadLocale(name) { export function getSetGlobalLocale (key, values) { var data; if (key) { - if (typeof values === 'undefined') { + if (isUndefined(values)) { data = getLocale(key); } else { diff --git a/bower_components/moment/src/lib/locale/prototype.js b/bower_components/moment/src/lib/locale/prototype.js index ed02d4f..bb27ad0 100644 --- a/bower_components/moment/src/lib/locale/prototype.js +++ b/bower_components/moment/src/lib/locale/prototype.js @@ -30,14 +30,20 @@ proto.set = set; import { localeMonthsParse, defaultLocaleMonths, localeMonths, - defaultLocaleMonthsShort, localeMonthsShort + defaultLocaleMonthsShort, localeMonthsShort, + defaultMonthsRegex, monthsRegex, + defaultMonthsShortRegex, monthsShortRegex } from '../units/month'; -proto.months = localeMonths; -proto._months = defaultLocaleMonths; -proto.monthsShort = localeMonthsShort; -proto._monthsShort = defaultLocaleMonthsShort; -proto.monthsParse = localeMonthsParse; +proto.months = localeMonths; +proto._months = defaultLocaleMonths; +proto.monthsShort = localeMonthsShort; +proto._monthsShort = defaultLocaleMonthsShort; +proto.monthsParse = localeMonthsParse; +proto._monthsRegex = defaultMonthsRegex; +proto.monthsRegex = monthsRegex; +proto._monthsShortRegex = defaultMonthsShortRegex; +proto.monthsShortRegex = monthsShortRegex; // Week import { localeWeek, defaultLocaleWeek, localeFirstDayOfYear, localeFirstDayOfWeek } from '../units/week'; diff --git a/bower_components/moment/src/lib/locale/relative.js b/bower_components/moment/src/lib/locale/relative.js index 5986a67..4c485ea 100644 --- a/bower_components/moment/src/lib/locale/relative.js +++ b/bower_components/moment/src/lib/locale/relative.js @@ -14,14 +14,16 @@ export var defaultRelativeTime = { yy : '%d years' }; +import isFunction from '../utils/is-function'; + export function relativeTime (number, withoutSuffix, string, isFuture) { var output = this._relativeTime[string]; - return (typeof output === 'function') ? + return (isFunction(output)) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number); } export function pastFuture (diff, output) { var format = this._relativeTime[diff > 0 ? 'future' : 'past']; - return typeof format === 'function' ? format(output) : format.replace(/%s/i, output); + return isFunction(format) ? format(output) : format.replace(/%s/i, output); } diff --git a/bower_components/moment/src/lib/locale/set.js b/bower_components/moment/src/lib/locale/set.js index 32db2ad..062e842 100644 --- a/bower_components/moment/src/lib/locale/set.js +++ b/bower_components/moment/src/lib/locale/set.js @@ -1,8 +1,10 @@ +import isFunction from '../utils/is-function'; + export function set (config) { var prop, i; for (i in config) { prop = config[i]; - if (typeof prop === 'function') { + if (isFunction(prop)) { this[i] = prop; } else { this['_' + i] = prop; diff --git a/bower_components/moment/src/lib/moment/add-subtract.js b/bower_components/moment/src/lib/moment/add-subtract.js index ebfe674..988eff3 100644 --- a/bower_components/moment/src/lib/moment/add-subtract.js +++ b/bower_components/moment/src/lib/moment/add-subtract.js @@ -25,6 +25,12 @@ export function addSubtract (mom, duration, isAdding, updateOffset) { var milliseconds = duration._milliseconds, days = duration._days, months = duration._months; + + if (!mom.isValid()) { + // No op + return; + } + updateOffset = updateOffset == null ? true : updateOffset; if (milliseconds) { diff --git a/bower_components/moment/src/lib/moment/calendar.js b/bower_components/moment/src/lib/moment/calendar.js index c9df803..bc5092c 100644 --- a/bower_components/moment/src/lib/moment/calendar.js +++ b/bower_components/moment/src/lib/moment/calendar.js @@ -1,5 +1,6 @@ import { createLocal } from '../create/local'; import { cloneWithOffset } from '../units/offset'; +import isFunction from '../utils/is-function'; export function calendar (time, formats) { // We want to compare the start of today, vs this. @@ -13,5 +14,8 @@ export function calendar (time, formats) { diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse'; - return this.format(formats && formats[format] || this.localeData().calendar(format, this, createLocal(now))); + + var output = formats && (isFunction(formats[format]) ? formats[format]() : formats[format]); + + return this.format(output || this.localeData().calendar(format, this, createLocal(now))); } diff --git a/bower_components/moment/src/lib/moment/compare.js b/bower_components/moment/src/lib/moment/compare.js index b663473..d196a98 100644 --- a/bower_components/moment/src/lib/moment/compare.js +++ b/bower_components/moment/src/lib/moment/compare.js @@ -1,28 +1,31 @@ import { isMoment } from './constructor'; import { normalizeUnits } from '../units/aliases'; import { createLocal } from '../create/local'; +import isUndefined from '../utils/is-undefined'; export function isAfter (input, units) { - var inputMs; - units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); + var localInput = isMoment(input) ? input : createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); if (units === 'millisecond') { - input = isMoment(input) ? input : createLocal(input); - return +this > +input; + return +this > +localInput; } else { - inputMs = isMoment(input) ? +input : +createLocal(input); - return inputMs < +this.clone().startOf(units); + return +localInput < +this.clone().startOf(units); } } export function isBefore (input, units) { - var inputMs; - units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); + var localInput = isMoment(input) ? input : createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); if (units === 'millisecond') { - input = isMoment(input) ? input : createLocal(input); - return +this < +input; + return +this < +localInput; } else { - inputMs = isMoment(input) ? +input : +createLocal(input); - return +this.clone().endOf(units) < inputMs; + return +this.clone().endOf(units) < +localInput; } } @@ -31,13 +34,24 @@ export function isBetween (from, to, units) { } export function isSame (input, units) { - var inputMs; + var localInput = isMoment(input) ? input : createLocal(input), + inputMs; + if (!(this.isValid() && localInput.isValid())) { + return false; + } units = normalizeUnits(units || 'millisecond'); if (units === 'millisecond') { - input = isMoment(input) ? input : createLocal(input); - return +this === +input; + return +this === +localInput; } else { - inputMs = +createLocal(input); + inputMs = +localInput; return +(this.clone().startOf(units)) <= inputMs && inputMs <= +(this.clone().endOf(units)); } } + +export function isSameOrAfter (input, units) { + return this.isSame(input, units) || this.isAfter(input,units); +} + +export function isSameOrBefore (input, units) { + return this.isSame(input, units) || this.isBefore(input,units); +} diff --git a/bower_components/moment/src/lib/moment/constructor.js b/bower_components/moment/src/lib/moment/constructor.js index f5f3da0..964c0ae 100644 --- a/bower_components/moment/src/lib/moment/constructor.js +++ b/bower_components/moment/src/lib/moment/constructor.js @@ -1,5 +1,6 @@ import { hooks } from '../utils/hooks'; import hasOwnProp from '../utils/has-own-prop'; +import isUndefined from '../utils/is-undefined'; import getParsingFlags from '../create/parsing-flags'; // Plugins that add properties should also add the key here (null value), @@ -9,34 +10,34 @@ var momentProperties = hooks.momentProperties = []; export function copyConfig(to, from) { var i, prop, val; - if (typeof from._isAMomentObject !== 'undefined') { + if (!isUndefined(from._isAMomentObject)) { to._isAMomentObject = from._isAMomentObject; } - if (typeof from._i !== 'undefined') { + if (!isUndefined(from._i)) { to._i = from._i; } - if (typeof from._f !== 'undefined') { + if (!isUndefined(from._f)) { to._f = from._f; } - if (typeof from._l !== 'undefined') { + if (!isUndefined(from._l)) { to._l = from._l; } - if (typeof from._strict !== 'undefined') { + if (!isUndefined(from._strict)) { to._strict = from._strict; } - if (typeof from._tzm !== 'undefined') { + if (!isUndefined(from._tzm)) { to._tzm = from._tzm; } - if (typeof from._isUTC !== 'undefined') { + if (!isUndefined(from._isUTC)) { to._isUTC = from._isUTC; } - if (typeof from._offset !== 'undefined') { + if (!isUndefined(from._offset)) { to._offset = from._offset; } - if (typeof from._pf !== 'undefined') { + if (!isUndefined(from._pf)) { to._pf = getParsingFlags(from); } - if (typeof from._locale !== 'undefined') { + if (!isUndefined(from._locale)) { to._locale = from._locale; } @@ -44,7 +45,7 @@ export function copyConfig(to, from) { for (i in momentProperties) { prop = momentProperties[i]; val = from[prop]; - if (typeof val !== 'undefined') { + if (!isUndefined(val)) { to[prop] = val; } } diff --git a/bower_components/moment/src/lib/moment/creation-data.js b/bower_components/moment/src/lib/moment/creation-data.js new file mode 100644 index 0000000..7e2d69a --- /dev/null +++ b/bower_components/moment/src/lib/moment/creation-data.js @@ -0,0 +1,9 @@ +export function creationData() { + return { + input: this._i, + format: this._f, + locale: this._locale, + isUTC: this._isUTC, + strict: this._strict + }; +} diff --git a/bower_components/moment/src/lib/moment/diff.js b/bower_components/moment/src/lib/moment/diff.js index 2c16d1d..695fe20 100644 --- a/bower_components/moment/src/lib/moment/diff.js +++ b/bower_components/moment/src/lib/moment/diff.js @@ -3,10 +3,22 @@ import { cloneWithOffset } from '../units/offset'; import { normalizeUnits } from '../units/aliases'; export function diff (input, units, asFloat) { - var that = cloneWithOffset(input, this), - zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4, + var that, + zoneDelta, delta, output; + if (!this.isValid()) { + return NaN; + } + + that = cloneWithOffset(input, this); + + if (!that.isValid()) { + return NaN; + } + + zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; + units = normalizeUnits(units); if (units === 'year' || units === 'month' || units === 'quarter') { diff --git a/bower_components/moment/src/lib/moment/format.js b/bower_components/moment/src/lib/moment/format.js index 4939f38..7e93a0a 100644 --- a/bower_components/moment/src/lib/moment/format.js +++ b/bower_components/moment/src/lib/moment/format.js @@ -1,5 +1,6 @@ import { formatMoment } from '../format/format'; import { hooks } from '../utils/hooks'; +import isFunction from '../utils/is-function'; hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; @@ -10,7 +11,7 @@ export function toString () { export function toISOString () { var m = this.clone().utc(); if (0 < m.year() && m.year() <= 9999) { - if ('function' === typeof Date.prototype.toISOString) { + if (isFunction(Date.prototype.toISOString)) { // native implementation is ~50x faster, use it when we can return this.toDate().toISOString(); } else { diff --git a/bower_components/moment/src/lib/moment/from.js b/bower_components/moment/src/lib/moment/from.js index c6a5449..4fbd03e 100644 --- a/bower_components/moment/src/lib/moment/from.js +++ b/bower_components/moment/src/lib/moment/from.js @@ -1,11 +1,15 @@ import { createDuration } from '../duration/create'; import { createLocal } from '../create/local'; +import { isMoment } from '../moment/constructor'; export function from (time, withoutSuffix) { - if (!this.isValid()) { + if (this.isValid() && + ((isMoment(time) && time.isValid()) || + createLocal(time).isValid())) { + return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); + } else { return this.localeData().invalidDate(); } - return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); } export function fromNow (withoutSuffix) { diff --git a/bower_components/moment/src/lib/moment/get-set.js b/bower_components/moment/src/lib/moment/get-set.js index 0f2be60..ef43f39 100644 --- a/bower_components/moment/src/lib/moment/get-set.js +++ b/bower_components/moment/src/lib/moment/get-set.js @@ -1,5 +1,6 @@ import { normalizeUnits } from '../units/aliases'; import { hooks } from '../utils/hooks'; +import isFunction from '../utils/is-function'; export function makeGetSet (unit, keepTime) { return function (value) { @@ -14,11 +15,14 @@ export function makeGetSet (unit, keepTime) { } export function get (mom, unit) { - return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit](); + return mom.isValid() ? + mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN; } export function set (mom, unit, value) { - return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); + if (mom.isValid()) { + mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); + } } // MOMENTS @@ -31,7 +35,7 @@ export function getSet (units, value) { } } else { units = normalizeUnits(units); - if (typeof this[units] === 'function') { + if (isFunction(this[units])) { return this[units](value); } } diff --git a/bower_components/moment/src/lib/moment/min-max.js b/bower_components/moment/src/lib/moment/min-max.js index 912cbfe..e355883 100644 --- a/bower_components/moment/src/lib/moment/min-max.js +++ b/bower_components/moment/src/lib/moment/min-max.js @@ -1,12 +1,17 @@ import { deprecate } from '../utils/deprecate'; import isArray from '../utils/is-array'; import { createLocal } from '../create/local'; +import { createInvalid } from '../create/valid'; export var prototypeMin = deprecate( 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', function () { var other = createLocal.apply(null, arguments); - return other < this ? this : other; + if (this.isValid() && other.isValid()) { + return other < this ? this : other; + } else { + return createInvalid(); + } } ); @@ -14,7 +19,11 @@ export var prototypeMax = deprecate( 'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', function () { var other = createLocal.apply(null, arguments); - return other > this ? this : other; + if (this.isValid() && other.isValid()) { + return other > this ? this : other; + } else { + return createInvalid(); + } } ); diff --git a/bower_components/moment/src/lib/moment/moment.js b/bower_components/moment/src/lib/moment/moment.js index cf73b9f..12eb5f1 100644 --- a/bower_components/moment/src/lib/moment/moment.js +++ b/bower_components/moment/src/lib/moment/moment.js @@ -3,6 +3,7 @@ import { createUTC } from '../create/utc'; import { createInvalid } from '../create/valid'; import { isMoment } from './constructor'; import { min, max } from './min-max'; +import { now } from './now'; import momentPrototype from './prototype'; function createUnix (input) { @@ -14,6 +15,7 @@ function createInZone () { } export { + now, min, max, isMoment, diff --git a/bower_components/moment/src/lib/moment/now.js b/bower_components/moment/src/lib/moment/now.js new file mode 100644 index 0000000..0f4d0ae --- /dev/null +++ b/bower_components/moment/src/lib/moment/now.js @@ -0,0 +1,3 @@ +export var now = function () { + return Date.now ? Date.now() : +(new Date()); +}; diff --git a/bower_components/moment/src/lib/moment/prototype.js b/bower_components/moment/src/lib/moment/prototype.js index d17f743..3977588 100644 --- a/bower_components/moment/src/lib/moment/prototype.js +++ b/bower_components/moment/src/lib/moment/prototype.js @@ -5,7 +5,7 @@ var proto = Moment.prototype; import { add, subtract } from './add-subtract'; import { calendar } from './calendar'; import { clone } from './clone'; -import { isBefore, isBetween, isSame, isAfter } from './compare'; +import { isBefore, isBetween, isSame, isAfter, isSameOrAfter, isSameOrBefore } from './compare'; import { diff } from './diff'; import { format, toString, toISOString } from './format'; import { from, fromNow } from './from'; @@ -14,43 +14,47 @@ import { getSet } from './get-set'; import { locale, localeData, lang } from './locale'; import { prototypeMin, prototypeMax } from './min-max'; import { startOf, endOf } from './start-end-of'; -import { valueOf, toDate, toArray, toObject, unix } from './to-type'; +import { valueOf, toDate, toArray, toObject, toJSON, unix } from './to-type'; import { isValid, parsingFlags, invalidAt } from './valid'; - -proto.add = add; -proto.calendar = calendar; -proto.clone = clone; -proto.diff = diff; -proto.endOf = endOf; -proto.format = format; -proto.from = from; -proto.fromNow = fromNow; -proto.to = to; -proto.toNow = toNow; -proto.get = getSet; -proto.invalidAt = invalidAt; -proto.isAfter = isAfter; -proto.isBefore = isBefore; -proto.isBetween = isBetween; -proto.isSame = isSame; -proto.isValid = isValid; -proto.lang = lang; -proto.locale = locale; -proto.localeData = localeData; -proto.max = prototypeMax; -proto.min = prototypeMin; -proto.parsingFlags = parsingFlags; -proto.set = getSet; -proto.startOf = startOf; -proto.subtract = subtract; -proto.toArray = toArray; -proto.toObject = toObject; -proto.toDate = toDate; -proto.toISOString = toISOString; -proto.toJSON = toISOString; -proto.toString = toString; -proto.unix = unix; -proto.valueOf = valueOf; +import { creationData } from './creation-data'; + +proto.add = add; +proto.calendar = calendar; +proto.clone = clone; +proto.diff = diff; +proto.endOf = endOf; +proto.format = format; +proto.from = from; +proto.fromNow = fromNow; +proto.to = to; +proto.toNow = toNow; +proto.get = getSet; +proto.invalidAt = invalidAt; +proto.isAfter = isAfter; +proto.isBefore = isBefore; +proto.isBetween = isBetween; +proto.isSame = isSame; +proto.isSameOrAfter = isSameOrAfter; +proto.isSameOrBefore = isSameOrBefore; +proto.isValid = isValid; +proto.lang = lang; +proto.locale = locale; +proto.localeData = localeData; +proto.max = prototypeMax; +proto.min = prototypeMin; +proto.parsingFlags = parsingFlags; +proto.set = getSet; +proto.startOf = startOf; +proto.subtract = subtract; +proto.toArray = toArray; +proto.toObject = toObject; +proto.toDate = toDate; +proto.toISOString = toISOString; +proto.toJSON = toJSON; +proto.toString = toString; +proto.unix = unix; +proto.valueOf = valueOf; +proto.creationData = creationData; // Year import { getSetYear, getIsLeapYear } from '../units/year'; diff --git a/bower_components/moment/src/lib/moment/to-type.js b/bower_components/moment/src/lib/moment/to-type.js index 3008d95..b6787af 100644 --- a/bower_components/moment/src/lib/moment/to-type.js +++ b/bower_components/moment/src/lib/moment/to-type.js @@ -27,3 +27,8 @@ export function toObject () { milliseconds: m.milliseconds() }; } + +export function toJSON () { + // JSON.stringify(new Date(NaN)) === 'null' + return this.isValid() ? this.toISOString() : 'null'; +} diff --git a/bower_components/moment/src/lib/moment/to.js b/bower_components/moment/src/lib/moment/to.js index d9eccfd..7ad667e 100644 --- a/bower_components/moment/src/lib/moment/to.js +++ b/bower_components/moment/src/lib/moment/to.js @@ -1,11 +1,15 @@ import { createDuration } from '../duration/create'; import { createLocal } from '../create/local'; +import { isMoment } from '../moment/constructor'; export function to (time, withoutSuffix) { - if (!this.isValid()) { + if (this.isValid() && + ((isMoment(time) && time.isValid()) || + createLocal(time).isValid())) { + return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); + } else { return this.localeData().invalidDate(); } - return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); } export function toNow (withoutSuffix) { diff --git a/bower_components/moment/src/lib/parse/regex.js b/bower_components/moment/src/lib/parse/regex.js index 9e7d678..b1dc752 100644 --- a/bower_components/moment/src/lib/parse/regex.js +++ b/bower_components/moment/src/lib/parse/regex.js @@ -4,6 +4,8 @@ export var match3 = /\d{3}/; // 000 - 999 export var match4 = /\d{4}/; // 0000 - 9999 export var match6 = /[+-]?\d{6}/; // -999999 - 999999 export var match1to2 = /\d\d?/; // 0 - 99 +export var match3to4 = /\d\d\d\d?/; // 999 - 9999 +export var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999 export var match1to3 = /\d{1,3}/; // 0 - 999 export var match1to4 = /\d{1,4}/; // 0 - 9999 export var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999 @@ -12,25 +14,22 @@ export var matchUnsigned = /\d+/; // 0 - inf export var matchSigned = /[+-]?\d+/; // -inf - inf export var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z +export var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z export var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123 // any word (or two) characters or numbers including two/three word month in arabic. +// includes scottish gaelic two word and hyphenated months export var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i; + import hasOwnProp from '../utils/has-own-prop'; +import isFunction from '../utils/is-function'; var regexes = {}; -function isFunction (sth) { - // https://github.com/moment/moment/issues/2325 - return typeof sth === 'function' && - Object.prototype.toString.call(sth) === '[object Function]'; -} - - export function addRegexToken (token, regex, strictRegex) { - regexes[token] = isFunction(regex) ? regex : function (isStrict) { + regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) { return (isStrict && strictRegex) ? strictRegex : regex; }; } @@ -45,7 +44,11 @@ export function getParseRegexForToken (token, config) { // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript function unescapeFormat(s) { - return s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { + return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { return p1 || p2 || p3 || p4; - }).replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); + })); +} + +export function regexEscape(s) { + return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); } diff --git a/bower_components/moment/src/lib/units/constants.js b/bower_components/moment/src/lib/units/constants.js index 588e70d..70bf1b2 100644 --- a/bower_components/moment/src/lib/units/constants.js +++ b/bower_components/moment/src/lib/units/constants.js @@ -5,3 +5,5 @@ export var HOUR = 3; export var MINUTE = 4; export var SECOND = 5; export var MILLISECOND = 6; +export var WEEK = 7; +export var WEEKDAY = 8; diff --git a/bower_components/moment/src/lib/units/day-of-week.js b/bower_components/moment/src/lib/units/day-of-week.js index a82f126..2f0460a 100644 --- a/bower_components/moment/src/lib/units/day-of-week.js +++ b/bower_components/moment/src/lib/units/day-of-week.js @@ -3,6 +3,7 @@ import { addUnitAlias } from './aliases'; import { addRegexToken, match1to2, matchWord } from '../parse/regex'; import { addWeekParseToken } from '../parse/token'; import toInt from '../utils/to-int'; +import isArray from '../utils/is-array'; import { createLocal } from '../create/local'; import getParsingFlags from '../create/parsing-flags'; @@ -40,8 +41,8 @@ addRegexToken('dd', matchWord); addRegexToken('ddd', matchWord); addRegexToken('dddd', matchWord); -addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config) { - var weekday = config._locale.weekdaysParse(input); +addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { + var weekday = config._locale.weekdaysParse(input, token, config._strict); // if we didn't get a weekday name, mark the date as invalid if (weekday != null) { week.d = weekday; @@ -76,8 +77,9 @@ function parseWeekday(input, locale) { // LOCALES export var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'); -export function localeWeekdays (m) { - return this._weekdays[m.day()]; +export function localeWeekdays (m, format) { + return isArray(this._weekdays) ? this._weekdays[m.day()] : + this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()]; } export var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'); @@ -90,20 +92,37 @@ export function localeWeekdaysMin (m) { return this._weekdaysMin[m.day()]; } -export function localeWeekdaysParse (weekdayName) { +export function localeWeekdaysParse (weekdayName, format, strict) { var i, mom, regex; - this._weekdaysParse = this._weekdaysParse || []; + if (!this._weekdaysParse) { + this._weekdaysParse = []; + this._minWeekdaysParse = []; + this._shortWeekdaysParse = []; + this._fullWeekdaysParse = []; + } for (i = 0; i < 7; i++) { // make the regex if we don't have it already + + mom = createLocal([2000, 1]).day(i); + if (strict && !this._fullWeekdaysParse[i]) { + this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i'); + this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i'); + this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i'); + } if (!this._weekdaysParse[i]) { - mom = createLocal([2000, 1]).day(i); regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex - if (this._weekdaysParse[i].test(weekdayName)) { + if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { return i; } } @@ -112,6 +131,9 @@ export function localeWeekdaysParse (weekdayName) { // MOMENTS export function getSetDayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); if (input != null) { input = parseWeekday(input, this.localeData()); @@ -122,11 +144,17 @@ export function getSetDayOfWeek (input) { } export function getSetLocaleDayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; return input == null ? weekday : this.add(input - weekday, 'd'); } export function getSetISODayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } // behaves the same as moment#day except // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) // as a setter, sunday should belong to the previous week. diff --git a/bower_components/moment/src/lib/units/day-of-year.js b/bower_components/moment/src/lib/units/day-of-year.js index 0c34fa3..62d4de8 100644 --- a/bower_components/moment/src/lib/units/day-of-year.js +++ b/bower_components/moment/src/lib/units/day-of-year.js @@ -24,23 +24,6 @@ addParseToken(['DDD', 'DDDD'], function (input, array, config) { // HELPERS -//http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday -export function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) { - var week1Jan = 6 + firstDayOfWeek - firstDayOfWeekOfYear, janX = createUTCDate(year, 0, 1 + week1Jan), d = janX.getUTCDay(), dayOfYear; - if (d < firstDayOfWeek) { - d += 7; - } - - weekday = weekday != null ? 1 * weekday : firstDayOfWeek; - - dayOfYear = 1 + week1Jan + 7 * (week - 1) - d + weekday; - - return { - year: dayOfYear > 0 ? year : year - 1, - dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear - }; -} - // MOMENTS export function getSetDayOfYear (input) { diff --git a/bower_components/moment/src/lib/units/hour.js b/bower_components/moment/src/lib/units/hour.js index 356c74d..63919de 100644 --- a/bower_components/moment/src/lib/units/hour.js +++ b/bower_components/moment/src/lib/units/hour.js @@ -1,17 +1,38 @@ import { makeGetSet } from '../moment/get-set'; import { addFormatToken } from '../format/format'; import { addUnitAlias } from './aliases'; -import { addRegexToken, match1to2, match2 } from '../parse/regex'; +import { addRegexToken, match1to2, match2, match3to4, match5to6 } from '../parse/regex'; import { addParseToken } from '../parse/token'; -import { HOUR } from './constants'; +import { HOUR, MINUTE, SECOND } from './constants'; import toInt from '../utils/to-int'; +import zeroFill from '../utils/zero-fill'; import getParsingFlags from '../create/parsing-flags'; // FORMATTING -addFormatToken('H', ['HH', 2], 0, 'hour'); -addFormatToken('h', ['hh', 2], 0, function () { +function hFormat() { return this.hours() % 12 || 12; +} + +addFormatToken('H', ['HH', 2], 0, 'hour'); +addFormatToken('h', ['hh', 2], 0, hFormat); + +addFormatToken('hmm', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); +}); + +addFormatToken('hmmss', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + + zeroFill(this.seconds(), 2); +}); + +addFormatToken('Hmm', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2); +}); + +addFormatToken('Hmmss', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2) + + zeroFill(this.seconds(), 2); }); function meridiem (token, lowercase) { @@ -40,6 +61,11 @@ addRegexToken('h', match1to2); addRegexToken('HH', match1to2, match2); addRegexToken('hh', match1to2, match2); +addRegexToken('hmm', match3to4); +addRegexToken('hmmss', match5to6); +addRegexToken('Hmm', match3to4); +addRegexToken('Hmmss', match5to6); + addParseToken(['H', 'HH'], HOUR); addParseToken(['a', 'A'], function (input, array, config) { config._isPm = config._locale.isPM(input); @@ -49,6 +75,32 @@ addParseToken(['h', 'hh'], function (input, array, config) { array[HOUR] = toInt(input); getParsingFlags(config).bigHour = true; }); +addParseToken('hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); + getParsingFlags(config).bigHour = true; +}); +addParseToken('hmmss', function (input, array, config) { + var pos1 = input.length - 4; + var pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); + getParsingFlags(config).bigHour = true; +}); +addParseToken('Hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); +}); +addParseToken('Hmmss', function (input, array, config) { + var pos1 = input.length - 4; + var pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); +}); // LOCALES diff --git a/bower_components/moment/src/lib/units/month.js b/bower_components/moment/src/lib/units/month.js index 63d18b4..60806d6 100644 --- a/bower_components/moment/src/lib/units/month.js +++ b/bower_components/moment/src/lib/units/month.js @@ -1,11 +1,13 @@ import { get } from '../moment/get-set'; +import hasOwnProp from '../utils/has-own-prop'; import { addFormatToken } from '../format/format'; import { addUnitAlias } from './aliases'; -import { addRegexToken, match1to2, match2, matchWord } from '../parse/regex'; +import { addRegexToken, match1to2, match2, matchWord, regexEscape } from '../parse/regex'; import { addParseToken } from '../parse/token'; import { hooks } from '../utils/hooks'; import { MONTH } from './constants'; import toInt from '../utils/to-int'; +import isArray from '../utils/is-array'; import { createUTC } from '../create/utc'; import getParsingFlags from '../create/parsing-flags'; @@ -35,8 +37,12 @@ addUnitAlias('month', 'M'); addRegexToken('M', match1to2); addRegexToken('MM', match1to2, match2); -addRegexToken('MMM', matchWord); -addRegexToken('MMMM', matchWord); +addRegexToken('MMM', function (isStrict, locale) { + return locale.monthsShortRegex(isStrict); +}); +addRegexToken('MMMM', function (isStrict, locale) { + return locale.monthsRegex(isStrict); +}); addParseToken(['M', 'MM'], function (input, array) { array[MONTH] = toInt(input) - 1; @@ -54,14 +60,17 @@ addParseToken(['MMM', 'MMMM'], function (input, array, config, token) { // LOCALES +var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/; export var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'); -export function localeMonths (m) { - return this._months[m.month()]; +export function localeMonths (m, format) { + return isArray(this._months) ? this._months[m.month()] : + this._months[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; } export var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'); -export function localeMonthsShort (m) { - return this._monthsShort[m.month()]; +export function localeMonthsShort (m, format) { + return isArray(this._monthsShort) ? this._monthsShort[m.month()] : + this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; } export function localeMonthsParse (monthName, format, strict) { @@ -100,6 +109,11 @@ export function localeMonthsParse (monthName, format, strict) { export function setMonth (mom, value) { var dayOfMonth; + if (!mom.isValid()) { + // No op + return mom; + } + // TODO: Move this out of here! if (typeof value === 'string') { value = mom.localeData().monthsParse(value); @@ -127,3 +141,69 @@ export function getSetMonth (value) { export function getDaysInMonth () { return daysInMonth(this.year(), this.month()); } + +export var defaultMonthsShortRegex = matchWord; +export function monthsShortRegex (isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, '_monthsRegex')) { + computeMonthsParse.call(this); + } + if (isStrict) { + return this._monthsShortStrictRegex; + } else { + return this._monthsShortRegex; + } + } else { + return this._monthsShortStrictRegex && isStrict ? + this._monthsShortStrictRegex : this._monthsShortRegex; + } +} + +export var defaultMonthsRegex = matchWord; +export function monthsRegex (isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, '_monthsRegex')) { + computeMonthsParse.call(this); + } + if (isStrict) { + return this._monthsStrictRegex; + } else { + return this._monthsRegex; + } + } else { + return this._monthsStrictRegex && isStrict ? + this._monthsStrictRegex : this._monthsRegex; + } +} + +function computeMonthsParse () { + function cmpLenRev(a, b) { + return b.length - a.length; + } + + var shortPieces = [], longPieces = [], mixedPieces = [], + i, mom; + for (i = 0; i < 12; i++) { + // make the regex if we don't have it already + mom = createUTC([2000, i]); + shortPieces.push(this.monthsShort(mom, '')); + longPieces.push(this.months(mom, '')); + mixedPieces.push(this.months(mom, '')); + mixedPieces.push(this.monthsShort(mom, '')); + } + // Sorting makes sure if one month (or abbr) is a prefix of another it + // will match the longer piece. + shortPieces.sort(cmpLenRev); + longPieces.sort(cmpLenRev); + mixedPieces.sort(cmpLenRev); + for (i = 0; i < 12; i++) { + shortPieces[i] = regexEscape(shortPieces[i]); + longPieces[i] = regexEscape(longPieces[i]); + mixedPieces[i] = regexEscape(mixedPieces[i]); + } + + this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); + this._monthsShortRegex = this._monthsRegex; + this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')$', 'i'); + this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')$', 'i'); +} diff --git a/bower_components/moment/src/lib/units/offset.js b/bower_components/moment/src/lib/units/offset.js index 33288c0..8723c87 100644 --- a/bower_components/moment/src/lib/units/offset.js +++ b/bower_components/moment/src/lib/units/offset.js @@ -3,13 +3,14 @@ import { createDuration } from '../duration/create'; import { addSubtract } from '../moment/add-subtract'; import { isMoment, copyConfig } from '../moment/constructor'; import { addFormatToken } from '../format/format'; -import { addRegexToken, matchOffset } from '../parse/regex'; +import { addRegexToken, matchOffset, matchShortOffset } from '../parse/regex'; import { addParseToken } from '../parse/token'; import { createLocal } from '../create/local'; import { prepareConfig } from '../create/from-anything'; import { createUTC } from '../create/utc'; import isDate from '../utils/is-date'; import toInt from '../utils/to-int'; +import isUndefined from '../utils/is-undefined'; import compareArrays from '../utils/compare-arrays'; import { hooks } from '../utils/hooks'; @@ -32,11 +33,11 @@ offset('ZZ', ''); // PARSING -addRegexToken('Z', matchOffset); -addRegexToken('ZZ', matchOffset); +addRegexToken('Z', matchShortOffset); +addRegexToken('ZZ', matchShortOffset); addParseToken(['Z', 'ZZ'], function (input, array, config) { config._useUTC = true; - config._tzm = offsetFromString(input); + config._tzm = offsetFromString(matchShortOffset, input); }); // HELPERS @@ -46,8 +47,8 @@ addParseToken(['Z', 'ZZ'], function (input, array, config) { // '-1530' > ['-15', '30'] var chunkOffset = /([\+\-]|\d\d)/gi; -function offsetFromString(string) { - var matches = ((string || '').match(matchOffset) || []); +function offsetFromString(matcher, string) { + var matches = ((string || '').match(matcher) || []); var chunk = matches[matches.length - 1] || []; var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; var minutes = +(parts[1] * 60) + toInt(parts[2]); @@ -97,11 +98,13 @@ hooks.updateOffset = function () {}; export function getSetOffset (input, keepLocalTime) { var offset = this._offset || 0, localAdjust; + if (!this.isValid()) { + return input != null ? this : NaN; + } if (input != null) { if (typeof input === 'string') { - input = offsetFromString(input); - } - if (Math.abs(input) < 16) { + input = offsetFromString(matchShortOffset, input); + } else if (Math.abs(input) < 16) { input = input * 60; } if (!this._isUTC && keepLocalTime) { @@ -161,12 +164,15 @@ export function setOffsetToParsedOffset () { if (this._tzm) { this.utcOffset(this._tzm); } else if (typeof this._i === 'string') { - this.utcOffset(offsetFromString(this._i)); + this.utcOffset(offsetFromString(matchOffset, this._i)); } return this; } export function hasAlignedHourOffset (input) { + if (!this.isValid()) { + return false; + } input = input ? createLocal(input).utcOffset() : 0; return (this.utcOffset() - input) % 60 === 0; @@ -180,7 +186,7 @@ export function isDaylightSavingTime () { } export function isDaylightSavingTimeShifted () { - if (typeof this._isDSTShifted !== 'undefined') { + if (!isUndefined(this._isDSTShifted)) { return this._isDSTShifted; } @@ -201,13 +207,13 @@ export function isDaylightSavingTimeShifted () { } export function isLocal () { - return !this._isUTC; + return this.isValid() ? !this._isUTC : false; } export function isUtcOffset () { - return this._isUTC; + return this.isValid() ? this._isUTC : false; } export function isUtc () { - return this._isUTC && this._offset === 0; + return this.isValid() ? this._isUTC && this._offset === 0 : false; } diff --git a/bower_components/moment/src/lib/units/quarter.js b/bower_components/moment/src/lib/units/quarter.js index d383f56..78543a6 100644 --- a/bower_components/moment/src/lib/units/quarter.js +++ b/bower_components/moment/src/lib/units/quarter.js @@ -7,7 +7,7 @@ import toInt from '../utils/to-int'; // FORMATTING -addFormatToken('Q', 0, 0, 'quarter'); +addFormatToken('Q', 0, 'Qo', 'quarter'); // ALIASES diff --git a/bower_components/moment/src/lib/units/week-calendar-utils.js b/bower_components/moment/src/lib/units/week-calendar-utils.js new file mode 100644 index 0000000..b89810c --- /dev/null +++ b/bower_components/moment/src/lib/units/week-calendar-utils.js @@ -0,0 +1,65 @@ +import { daysInYear } from './year'; +import { createLocal } from '../create/local'; +import { createUTCDate } from '../create/date-from-array'; + +// start-of-first-week - start-of-year +function firstWeekOffset(year, dow, doy) { + var // first-week day -- which january is always in the first week (4 for iso, 1 for other) + fwd = 7 + dow - doy, + // first-week day local weekday -- which local weekday is fwd + fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; + + return -fwdlw + fwd - 1; +} + +//http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday +export function dayOfYearFromWeeks(year, week, weekday, dow, doy) { + var localWeekday = (7 + weekday - dow) % 7, + weekOffset = firstWeekOffset(year, dow, doy), + dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, + resYear, resDayOfYear; + + if (dayOfYear <= 0) { + resYear = year - 1; + resDayOfYear = daysInYear(resYear) + dayOfYear; + } else if (dayOfYear > daysInYear(year)) { + resYear = year + 1; + resDayOfYear = dayOfYear - daysInYear(year); + } else { + resYear = year; + resDayOfYear = dayOfYear; + } + + return { + year: resYear, + dayOfYear: resDayOfYear + }; +} + +export function weekOfYear(mom, dow, doy) { + var weekOffset = firstWeekOffset(mom.year(), dow, doy), + week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, + resWeek, resYear; + + if (week < 1) { + resYear = mom.year() - 1; + resWeek = week + weeksInYear(resYear, dow, doy); + } else if (week > weeksInYear(mom.year(), dow, doy)) { + resWeek = week - weeksInYear(mom.year(), dow, doy); + resYear = mom.year() + 1; + } else { + resYear = mom.year(); + resWeek = week; + } + + return { + week: resWeek, + year: resYear + }; +} + +export function weeksInYear(year, dow, doy) { + var weekOffset = firstWeekOffset(year, dow, doy), + weekOffsetNext = firstWeekOffset(year + 1, dow, doy); + return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; +} diff --git a/bower_components/moment/src/lib/units/week-year.js b/bower_components/moment/src/lib/units/week-year.js index 8ecfce7..44c4f33 100644 --- a/bower_components/moment/src/lib/units/week-year.js +++ b/bower_components/moment/src/lib/units/week-year.js @@ -2,10 +2,11 @@ import { addFormatToken } from '../format/format'; import { addUnitAlias } from './aliases'; import { addRegexToken, match1to2, match1to4, match1to6, match2, match4, match6, matchSigned } from '../parse/regex'; import { addWeekParseToken } from '../parse/token'; -import { weekOfYear } from './week'; +import { weekOfYear, weeksInYear, dayOfYearFromWeeks } from './week-calendar-utils'; import toInt from '../utils/to-int'; import { hooks } from '../utils/hooks'; import { createLocal } from '../create/local'; +import { createUTCDate } from '../create/date-from-array'; // FORMATTING @@ -50,22 +51,20 @@ addWeekParseToken(['gg', 'GG'], function (input, week, config, token) { week[token] = hooks.parseTwoDigitYear(input); }); -// HELPERS - -function weeksInYear(year, dow, doy) { - return weekOfYear(createLocal([year, 11, 31 + dow - doy]), dow, doy).week; -} - // MOMENTS export function getSetWeekYear (input) { - var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year; - return input == null ? year : this.add((input - year), 'y'); + return getSetWeekYearHelper.call(this, + input, + this.week(), + this.weekday(), + this.localeData()._week.dow, + this.localeData()._week.doy); } export function getSetISOWeekYear (input) { - var year = weekOfYear(this, 1, 4).year; - return input == null ? year : this.add((input - year), 'y'); + return getSetWeekYearHelper.call(this, + input, this.isoWeek(), this.isoWeekday(), 1, 4); } export function getISOWeeksInYear () { @@ -76,3 +75,27 @@ export function getWeeksInYear () { var weekInfo = this.localeData()._week; return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); } + +function getSetWeekYearHelper(input, week, weekday, dow, doy) { + var weeksTarget; + if (input == null) { + return weekOfYear(this, dow, doy).year; + } else { + weeksTarget = weeksInYear(input, dow, doy); + if (week > weeksTarget) { + week = weeksTarget; + } + return setWeekAll.call(this, input, week, weekday, dow, doy); + } +} + +function setWeekAll(weekYear, week, weekday, dow, doy) { + var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), + date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); + + // console.log("got", weekYear, week, weekday, "set", date.toISOString()); + this.year(date.getUTCFullYear()); + this.month(date.getUTCMonth()); + this.date(date.getUTCDate()); + return this; +} diff --git a/bower_components/moment/src/lib/units/week.js b/bower_components/moment/src/lib/units/week.js index 178f6b5..7ea3201 100644 --- a/bower_components/moment/src/lib/units/week.js +++ b/bower_components/moment/src/lib/units/week.js @@ -4,6 +4,7 @@ import { addRegexToken, match1to2, match2 } from '../parse/regex'; import { addWeekParseToken } from '../parse/token'; import toInt from '../utils/to-int'; import { createLocal } from '../create/local'; +import { weekOfYear } from './week-calendar-utils'; // FORMATTING @@ -28,34 +29,6 @@ addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) // HELPERS -// firstDayOfWeek 0 = sun, 6 = sat -// the day of the week that starts the week -// (usually sunday or monday) -// firstDayOfWeekOfYear 0 = sun, 6 = sat -// the first week is the week that contains the first -// of this day of the week -// (eg. ISO weeks use thursday (4)) -export function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) { - var end = firstDayOfWeekOfYear - firstDayOfWeek, - daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(), - adjustedMoment; - - - if (daysToDayOfWeek > end) { - daysToDayOfWeek -= 7; - } - - if (daysToDayOfWeek < end - 7) { - daysToDayOfWeek += 7; - } - - adjustedMoment = createLocal(mom).add(daysToDayOfWeek, 'd'); - return { - week: Math.ceil(adjustedMoment.dayOfYear() / 7), - year: adjustedMoment.year() - }; -} - // LOCALES export function localeWeek (mom) { diff --git a/bower_components/moment/src/lib/units/year.js b/bower_components/moment/src/lib/units/year.js index cc32b55..a09e5e3 100644 --- a/bower_components/moment/src/lib/units/year.js +++ b/bower_components/moment/src/lib/units/year.js @@ -9,6 +9,11 @@ import toInt from '../utils/to-int'; // FORMATTING +addFormatToken('Y', 0, 0, function () { + var y = this.year(); + return y <= 9999 ? '' + y : '+' + y; +}); + addFormatToken(0, ['YY', 2], 0, function () { return this.year() % 100; }); @@ -36,6 +41,9 @@ addParseToken('YYYY', function (input, array) { addParseToken('YY', function (input, array) { array[YEAR] = hooks.parseTwoDigitYear(input); }); +addParseToken('Y', function (input, array) { + array[YEAR] = parseInt(input, 10); +}); // HELPERS diff --git a/bower_components/moment/src/lib/utils/deprecate.js b/bower_components/moment/src/lib/utils/deprecate.js index df4286b..eddcce2 100644 --- a/bower_components/moment/src/lib/utils/deprecate.js +++ b/bower_components/moment/src/lib/utils/deprecate.js @@ -1,8 +1,10 @@ import extend from './extend'; import { hooks } from './hooks'; +import isUndefined from './is-undefined'; function warn(msg) { - if (hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) { + if (hooks.suppressDeprecationWarnings === false && + (typeof console !== 'undefined') && console.warn) { console.warn('Deprecation warning: ' + msg); } } @@ -12,7 +14,7 @@ export function deprecate(msg, fn) { return extend(function () { if (firstTime) { - warn(msg + '\n' + (new Error()).stack); + warn(msg + '\nArguments: ' + Array.prototype.slice.call(arguments).join(', ') + '\n' + (new Error()).stack); firstTime = false; } return fn.apply(this, arguments); @@ -29,4 +31,3 @@ export function deprecateSimple(name, msg) { } hooks.suppressDeprecationWarnings = false; - diff --git a/bower_components/moment/src/lib/utils/is-function.js b/bower_components/moment/src/lib/utils/is-function.js new file mode 100644 index 0000000..12304b1 --- /dev/null +++ b/bower_components/moment/src/lib/utils/is-function.js @@ -0,0 +1,3 @@ +export default function isFunction(input) { + return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; +} diff --git a/bower_components/moment/src/lib/utils/is-undefined.js b/bower_components/moment/src/lib/utils/is-undefined.js new file mode 100644 index 0000000..de57a8b --- /dev/null +++ b/bower_components/moment/src/lib/utils/is-undefined.js @@ -0,0 +1,3 @@ +export default function isUndefined(input) { + return input === void 0; +} diff --git a/bower_components/moment/src/locale/be.js b/bower_components/moment/src/locale/be.js index 54e7e4a..cfdd99f 100644 --- a/bower_components/moment/src/locale/be.js +++ b/bower_components/moment/src/locale/be.js @@ -28,31 +28,18 @@ function relativeTimeWithPlural(number, withoutSuffix, key) { return number + ' ' + plural(format[key], +number); } } -function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_'), - 'accusative': 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_') - }, - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return months[nounCase][m.month()]; -} -function weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'), - 'accusative': 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_') - }, - nounCase = (/\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/).test(format) ? - 'accusative' : - 'nominative'; - return weekdays[nounCase][m.day()]; -} export default moment.defineLocale('be', { - months : monthsCaseReplace, + months : { + format: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_'), + standalone: 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_') + }, monthsShort : 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'), - weekdays : weekdaysCaseReplace, + weekdays : { + format: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_'), + standalone: 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'), + isFormat: /\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/ + }, weekdaysShort : 'нд_пн_ат_ср_чц_пт_сб'.split('_'), weekdaysMin : 'нд_пн_ат_ср_чц_пт_сб'.split('_'), longDateFormat : { diff --git a/bower_components/moment/src/locale/bn.js b/bower_components/moment/src/locale/bn.js index c5893dd..3ab629c 100644 --- a/bower_components/moment/src/locale/bn.js +++ b/bower_components/moment/src/locale/bn.js @@ -32,8 +32,8 @@ numberMap = { export default moment.defineLocale('bn', { months : 'জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split('_'), monthsShort : 'জানু_ফেব_মার্চ_এপর_মে_জুন_জুল_অগ_সেপ্ট_অক্টো_নভ_ডিসেম্'.split('_'), - weekdays : 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রুবার_শনিবার'.split('_'), - weekdaysShort : 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্রু_শনি'.split('_'), + weekdays : 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রবার_শনিবার'.split('_'), + weekdaysShort : 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্র_শনি'.split('_'), weekdaysMin : 'রব_সম_মঙ্গ_বু_ব্রিহ_শু_শনি'.split('_'), longDateFormat : { LT : 'A h:mm সময়', @@ -54,7 +54,7 @@ export default moment.defineLocale('bn', { relativeTime : { future : '%s পরে', past : '%s আগে', - s : 'কএক সেকেন্ড', + s : 'কয়েক সেকেন্ড', m : 'এক মিনিট', mm : '%d মিনিট', h : 'এক ঘন্টা', @@ -76,9 +76,9 @@ export default moment.defineLocale('bn', { return symbolMap[match]; }); }, - meridiemParse: /রাত|সকাল|দুপুর|বিকেল|রাত/, + meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/, isPM: function (input) { - return /^(দুপুর|বিকেল|রাত)$/.test(input); + return /^(দুপুর|বিকাল|রাত)$/.test(input); }, //Bengali is a vast language its spoken //in different forms in various parts of the world. @@ -91,7 +91,7 @@ export default moment.defineLocale('bn', { } else if (hour < 17) { return 'দুপুর'; } else if (hour < 20) { - return 'বিকেল'; + return 'বিকাল'; } else { return 'রাত'; } diff --git a/bower_components/moment/src/locale/ca.js b/bower_components/moment/src/locale/ca.js index d0c1a45..01204ae 100644 --- a/bower_components/moment/src/locale/ca.js +++ b/bower_components/moment/src/locale/ca.js @@ -12,7 +12,7 @@ export default moment.defineLocale('ca', { weekdaysMin : 'Dg_Dl_Dt_Dc_Dj_Dv_Ds'.split('_'), longDateFormat : { LT : 'H:mm', - LTS : 'LT:ss', + LTS : 'H:mm:ss', L : 'DD/MM/YYYY', LL : 'D MMMM YYYY', LLL : 'D MMMM YYYY H:mm', diff --git a/bower_components/moment/src/locale/cs.js b/bower_components/moment/src/locale/cs.js index 57b750b..3f31fde 100644 --- a/bower_components/moment/src/locale/cs.js +++ b/bower_components/moment/src/locale/cs.js @@ -73,6 +73,20 @@ export default moment.defineLocale('cs', { } return _monthsParse; }(months, monthsShort)), + shortMonthsParse : (function (monthsShort) { + var i, _shortMonthsParse = []; + for (i = 0; i < 12; i++) { + _shortMonthsParse[i] = new RegExp('^' + monthsShort[i] + '$', 'i'); + } + return _shortMonthsParse; + }(monthsShort)), + longMonthsParse : (function (months) { + var i, _longMonthsParse = []; + for (i = 0; i < 12; i++) { + _longMonthsParse[i] = new RegExp('^' + months[i] + '$', 'i'); + } + return _longMonthsParse; + }(months)), weekdays : 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'), weekdaysShort : 'ne_po_út_st_čt_pá_so'.split('_'), weekdaysMin : 'ne_po_út_st_čt_pá_so'.split('_'), diff --git a/bower_components/moment/src/locale/de-at.js b/bower_components/moment/src/locale/de-at.js index 5a28e7f..04f213d 100644 --- a/bower_components/moment/src/locale/de-at.js +++ b/bower_components/moment/src/locale/de-at.js @@ -3,6 +3,7 @@ //! author : lluchs : https://github.com/lluchs //! author: Menelion Elensúle: https://github.com/Oire //! author : Martin Groller : https://github.com/MadMG +//! author : Mikolaj Dadela : https://github.com/mik01aj import moment from '../moment'; @@ -35,11 +36,11 @@ export default moment.defineLocale('de-at', { LLLL : 'dddd, D. MMMM YYYY HH:mm' }, calendar : { - sameDay: '[Heute um] LT [Uhr]', + sameDay: '[heute um] LT [Uhr]', sameElse: 'L', - nextDay: '[Morgen um] LT [Uhr]', + nextDay: '[morgen um] LT [Uhr]', nextWeek: 'dddd [um] LT [Uhr]', - lastDay: '[Gestern um] LT [Uhr]', + lastDay: '[gestern um] LT [Uhr]', lastWeek: '[letzten] dddd [um] LT [Uhr]' }, relativeTime : { @@ -64,4 +65,3 @@ export default moment.defineLocale('de-at', { doy : 4 // The week that contains Jan 4th is the first week of the year. } }); - diff --git a/bower_components/moment/src/locale/de.js b/bower_components/moment/src/locale/de.js index 205d683..e16d3fe 100644 --- a/bower_components/moment/src/locale/de.js +++ b/bower_components/moment/src/locale/de.js @@ -2,6 +2,7 @@ //! locale : german (de) //! author : lluchs : https://github.com/lluchs //! author: Menelion Elensúle: https://github.com/Oire +//! author : Mikolaj Dadela : https://github.com/mik01aj import moment from '../moment'; @@ -34,11 +35,11 @@ export default moment.defineLocale('de', { LLLL : 'dddd, D. MMMM YYYY HH:mm' }, calendar : { - sameDay: '[Heute um] LT [Uhr]', + sameDay: '[heute um] LT [Uhr]', sameElse: 'L', - nextDay: '[Morgen um] LT [Uhr]', + nextDay: '[morgen um] LT [Uhr]', nextWeek: 'dddd [um] LT [Uhr]', - lastDay: '[Gestern um] LT [Uhr]', + lastDay: '[gestern um] LT [Uhr]', lastWeek: '[letzten] dddd [um] LT [Uhr]' }, relativeTime : { @@ -63,4 +64,3 @@ export default moment.defineLocale('de', { doy : 4 // The week that contains Jan 4th is the first week of the year. } }); - diff --git a/bower_components/moment/src/locale/dv.js b/bower_components/moment/src/locale/dv.js new file mode 100644 index 0000000..481237f --- /dev/null +++ b/bower_components/moment/src/locale/dv.js @@ -0,0 +1,89 @@ +//! moment.js locale configuration +//! locale : dhivehi (dv) +//! author : Jawish Hameed : https://github.com/jawish + +import moment from '../moment'; + +var months = [ + 'ޖެނުއަރީ', + 'ފެބްރުއަރީ', + 'މާރިޗު', + 'އޭޕްރީލު', + 'މޭ', + 'ޖޫން', + 'ޖުލައި', + 'އޯގަސްޓު', + 'ސެޕްޓެމްބަރު', + 'އޮކްޓޯބަރު', + 'ނޮވެމްބަރު', + 'ޑިސެމްބަރު' +], weekdays = [ + 'އާދިއްތަ', + 'ހޯމަ', + 'އަންގާރަ', + 'ބުދަ', + 'ބުރާސްފަތި', + 'ހުކުރު', + 'ހޮނިހިރު' +]; + +export default moment.defineLocale('dv', { + months : months, + monthsShort : months, + weekdays : weekdays, + weekdaysShort : weekdays, + weekdaysMin : 'އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި'.split('_'), + longDateFormat : { + + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'D/M/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd D MMMM YYYY HH:mm' + }, + meridiemParse: /މކ|މފ/, + isPM : function (input) { + return '' === input; + }, + meridiem : function (hour, minute, isLower) { + if (hour < 12) { + return 'މކ'; + } else { + return 'މފ'; + } + }, + calendar : { + sameDay : '[މިއަދު] LT', + nextDay : '[މާދަމާ] LT', + nextWeek : 'dddd LT', + lastDay : '[އިއްޔެ] LT', + lastWeek : '[ފާއިތުވި] dddd LT', + sameElse : 'L' + }, + relativeTime : { + future : 'ތެރޭގައި %s', + past : 'ކުރިން %s', + s : 'ސިކުންތުކޮޅެއް', + m : 'މިނިޓެއް', + mm : 'މިނިޓު %d', + h : 'ގަޑިއިރެއް', + hh : 'ގަޑިއިރު %d', + d : 'ދުވަހެއް', + dd : 'ދުވަސް %d', + M : 'މަހެއް', + MM : 'މަސް %d', + y : 'އަހަރެއް', + yy : 'އަހަރު %d' + }, + preparse: function (string) { + return string.replace(/،/g, ','); + }, + postformat: function (string) { + return string.replace(/,/g, '،'); + }, + week : { + dow : 7, // Sunday is the first day of the week. + doy : 12 // The week that contains Jan 1st is the first week of the year. + } +}); diff --git a/bower_components/moment/src/locale/el.js b/bower_components/moment/src/locale/el.js index 83a3421..2722062 100644 --- a/bower_components/moment/src/locale/el.js +++ b/bower_components/moment/src/locale/el.js @@ -3,6 +3,7 @@ //! author : Aggelos Karalias : https://github.com/mehiel import moment from '../moment'; +import isFunction from '../lib/utils/is-function'; export default moment.defineLocale('el', { monthsNominativeEl : 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split('_'), @@ -55,7 +56,7 @@ export default moment.defineLocale('el', { calendar : function (key, mom) { var output = this._calendarEl[key], hours = mom && mom.hours(); - if (typeof output === 'function') { + if (isFunction(output)) { output = output.apply(mom); } return output.replace('{}', (hours % 12 === 1 ? 'στη' : 'στις')); diff --git a/bower_components/moment/src/locale/en-ie.js b/bower_components/moment/src/locale/en-ie.js new file mode 100644 index 0000000..cb3ae8f --- /dev/null +++ b/bower_components/moment/src/locale/en-ie.js @@ -0,0 +1,58 @@ +//! moment.js locale configuration +//! locale : Irish english (en-ie) +//! author : Chris Cartlidge : https://github.com/chriscartlidge + +import moment from '../moment'; + +export default moment.defineLocale('en-ie', { + months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), + monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), + weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), + weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD-MM-YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd D MMMM YYYY HH:mm' + }, + calendar : { + sameDay : '[Today at] LT', + nextDay : '[Tomorrow at] LT', + nextWeek : 'dddd [at] LT', + lastDay : '[Yesterday at] LT', + lastWeek : '[Last] dddd [at] LT', + sameElse : 'L' + }, + relativeTime : { + future : 'in %s', + past : '%s ago', + s : 'a few seconds', + m : 'a minute', + mm : '%d minutes', + h : 'an hour', + hh : '%d hours', + d : 'a day', + dd : '%d days', + M : 'a month', + MM : '%d months', + y : 'a year', + yy : '%d years' + }, + ordinalParse: /\d{1,2}(st|nd|rd|th)/, + ordinal : function (number) { + var b = number % 10, + output = (~~(number % 100 / 10) === 1) ? 'th' : + (b === 1) ? 'st' : + (b === 2) ? 'nd' : + (b === 3) ? 'rd' : 'th'; + return number + output; + }, + week : { + dow : 1, // Monday is the first day of the week. + doy : 4 // The week that contains Jan 4th is the first week of the year. + } +}); + diff --git a/bower_components/moment/src/locale/en-nz.js b/bower_components/moment/src/locale/en-nz.js new file mode 100644 index 0000000..c6e9f18 --- /dev/null +++ b/bower_components/moment/src/locale/en-nz.js @@ -0,0 +1,56 @@ +//! moment.js locale configuration +//! locale : New Zealand english (en-nz) + +import moment from '../moment'; + +export default moment.defineLocale('en-nz', { + months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), + monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), + weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), + weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), + longDateFormat : { + LT : 'h:mm A', + LTS : 'h:mm:ss A', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY h:mm A', + LLLL : 'dddd, D MMMM YYYY h:mm A' + }, + calendar : { + sameDay : '[Today at] LT', + nextDay : '[Tomorrow at] LT', + nextWeek : 'dddd [at] LT', + lastDay : '[Yesterday at] LT', + lastWeek : '[Last] dddd [at] LT', + sameElse : 'L' + }, + relativeTime : { + future : 'in %s', + past : '%s ago', + s : 'a few seconds', + m : 'a minute', + mm : '%d minutes', + h : 'an hour', + hh : '%d hours', + d : 'a day', + dd : '%d days', + M : 'a month', + MM : '%d months', + y : 'a year', + yy : '%d years' + }, + ordinalParse: /\d{1,2}(st|nd|rd|th)/, + ordinal : function (number) { + var b = number % 10, + output = (~~(number % 100 / 10) === 1) ? 'th' : + (b === 1) ? 'st' : + (b === 2) ? 'nd' : + (b === 3) ? 'rd' : 'th'; + return number + output; + }, + week : { + dow : 1, // Monday is the first day of the week. + doy : 4 // The week that contains Jan 4th is the first week of the year. + } +}); diff --git a/bower_components/moment/src/locale/es.js b/bower_components/moment/src/locale/es.js index f9faafe..47d5def 100644 --- a/bower_components/moment/src/locale/es.js +++ b/bower_components/moment/src/locale/es.js @@ -4,11 +4,11 @@ import moment from '../moment'; -var monthsShortDot = 'Ene._Feb._Mar._Abr._May._Jun._Jul._Ago._Sep._Oct._Nov._Dic.'.split('_'), - monthsShort = 'Ene_Feb_Mar_Abr_May_Jun_Jul_Ago_Sep_Oct_Nov_Dic'.split('_'); +var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'), + monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'); export default moment.defineLocale('es', { - months : 'Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre'.split('_'), + months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'), monthsShort : function (m, format) { if (/-MMM-/.test(format)) { return monthsShort[m.month()]; @@ -16,9 +16,9 @@ export default moment.defineLocale('es', { return monthsShortDot[m.month()]; } }, - weekdays : 'Domingo_Lunes_Martes_Miércoles_Jueves_Viernes_Sábado'.split('_'), - weekdaysShort : 'Dom._Lun._Mar._Mié._Jue._Vie._Sáb.'.split('_'), - weekdaysMin : 'Do_Lu_Ma_Mi_Ju_Vi_Sá'.split('_'), + weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), + weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), + weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'), longDateFormat : { LT : 'H:mm', LTS : 'H:mm:ss', diff --git a/bower_components/moment/src/locale/fr-ch.js b/bower_components/moment/src/locale/fr-ch.js new file mode 100644 index 0000000..3534365 --- /dev/null +++ b/bower_components/moment/src/locale/fr-ch.js @@ -0,0 +1,53 @@ +//! moment.js locale configuration +//! locale : swiss french (fr) +//! author : Gaspard Bucher : https://github.com/gaspard + +import moment from '../moment'; + +export default moment.defineLocale('fr-ch', { + months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'), + monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'), + weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), + weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), + weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd D MMMM YYYY HH:mm' + }, + calendar : { + sameDay: '[Aujourd\'hui à] LT', + nextDay: '[Demain à] LT', + nextWeek: 'dddd [à] LT', + lastDay: '[Hier à] LT', + lastWeek: 'dddd [dernier à] LT', + sameElse: 'L' + }, + relativeTime : { + future : 'dans %s', + past : 'il y a %s', + s : 'quelques secondes', + m : 'une minute', + mm : '%d minutes', + h : 'une heure', + hh : '%d heures', + d : 'un jour', + dd : '%d jours', + M : 'un mois', + MM : '%d mois', + y : 'un an', + yy : '%d ans' + }, + ordinalParse: /\d{1,2}(er|e)/, + ordinal : function (number) { + return number + (number === 1 ? 'er' : 'e'); + }, + week : { + dow : 1, // Monday is the first day of the week. + doy : 4 // The week that contains Jan 4th is the first week of the year. + } +}); + diff --git a/bower_components/moment/src/locale/gd.js b/bower_components/moment/src/locale/gd.js new file mode 100644 index 0000000..b7689f9 --- /dev/null +++ b/bower_components/moment/src/locale/gd.js @@ -0,0 +1,67 @@ +//! moment.js locale configuration +//! locale : great britain scottish gealic (gd) +//! author : Jon Ashdown : https://github.com/jonashdown + +import moment from '../moment'; + +var months = [ + 'Am Faoilleach', 'An Gearran', 'Am Màrt', 'An Giblean', 'An Cèitean', 'An t-Ògmhios', 'An t-Iuchar', 'An Lùnastal', 'An t-Sultain', 'An Dàmhair', 'An t-Samhain', 'An Dùbhlachd' +]; + +var monthsShort = ['Faoi', 'Gear', 'Màrt', 'Gibl', 'Cèit', 'Ògmh', 'Iuch', 'Lùn', 'Sult', 'Dàmh', 'Samh', 'Dùbh']; + +var weekdays = ['Didòmhnaich', 'Diluain', 'Dimàirt', 'Diciadain', 'Diardaoin', 'Dihaoine', 'Disathairne']; + +var weekdaysShort = ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis']; + +var weekdaysMin = ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa']; + +export default moment.defineLocale('gd', { + months : months, + monthsShort : monthsShort, + monthsParseExact : true, + weekdays : weekdays, + weekdaysShort : weekdaysShort, + weekdaysMin : weekdaysMin, + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd, D MMMM YYYY HH:mm' + }, + calendar : { + sameDay : '[An-diugh aig] LT', + nextDay : '[A-màireach aig] LT', + nextWeek : 'dddd [aig] LT', + lastDay : '[An-dè aig] LT', + lastWeek : 'dddd [seo chaidh] [aig] LT', + sameElse : 'L' + }, + relativeTime : { + future : 'ann an %s', + past : 'bho chionn %s', + s : 'beagan diogan', + m : 'mionaid', + mm : '%d mionaidean', + h : 'uair', + hh : '%d uairean', + d : 'latha', + dd : '%d latha', + M : 'mìos', + MM : '%d mìosan', + y : 'bliadhna', + yy : '%d bliadhna' + }, + ordinalParse : /\d{1,2}(d|na|mh)/, + ordinal : function (number) { + var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh'; + return number + output; + }, + week : { + dow : 1, // Monday is the first day of the week. + doy : 4 // The week that contains Jan 4th is the first week of the year. + } +}); + diff --git a/bower_components/moment/src/locale/hr.js b/bower_components/moment/src/locale/hr.js index 5dd529a..dc79287 100644 --- a/bower_components/moment/src/locale/hr.js +++ b/bower_components/moment/src/locale/hr.js @@ -58,7 +58,10 @@ function translate(number, withoutSuffix, key) { } export default moment.defineLocale('hr', { - months : 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_'), + months : { + format: 'siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca'.split('_'), + standalone: 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_') + }, monthsShort : 'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split('_'), weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'), weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'), diff --git a/bower_components/moment/src/locale/hy-am.js b/bower_components/moment/src/locale/hy-am.js index dd78e6a..7b5cc2b 100644 --- a/bower_components/moment/src/locale/hy-am.js +++ b/bower_components/moment/src/locale/hy-am.js @@ -4,29 +4,13 @@ import moment from '../moment'; -function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_'), - 'accusative': 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_') - }, - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return months[nounCase][m.month()]; -} -function monthsShortCaseReplace(m, format) { - var monthsShort = 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'); - return monthsShort[m.month()]; -} -function weekdaysCaseReplace(m, format) { - var weekdays = 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_'); - return weekdays[m.day()]; -} - export default moment.defineLocale('hy-am', { - months : monthsCaseReplace, - monthsShort : monthsShortCaseReplace, - weekdays : weekdaysCaseReplace, + months : { + format: 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_'), + standalone: 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_') + }, + monthsShort : 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'), + weekdays : 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_'), weekdaysShort : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'), weekdaysMin : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'), longDateFormat : { diff --git a/bower_components/moment/src/locale/it.js b/bower_components/moment/src/locale/it.js index d2d764c..4875112 100644 --- a/bower_components/moment/src/locale/it.js +++ b/bower_components/moment/src/locale/it.js @@ -10,7 +10,7 @@ export default moment.defineLocale('it', { monthsShort : 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'), weekdays : 'Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato'.split('_'), weekdaysShort : 'Dom_Lun_Mar_Mer_Gio_Ven_Sab'.split('_'), - weekdaysMin : 'D_L_Ma_Me_G_V_S'.split('_'), + weekdaysMin : 'Do_Lu_Ma_Me_Gi_Ve_Sa'.split('_'), longDateFormat : { LT : 'HH:mm', LTS : 'HH:mm:ss', diff --git a/bower_components/moment/src/locale/ka.js b/bower_components/moment/src/locale/ka.js index b1454b8..a540f30 100644 --- a/bower_components/moment/src/locale/ka.js +++ b/bower_components/moment/src/locale/ka.js @@ -4,31 +4,17 @@ import moment from '../moment'; -function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'), - 'accusative': 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_') - }, - nounCase = (/D[oD] *MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return months[nounCase][m.month()]; -} -function weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'), - 'accusative': 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_') - }, - nounCase = (/(წინა|შემდეგ)/).test(format) ? - 'accusative' : - 'nominative'; - return weekdays[nounCase][m.day()]; -} - export default moment.defineLocale('ka', { - months : monthsCaseReplace, + months : { + standalone: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'), + format: 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_') + }, monthsShort : 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'), - weekdays : weekdaysCaseReplace, + weekdays : { + standalone: 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'), + format: 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_'), + isFormat: /(წინა|შემდეგ)/ + }, weekdaysShort : 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'), weekdaysMin : 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'), longDateFormat : { diff --git a/bower_components/moment/src/locale/kk.js b/bower_components/moment/src/locale/kk.js new file mode 100644 index 0000000..3517ab4 --- /dev/null +++ b/bower_components/moment/src/locale/kk.js @@ -0,0 +1,77 @@ +//! moment.js locale configuration +//! locale : kazakh (kk) +//! authors : Nurlan Rakhimzhanov : https://github.com/nurlan + +import moment from '../moment'; + +var suffixes = { + 0: '-ші', + 1: '-ші', + 2: '-ші', + 3: '-ші', + 4: '-ші', + 5: '-ші', + 6: '-шы', + 7: '-ші', + 8: '-ші', + 9: '-шы', + 10: '-шы', + 20: '-шы', + 30: '-шы', + 40: '-шы', + 50: '-ші', + 60: '-шы', + 70: '-ші', + 80: '-ші', + 90: '-шы', + 100: '-ші' +}; + +export default moment.defineLocale('kk', { + months : 'Қаңтар_Ақпан_Наурыз_Сәуір_Мамыр_Маусым_Шілде_Тамыз_Қыркүйек_Қазан_Қараша_Желтоқсан'.split('_'), + monthsShort : 'Қаң_Ақп_Нау_Сәу_Мам_Мау_Шіл_Там_Қыр_Қаз_Қар_Жел'.split('_'), + weekdays : 'Жексенбі_Дүйсенбі_Сейсенбі_Сәрсенбі_Бейсенбі_Жұма_Сенбі'.split('_'), + weekdaysShort : 'Жек_Дүй_Сей_Сәр_Бей_Жұм_Сен'.split('_'), + weekdaysMin : 'Жк_Дй_Сй_Ср_Бй_Жм_Сн'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd, D MMMM YYYY HH:mm' + }, + calendar : { + sameDay : '[Бүгін сағат] LT', + nextDay : '[Ертең сағат] LT', + nextWeek : 'dddd [сағат] LT', + lastDay : '[Кеше сағат] LT', + lastWeek : '[Өткен аптаның] dddd [сағат] LT', + sameElse : 'L' + }, + relativeTime : { + future : '%s ішінде', + past : '%s бұрын', + s : 'бірнеше секунд', + m : 'бір минут', + mm : '%d минут', + h : 'бір сағат', + hh : '%d сағат', + d : 'бір күн', + dd : '%d күн', + M : 'бір ай', + MM : '%d ай', + y : 'бір жыл', + yy : '%d жыл' + }, + ordinalParse: /\d{1,2}-(ші|шы)/, + ordinal : function (number) { + var a = number % 10, + b = number >= 100 ? 100 : null; + return number + (suffixes[number] || suffixes[a] || suffixes[b]); + }, + week : { + dow : 1, // Monday is the first day of the week. + doy : 7 // The week that contains Jan 1st is the first week of the year. + } +}); diff --git a/bower_components/moment/src/locale/km.js b/bower_components/moment/src/locale/km.js index 389d1f6..0d85f3f 100644 --- a/bower_components/moment/src/locale/km.js +++ b/bower_components/moment/src/locale/km.js @@ -19,7 +19,7 @@ export default moment.defineLocale('km', { LLLL: 'dddd, D MMMM YYYY HH:mm' }, calendar: { - sameDay: '[ថ្ងៃនៈ ម៉ោង] LT', + sameDay: '[ថ្ងៃនេះ ម៉ោង] LT', nextDay: '[ស្អែក ម៉ោង] LT', nextWeek: 'dddd [ម៉ោង] LT', lastDay: '[ម្សិលមិញ ម៉ោង] LT', diff --git a/bower_components/moment/src/locale/lo.js b/bower_components/moment/src/locale/lo.js new file mode 100644 index 0000000..aed4f46 --- /dev/null +++ b/bower_components/moment/src/locale/lo.js @@ -0,0 +1,60 @@ +//! moment.js locale configuration +//! locale : lao (lo) +//! author : Ryan Hart : https://github.com/ryanhart2 + +import moment from '../moment'; + +export default moment.defineLocale('lo', { + months : 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'), + monthsShort : 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'), + weekdays : 'ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'), + weekdaysShort : 'ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'), + weekdaysMin : 'ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'ວັນdddd D MMMM YYYY HH:mm' + }, + meridiemParse: /ຕອນເຊົ້າ|ຕອນແລງ/, + isPM: function (input) { + return input === 'ຕອນແລງ'; + }, + meridiem : function (hour, minute, isLower) { + if (hour < 12) { + return 'ຕອນເຊົ້າ'; + } else { + return 'ຕອນແລງ'; + } + }, + calendar : { + sameDay : '[ມື້ນີ້ເວລາ] LT', + nextDay : '[ມື້ອື່ນເວລາ] LT', + nextWeek : '[ວັນ]dddd[ໜ້າເວລາ] LT', + lastDay : '[ມື້ວານນີ້ເວລາ] LT', + lastWeek : '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT', + sameElse : 'L' + }, + relativeTime : { + future : 'ອີກ %s', + past : '%sຜ່ານມາ', + s : 'ບໍ່ເທົ່າໃດວິນາທີ', + m : '1 ນາທີ', + mm : '%d ນາທີ', + h : '1 ຊົ່ວໂມງ', + hh : '%d ຊົ່ວໂມງ', + d : '1 ມື້', + dd : '%d ມື້', + M : '1 ເດືອນ', + MM : '%d ເດືອນ', + y : '1 ປີ', + yy : '%d ປີ' + }, + ordinalParse: /(ທີ່)\d{1,2}/, + ordinal : function (number) { + return 'ທີ່' + number; + } +}); + diff --git a/bower_components/moment/src/locale/lt.js b/bower_components/moment/src/locale/lt.js index 6487c68..81e7e81 100644 --- a/bower_components/moment/src/locale/lt.js +++ b/bower_components/moment/src/locale/lt.js @@ -15,8 +15,7 @@ var units = { 'MM': 'mėnesiai_mėnesių_mėnesius', 'y' : 'metai_metų_metus', 'yy': 'metai_metų_metus' -}, -weekDays = 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_'); +}; function translateSeconds(number, withoutSuffix, key, isFuture) { if (withoutSuffix) { return 'kelios sekundės'; @@ -24,16 +23,6 @@ function translateSeconds(number, withoutSuffix, key, isFuture) { return isFuture ? 'kelių sekundžių' : 'kelias sekundes'; } } -function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split('_'), - 'accusative': 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_') - }, - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return months[nounCase][m.month()]; -} function translateSingular(number, withoutSuffix, key, isFuture) { return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]); } @@ -57,16 +46,17 @@ function translate(number, withoutSuffix, key, isFuture) { } } } -function relativeWeekDay(moment, format) { - var nominative = format.indexOf('dddd HH:mm') === -1, - weekDay = weekDays[moment.day()]; - return nominative ? weekDay : weekDay.substring(0, weekDay.length - 2) + 'į'; -} - export default moment.defineLocale('lt', { - months : monthsCaseReplace, + months : { + format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_'), + standalone: 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split('_') + }, monthsShort : 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'), - weekdays : relativeWeekDay, + weekdays : { + format: 'sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį'.split('_'), + standalone: 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_'), + isFormat: /dddd HH:mm/ + }, weekdaysShort : 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'), weekdaysMin : 'S_P_A_T_K_Pn_Š'.split('_'), longDateFormat : { diff --git a/bower_components/moment/src/locale/mk.js b/bower_components/moment/src/locale/mk.js index 3d2bb93..ce820e6 100644 --- a/bower_components/moment/src/locale/mk.js +++ b/bower_components/moment/src/locale/mk.js @@ -21,19 +21,19 @@ export default moment.defineLocale('mk', { calendar : { sameDay : '[Денес во] LT', nextDay : '[Утре во] LT', - nextWeek : 'dddd [во] LT', + nextWeek : '[Во] dddd [во] LT', lastDay : '[Вчера во] LT', lastWeek : function () { switch (this.day()) { case 0: case 3: case 6: - return '[Во изминатата] dddd [во] LT'; + return '[Изминатата] dddd [во] LT'; case 1: case 2: case 4: case 5: - return '[Во изминатиот] dddd [во] LT'; + return '[Изминатиот] dddd [во] LT'; } }, sameElse : 'L' diff --git a/bower_components/moment/src/locale/mr.js b/bower_components/moment/src/locale/mr.js index 7a2b8e0..dda9aaa 100644 --- a/bower_components/moment/src/locale/mr.js +++ b/bower_components/moment/src/locale/mr.js @@ -1,6 +1,7 @@ //! moment.js locale configuration //! locale : Marathi (mr) //! author : Harshad Kale : https://github.com/kalehv +//! author : Vivek Athalye : https://github.com/vnathalye import moment from '../moment'; @@ -29,6 +30,42 @@ numberMap = { '०': '0' }; +function relativeTimeMr(number, withoutSuffix, string, isFuture) +{ + var output = ''; + if (withoutSuffix) { + switch (string) { + case 's': output = 'काही सेकंद'; break; + case 'm': output = 'एक मिनिट'; break; + case 'mm': output = '%d मिनिटे'; break; + case 'h': output = 'एक तास'; break; + case 'hh': output = '%d तास'; break; + case 'd': output = 'एक दिवस'; break; + case 'dd': output = '%d दिवस'; break; + case 'M': output = 'एक महिना'; break; + case 'MM': output = '%d महिने'; break; + case 'y': output = 'एक वर्ष'; break; + case 'yy': output = '%d वर्षे'; break; + } + } + else { + switch (string) { + case 's': output = 'काही सेकंदां'; break; + case 'm': output = 'एका मिनिटा'; break; + case 'mm': output = '%d मिनिटां'; break; + case 'h': output = 'एका तासा'; break; + case 'hh': output = '%d तासां'; break; + case 'd': output = 'एका दिवसा'; break; + case 'dd': output = '%d दिवसां'; break; + case 'M': output = 'एका महिन्या'; break; + case 'MM': output = '%d महिन्यां'; break; + case 'y': output = 'एका वर्षा'; break; + case 'yy': output = '%d वर्षां'; break; + } + } + return output.replace(/%d/i, number); +} + export default moment.defineLocale('mr', { months : 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split('_'), monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split('_'), @@ -52,19 +89,19 @@ export default moment.defineLocale('mr', { sameElse : 'L' }, relativeTime : { - future : '%s नंतर', - past : '%s पूर्वी', - s : 'सेकंद', - m: 'एक मिनिट', - mm: '%d मिनिटे', - h : 'एक तास', - hh : '%d तास', - d : 'एक दिवस', - dd : '%d दिवस', - M : 'एक महिना', - MM : '%d महिने', - y : 'एक वर्ष', - yy : '%d वर्षे' + future: '%sमध्ये', + past: '%sपूर्वी', + s: relativeTimeMr, + m: relativeTimeMr, + mm: relativeTimeMr, + h: relativeTimeMr, + hh: relativeTimeMr, + d: relativeTimeMr, + dd: relativeTimeMr, + M: relativeTimeMr, + MM: relativeTimeMr, + y: relativeTimeMr, + yy: relativeTimeMr }, preparse: function (string) { return string.replace(/[१२३४५६७८९०]/g, function (match) { diff --git a/bower_components/moment/src/locale/nb.js b/bower_components/moment/src/locale/nb.js index d5f15a9..8595f01 100644 --- a/bower_components/moment/src/locale/nb.js +++ b/bower_components/moment/src/locale/nb.js @@ -7,17 +7,17 @@ import moment from '../moment'; export default moment.defineLocale('nb', { months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'), - monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'), + monthsShort : 'jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.'.split('_'), weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'), - weekdaysShort : 'søn_man_tirs_ons_tors_fre_lør'.split('_'), + weekdaysShort : 'sø._ma._ti._on._to._fr._lø.'.split('_'), weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'), longDateFormat : { - LT : 'H.mm', - LTS : 'H.mm.ss', + LT : 'HH:mm', + LTS : 'HH:mm:ss', L : 'DD.MM.YYYY', LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY [kl.] H.mm', - LLLL : 'dddd D. MMMM YYYY [kl.] H.mm' + LLL : 'D. MMMM YYYY [kl.] HH:mm', + LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm' }, calendar : { sameDay: '[i dag kl.] LT', diff --git a/bower_components/moment/src/locale/ne.js b/bower_components/moment/src/locale/ne.js index e229357..e2bc455 100644 --- a/bower_components/moment/src/locale/ne.js +++ b/bower_components/moment/src/locale/ne.js @@ -34,7 +34,7 @@ export default moment.defineLocale('ne', { monthsShort : 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split('_'), weekdays : 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split('_'), weekdaysShort : 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'), - weekdaysMin : 'आइ._सो._मङ्_बु._बि._शु._श.'.split('_'), + weekdaysMin : 'आ._सो._मं._बु._बि._शु._श.'.split('_'), longDateFormat : { LT : 'Aको h:mm बजे', LTS : 'Aको h:mm:ss बजे', @@ -53,39 +53,37 @@ export default moment.defineLocale('ne', { return symbolMap[match]; }); }, - meridiemParse: /राती|बिहान|दिउँसो|बेलुका|साँझ|राती/, + meridiemParse: /राति|बिहान|दिउँसो|साँझ/, meridiemHour : function (hour, meridiem) { if (hour === 12) { hour = 0; } - if (meridiem === 'राती') { - return hour < 3 ? hour : hour + 12; + if (meridiem === 'राति') { + return hour < 4 ? hour : hour + 12; } else if (meridiem === 'बिहान') { return hour; } else if (meridiem === 'दिउँसो') { return hour >= 10 ? hour : hour + 12; - } else if (meridiem === 'बेलुका' || meridiem === 'साँझ') { + } else if (meridiem === 'साँझ') { return hour + 12; } }, meridiem : function (hour, minute, isLower) { if (hour < 3) { - return 'राती'; - } else if (hour < 10) { + return 'राति'; + } else if (hour < 12) { return 'बिहान'; - } else if (hour < 15) { + } else if (hour < 16) { return 'दिउँसो'; - } else if (hour < 18) { - return 'बेलुका'; } else if (hour < 20) { return 'साँझ'; } else { - return 'राती'; + return 'राति'; } }, calendar : { sameDay : '[आज] LT', - nextDay : '[भोली] LT', + nextDay : '[भोलि] LT', nextWeek : '[आउँदो] dddd[,] LT', lastDay : '[हिजो] LT', lastWeek : '[गएको] dddd[,] LT', @@ -93,8 +91,8 @@ export default moment.defineLocale('ne', { }, relativeTime : { future : '%sमा', - past : '%s अगाडी', - s : 'केही समय', + past : '%s अगाडि', + s : 'केही क्षण', m : 'एक मिनेट', mm : '%d मिनेट', h : 'एक घण्टा', @@ -107,8 +105,8 @@ export default moment.defineLocale('ne', { yy : '%d बर्ष' }, week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. + dow : 0, // Sunday is the first day of the week. + doy : 6 // The week that contains Jan 1st is the first week of the year. } }); diff --git a/bower_components/moment/src/locale/nn.js b/bower_components/moment/src/locale/nn.js index 3f284b3..822a44c 100644 --- a/bower_components/moment/src/locale/nn.js +++ b/bower_components/moment/src/locale/nn.js @@ -14,9 +14,9 @@ export default moment.defineLocale('nn', { LT : 'HH:mm', LTS : 'HH:mm:ss', L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' + LL : 'D. MMMM YYYY', + LLL : 'D. MMMM YYYY [kl.] H:mm', + LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm' }, calendar : { sameDay: '[I dag klokka] LT', diff --git a/bower_components/moment/src/locale/pl.js b/bower_components/moment/src/locale/pl.js index e6a3a5a..fde1bb2 100644 --- a/bower_components/moment/src/locale/pl.js +++ b/bower_components/moment/src/locale/pl.js @@ -43,7 +43,7 @@ export default moment.defineLocale('pl', { monthsShort : 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'), weekdays : 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'), weekdaysShort : 'nie_pon_wt_śr_czw_pt_sb'.split('_'), - weekdaysMin : 'N_Pn_Wt_Śr_Cz_Pt_So'.split('_'), + weekdaysMin : 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'), longDateFormat : { LT : 'HH:mm', LTS : 'HH:mm:ss', diff --git a/bower_components/moment/src/locale/ru.js b/bower_components/moment/src/locale/ru.js index 0687888..e9f0635 100644 --- a/bower_components/moment/src/locale/ru.js +++ b/bower_components/moment/src/locale/ru.js @@ -24,44 +24,27 @@ function relativeTimeWithPlural(number, withoutSuffix, key) { return number + ' ' + plural(format[key], +number); } } -function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'), - 'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_') +var monthsParse = [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[й|я]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i]; + +export default moment.defineLocale('ru', { + months : { + format: 'Января_Февраля_Марта_Апреля_Мая_Июня_Июля_Августа_Сентября_Октября_Ноября_Декабря'.split('_'), + standalone: 'Январь_Февраль_Март_Апрель_Май_Июнь_Июль_Август_Сентябрь_Октябрь_Ноябрь_Декабрь'.split('_') }, - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return months[nounCase][m.month()]; -} -function monthsShortCaseReplace(m, format) { - var monthsShort = { - 'nominative': 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'), - 'accusative': 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_') + monthsShort : { + format: 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_'), + standalone: 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_') }, - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return monthsShort[nounCase][m.month()]; -} -function weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'), - 'accusative': 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_') + weekdays : { + standalone: 'Воскресенье_Понедельник_Вторник_Среда_Четверг_Пятница_Суббота'.split('_'), + format: 'Воскресенье_Понедельник_Вторник_Среду_Четверг_Пятницу_Субботу'.split('_'), + isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/ }, - nounCase = (/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/).test(format) ? - 'accusative' : - 'nominative'; - return weekdays[nounCase][m.day()]; -} - -export default moment.defineLocale('ru', { - months : monthsCaseReplace, - monthsShort : monthsShortCaseReplace, - weekdays : weekdaysCaseReplace, - weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'), - weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'), - monthsParse : [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[й|я]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i], + weekdaysShort : 'Вс_Пн_Вт_Ср_Чт_Пт_Сб'.split('_'), + weekdaysMin : 'Вс_Пн_Вт_Ср_Чт_Пт_Сб'.split('_'), + monthsParse : monthsParse, + longMonthsParse : monthsParse, + shortMonthsParse : monthsParse, longDateFormat : { LT : 'HH:mm', LTS : 'HH:mm:ss', @@ -74,8 +57,27 @@ export default moment.defineLocale('ru', { sameDay: '[Сегодня в] LT', nextDay: '[Завтра в] LT', lastDay: '[Вчера в] LT', - nextWeek: function () { - return this.day() === 2 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT'; + nextWeek: function (now) { + if (now.week() !== this.week()) { + switch (this.day()) { + case 0: + return '[В следующее] dddd [в] LT'; + case 1: + case 2: + case 4: + return '[В следующий] dddd [в] LT'; + case 3: + case 5: + case 6: + return '[В следующую] dddd [в] LT'; + } + } else { + if (this.day() === 2) { + return '[Во] dddd [в] LT'; + } else { + return '[В] dddd [в] LT'; + } + } }, lastWeek: function (now) { if (now.week() !== this.week()) { @@ -152,4 +154,3 @@ export default moment.defineLocale('ru', { doy : 7 // The week that contains Jan 1st is the first week of the year. } }); - diff --git a/bower_components/moment/src/locale/se.js b/bower_components/moment/src/locale/se.js new file mode 100644 index 0000000..e720639 --- /dev/null +++ b/bower_components/moment/src/locale/se.js @@ -0,0 +1,51 @@ +//! moment.js locale configuration +//! locale : Northern Sami (se) +//! authors : Bård Rolstad Henriksen : https://github.com/karamell + + +import moment from '../moment'; + +export default moment.defineLocale('se', { + months : 'ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu'.split('_'), + monthsShort : 'ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov'.split('_'), + weekdays : 'sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat'.split('_'), + weekdaysShort : 'sotn_vuos_maŋ_gask_duor_bear_láv'.split('_'), + weekdaysMin : 's_v_m_g_d_b_L'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'MMMM D. [b.] YYYY', + LLL : 'MMMM D. [b.] YYYY [ti.] HH:mm', + LLLL : 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm' + }, + calendar : { + sameDay: '[otne ti] LT', + nextDay: '[ihttin ti] LT', + nextWeek: 'dddd [ti] LT', + lastDay: '[ikte ti] LT', + lastWeek: '[ovddit] dddd [ti] LT', + sameElse: 'L' + }, + relativeTime : { + future : '%s geažes', + past : 'maŋit %s', + s : 'moadde sekunddat', + m : 'okta minuhta', + mm : '%d minuhtat', + h : 'okta diimmu', + hh : '%d diimmut', + d : 'okta beaivi', + dd : '%d beaivvit', + M : 'okta mánnu', + MM : '%d mánut', + y : 'okta jahki', + yy : '%d jagit' + }, + ordinalParse: /\d{1,2}\./, + ordinal : '%d.', + week : { + dow : 1, // Monday is the first day of the week. + doy : 4 // The week that contains Jan 4th is the first week of the year. + } +}); diff --git a/bower_components/moment/src/locale/sk.js b/bower_components/moment/src/locale/sk.js index 079725c..dbc73be 100644 --- a/bower_components/moment/src/locale/sk.js +++ b/bower_components/moment/src/locale/sk.js @@ -66,14 +66,6 @@ function translate(number, withoutSuffix, key, isFuture) { export default moment.defineLocale('sk', { months : months, monthsShort : monthsShort, - monthsParse : (function (months, monthsShort) { - var i, _monthsParse = []; - for (i = 0; i < 12; i++) { - // use custom parser to solve problem with July (červenec) - _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i'); - } - return _monthsParse; - }(months, monthsShort)), weekdays : 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'), weekdaysShort : 'ne_po_ut_st_št_pi_so'.split('_'), weekdaysMin : 'ne_po_ut_st_št_pi_so'.split('_'), diff --git a/bower_components/moment/src/locale/sw.js b/bower_components/moment/src/locale/sw.js new file mode 100644 index 0000000..0b7ae92 --- /dev/null +++ b/bower_components/moment/src/locale/sw.js @@ -0,0 +1,49 @@ +//! moment.js locale configuration +//! locale : swahili (sw) +//! author : Fahad Kassim : https://github.com/fadsel + +import moment from '../moment'; + +export default moment.defineLocale('sw', { + months : 'Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba'.split('_'), + monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des'.split('_'), + weekdays : 'Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi'.split('_'), + weekdaysShort : 'Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos'.split('_'), + weekdaysMin : 'J2_J3_J4_J5_Al_Ij_J1'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd, D MMMM YYYY HH:mm' + }, + calendar : { + sameDay : '[leo saa] LT', + nextDay : '[kesho saa] LT', + nextWeek : '[wiki ijayo] dddd [saat] LT', + lastDay : '[jana] LT', + lastWeek : '[wiki iliyopita] dddd [saat] LT', + sameElse : 'L' + }, + relativeTime : { + future : '%s baadaye', + past : 'tokea %s', + s : 'hivi punde', + m : 'dakika moja', + mm : 'dakika %d', + h : 'saa limoja', + hh : 'masaa %d', + d : 'siku moja', + dd : 'masiku %d', + M : 'mwezi mmoja', + MM : 'miezi %d', + y : 'mwaka mmoja', + yy : 'miaka %d' + }, + week : { + dow : 1, // Monday is the first day of the week. + doy : 7 // The week that contains Jan 1st is the first week of the year. + } +}); + diff --git a/bower_components/moment/src/locale/ta.js b/bower_components/moment/src/locale/ta.js index 6879be4..f9b9ccc 100644 --- a/bower_components/moment/src/locale/ta.js +++ b/bower_components/moment/src/locale/ta.js @@ -4,6 +4,30 @@ import moment from '../moment'; +var symbolMap = { + '1': '௧', + '2': '௨', + '3': '௩', + '4': '௪', + '5': '௫', + '6': '௬', + '7': '௭', + '8': '௮', + '9': '௯', + '0': '௦' +}, numberMap = { + '௧': '1', + '௨': '2', + '௩': '3', + '௪': '4', + '௫': '5', + '௬': '6', + '௭': '7', + '௮': '8', + '௯': '9', + '௦': '0' +}; + export default moment.defineLocale('ta', { months : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'), monthsShort : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'), @@ -45,6 +69,16 @@ export default moment.defineLocale('ta', { ordinal : function (number) { return number + 'வது'; }, + preparse: function (string) { + return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) { + return numberMap[match]; + }); + }, + postformat: function (string) { + return string.replace(/\d/g, function (match) { + return symbolMap[match]; + }); + }, // refer http://ta.wikipedia.org/s/1er1 meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/, meridiem : function (hour, minute, isLower) { diff --git a/bower_components/moment/src/locale/te.js b/bower_components/moment/src/locale/te.js new file mode 100644 index 0000000..37daa5b --- /dev/null +++ b/bower_components/moment/src/locale/te.js @@ -0,0 +1,78 @@ +//! moment.js locale configuration +//! locale : telugu (te) +//! author : Krishna Chaitanya Thota : https://github.com/kcthota + +import moment from '../moment'; + +export default moment.defineLocale('te', { + months : 'జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జూలై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్'.split('_'), + monthsShort : 'జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జూలై_ఆగ._సెప్._అక్టో._నవ._డిసె.'.split('_'), + weekdays : 'ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం'.split('_'), + weekdaysShort : 'ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని'.split('_'), + weekdaysMin : 'ఆ_సో_మం_బు_గు_శు_శ'.split('_'), + longDateFormat : { + LT : 'A h:mm', + LTS : 'A h:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY, A h:mm', + LLLL : 'dddd, D MMMM YYYY, A h:mm' + }, + calendar : { + sameDay : '[నేడు] LT', + nextDay : '[రేపు] LT', + nextWeek : 'dddd, LT', + lastDay : '[నిన్న] LT', + lastWeek : '[గత] dddd, LT', + sameElse : 'L' + }, + relativeTime : { + future : '%s లో', + past : '%s క్రితం', + s : 'కొన్ని క్షణాలు', + m : 'ఒక నిమిషం', + mm : '%d నిమిషాలు', + h : 'ఒక గంట', + hh : '%d గంటలు', + d : 'ఒక రోజు', + dd : '%d రోజులు', + M : 'ఒక నెల', + MM : '%d నెలలు', + y : 'ఒక సంవత్సరం', + yy : '%d సంవత్సరాలు' + }, + ordinalParse : /\d{1,2}వ/, + ordinal : '%dవ', + meridiemParse: /రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/, + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if (meridiem === 'రాత్రి') { + return hour < 4 ? hour : hour + 12; + } else if (meridiem === 'ఉదయం') { + return hour; + } else if (meridiem === 'మధ్యాహ్నం') { + return hour >= 10 ? hour : hour + 12; + } else if (meridiem === 'సాయంత్రం') { + return hour + 12; + } + }, + meridiem : function (hour, minute, isLower) { + if (hour < 4) { + return 'రాత్రి'; + } else if (hour < 10) { + return 'ఉదయం'; + } else if (hour < 17) { + return 'మధ్యాహ్నం'; + } else if (hour < 20) { + return 'సాయంత్రం'; + } else { + return 'రాత్రి'; + } + }, + week : { + dow : 0, // Sunday is the first day of the week. + doy : 6 // The week that contains Jan 1st is the first week of the year. + } +}); diff --git a/bower_components/moment/src/locale/tlh.js b/bower_components/moment/src/locale/tlh.js new file mode 100644 index 0000000..e8ffa2a --- /dev/null +++ b/bower_components/moment/src/locale/tlh.js @@ -0,0 +1,109 @@ +//! moment.js locale configuration +//! locale : Klingon (tlh) +//! author : Dominika Kruk : https://github.com/amaranthrose + +import moment from '../moment'; + +var numbersNouns = 'pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut'.split('_'); + +function translateFuture(output) { + var time = output; + time = (output.indexOf('jaj') !== -1) ? + time.slice(0, -3) + 'leS' : + (output.indexOf('jar') !== -1) ? + time.slice(0, -3) + 'waQ' : + (output.indexOf('DIS') !== -1) ? + time.slice(0, -3) + 'nem' : + time + ' pIq'; + return time; +} + +function translatePast(output) { + var time = output; + time = (output.indexOf('jaj') !== -1) ? + time.slice(0, -3) + 'Hu’' : + (output.indexOf('jar') !== -1) ? + time.slice(0, -3) + 'wen' : + (output.indexOf('DIS') !== -1) ? + time.slice(0, -3) + 'ben' : + time + ' ret'; + return time; +} + +function translate(number, withoutSuffix, string, isFuture) { + var numberNoun = numberAsNoun(number); + switch (string) { + case 'mm': + return numberNoun + ' tup'; + case 'hh': + return numberNoun + ' rep'; + case 'dd': + return numberNoun + ' jaj'; + case 'MM': + return numberNoun + ' jar'; + case 'yy': + return numberNoun + ' DIS'; + } +} + +function numberAsNoun(number) { + var hundred = Math.floor((number % 1000) / 100), + ten = Math.floor((number % 100) / 10), + one = number % 10, + word = ''; + if (hundred > 0) { + word += numbersNouns[hundred] + 'vatlh'; + } + if (ten > 0) { + word += ((word !== '') ? ' ' : '') + numbersNouns[ten] + 'maH'; + } + if (one > 0) { + word += ((word !== '') ? ' ' : '') + numbersNouns[one]; + } + return (word === '') ? 'pagh' : word; +} + +export default moment.defineLocale('tlh', { + months : 'tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’'.split('_'), + monthsShort : 'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split('_'), + weekdays : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'), + weekdaysShort : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'), + weekdaysMin : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'), + longDateFormat : { + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd, D MMMM YYYY HH:mm' + }, + calendar : { + sameDay: '[DaHjaj] LT', + nextDay: '[wa’leS] LT', + nextWeek: 'LLL', + lastDay: '[wa’Hu’] LT', + lastWeek: 'LLL', + sameElse: 'L' + }, + relativeTime : { + future : translateFuture, + past : translatePast, + s : 'puS lup', + m : 'wa’ tup', + mm : translate, + h : 'wa’ rep', + hh : translate, + d : 'wa’ jaj', + dd : translate, + M : 'wa’ jar', + MM : translate, + y : 'wa’ DIS', + yy : translate + }, + ordinalParse: /\d{1,2}\./, + ordinal : '%d.', + week : { + dow : 1, // Monday is the first day of the week. + doy : 4 // The week that contains Jan 4th is the first week of the year. + } +}); diff --git a/bower_components/moment/src/locale/tzl.js b/bower_components/moment/src/locale/tzl.js index cae8534..7c2a77a 100644 --- a/bower_components/moment/src/locale/tzl.js +++ b/bower_components/moment/src/locale/tzl.js @@ -15,11 +15,11 @@ export default moment.defineLocale('tzl', { weekdaysMin : 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'), longDateFormat : { LT : 'HH.mm', - LTS : 'LT.ss', + LTS : 'HH.mm.ss', L : 'DD.MM.YYYY', LL : 'D. MMMM [dallas] YYYY', - LLL : 'D. MMMM [dallas] YYYY LT', - LLLL : 'dddd, [li] D. MMMM [dallas] YYYY LT' + LLL : 'D. MMMM [dallas] YYYY HH.mm', + LLLL : 'dddd, [li] D. MMMM [dallas] YYYY HH.mm' }, meridiem : function (hours, minutes, isLower) { if (hours > 11) { @@ -63,16 +63,16 @@ function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { 's': ['viensas secunds', '\'iensas secunds'], 'm': ['\'n míut', '\'iens míut'], - 'mm': [number + ' míuts', ' ' + number + ' míuts'], + 'mm': [number + ' míuts', '' + number + ' míuts'], 'h': ['\'n þora', '\'iensa þora'], - 'hh': [number + ' þoras', ' ' + number + ' þoras'], + 'hh': [number + ' þoras', '' + number + ' þoras'], 'd': ['\'n ziua', '\'iensa ziua'], - 'dd': [number + ' ziuas', ' ' + number + ' ziuas'], + 'dd': [number + ' ziuas', '' + number + ' ziuas'], 'M': ['\'n mes', '\'iens mes'], - 'MM': [number + ' mesen', ' ' + number + ' mesen'], + 'MM': [number + ' mesen', '' + number + ' mesen'], 'y': ['\'n ar', '\'iens ar'], - 'yy': [number + ' ars', ' ' + number + ' ars'] + 'yy': [number + ' ars', '' + number + ' ars'] }; - return isFuture ? format[key][0] : (withoutSuffix ? format[key][0] : format[key][1].trim()); + return isFuture ? format[key][0] : (withoutSuffix ? format[key][0] : format[key][1]); } diff --git a/bower_components/moment/src/locale/uk.js b/bower_components/moment/src/locale/uk.js index fe1f7d2..6cbffaa 100644 --- a/bower_components/moment/src/locale/uk.js +++ b/bower_components/moment/src/locale/uk.js @@ -11,8 +11,8 @@ function plural(word, num) { } function relativeTimeWithPlural(number, withoutSuffix, key) { var format = { - 'mm': 'хвилина_хвилини_хвилин', - 'hh': 'година_години_годин', + 'mm': withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин', + 'hh': withoutSuffix ? 'година_години_годин' : 'годину_години_годин', 'dd': 'день_дні_днів', 'MM': 'місяць_місяці_місяців', 'yy': 'рік_роки_років' @@ -27,16 +27,6 @@ function relativeTimeWithPlural(number, withoutSuffix, key) { return number + ' ' + plural(format[key], +number); } } -function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_'), - 'accusative': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_') - }, - nounCase = (/D[oD]? *MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - return months[nounCase][m.month()]; -} function weekdaysCaseReplace(m, format) { var weekdays = { 'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'), @@ -57,7 +47,10 @@ function processHoursFunction(str) { } export default moment.defineLocale('uk', { - months : monthsCaseReplace, + months : { + 'format': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_'), + 'standalone': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_') + }, monthsShort : 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'), weekdays : weekdaysCaseReplace, weekdaysShort : 'нд_пн_вт_ср_чт_пт_сб'.split('_'), diff --git a/bower_components/moment/src/locale/uz.js b/bower_components/moment/src/locale/uz.js index 646b5e6..881e50b 100644 --- a/bower_components/moment/src/locale/uz.js +++ b/bower_components/moment/src/locale/uz.js @@ -5,7 +5,7 @@ import moment from '../moment'; export default moment.defineLocale('uz', { - months : 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'), + months : 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split('_'), monthsShort : 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'), weekdays : 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'), weekdaysShort : 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'), diff --git a/bower_components/moment/src/moment.js b/bower_components/moment/src/moment.js index 15fe0e6..91d5b1c 100644 --- a/bower_components/moment/src/moment.js +++ b/bower_components/moment/src/moment.js @@ -1,16 +1,17 @@ //! moment.js -//! version : 2.10.6 +//! version : 2.11.1 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com import { hooks as moment, setHookCallback } from './lib/utils/hooks'; -moment.version = '2.10.6'; +moment.version = '2.11.1'; import { min, max, + now, isMoment, momentPrototype as fn, createUTC as utc, @@ -46,6 +47,7 @@ setHookCallback(local); moment.fn = fn; moment.min = min; moment.max = max; +moment.now = now; moment.utc = utc; moment.unix = unix; moment.months = months; @@ -64,5 +66,6 @@ moment.defineLocale = defineLocale; moment.weekdaysShort = weekdaysShort; moment.normalizeUnits = normalizeUnits; moment.relativeTimeThreshold = relativeTimeThreshold; +moment.prototype = fn; export default moment; diff --git a/bower_components/moment/templates/default.js b/bower_components/moment/templates/default.js new file mode 100644 index 0000000..3d6d4af --- /dev/null +++ b/bower_components/moment/templates/default.js @@ -0,0 +1,5 @@ +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + global.moment = factory() +}(this, function () { 'use strict'; diff --git a/bower_components/moment/templates/locale-header.js b/bower_components/moment/templates/locale-header.js index f304506..9a0f5a7 100644 --- a/bower_components/moment/templates/locale-header.js +++ b/bower_components/moment/templates/locale-header.js @@ -1,5 +1,6 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/bower_components/moment/templates/test-header.js b/bower_components/moment/templates/test-header.js index 38940c3..aee69d3 100644 --- a/bower_components/moment/templates/test-header.js +++ b/bower_components/moment/templates/test-header.js @@ -1,5 +1,6 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) : +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : typeof define === 'function' && define.amd ? define(['../../moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; diff --git a/lib/handsontable.meteor.0.20.3.css b/lib/handsontable.meteor.0.20.3.css new file mode 100644 index 0000000..b8e6c92 --- /dev/null +++ b/lib/handsontable.meteor.0.20.3.css @@ -0,0 +1,1392 @@ +/*! +(The MIT License) + +Copyright (c) 2012-2014 Marcin Warpechowski +Copyright (c) 2015 Handsoncode sp. z o.o. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +.handsontable { + position: relative; +} + +.handsontable .hide{ + display: none; +} +.handsontable .relative { + position: relative; +} + +.handsontable.htAutoSize { + visibility: hidden; + left: -99000px; + position: absolute; + top: -99000px; +} + +.handsontable .wtHider { + width: 0; +} + +.handsontable .wtSpreader { + position: relative; + width: 0; /*must be 0, otherwise blank space appears in scroll demo after scrolling max to the right */ + height: auto; +} + +.handsontable table, +.handsontable tbody, +.handsontable thead, +.handsontable td, +.handsontable th, +.handsontable input, +.handsontable textarea, +.handsontable div { + box-sizing: content-box; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; +} + +.handsontable input, +.handsontable textarea { + min-height: initial; +} + +.handsontable table.htCore { + border-collapse: separate; + /*it must be separate, otherwise there are offset miscalculations in WebKit: http://stackoverflow.com/questions/2655987/border-collapse-differences-in-ff-and-webkit*/ + /*this actually only changes appearance of user selection - does not make text unselectable + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -o-user-select: none; + -ms-user-select: none; + /*user-select: none; /*no browser supports unprefixed version*/ + border-spacing: 0; + margin: 0; + border-width: 0; + table-layout: fixed; + width: 0; + outline-width: 0; + /* reset bootstrap table style. for more info see: https://github.com/handsontable/handsontable/issues/224 */ + max-width: none; + max-height: none; +} + +.handsontable col { + width: 50px; +} + +.handsontable col.rowHeader { + width: 50px; +} + +.handsontable th, +.handsontable td { + border-right: 1px solid #CCC; + border-bottom: 1px solid #CCC; + height: 22px; + empty-cells: show; + line-height: 21px; + padding: 0 4px 0 4px; + /* top, bottom padding different than 0 is handled poorly by FF with HTML5 doctype */ + background-color: #FFF; + vertical-align: top; + overflow: hidden; + outline-width: 0; + white-space: pre-line; + /* preserve new line character in cell */ +} + +.handsontable td.htInvalid { + background-color: #ff4c42 !important; /*gives priority over td.area selection background*/ +} + +.handsontable td.htNoWrap { + white-space: nowrap; +} + +.handsontable th:last-child { + /*Foundation framework fix*/ + border-right: 1px solid #CCC; + border-bottom: 1px solid #CCC; +} + +.handsontable tr:first-child th.htNoFrame, +.handsontable th:first-child.htNoFrame, +.handsontable th.htNoFrame { + border-left-width: 0; + background-color: white; + border-color: #FFF; +} + +.handsontable th:first-child, +.handsontable td:first-of-type, +.handsontable .htNoFrame + th, +.handsontable .htNoFrame + td { + border-left: 1px solid #CCC; +} + +.handsontable.htRowHeaders thead tr th:nth-child(2) { + border-left: 1px solid #CCC; +} + +.handsontable tr:first-child th, +.handsontable tr:first-child td { + border-top: 1px solid #CCC; +} + +.ht_master:not(.innerBorderLeft) ~ .handsontable tbody tr th, +.ht_master:not(.innerBorderLeft) ~ .handsontable:not(.ht_clone_top) thead tr th:first-child +{ + border-right-width: 0; +} + +.ht_master:not(.innerBorderTop) thead tr:last-child th, +.ht_master:not(.innerBorderTop) ~ .handsontable thead tr:last-child th, +.ht_master:not(.innerBorderTop) thead tr.lastChild th, +.ht_master:not(.innerBorderTop) ~ .handsontable thead tr.lastChild th { + border-bottom-width: 0; +} + +.handsontable th { + background-color: #EEE; + color: #222; + text-align: center; + font-weight: normal; + white-space: nowrap; +} + +.handsontable thead th { + padding: 0; +} + +.handsontable th.active { + background-color: #CCC; +} + +.handsontable thead th .relative { + padding: 2px 4px; +} + +/* plugins */ + +.handsontable .manualColumnMover { + position: fixed; + left: 0; + top: 0; + background-color: transparent; + width: 5px; + height: 25px; + z-index: 999; + cursor: move; +} + +.handsontable .manualRowMover { + position: fixed; + left: -4px; + top: 0; + background-color: transparent; + height: 5px; + width: 50px; + z-index: 999; + cursor: move; +} + +.handsontable .manualColumnMoverGuide, +.handsontable .manualRowMoverGuide { + position: fixed; + left: 0; + top: 0; + background-color: #CCC; + width: 25px; + height: 25px; + opacity: 0.7; + display: none; +} + +.handsontable .manualColumnMoverGuide.active, +.handsontable .manualRowMoverGuide.active { + display: block; +} + +.handsontable .manualColumnMover:hover, +.handsontable .manualColumnMover.active, +.handsontable .manualRowMover:hover, +.handsontable .manualRowMover.active{ + background-color: #88F; +} + +/* row + column resizer*/ + +.handsontable .manualColumnResizer { + position: fixed; + top: 0; + cursor: col-resize; + z-index: 110; + width: 5px; + height: 25px; +} + +.handsontable .manualRowResizer { + position: fixed; + left: 0; + cursor: row-resize; + z-index: 110; + height: 5px; + width: 50px; +} + +.handsontable .manualColumnResizer:hover, +.handsontable .manualColumnResizer.active, +.handsontable .manualRowResizer:hover, +.handsontable .manualRowResizer.active { + background-color: #AAB; +} + +.handsontable .manualColumnResizerGuide { + position: fixed; + right: 0; + top: 0; + background-color: #AAB; + display: none; + width: 0; + border-right: 1px dashed #777; + margin-left: 5px; +} + +.handsontable .manualRowResizerGuide { + position: fixed; + left: 0; + bottom: 0; + background-color: #AAB; + display: none; + height: 0; + border-bottom: 1px dashed #777; + margin-top: 5px; +} + +.handsontable .manualColumnResizerGuide.active, +.handsontable .manualRowResizerGuide.active { + display: block; +} + +.handsontable .columnSorting { + position: relative; +} + +.handsontable .columnSorting:hover { + text-decoration: underline; + cursor: pointer; +} + +.handsontable .columnSorting.ascending::after { + content: '\25B2'; + color: #5f5f5f; + position: absolute; + right: -15px; +} + +.handsontable .columnSorting.descending::after { + content: '\25BC'; + color: #5f5f5f; + position: absolute; + right: -15px; +} + +.handsontable th.beforeHiddenColumn { + position: relative; +} + +.handsontable th.beforeHiddenColumn::after, +.handsontable th.afterHiddenColumn::before { + content: '\25C0'; + color: #bbb; + position: absolute; + right: 1px; + top: 2px; + font-size: 5pt; +} + +.handsontable th.afterHiddenColumn { + position: relative; +} + +.handsontable th.afterHiddenColumn::before { + left: 1px; + top: 2px; + right: auto; + content: '\25B6'; +} + +.handsontable td.afterHiddenColumn.firstVisible { + border-left: 1px solid #CCC; +} + +.handsontable thead th.hiddenHeader { + display: none; +} + +/* border line */ + +.handsontable .wtBorder { + position: absolute; + font-size: 0; +} +.handsontable .wtBorder.hidden{ + display:none !important; +} + +.handsontable td.area { + background: -moz-linear-gradient(top, rgba(181,209,255,0.34) 0%, rgba(181,209,255,0.34) 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(181,209,255,0.34)), color-stop(100%,rgba(181,209,255,0.34))); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, rgba(181,209,255,0.34) 0%,rgba(181,209,255,0.34) 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, rgba(181,209,255,0.34) 0%,rgba(181,209,255,0.34) 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, rgba(181,209,255,0.34) 0%,rgba(181,209,255,0.34) 100%); /* IE10+ */ + background: linear-gradient(to bottom, rgba(181,209,255,0.34) 0%,rgba(181,209,255,0.34) 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#57b5d1ff', endColorstr='#57b5d1ff',GradientType=0 ); /* IE6-9 */ + background-color: #fff; +} + +/* fill handle */ + +.handsontable .wtBorder.corner { + font-size: 0; + cursor: crosshair; +} + +.handsontable .htBorder.htFillBorder { + background: red; + width: 1px; + height: 1px; +} + +.handsontableInput { + border:none; + outline-width: 0; + margin: 0 ; + padding: 1px 5px 0 5px; + font-family: inherit; + line-height: 21px; + font-size: inherit; + box-shadow: 0 0 0 2px #5292F7 inset; + resize: none; + /*below are needed to overwrite stuff added by jQuery UI Bootstrap theme*/ + display: inline-block; + color: #000; + border-radius: 0; + background-color: #FFF; + /*overwrite styles potentionally made by a framework*/ +} + +.handsontableInputHolder { + position: absolute; + top: 0; + left: 0; + z-index: 100; +} + +.htSelectEditor { + -webkit-appearance: menulist-button !important; + position: absolute; + width: auto; +} + +/* +TextRenderer readOnly cell +*/ + +.handsontable .htDimmed { + color: #777; +} + +.handsontable .htSubmenu { + position: relative; +} + +.handsontable .htSubmenu :after{ + content: '▶'; + color: #777; + position: absolute; + right: 5px; +} + + +/* +TextRenderer horizontal alignment +*/ +.handsontable .htLeft{ + text-align: left; +} +.handsontable .htCenter{ + text-align: center; +} +.handsontable .htRight{ + text-align: right; +} +.handsontable .htJustify{ + text-align: justify; +} +/* +TextRenderer vertical alignment +*/ +.handsontable .htTop{ + vertical-align: top; +} +.handsontable .htMiddle{ + vertical-align: middle; +} +.handsontable .htBottom{ + vertical-align: bottom; +} + +/* +TextRenderer placeholder value +*/ + +.handsontable .htPlaceholder { + color: #999; +} + +/* +AutocompleteRenderer down arrow +*/ + +.handsontable .htAutocompleteArrow { + float: right; + font-size: 10px; + color: #EEE; + cursor: default; + width: 16px; + text-align: center; +} + +.handsontable td .htAutocompleteArrow:hover { + color: #777; +} + +.handsontable td.area .htAutocompleteArrow { + color: #d3d3d3; +} + +/* +CheckboxRenderer +*/ + +.handsontable .htCheckboxRendererInput.noValue { + opacity: 0.5; +} +.handsontable .htCheckboxRendererLabel { + cursor: pointer; + display: inline-block; + width: 100%; +} + +/* +NumericRenderer +*/ + +.handsontable .htNumeric { + text-align: right; +} + +/* +Comment For Cell +*/ +.htCommentCell{ + position: relative; +} +.htCommentCell:after{ + content: ''; + position: absolute; + top: 0; + right: 0; + border-left: 6px solid transparent; + border-top: 6px solid red; +} + +@-webkit-keyframes opacity-hide { + from { + opacity: 1; + } + to { + opacity: 0; + /*display: none;*/ + } +} +@keyframes opacity-hide { + from { + /*display: block;*/ + opacity: 1; + } + to { + opacity: 0; + /*display: none;*/ + } +} + +@-webkit-keyframes opacity-show { + from { + opacity: 0; + /*display: none;*/ + } + to { + opacity: 1; + /*display: block;*/ + } +} +@keyframes opacity-show { + from { + opacity: 0; + /*display: none;*/ + } + to { + opacity: 1; + /*display: block;*/ + } +} + +/** + * Handsontable in Handsontable + */ + +.handsontable .handsontable.ht_clone_top .wtHider { + padding: 0 0 5px 0; +} + +/* removing shadows, TODO: remove the commented code and this comment */ +/*.handsontable .handsontable:not(.ht_master) table {*/ + /*-webkit-box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.4);*/ + /*box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.4);*/ +/*}*/ + +/** +* Autocomplete Editor +*/ +.handsontable .autocompleteEditor.handsontable { + padding-right: 17px; +} +.handsontable .autocompleteEditor.handsontable.htMacScroll { + padding-right: 15px; +} + + +/** + * Handsontable listbox theme + */ + +.handsontable.listbox { + margin: 0; +} + +.handsontable.listbox .ht_master table { + border: 1px solid #ccc; + border-collapse: separate; + background: white; +} + +.handsontable.listbox th, +.handsontable.listbox tr:first-child th, +.handsontable.listbox tr:last-child th, +.handsontable.listbox tr:first-child td, +.handsontable.listbox td { + border-color: transparent; +} + +.handsontable.listbox th, +.handsontable.listbox td { + white-space: nowrap; + text-overflow: ellipsis; +} + +.handsontable.listbox td.htDimmed { + cursor: default; + color: inherit; + font-style: inherit; +} + +.handsontable.listbox .wtBorder { + visibility: hidden; +} + +.handsontable.listbox tr td.current, +.handsontable.listbox tr:hover td { + background: #eee; +} + +.ht_clone_top { + z-index: 101; +} + +.ht_clone_left { + z-index: 102; +} + +.ht_clone_top_left_corner, +.ht_clone_bottom_left_corner { + z-index: 103; +} + +.ht_clone_debug { + z-index: 103; +} + +.handsontable td.htSearchResult { + background: #fcedd9; + color: #583707; +} + +/* +Cell borders +*/ +.htBordered{ + /*box-sizing: border-box !important;*/ + border-width: 1px; +} +.htBordered.htTopBorderSolid { + border-top-style: solid; + border-top-color: #000; +} +.htBordered.htRightBorderSolid { + border-right-style: solid; + border-right-color: #000; +} +.htBordered.htBottomBorderSolid { + border-bottom-style: solid; + border-bottom-color: #000; +} +.htBordered.htLeftBorderSolid { + border-left-style: solid; + border-left-color: #000; +} + +.htCommentTextArea{ + -moz-box-shadow: 1px 1px 2px #bbb; + -webkit-box-shadow: 1px 1px 2px #bbb; + background-color: #FFFACD; + border: 1px solid #999; + box-shadow: 1px 1px 2px #bbb; + font-family: 'Arial'; +} + +.handsontable tbody tr th:nth-last-child(2) { + border-right: 1px solid #CCC; +} + +.handsontable thead tr:nth-last-child(2) th.htGroupIndicatorContainer { + border-bottom: 1px solid #CCC; + padding-bottom: 5px; +} + + +.ht_clone_top_left_corner thead tr th:nth-last-child(2) { + border-right: 1px solid #CCC; +} + +.htCollapseButton { + width: 10px; + height: 10px; + line-height: 10px; + text-align: center; + border-radius: 5px; + border: 1px solid #f3f3f3; + -webkit-box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4); + box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4); + cursor: pointer; + margin-bottom: 3px; + position: relative; +} + +.htCollapseButton:after { + content: ""; + height: 300%; + width: 1px; + display: block; + background: #ccc; + margin-left: 4px; + position: absolute; + /*top: -300%;*/ + bottom: 10px; +} + + +thead .htCollapseButton { + right: 5px; + position: absolute; + top: 5px; + background: #fff; +} + +thead .htCollapseButton:after { + height: 1px; + width: 700%; + right: 10px; + top: 4px; +} + +.handsontable tr th .htExpandButton { + position: absolute; + width: 10px; + height: 10px; + line-height: 10px; + text-align: center; + border-radius: 5px; + border: 1px solid #f3f3f3; + -webkit-box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4); + box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4); + cursor: pointer; + top: 0; + display: none; +} + +.handsontable thead tr th .htExpandButton { + /*left: 5px;*/ + top: 5px; +} + +.handsontable tr th .htExpandButton.clickable { + display: block; +} + +.collapsibleIndicator { + position: absolute; + top: 50%; + transform: translate(0% ,-50%); + right: 5px; + border: 1px solid #A6A6A6; + line-height: 10px; + color: #222; + border-radius: 10px; + font-size: 10px; + width: 10px; + height: 10px; + cursor: pointer; + -webkit-box-shadow: 0px 0px 0px 6px rgba(238,238,238,1); + -moz-box-shadow: 0px 0px 0px 6px rgba(238,238,238,1); + box-shadow: 0px 0px 0px 6px rgba(238,238,238,1); + background: #eee; +} + +.handsontable col.hidden { + width: 0 !important; +} + +.handsontable table tr th.lightRightBorder { + border-right: 1px solid #E6E6E6; +} + +.handsontable tr.hidden, +.handsontable tr.hidden td, +.handsontable tr.hidden th { + display: none; +} + +.ht_master, +.ht_clone_left, +.ht_clone_top, +.ht_clone_bottom { + overflow: hidden; +} + +.ht_master .wtHolder { + overflow: auto; +} + +.ht_clone_left .wtHolder { + overflow-x: hidden; + overflow-y: auto; +} + +.ht_clone_top .wtHolder, +.ht_clone_bottom .wtHolder { + overflow-x: auto; + overflow-y: hidden; +} + + +/*WalkontableDebugOverlay*/ + +.wtDebugHidden { + display: none; +} + +.wtDebugVisible { + display: block; + -webkit-animation-duration: 0.5s; + -webkit-animation-name: wtFadeInFromNone; + animation-duration: 0.5s; + animation-name: wtFadeInFromNone; +} + +@keyframes wtFadeInFromNone { + 0% { + display: none; + opacity: 0; + } + + 1% { + display: block; + opacity: 0; + } + + 100% { + display: block; + opacity: 1; + } +} + +@-webkit-keyframes wtFadeInFromNone { + 0% { + display: none; + opacity: 0; + } + + 1% { + display: block; + opacity: 0; + } + + 100% { + display: block; + opacity: 1; + } +} +/* + + Handsontable Mobile Text Editor stylesheet + + */ + +.handsontable.mobile, +.handsontable.mobile .wtHolder { + -webkit-touch-callout:none; + -webkit-user-select:none; + -khtml-user-select:none; + -moz-user-select:none; + -ms-user-select:none; + user-select:none; + -webkit-tap-highlight-color:rgba(0,0,0,0); + -webkit-overflow-scrolling: touch; +} + +.htMobileEditorContainer { + display: none; + position: absolute; + top: 0; + width: 70%; + height: 54pt; + background: #f8f8f8; + border-radius: 20px; + border: 1px solid #ebebeb; + z-index: 999; + box-sizing: border-box; + -webkit-box-sizing: border-box; + -webkit-text-size-adjust: none; +} + +.topLeftSelectionHandle:not(.ht_master .topLeftSelectionHandle), +.topLeftSelectionHandle-HitArea:not(.ht_master .topLeftSelectionHandle-HitArea) { + z-index: 9999; +} + +/* Initial left/top coordinates - overwritten when actual position is set */ +.topLeftSelectionHandle, +.topLeftSelectionHandle-HitArea, +.bottomRightSelectionHandle, +.bottomRightSelectionHandle-HitArea { + left: -10000px; + top: -10000px; +} + +.htMobileEditorContainer.active { + display: block; +} + +.htMobileEditorContainer .inputs { + position: absolute; + right: 210pt; + bottom: 10pt; + top: 10pt; + left: 14px; + height: 34pt; +} + +.htMobileEditorContainer .inputs textarea { + font-size: 13pt; + border: 1px solid #a1a1a1; + -webkit-appearance: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + position: absolute; + left: 14px; + right: 14px; + top: 0; + bottom: 0; + padding: 7pt; +} + +.htMobileEditorContainer .cellPointer { + position: absolute; + top: -13pt; + height: 0; + width: 0; + left: 30px; + + border-left: 13pt solid transparent; + border-right: 13pt solid transparent; + border-bottom: 13pt solid #ebebeb; +} + +.htMobileEditorContainer .cellPointer.hidden { + display: none; +} + +.htMobileEditorContainer .cellPointer:before { + content: ''; + display: block; + position: absolute; + top: 2px; + height: 0; + width: 0; + left: -13pt; + + border-left: 13pt solid transparent; + border-right: 13pt solid transparent; + border-bottom: 13pt solid #f8f8f8; +} + +.htMobileEditorContainer .moveHandle { + position: absolute; + top: 10pt; + left: 5px; + width: 30px; + bottom: 0px; + cursor: move; + z-index: 9999; +} + +.htMobileEditorContainer .moveHandle:after { + content: "..\a..\a..\a.."; + white-space: pre; + line-height: 10px; + font-size: 20pt; + display: inline-block; + margin-top: -8px; + color: #ebebeb; +} + +.htMobileEditorContainer .positionControls { + width: 205pt; + position: absolute; + right: 5pt; + top: 0; + bottom: 0; +} + +.htMobileEditorContainer .positionControls > div { + width: 50pt; + height: 100%; + float: left; +} + +.htMobileEditorContainer .positionControls > div:after { + content: " "; + display: block; + width: 15pt; + height: 15pt; + text-align: center; + line-height: 50pt; +} + +.htMobileEditorContainer .leftButton:after, +.htMobileEditorContainer .rightButton:after, +.htMobileEditorContainer .upButton:after, +.htMobileEditorContainer .downButton:after { + transform-origin: 5pt 5pt; + -webkit-transform-origin: 5pt 5pt; + margin: 21pt 0 0 21pt; +} + +.htMobileEditorContainer .leftButton:after { + border-top: 2px solid #288ffe; + border-left: 2px solid #288ffe; + -webkit-transform: rotate(-45deg); + /*margin-top: 17pt;*/ + /*margin-left: 20pt;*/ +} +.htMobileEditorContainer .leftButton:active:after { + border-color: #cfcfcf; +} + +.htMobileEditorContainer .rightButton:after { + border-top: 2px solid #288ffe; + border-left: 2px solid #288ffe; + -webkit-transform: rotate(135deg); + /*margin-top: 17pt;*/ + /*margin-left: 10pt;*/ +} +.htMobileEditorContainer .rightButton:active:after { + border-color: #cfcfcf; +} + +.htMobileEditorContainer .upButton:after { + /*border-top: 2px solid #cfcfcf;*/ + border-top: 2px solid #288ffe; + border-left: 2px solid #288ffe; + -webkit-transform: rotate(45deg); + /*margin-top: 22pt;*/ + /*margin-left: 15pt;*/ +} +.htMobileEditorContainer .upButton:active:after { + border-color: #cfcfcf; +} + +.htMobileEditorContainer .downButton:after { + border-top: 2px solid #288ffe; + border-left: 2px solid #288ffe; + -webkit-transform: rotate(225deg); + /*margin-top: 15pt;*/ + /*margin-left: 15pt;*/ +} +.htMobileEditorContainer .downButton:active:after { + border-color: #cfcfcf; +} + +.handsontable.hide-tween { + -webkit-animation: opacity-hide 0.3s; + animation: opacity-hide 0.3s; + animation-fill-mode: forwards; + -webkit-animation-fill-mode: forwards; +} + +.handsontable.show-tween { + -webkit-animation: opacity-show 0.3s; + animation: opacity-show 0.3s; + animation-fill-mode: forwards; + -webkit-animation-fill-mode: forwards; +} +/*! + * Handsontable ContextMenu + */ + +.htContextMenu { + display: none; + position: absolute; + z-index: 1060; /* needs to be higher than 1050 - z-index for Twitter Bootstrap modal (#1569) */ +} + +.htContextMenu .ht_clone_top, +.htContextMenu .ht_clone_left, +.htContextMenu .ht_clone_corner, +.htContextMenu .ht_clone_debug { + display: none; +} + +.htContextMenu table.htCore { + border: 1px solid #bbb; + border-bottom-width: 2px; + border-right-width: 2px; +} + +.htContextMenu .wtBorder { + visibility: hidden; +} + +.htContextMenu table tbody tr td { + background: white; + border-width: 0; + padding: 4px 6px 0 6px; + cursor: pointer; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.htContextMenu table tbody tr td:first-child { + border: 0; +} + +.htContextMenu table tbody tr td.htDimmed { + font-style: normal; + color: #323232; +} + +.htContextMenu table tbody tr td.current, +.htContextMenu table tbody tr td.zeroclipboard-is-hover { + background: #e9e9e9; +} + +.htContextMenu table tbody tr td.htSeparator { + border-top: 1px solid #bbb; + height: 0; + padding: 0; +} + +.htContextMenu table tbody tr td.htDisabled { + color: #999; +} + +.htContextMenu table tbody tr td.htDisabled:hover { + background: #fff; + color: #999; + cursor: default; +} + +.htContextMenu table tbody tr.htHidden { + display: none; +} + +.htContextMenu table tbody tr td .htItemWrapper { + margin-left: 10px; + margin-right: 6px; +} + +.htContextMenu table tbody tr td div span.selected { + margin-top: -2px; + position: absolute; + left: 4px; +} + +.htContextMenu .ht_master .wtHolder { + overflow: hidden; +} +@charset "UTF-8"; + +/*! + * Pikaday + * Copyright © 2014 David Bushell | BSD & MIT license | http://dbushell.com/ + */ + +.pika-single { + z-index: 9999; + display: block; + position: relative; + color: #333; + background: #fff; + border: 1px solid #ccc; + border-bottom-color: #bbb; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; +} + +/* +clear child float (pika-lendar), using the famous micro clearfix hack +http://nicolasgallagher.com/micro-clearfix-hack/ +*/ +.pika-single:before, +.pika-single:after { + content: " "; + display: table; +} +.pika-single:after { clear: both } +.pika-single { *zoom: 1 } + +.pika-single.is-hidden { + display: none; +} + +.pika-single.is-bound { + position: absolute; + box-shadow: 0 5px 15px -5px rgba(0,0,0,.5); +} + +.pika-lendar { + float: left; + width: 240px; + margin: 8px; +} + +.pika-title { + position: relative; + text-align: center; +} + +.pika-label { + display: inline-block; + *display: inline; + position: relative; + z-index: 9999; + overflow: hidden; + margin: 0; + padding: 5px 3px; + font-size: 14px; + line-height: 20px; + font-weight: bold; + background-color: #fff; +} +.pika-title select { + cursor: pointer; + position: absolute; + z-index: 9998; + margin: 0; + left: 0; + top: 5px; + filter: alpha(opacity=0); + opacity: 0; +} + +.pika-prev, +.pika-next { + display: block; + cursor: pointer; + position: relative; + outline: none; + border: 0; + padding: 0; + width: 20px; + height: 30px; + /* hide text using text-indent trick, using width value (it's enough) */ + text-indent: 20px; + white-space: nowrap; + overflow: hidden; + background-color: transparent; + background-position: center center; + background-repeat: no-repeat; + background-size: 75% 75%; + opacity: .5; + *position: absolute; + *top: 0; +} + +.pika-prev:hover, +.pika-next:hover { + opacity: 1; +} + +.pika-prev, +.is-rtl .pika-next { + float: left; + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAUklEQVR42u3VMQoAIBADQf8Pgj+OD9hG2CtONJB2ymQkKe0HbwAP0xucDiQWARITIDEBEnMgMQ8S8+AqBIl6kKgHiXqQqAeJepBo/z38J/U0uAHlaBkBl9I4GwAAAABJRU5ErkJggg=='); + *left: 0; +} + +.pika-next, +.is-rtl .pika-prev { + float: right; + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAU0lEQVR42u3VOwoAMAgE0dwfAnNjU26bYkBCFGwfiL9VVWoO+BJ4Gf3gtsEKKoFBNTCoCAYVwaAiGNQGMUHMkjGbgjk2mIONuXo0nC8XnCf1JXgArVIZAQh5TKYAAAAASUVORK5CYII='); + *right: 0; +} + +.pika-prev.is-disabled, +.pika-next.is-disabled { + cursor: default; + opacity: .2; +} + +.pika-select { + display: inline-block; + *display: inline; +} + +.pika-table { + width: 100%; + border-collapse: collapse; + border-spacing: 0; + border: 0; +} + +.pika-table th, +.pika-table td { + width: 14.285714285714286%; + padding: 0; +} + +.pika-table th { + color: #999; + font-size: 12px; + line-height: 25px; + font-weight: bold; + text-align: center; +} + +.pika-button { + cursor: pointer; + display: block; + box-sizing: border-box; + -moz-box-sizing: border-box; + outline: none; + border: 0; + margin: 0; + width: 100%; + padding: 5px; + color: #666; + font-size: 12px; + line-height: 15px; + text-align: right; + background: #f5f5f5; +} + +.pika-week { + font-size: 11px; + color: #999; +} + +.is-today .pika-button { + color: #33aaff; + font-weight: bold; +} + +.is-selected .pika-button { + color: #fff; + font-weight: bold; + background: #33aaff; + box-shadow: inset 0 1px 3px #178fe5; + border-radius: 3px; +} + +.is-inrange .pika-button { + background: #D5E9F7; +} + +.is-startrange .pika-button { + color: #fff; + background: #6CB31D; + box-shadow: none; + border-radius: 3px; +} + +.is-endrange .pika-button { + color: #fff; + background: #33aaff; + box-shadow: none; + border-radius: 3px; +} + +.is-disabled .pika-button { + pointer-events: none; + cursor: default; + color: #999; + opacity: .3; +} + +.pika-button:hover { + color: #fff; + background: #ff8000; + box-shadow: none; + border-radius: 3px; +} + +/* styling for abbr */ +.pika-table abbr { + border-bottom: none; + cursor: help; +} + diff --git a/lib/handsontable.meteor.0.20.3.js b/lib/handsontable.meteor.0.20.3.js new file mode 100644 index 0000000..33d20a5 --- /dev/null +++ b/lib/handsontable.meteor.0.20.3.js @@ -0,0 +1,27842 @@ +/*! +(The MIT License) + +Copyright (c) 2012-2014 Marcin Warpechowski +Copyright (c) 2015 Handsoncode sp. z o.o. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Handsontable = f()}})(function(){var define,module,exports;return (function init(modules, cache, entry) { + (function outer (modules, cache, entry) { + // Save the require from previous bundle to this closure if any + var previousRequire = typeof require == "function" && require; + var globalNS = JSON.parse('{"zeroclipboard":"ZeroClipboard","moment":"moment","pikaday":"Pikaday"}') || {}; + + function newRequire(name, jumped){ + if(!cache[name]) { + + if(!modules[name]) { + // if we cannot find the the module within our internal map or + // cache jump to the current global require ie. the last bundle + // that was added to the page. + var currentRequire = typeof require == "function" && require; + if (!jumped && currentRequire) return currentRequire(name, true); + + // If there are other bundles on this page the require from the + // previous one is saved to 'previousRequire'. Repeat this as + // many times as there are bundles until the module is found or + // we exhaust the require chain. + if (previousRequire) return previousRequire(name, true); + + // Try find module from global scope + if (globalNS[name] && typeof window[globalNS[name]] !== 'undefined') { + return window[globalNS[name]]; + } + + var err = new Error('Cannot find module \'' + name + '\''); + err.code = 'MODULE_NOT_FOUND'; + throw err; + } + var m = cache[name] = {exports:{}}; + modules[name][0].call(m.exports, function(x){ + var id = modules[name][1][x]; + return newRequire(id ? id : x); + },m,m.exports,outer,modules,cache,entry); + } + + return cache[name].exports; + } + for(var i=0;i 1) { + for (i = 1, ilen = arguments.length; i < ilen; i++) { + args.push(arguments[i]); + } + } + if (instance) { + if (typeof instance[action] !== 'undefined') { + output = instance[action].apply(instance, args); + if (action === 'destroy') { + $this.removeData(); + } + } else { + throw new Error('Handsontable do not provide action: ' + action); + } + } + return output; + } + }; + })(window, jQuery, Handsontable); +} + +//# +},{}],2:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableBorder: {get: function() { + return WalkontableBorder; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_event__, + $___46__46__47__46__46__47__46__46__47_eventManager__, + $__cell_47_coords__, + $__overlay_47__95_base_46_js__; +var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}), + getComputedStyle = $__0.getComputedStyle, + getTrimmingContainer = $__0.getTrimmingContainer, + innerWidth = $__0.innerWidth, + innerHeight = $__0.innerHeight, + offset = $__0.offset, + outerHeight = $__0.outerHeight, + outerWidth = $__0.outerWidth; +var stopImmediatePropagation = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_event__}).stopImmediatePropagation; +var EventManager = ($___46__46__47__46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47__46__46__47_eventManager__}).EventManager; +var WalkontableCellCoords = ($__cell_47_coords__ = require("cell/coords"), $__cell_47_coords__ && $__cell_47_coords__.__esModule && $__cell_47_coords__ || {default: $__cell_47_coords__}).WalkontableCellCoords; +var WalkontableOverlay = ($__overlay_47__95_base_46_js__ = require("overlay/_base.js"), $__overlay_47__95_base_46_js__ && $__overlay_47__95_base_46_js__.__esModule && $__overlay_47__95_base_46_js__ || {default: $__overlay_47__95_base_46_js__}).WalkontableOverlay; +var WalkontableBorder = function WalkontableBorder(wotInstance, settings) { + if (!settings) { + return; + } + this.eventManager = new EventManager(wotInstance); + this.instance = wotInstance; + this.wot = wotInstance; + this.settings = settings; + this.mouseDown = false; + this.main = null; + this.top = null; + this.left = null; + this.bottom = null; + this.right = null; + this.topStyle = null; + this.leftStyle = null; + this.bottomStyle = null; + this.rightStyle = null; + this.cornerDefaultStyle = { + width: '5px', + height: '5px', + borderWidth: '2px', + borderStyle: 'solid', + borderColor: '#FFF' + }; + this.corner = null; + this.cornerStyle = null; + this.createBorders(settings); + this.registerListeners(); +}; +($traceurRuntime.createClass)(WalkontableBorder, { + registerListeners: function() { + var $__5 = this; + this.eventManager.addEventListener(document.body, 'mousedown', (function() { + return $__5.onMouseDown(); + })); + this.eventManager.addEventListener(document.body, 'mouseup', (function() { + return $__5.onMouseUp(); + })); + var $__7 = this, + $__8 = function(c, len) { + $__7.eventManager.addEventListener($__7.main.childNodes[c], 'mouseenter', (function(event) { + return $__5.onMouseEnter(event, $__5.main.childNodes[c]); + })); + }; + for (var c = 0, + len = this.main.childNodes.length; c < len; c++) { + $__8(c, len); + } + }, + onMouseDown: function() { + this.mouseDown = true; + }, + onMouseUp: function() { + this.mouseDown = false; + }, + onMouseEnter: function(event, parentElement) { + if (!this.mouseDown || !this.wot.getSetting('hideBorderOnMouseDownOver')) { + return; + } + event.preventDefault(); + stopImmediatePropagation(event); + var _this = this; + var bounds = parentElement.getBoundingClientRect(); + parentElement.style.display = 'none'; + function isOutside(event) { + if (event.clientY < Math.floor(bounds.top)) { + return true; + } + if (event.clientY > Math.ceil(bounds.top + bounds.height)) { + return true; + } + if (event.clientX < Math.floor(bounds.left)) { + return true; + } + if (event.clientX > Math.ceil(bounds.left + bounds.width)) { + return true; + } + } + function handler(event) { + if (isOutside(event)) { + _this.eventManager.removeEventListener(document.body, 'mousemove', handler); + parentElement.style.display = 'block'; + } + } + this.eventManager.addEventListener(document.body, 'mousemove', handler); + }, + createBorders: function(settings) { + this.main = document.createElement('div'); + var borderDivs = ['top', 'left', 'bottom', 'right', 'corner']; + var style = this.main.style; + style.position = 'absolute'; + style.top = 0; + style.left = 0; + for (var i = 0; i < 5; i++) { + var position = borderDivs[i]; + var div = document.createElement('div'); + div.className = 'wtBorder ' + (this.settings.className || ''); + if (this.settings[position] && this.settings[position].hide) { + div.className += ' hidden'; + } + style = div.style; + style.backgroundColor = (this.settings[position] && this.settings[position].color) ? this.settings[position].color : settings.border.color; + style.height = (this.settings[position] && this.settings[position].width) ? this.settings[position].width + 'px' : settings.border.width + 'px'; + style.width = (this.settings[position] && this.settings[position].width) ? this.settings[position].width + 'px' : settings.border.width + 'px'; + this.main.appendChild(div); + } + this.top = this.main.childNodes[0]; + this.left = this.main.childNodes[1]; + this.bottom = this.main.childNodes[2]; + this.right = this.main.childNodes[3]; + this.topStyle = this.top.style; + this.leftStyle = this.left.style; + this.bottomStyle = this.bottom.style; + this.rightStyle = this.right.style; + this.corner = this.main.childNodes[4]; + this.corner.className += ' corner'; + this.cornerStyle = this.corner.style; + this.cornerStyle.width = this.cornerDefaultStyle.width; + this.cornerStyle.height = this.cornerDefaultStyle.height; + this.cornerStyle.border = [this.cornerDefaultStyle.borderWidth, this.cornerDefaultStyle.borderStyle, this.cornerDefaultStyle.borderColor].join(' '); + if (Handsontable.mobileBrowser) { + this.createMultipleSelectorHandles(); + } + this.disappear(); + if (!this.wot.wtTable.bordersHolder) { + this.wot.wtTable.bordersHolder = document.createElement('div'); + this.wot.wtTable.bordersHolder.className = 'htBorders'; + this.wot.wtTable.spreader.appendChild(this.wot.wtTable.bordersHolder); + } + this.wot.wtTable.bordersHolder.insertBefore(this.main, this.wot.wtTable.bordersHolder.firstChild); + }, + createMultipleSelectorHandles: function() { + this.selectionHandles = { + topLeft: document.createElement('DIV'), + topLeftHitArea: document.createElement('DIV'), + bottomRight: document.createElement('DIV'), + bottomRightHitArea: document.createElement('DIV') + }; + var width = 10; + var hitAreaWidth = 40; + this.selectionHandles.topLeft.className = 'topLeftSelectionHandle'; + this.selectionHandles.topLeftHitArea.className = 'topLeftSelectionHandle-HitArea'; + this.selectionHandles.bottomRight.className = 'bottomRightSelectionHandle'; + this.selectionHandles.bottomRightHitArea.className = 'bottomRightSelectionHandle-HitArea'; + this.selectionHandles.styles = { + topLeft: this.selectionHandles.topLeft.style, + topLeftHitArea: this.selectionHandles.topLeftHitArea.style, + bottomRight: this.selectionHandles.bottomRight.style, + bottomRightHitArea: this.selectionHandles.bottomRightHitArea.style + }; + var hitAreaStyle = { + position: 'absolute', + height: hitAreaWidth + 'px', + width: hitAreaWidth + 'px', + 'border-radius': parseInt(hitAreaWidth / 1.5, 10) + 'px' + }; + for (var prop in hitAreaStyle) { + if (hitAreaStyle.hasOwnProperty(prop)) { + this.selectionHandles.styles.bottomRightHitArea[prop] = hitAreaStyle[prop]; + this.selectionHandles.styles.topLeftHitArea[prop] = hitAreaStyle[prop]; + } + } + var handleStyle = { + position: 'absolute', + height: width + 'px', + width: width + 'px', + 'border-radius': parseInt(width / 1.5, 10) + 'px', + background: '#F5F5FF', + border: '1px solid #4285c8' + }; + for (var prop$__9 in handleStyle) { + if (handleStyle.hasOwnProperty(prop$__9)) { + this.selectionHandles.styles.bottomRight[prop$__9] = handleStyle[prop$__9]; + this.selectionHandles.styles.topLeft[prop$__9] = handleStyle[prop$__9]; + } + } + this.main.appendChild(this.selectionHandles.topLeft); + this.main.appendChild(this.selectionHandles.bottomRight); + this.main.appendChild(this.selectionHandles.topLeftHitArea); + this.main.appendChild(this.selectionHandles.bottomRightHitArea); + }, + isPartRange: function(row, col) { + if (this.wot.selections.area.cellRange) { + if (row != this.wot.selections.area.cellRange.to.row || col != this.wot.selections.area.cellRange.to.col) { + return true; + } + } + return false; + }, + updateMultipleSelectionHandlesPosition: function(row, col, top, left, width, height) { + var handleWidth = parseInt(this.selectionHandles.styles.topLeft.width, 10); + var hitAreaWidth = parseInt(this.selectionHandles.styles.topLeftHitArea.width, 10); + this.selectionHandles.styles.topLeft.top = parseInt(top - handleWidth, 10) + 'px'; + this.selectionHandles.styles.topLeft.left = parseInt(left - handleWidth, 10) + 'px'; + this.selectionHandles.styles.topLeftHitArea.top = parseInt(top - (hitAreaWidth / 4) * 3, 10) + 'px'; + this.selectionHandles.styles.topLeftHitArea.left = parseInt(left - (hitAreaWidth / 4) * 3, 10) + 'px'; + this.selectionHandles.styles.bottomRight.top = parseInt(top + height, 10) + 'px'; + this.selectionHandles.styles.bottomRight.left = parseInt(left + width, 10) + 'px'; + this.selectionHandles.styles.bottomRightHitArea.top = parseInt(top + height - hitAreaWidth / 4, 10) + 'px'; + this.selectionHandles.styles.bottomRightHitArea.left = parseInt(left + width - hitAreaWidth / 4, 10) + 'px'; + if (this.settings.border.multipleSelectionHandlesVisible && this.settings.border.multipleSelectionHandlesVisible()) { + this.selectionHandles.styles.topLeft.display = 'block'; + this.selectionHandles.styles.topLeftHitArea.display = 'block'; + if (this.isPartRange(row, col)) { + this.selectionHandles.styles.bottomRight.display = 'none'; + this.selectionHandles.styles.bottomRightHitArea.display = 'none'; + } else { + this.selectionHandles.styles.bottomRight.display = 'block'; + this.selectionHandles.styles.bottomRightHitArea.display = 'block'; + } + } else { + this.selectionHandles.styles.topLeft.display = 'none'; + this.selectionHandles.styles.bottomRight.display = 'none'; + this.selectionHandles.styles.topLeftHitArea.display = 'none'; + this.selectionHandles.styles.bottomRightHitArea.display = 'none'; + } + if (row == this.wot.wtSettings.getSetting('fixedRowsTop') || col == this.wot.wtSettings.getSetting('fixedColumnsLeft')) { + this.selectionHandles.styles.topLeft.zIndex = '9999'; + this.selectionHandles.styles.topLeftHitArea.zIndex = '9999'; + } else { + this.selectionHandles.styles.topLeft.zIndex = ''; + this.selectionHandles.styles.topLeftHitArea.zIndex = ''; + } + }, + appear: function(corners) { + if (this.disabled) { + return; + } + var isMultiple, + fromTD, + toTD, + fromOffset, + toOffset, + containerOffset, + top, + minTop, + left, + minLeft, + height, + width, + fromRow, + fromColumn, + toRow, + toColumn, + trimmingContainer, + cornerOverlappingContainer, + ilen; + if (WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_TOP) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_TOP_LEFT_CORNER)) { + ilen = this.wot.getSetting('fixedRowsTop'); + } else if (WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)) { + ilen = this.wot.getSetting('fixedRowsBottom'); + } else { + ilen = this.wot.wtTable.getRenderedRowsCount(); + } + for (var i = 0; i < ilen; i++) { + var s = this.wot.wtTable.rowFilter.renderedToSource(i); + if (s >= corners[0] && s <= corners[2]) { + fromRow = s; + break; + } + } + for (var i$__10 = ilen - 1; i$__10 >= 0; i$__10--) { + var s$__11 = this.wot.wtTable.rowFilter.renderedToSource(i$__10); + if (s$__11 >= corners[0] && s$__11 <= corners[2]) { + toRow = s$__11; + break; + } + } + ilen = this.wot.wtTable.getRenderedColumnsCount(); + for (var i$__12 = 0; i$__12 < ilen; i$__12++) { + var s$__13 = this.wot.wtTable.columnFilter.renderedToSource(i$__12); + if (s$__13 >= corners[1] && s$__13 <= corners[3]) { + fromColumn = s$__13; + break; + } + } + for (var i$__14 = ilen - 1; i$__14 >= 0; i$__14--) { + var s$__15 = this.wot.wtTable.columnFilter.renderedToSource(i$__14); + if (s$__15 >= corners[1] && s$__15 <= corners[3]) { + toColumn = s$__15; + break; + } + } + if (fromRow === void 0 || fromColumn === void 0) { + this.disappear(); + return; + } + isMultiple = (fromRow !== toRow || fromColumn !== toColumn); + fromTD = this.wot.wtTable.getCell(new WalkontableCellCoords(fromRow, fromColumn)); + toTD = isMultiple ? this.wot.wtTable.getCell(new WalkontableCellCoords(toRow, toColumn)) : fromTD; + fromOffset = offset(fromTD); + toOffset = isMultiple ? offset(toTD) : fromOffset; + containerOffset = offset(this.wot.wtTable.TABLE); + minTop = fromOffset.top; + height = toOffset.top + outerHeight(toTD) - minTop; + minLeft = fromOffset.left; + width = toOffset.left + outerWidth(toTD) - minLeft; + top = minTop - containerOffset.top - 1; + left = minLeft - containerOffset.left - 1; + var style = getComputedStyle(fromTD); + if (parseInt(style.borderTopWidth, 10) > 0) { + top += 1; + height = height > 0 ? height - 1 : 0; + } + if (parseInt(style.borderLeftWidth, 10) > 0) { + left += 1; + width = width > 0 ? width - 1 : 0; + } + this.topStyle.top = top + 'px'; + this.topStyle.left = left + 'px'; + this.topStyle.width = width + 'px'; + this.topStyle.display = 'block'; + this.leftStyle.top = top + 'px'; + this.leftStyle.left = left + 'px'; + this.leftStyle.height = height + 'px'; + this.leftStyle.display = 'block'; + var delta = Math.floor(this.settings.border.width / 2); + this.bottomStyle.top = top + height - delta + 'px'; + this.bottomStyle.left = left + 'px'; + this.bottomStyle.width = width + 'px'; + this.bottomStyle.display = 'block'; + this.rightStyle.top = top + 'px'; + this.rightStyle.left = left + width - delta + 'px'; + this.rightStyle.height = height + 1 + 'px'; + this.rightStyle.display = 'block'; + if (Handsontable.mobileBrowser || (!this.hasSetting(this.settings.border.cornerVisible) || this.isPartRange(toRow, toColumn))) { + this.cornerStyle.display = 'none'; + } else { + this.cornerStyle.top = top + height - 4 + 'px'; + this.cornerStyle.left = left + width - 4 + 'px'; + this.cornerStyle.borderRightWidth = this.cornerDefaultStyle.borderWidth; + this.cornerStyle.width = this.cornerDefaultStyle.width; + this.cornerStyle.display = 'block'; + trimmingContainer = getTrimmingContainer(this.wot.wtTable.TABLE); + if (toColumn === this.wot.getSetting('totalColumns') - 1) { + cornerOverlappingContainer = toTD.offsetLeft + outerWidth(toTD) >= innerWidth(trimmingContainer); + if (cornerOverlappingContainer) { + this.cornerStyle.left = Math.floor(left + width - 3 - parseInt(this.cornerDefaultStyle.width) / 2) + 'px'; + this.cornerStyle.borderRightWidth = 0; + } + } + if (toRow === this.wot.getSetting('totalRows') - 1) { + cornerOverlappingContainer = toTD.offsetTop + outerHeight(toTD) >= innerHeight(trimmingContainer); + if (cornerOverlappingContainer) { + this.cornerStyle.top = Math.floor(top + height - 3 - parseInt(this.cornerDefaultStyle.height) / 2) + 'px'; + this.cornerStyle.borderBottomWidth = 0; + } + } + } + if (Handsontable.mobileBrowser) { + this.updateMultipleSelectionHandlesPosition(fromRow, fromColumn, top, left, width, height); + } + }, + disappear: function() { + this.topStyle.display = 'none'; + this.leftStyle.display = 'none'; + this.bottomStyle.display = 'none'; + this.rightStyle.display = 'none'; + this.cornerStyle.display = 'none'; + if (Handsontable.mobileBrowser) { + this.selectionHandles.styles.topLeft.display = 'none'; + this.selectionHandles.styles.bottomRight.display = 'none'; + } + }, + hasSetting: function(setting) { + if (typeof setting === 'function') { + return setting(); + } + return !!setting; + } +}, {}); +; +window.WalkontableBorder = WalkontableBorder; + +//# +},{"cell/coords":5,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"overlay/_base.js":11}],3:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableViewportColumnsCalculator: {get: function() { + return WalkontableViewportColumnsCalculator; + }}, + __esModule: {value: true} +}); +var privatePool = new WeakMap(); +var WalkontableViewportColumnsCalculator = function WalkontableViewportColumnsCalculator(viewportWidth, scrollOffset, totalColumns, columnWidthFn, overrideFn, onlyFullyVisible, stretchH) { + privatePool.set(this, { + viewportWidth: viewportWidth, + scrollOffset: scrollOffset, + totalColumns: totalColumns, + columnWidthFn: columnWidthFn, + overrideFn: overrideFn, + onlyFullyVisible: onlyFullyVisible + }); + this.count = 0; + this.startColumn = null; + this.endColumn = null; + this.startPosition = null; + this.stretchAllRatio = 0; + this.stretchLastWidth = 0; + this.stretch = stretchH; + this.totalTargetWidth = 0; + this.needVerifyLastColumnWidth = true; + this.stretchAllColumnsWidth = []; + this.calculate(); +}; +var $WalkontableViewportColumnsCalculator = WalkontableViewportColumnsCalculator; +($traceurRuntime.createClass)(WalkontableViewportColumnsCalculator, { + calculate: function() { + var sum = 0; + var needReverse = true; + var startPositions = []; + var columnWidth; + var priv = privatePool.get(this); + var onlyFullyVisible = priv.onlyFullyVisible; + var overrideFn = priv.overrideFn; + var scrollOffset = priv.scrollOffset; + var totalColumns = priv.totalColumns; + var viewportWidth = priv.viewportWidth; + for (var i = 0; i < totalColumns; i++) { + columnWidth = this._getColumnWidth(i); + if (sum <= scrollOffset && !onlyFullyVisible) { + this.startColumn = i; + } + if (sum >= scrollOffset && sum + columnWidth <= scrollOffset + viewportWidth) { + if (this.startColumn == null) { + this.startColumn = i; + } + this.endColumn = i; + } + startPositions.push(sum); + sum += columnWidth; + if (!onlyFullyVisible) { + this.endColumn = i; + } + if (sum >= scrollOffset + viewportWidth) { + needReverse = false; + break; + } + } + if (this.endColumn === totalColumns - 1 && needReverse) { + this.startColumn = this.endColumn; + while (this.startColumn > 0) { + var viewportSum = startPositions[this.endColumn] + columnWidth - startPositions[this.startColumn - 1]; + if (viewportSum <= viewportWidth || !onlyFullyVisible) { + this.startColumn--; + } + if (viewportSum > viewportWidth) { + break; + } + } + } + if (this.startColumn !== null && overrideFn) { + overrideFn(this); + } + this.startPosition = startPositions[this.startColumn]; + if (this.startPosition == void 0) { + this.startPosition = null; + } + if (this.startColumn !== null) { + this.count = this.endColumn - this.startColumn + 1; + } + }, + refreshStretching: function(totalWidth) { + if (this.stretch === 'none') { + return; + } + var sumAll = 0; + var columnWidth; + var remainingSize; + var priv = privatePool.get(this); + var totalColumns = priv.totalColumns; + for (var i = 0; i < totalColumns; i++) { + columnWidth = this._getColumnWidth(i); + sumAll += columnWidth; + } + this.totalTargetWidth = totalWidth; + remainingSize = sumAll - totalWidth; + if (this.stretch === 'all' && remainingSize < 0) { + this.stretchAllRatio = totalWidth / sumAll; + this.stretchAllColumnsWidth = []; + this.needVerifyLastColumnWidth = true; + } else if (this.stretch === 'last' && totalWidth !== Infinity) { + var columnWidth$__1 = this._getColumnWidth(totalColumns - 1); + var lastColumnWidth = -remainingSize + columnWidth$__1; + this.stretchLastWidth = lastColumnWidth >= 0 ? lastColumnWidth : columnWidth$__1; + } + }, + getStretchedColumnWidth: function(column, baseWidth) { + var result = null; + if (this.stretch === 'all' && this.stretchAllRatio !== 0) { + result = this._getStretchedAllColumnWidth(column, baseWidth); + } else if (this.stretch === 'last' && this.stretchLastWidth !== 0) { + result = this._getStretchedLastColumnWidth(column); + } + return result; + }, + _getStretchedAllColumnWidth: function(column, baseWidth) { + var sumRatioWidth = 0; + var priv = privatePool.get(this); + var totalColumns = priv.totalColumns; + if (!this.stretchAllColumnsWidth[column]) { + this.stretchAllColumnsWidth[column] = Math.round(baseWidth * this.stretchAllRatio); + } + if (this.stretchAllColumnsWidth.length === totalColumns && this.needVerifyLastColumnWidth) { + this.needVerifyLastColumnWidth = false; + for (var i = 0; i < this.stretchAllColumnsWidth.length; i++) { + sumRatioWidth += this.stretchAllColumnsWidth[i]; + } + if (sumRatioWidth !== this.totalTargetWidth) { + this.stretchAllColumnsWidth[this.stretchAllColumnsWidth.length - 1] += this.totalTargetWidth - sumRatioWidth; + } + } + return this.stretchAllColumnsWidth[column]; + }, + _getStretchedLastColumnWidth: function(column) { + var priv = privatePool.get(this); + var totalColumns = priv.totalColumns; + if (column === totalColumns - 1) { + return this.stretchLastWidth; + } + return null; + }, + _getColumnWidth: function(column) { + var width = privatePool.get(this).columnWidthFn(column); + if (width === undefined) { + width = $WalkontableViewportColumnsCalculator.DEFAULT_WIDTH; + } + return width; + } +}, {get DEFAULT_WIDTH() { + return 50; + }}); +; +window.WalkontableViewportColumnsCalculator = WalkontableViewportColumnsCalculator; + +//# +},{}],4:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableViewportRowsCalculator: {get: function() { + return WalkontableViewportRowsCalculator; + }}, + __esModule: {value: true} +}); +var privatePool = new WeakMap(); +var WalkontableViewportRowsCalculator = function WalkontableViewportRowsCalculator(viewportHeight, scrollOffset, totalRows, rowHeightFn, overrideFn, onlyFullyVisible, horizontalScrollbarHeight) { + privatePool.set(this, { + viewportHeight: viewportHeight, + scrollOffset: scrollOffset, + totalRows: totalRows, + rowHeightFn: rowHeightFn, + overrideFn: overrideFn, + onlyFullyVisible: onlyFullyVisible, + horizontalScrollbarHeight: horizontalScrollbarHeight + }); + this.count = 0; + this.startRow = null; + this.endRow = null; + this.startPosition = null; + this.calculate(); +}; +var $WalkontableViewportRowsCalculator = WalkontableViewportRowsCalculator; +($traceurRuntime.createClass)(WalkontableViewportRowsCalculator, {calculate: function() { + var sum = 0; + var needReverse = true; + var startPositions = []; + var priv = privatePool.get(this); + var onlyFullyVisible = priv.onlyFullyVisible; + var overrideFn = priv.overrideFn; + var rowHeightFn = priv.rowHeightFn; + var scrollOffset = priv.scrollOffset; + var totalRows = priv.totalRows; + var viewportHeight = priv.viewportHeight; + var horizontalScrollbarHeight = priv.horizontalScrollbarHeight || 0; + for (var i = 0; i < totalRows; i++) { + var rowHeight = rowHeightFn(i); + if (rowHeight === undefined) { + rowHeight = $WalkontableViewportRowsCalculator.DEFAULT_HEIGHT; + } + if (sum <= scrollOffset && !onlyFullyVisible) { + this.startRow = i; + } + if (sum >= scrollOffset && sum + rowHeight <= scrollOffset + viewportHeight - horizontalScrollbarHeight) { + if (this.startRow === null) { + this.startRow = i; + } + this.endRow = i; + } + startPositions.push(sum); + sum += rowHeight; + if (!onlyFullyVisible) { + this.endRow = i; + } + if (sum >= scrollOffset + viewportHeight - horizontalScrollbarHeight) { + needReverse = false; + break; + } + } + if (this.endRow === totalRows - 1 && needReverse) { + this.startRow = this.endRow; + while (this.startRow > 0) { + var viewportSum = startPositions[this.endRow] + rowHeight - startPositions[this.startRow - 1]; + if (viewportSum <= viewportHeight - horizontalScrollbarHeight || !onlyFullyVisible) { + this.startRow--; + } + if (viewportSum >= viewportHeight - horizontalScrollbarHeight) { + break; + } + } + } + if (this.startRow !== null && overrideFn) { + overrideFn(this); + } + this.startPosition = startPositions[this.startRow]; + if (this.startPosition == void 0) { + this.startPosition = null; + } + if (this.startRow !== null) { + this.count = this.endRow - this.startRow + 1; + } + }}, {get DEFAULT_HEIGHT() { + return 23; + }}); +; +window.WalkontableViewportRowsCalculator = WalkontableViewportRowsCalculator; + +//# +},{}],5:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableCellCoords: {get: function() { + return WalkontableCellCoords; + }}, + __esModule: {value: true} +}); +var WalkontableCellCoords = function WalkontableCellCoords(row, col) { + if (typeof row !== 'undefined' && typeof col !== 'undefined') { + this.row = row; + this.col = col; + } else { + this.row = null; + this.col = null; + } +}; +($traceurRuntime.createClass)(WalkontableCellCoords, { + isValid: function(wotInstance) { + if (this.row < 0 || this.col < 0) { + return false; + } + if (this.row >= wotInstance.getSetting('totalRows') || this.col >= wotInstance.getSetting('totalColumns')) { + return false; + } + return true; + }, + isEqual: function(cellCoords) { + if (cellCoords === this) { + return true; + } + return this.row === cellCoords.row && this.col === cellCoords.col; + }, + isSouthEastOf: function(testedCoords) { + return this.row >= testedCoords.row && this.col >= testedCoords.col; + }, + isNorthWestOf: function(testedCoords) { + return this.row <= testedCoords.row && this.col <= testedCoords.col; + }, + isSouthWestOf: function(testedCoords) { + return this.row >= testedCoords.row && this.col <= testedCoords.col; + }, + isNorthEastOf: function(testedCoords) { + return this.row <= testedCoords.row && this.col >= testedCoords.col; + } +}, {}); +; +window.WalkontableCellCoords = WalkontableCellCoords; + +//# +},{}],6:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableCellRange: {get: function() { + return WalkontableCellRange; + }}, + __esModule: {value: true} +}); +var $___46__46__47_cell_47_coords__; +var WalkontableCellCoords = ($___46__46__47_cell_47_coords__ = require("cell/coords"), $___46__46__47_cell_47_coords__ && $___46__46__47_cell_47_coords__.__esModule && $___46__46__47_cell_47_coords__ || {default: $___46__46__47_cell_47_coords__}).WalkontableCellCoords; +var WalkontableCellRange = function WalkontableCellRange(highlight, from, to) { + this.highlight = highlight; + this.from = from; + this.to = to; +}; +var $WalkontableCellRange = WalkontableCellRange; +($traceurRuntime.createClass)(WalkontableCellRange, { + isValid: function(wotInstance) { + return this.from.isValid(wotInstance) && this.to.isValid(wotInstance); + }, + isSingle: function() { + return this.from.row === this.to.row && this.from.col === this.to.col; + }, + getHeight: function() { + return Math.max(this.from.row, this.to.row) - Math.min(this.from.row, this.to.row) + 1; + }, + getWidth: function() { + return Math.max(this.from.col, this.to.col) - Math.min(this.from.col, this.to.col) + 1; + }, + includes: function(cellCoords) { + var topLeft = this.getTopLeftCorner(); + var bottomRight = this.getBottomRightCorner(); + if (cellCoords.row < 0) { + cellCoords.row = 0; + } + if (cellCoords.col < 0) { + cellCoords.col = 0; + } + return topLeft.row <= cellCoords.row && bottomRight.row >= cellCoords.row && topLeft.col <= cellCoords.col && bottomRight.col >= cellCoords.col; + }, + includesRange: function(testedRange) { + return this.includes(testedRange.getTopLeftCorner()) && this.includes(testedRange.getBottomRightCorner()); + }, + isEqual: function(testedRange) { + return (Math.min(this.from.row, this.to.row) == Math.min(testedRange.from.row, testedRange.to.row)) && (Math.max(this.from.row, this.to.row) == Math.max(testedRange.from.row, testedRange.to.row)) && (Math.min(this.from.col, this.to.col) == Math.min(testedRange.from.col, testedRange.to.col)) && (Math.max(this.from.col, this.to.col) == Math.max(testedRange.from.col, testedRange.to.col)); + }, + overlaps: function(testedRange) { + return testedRange.isSouthEastOf(this.getTopLeftCorner()) && testedRange.isNorthWestOf(this.getBottomRightCorner()); + }, + isSouthEastOf: function(testedCoords) { + return this.getTopLeftCorner().isSouthEastOf(testedCoords) || this.getBottomRightCorner().isSouthEastOf(testedCoords); + }, + isNorthWestOf: function(testedCoords) { + return this.getTopLeftCorner().isNorthWestOf(testedCoords) || this.getBottomRightCorner().isNorthWestOf(testedCoords); + }, + expand: function(cellCoords) { + var topLeft = this.getTopLeftCorner(); + var bottomRight = this.getBottomRightCorner(); + if (cellCoords.row < topLeft.row || cellCoords.col < topLeft.col || cellCoords.row > bottomRight.row || cellCoords.col > bottomRight.col) { + this.from = new WalkontableCellCoords(Math.min(topLeft.row, cellCoords.row), Math.min(topLeft.col, cellCoords.col)); + this.to = new WalkontableCellCoords(Math.max(bottomRight.row, cellCoords.row), Math.max(bottomRight.col, cellCoords.col)); + return true; + } + return false; + }, + expandByRange: function(expandingRange) { + if (this.includesRange(expandingRange) || !this.overlaps(expandingRange)) { + return false; + } + var topLeft = this.getTopLeftCorner(); + var bottomRight = this.getBottomRightCorner(); + var topRight = this.getTopRightCorner(); + var bottomLeft = this.getBottomLeftCorner(); + var expandingTopLeft = expandingRange.getTopLeftCorner(); + var expandingBottomRight = expandingRange.getBottomRightCorner(); + var resultTopRow = Math.min(topLeft.row, expandingTopLeft.row); + var resultTopCol = Math.min(topLeft.col, expandingTopLeft.col); + var resultBottomRow = Math.max(bottomRight.row, expandingBottomRight.row); + var resultBottomCol = Math.max(bottomRight.col, expandingBottomRight.col); + var finalFrom = new WalkontableCellCoords(resultTopRow, resultTopCol), + finalTo = new WalkontableCellCoords(resultBottomRow, resultBottomCol); + var isCorner = new $WalkontableCellRange(finalFrom, finalFrom, finalTo).isCorner(this.from, expandingRange), + onlyMerge = expandingRange.isEqual(new $WalkontableCellRange(finalFrom, finalFrom, finalTo)); + if (isCorner && !onlyMerge) { + if (this.from.col > finalFrom.col) { + finalFrom.col = resultBottomCol; + finalTo.col = resultTopCol; + } + if (this.from.row > finalFrom.row) { + finalFrom.row = resultBottomRow; + finalTo.row = resultTopRow; + } + } + this.from = finalFrom; + this.to = finalTo; + return true; + }, + getDirection: function() { + if (this.from.isNorthWestOf(this.to)) { + return 'NW-SE'; + } else if (this.from.isNorthEastOf(this.to)) { + return 'NE-SW'; + } else if (this.from.isSouthEastOf(this.to)) { + return 'SE-NW'; + } else if (this.from.isSouthWestOf(this.to)) { + return 'SW-NE'; + } + }, + setDirection: function(direction) { + switch (direction) { + case 'NW-SE': + this.from = this.getTopLeftCorner(); + this.to = this.getBottomRightCorner(); + break; + case 'NE-SW': + this.from = this.getTopRightCorner(); + this.to = this.getBottomLeftCorner(); + break; + case 'SE-NW': + this.from = this.getBottomRightCorner(); + this.to = this.getTopLeftCorner(); + break; + case 'SW-NE': + this.from = this.getBottomLeftCorner(); + this.to = this.getTopRightCorner(); + break; + } + }, + getTopLeftCorner: function() { + return new WalkontableCellCoords(Math.min(this.from.row, this.to.row), Math.min(this.from.col, this.to.col)); + }, + getBottomRightCorner: function() { + return new WalkontableCellCoords(Math.max(this.from.row, this.to.row), Math.max(this.from.col, this.to.col)); + }, + getTopRightCorner: function() { + return new WalkontableCellCoords(Math.min(this.from.row, this.to.row), Math.max(this.from.col, this.to.col)); + }, + getBottomLeftCorner: function() { + return new WalkontableCellCoords(Math.max(this.from.row, this.to.row), Math.min(this.from.col, this.to.col)); + }, + isCorner: function(coords, expandedRange) { + if (expandedRange) { + if (expandedRange.includes(coords)) { + if (this.getTopLeftCorner().isEqual(new WalkontableCellCoords(expandedRange.from.row, expandedRange.from.col)) || this.getTopRightCorner().isEqual(new WalkontableCellCoords(expandedRange.from.row, expandedRange.to.col)) || this.getBottomLeftCorner().isEqual(new WalkontableCellCoords(expandedRange.to.row, expandedRange.from.col)) || this.getBottomRightCorner().isEqual(new WalkontableCellCoords(expandedRange.to.row, expandedRange.to.col))) { + return true; + } + } + } + return coords.isEqual(this.getTopLeftCorner()) || coords.isEqual(this.getTopRightCorner()) || coords.isEqual(this.getBottomLeftCorner()) || coords.isEqual(this.getBottomRightCorner()); + }, + getOppositeCorner: function(coords, expandedRange) { + if (!(coords instanceof WalkontableCellCoords)) { + return false; + } + if (expandedRange) { + if (expandedRange.includes(coords)) { + if (this.getTopLeftCorner().isEqual(new WalkontableCellCoords(expandedRange.from.row, expandedRange.from.col))) { + return this.getBottomRightCorner(); + } + if (this.getTopRightCorner().isEqual(new WalkontableCellCoords(expandedRange.from.row, expandedRange.to.col))) { + return this.getBottomLeftCorner(); + } + if (this.getBottomLeftCorner().isEqual(new WalkontableCellCoords(expandedRange.to.row, expandedRange.from.col))) { + return this.getTopRightCorner(); + } + if (this.getBottomRightCorner().isEqual(new WalkontableCellCoords(expandedRange.to.row, expandedRange.to.col))) { + return this.getTopLeftCorner(); + } + } + } + if (coords.isEqual(this.getBottomRightCorner())) { + return this.getTopLeftCorner(); + } else if (coords.isEqual(this.getTopLeftCorner())) { + return this.getBottomRightCorner(); + } else if (coords.isEqual(this.getTopRightCorner())) { + return this.getBottomLeftCorner(); + } else if (coords.isEqual(this.getBottomLeftCorner())) { + return this.getTopRightCorner(); + } + }, + getBordersSharedWith: function(range) { + if (!this.includesRange(range)) { + return []; + } + var thisBorders = { + top: Math.min(this.from.row, this.to.row), + bottom: Math.max(this.from.row, this.to.row), + left: Math.min(this.from.col, this.to.col), + right: Math.max(this.from.col, this.to.col) + }; + var rangeBorders = { + top: Math.min(range.from.row, range.to.row), + bottom: Math.max(range.from.row, range.to.row), + left: Math.min(range.from.col, range.to.col), + right: Math.max(range.from.col, range.to.col) + }; + var result = []; + if (thisBorders.top == rangeBorders.top) { + result.push('top'); + } + if (thisBorders.right == rangeBorders.right) { + result.push('right'); + } + if (thisBorders.bottom == rangeBorders.bottom) { + result.push('bottom'); + } + if (thisBorders.left == rangeBorders.left) { + result.push('left'); + } + return result; + }, + getInner: function() { + var topLeft = this.getTopLeftCorner(); + var bottomRight = this.getBottomRightCorner(); + var out = []; + for (var r = topLeft.row; r <= bottomRight.row; r++) { + for (var c = topLeft.col; c <= bottomRight.col; c++) { + if (!(this.from.row === r && this.from.col === c) && !(this.to.row === r && this.to.col === c)) { + out.push(new WalkontableCellCoords(r, c)); + } + } + } + return out; + }, + getAll: function() { + var topLeft = this.getTopLeftCorner(); + var bottomRight = this.getBottomRightCorner(); + var out = []; + for (var r = topLeft.row; r <= bottomRight.row; r++) { + for (var c = topLeft.col; c <= bottomRight.col; c++) { + if (topLeft.row === r && topLeft.col === c) { + out.push(topLeft); + } else if (bottomRight.row === r && bottomRight.col === c) { + out.push(bottomRight); + } else { + out.push(new WalkontableCellCoords(r, c)); + } + } + } + return out; + }, + forAll: function(callback) { + var topLeft = this.getTopLeftCorner(); + var bottomRight = this.getBottomRightCorner(); + for (var r = topLeft.row; r <= bottomRight.row; r++) { + for (var c = topLeft.col; c <= bottomRight.col; c++) { + var breakIteration = callback(r, c); + if (breakIteration === false) { + return; + } + } + } + } +}, {}); +; +window.WalkontableCellRange = WalkontableCellRange; + +//# +},{"cell/coords":5}],7:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + Walkontable: {get: function() { + return Walkontable; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47__46__46__47_helpers_47_object__, + $___46__46__47__46__46__47__46__46__47_helpers_47_string__, + $__event__, + $__overlays__, + $__scroll__, + $__settings__, + $__table__, + $__viewport__, + $__overlay_47__95_base_46_js__, + $__overlay_47_top_46_js__, + $__overlay_47_left_46_js__, + $__overlay_47_debug_46_js__, + $__overlay_47_topLeftCorner_46_js__; +var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + fastInnerText = $__0.fastInnerText, + isVisible = $__0.isVisible, + removeClass = $__0.removeClass; +var objectEach = ($___46__46__47__46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_object__}).objectEach; +var $__2 = ($___46__46__47__46__46__47__46__46__47_helpers_47_string__ = require("helpers/string"), $___46__46__47__46__46__47__46__46__47_helpers_47_string__ && $___46__46__47__46__46__47__46__46__47_helpers_47_string__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_string__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_string__}), + toUpperCaseFirst = $__2.toUpperCaseFirst, + randomString = $__2.randomString; +var WalkontableEvent = ($__event__ = require("event"), $__event__ && $__event__.__esModule && $__event__ || {default: $__event__}).WalkontableEvent; +var WalkontableOverlays = ($__overlays__ = require("overlays"), $__overlays__ && $__overlays__.__esModule && $__overlays__ || {default: $__overlays__}).WalkontableOverlays; +var WalkontableScroll = ($__scroll__ = require("scroll"), $__scroll__ && $__scroll__.__esModule && $__scroll__ || {default: $__scroll__}).WalkontableScroll; +var WalkontableSettings = ($__settings__ = require("settings"), $__settings__ && $__settings__.__esModule && $__settings__ || {default: $__settings__}).WalkontableSettings; +var WalkontableTable = ($__table__ = require("table"), $__table__ && $__table__.__esModule && $__table__ || {default: $__table__}).WalkontableTable; +var WalkontableViewport = ($__viewport__ = require("viewport"), $__viewport__ && $__viewport__.__esModule && $__viewport__ || {default: $__viewport__}).WalkontableViewport; +var WalkontableOverlay = ($__overlay_47__95_base_46_js__ = require("overlay/_base.js"), $__overlay_47__95_base_46_js__ && $__overlay_47__95_base_46_js__.__esModule && $__overlay_47__95_base_46_js__ || {default: $__overlay_47__95_base_46_js__}).WalkontableOverlay; +var WalkontableTopOverlay = ($__overlay_47_top_46_js__ = require("overlay/top.js"), $__overlay_47_top_46_js__ && $__overlay_47_top_46_js__.__esModule && $__overlay_47_top_46_js__ || {default: $__overlay_47_top_46_js__}).WalkontableTopOverlay; +var WalkontableLeftOverlay = ($__overlay_47_left_46_js__ = require("overlay/left.js"), $__overlay_47_left_46_js__ && $__overlay_47_left_46_js__.__esModule && $__overlay_47_left_46_js__ || {default: $__overlay_47_left_46_js__}).WalkontableLeftOverlay; +var WalkontableDebugOverlay = ($__overlay_47_debug_46_js__ = require("overlay/debug.js"), $__overlay_47_debug_46_js__ && $__overlay_47_debug_46_js__.__esModule && $__overlay_47_debug_46_js__ || {default: $__overlay_47_debug_46_js__}).WalkontableDebugOverlay; +var WalkontableTopLeftCornerOverlay = ($__overlay_47_topLeftCorner_46_js__ = require("overlay/topLeftCorner.js"), $__overlay_47_topLeftCorner_46_js__ && $__overlay_47_topLeftCorner_46_js__.__esModule && $__overlay_47_topLeftCorner_46_js__ || {default: $__overlay_47_topLeftCorner_46_js__}).WalkontableTopLeftCornerOverlay; +var Walkontable = function Walkontable(settings) { + var originalHeaders = []; + this.guid = 'wt_' + randomString(); + if (settings.cloneSource) { + this.cloneSource = settings.cloneSource; + this.cloneOverlay = settings.cloneOverlay; + this.wtSettings = settings.cloneSource.wtSettings; + this.wtTable = new WalkontableTable(this, settings.table, settings.wtRootElement); + this.wtScroll = new WalkontableScroll(this); + this.wtViewport = settings.cloneSource.wtViewport; + this.wtEvent = new WalkontableEvent(this); + this.selections = this.cloneSource.selections; + } else { + this.wtSettings = new WalkontableSettings(this, settings); + this.wtTable = new WalkontableTable(this, settings.table); + this.wtScroll = new WalkontableScroll(this); + this.wtViewport = new WalkontableViewport(this); + this.wtEvent = new WalkontableEvent(this); + this.selections = this.getSetting('selections'); + this.wtOverlays = new WalkontableOverlays(this); + this.exportSettingsAsClassNames(); + } + if (this.wtTable.THEAD.childNodes.length && this.wtTable.THEAD.childNodes[0].childNodes.length) { + for (var c = 0, + clen = this.wtTable.THEAD.childNodes[0].childNodes.length; c < clen; c++) { + originalHeaders.push(this.wtTable.THEAD.childNodes[0].childNodes[c].innerHTML); + } + if (!this.getSetting('columnHeaders').length) { + this.update('columnHeaders', [function(column, TH) { + fastInnerText(TH, originalHeaders[column]); + }]); + } + } + this.drawn = false; + this.drawInterrupted = false; +}; +($traceurRuntime.createClass)(Walkontable, { + draw: function() { + var fastDraw = arguments[0] !== (void 0) ? arguments[0] : false; + this.drawInterrupted = false; + if (!fastDraw && !isVisible(this.wtTable.TABLE)) { + this.drawInterrupted = true; + } else { + this.wtTable.draw(fastDraw); + } + return this; + }, + getCell: function(coords) { + var topmost = arguments[1] !== (void 0) ? arguments[1] : false; + if (!topmost) { + return this.wtTable.getCell(coords); + } + var totalRows = this.wtSettings.getSetting('totalRows'); + var fixedRowsTop = this.wtSettings.getSetting('fixedRowsTop'); + var fixedRowsBottom = this.wtSettings.getSetting('fixedRowsBottom'); + var fixedColumns = this.wtSettings.getSetting('fixedColumnsLeft'); + if (coords.row < fixedRowsTop && coords.col < fixedColumns) { + return this.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell(coords); + } else if (coords.row < fixedRowsTop) { + return this.wtOverlays.topOverlay.clone.wtTable.getCell(coords); + } else if (coords.col < fixedColumns && coords.row >= totalRows - fixedRowsBottom) { + if (this.wtOverlays.bottomLeftCornerOverlay.clone) { + return this.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell(coords); + } + } else if (coords.col < fixedColumns) { + return this.wtOverlays.leftOverlay.clone.wtTable.getCell(coords); + } else if (coords.row > totalRows - fixedRowsBottom) { + if (this.wtOverlays.bottomOverlay.clone) { + return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(coords); + } + } + return this.wtTable.getCell(coords); + }, + update: function(settings, value) { + return this.wtSettings.update(settings, value); + }, + scrollVertical: function(row) { + this.wtOverlays.topOverlay.scrollTo(row); + this.getSetting('onScrollVertically'); + return this; + }, + scrollHorizontal: function(column) { + this.wtOverlays.leftOverlay.scrollTo(column); + this.getSetting('onScrollHorizontally'); + return this; + }, + scrollViewport: function(coords) { + this.wtScroll.scrollViewport(coords); + return this; + }, + getViewport: function() { + return [this.wtTable.getFirstVisibleRow(), this.wtTable.getFirstVisibleColumn(), this.wtTable.getLastVisibleRow(), this.wtTable.getLastVisibleColumn()]; + }, + getOverlayName: function() { + return this.cloneOverlay ? this.cloneOverlay.type : 'master'; + }, + exportSettingsAsClassNames: function() { + var $__14 = this; + var toExport = { + rowHeaders: ['array'], + columnHeaders: ['array'] + }; + var allClassNames = []; + var newClassNames = []; + objectEach(toExport, (function(optionType, key) { + if (optionType.indexOf('array') > -1 && $__14.getSetting(key).length) { + newClassNames.push('ht' + toUpperCaseFirst(key)); + } + allClassNames.push('ht' + toUpperCaseFirst(key)); + })); + removeClass(this.wtTable.wtRootElement.parentNode, allClassNames); + addClass(this.wtTable.wtRootElement.parentNode, newClassNames); + }, + getSetting: function(key, param1, param2, param3, param4) { + return this.wtSettings.getSetting(key, param1, param2, param3, param4); + }, + hasSetting: function(key) { + return this.wtSettings.has(key); + }, + destroy: function() { + this.wtOverlays.destroy(); + this.wtEvent.destroy(); + } +}, {}); +; +window.Walkontable = Walkontable; + +//# +},{"event":8,"helpers/dom/element":45,"helpers/object":50,"helpers/string":52,"overlay/_base.js":11,"overlay/debug.js":12,"overlay/left.js":13,"overlay/top.js":14,"overlay/topLeftCorner.js":15,"overlays":16,"scroll":17,"settings":19,"table":20,"viewport":22}],8:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableEvent: {get: function() { + return WalkontableEvent; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47__46__46__47_eventManager__; +var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}), + closest = $__0.closest, + hasClass = $__0.hasClass, + isChildOf = $__0.isChildOf; +var eventManagerObject = ($___46__46__47__46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47__46__46__47_eventManager__}).eventManager; +function WalkontableEvent(instance) { + var that = this; + var eventManager = eventManagerObject(instance); + this.instance = instance; + var dblClickOrigin = [null, null]; + this.dblClickTimeout = [null, null]; + var onMouseDown = function(event) { + var cell = that.parentCell(event.realTarget); + if (hasClass(event.realTarget, 'corner')) { + that.instance.getSetting('onCellCornerMouseDown', event, event.realTarget); + } else if (cell.TD) { + if (that.instance.hasSetting('onCellMouseDown')) { + that.instance.getSetting('onCellMouseDown', event, cell.coords, cell.TD, that.instance); + } + } + if (event.button !== 2) { + if (cell.TD) { + dblClickOrigin[0] = cell.TD; + clearTimeout(that.dblClickTimeout[0]); + that.dblClickTimeout[0] = setTimeout(function() { + dblClickOrigin[0] = null; + }, 1000); + } + } + }; + var onTouchMove = function(event) { + that.instance.touchMoving = true; + }; + var longTouchTimeout; + var onTouchStart = function(event) { + var container = this; + eventManager.addEventListener(this, 'touchmove', onTouchMove); + that.checkIfTouchMove = setTimeout(function() { + if (that.instance.touchMoving === true) { + that.instance.touchMoving = void 0; + eventManager.removeEventListener('touchmove', onTouchMove, false); + return; + } else { + onMouseDown(event); + } + }, 30); + }; + var onMouseOver = function(event) { + var table, + td, + mainWOT; + if (that.instance.hasSetting('onCellMouseOver')) { + table = that.instance.wtTable.TABLE; + td = closest(event.realTarget, ['TD', 'TH'], table); + mainWOT = that.instance.cloneSource || that.instance; + if (td && td !== mainWOT.lastMouseOver && isChildOf(td, table)) { + mainWOT.lastMouseOver = td; + that.instance.getSetting('onCellMouseOver', event, that.instance.wtTable.getCoords(td), td, that.instance); + } + } + }; + var onMouseUp = function(event) { + if (event.button !== 2) { + var cell = that.parentCell(event.realTarget); + if (cell.TD === dblClickOrigin[0] && cell.TD === dblClickOrigin[1]) { + if (hasClass(event.realTarget, 'corner')) { + that.instance.getSetting('onCellCornerDblClick', event, cell.coords, cell.TD, that.instance); + } else { + that.instance.getSetting('onCellDblClick', event, cell.coords, cell.TD, that.instance); + } + dblClickOrigin[0] = null; + dblClickOrigin[1] = null; + } else if (cell.TD === dblClickOrigin[0]) { + dblClickOrigin[1] = cell.TD; + clearTimeout(that.dblClickTimeout[1]); + that.dblClickTimeout[1] = setTimeout(function() { + dblClickOrigin[1] = null; + }, 500); + } + } + }; + var onTouchEnd = function(event) { + clearTimeout(longTouchTimeout); + event.preventDefault(); + onMouseUp(event); + }; + eventManager.addEventListener(this.instance.wtTable.holder, 'mousedown', onMouseDown); + eventManager.addEventListener(this.instance.wtTable.TABLE, 'mouseover', onMouseOver); + eventManager.addEventListener(this.instance.wtTable.holder, 'mouseup', onMouseUp); + if (this.instance.wtTable.holder.parentNode.parentNode && Handsontable.mobileBrowser && !that.instance.wtTable.isWorkingOnClone()) { + var classSelector = '.' + this.instance.wtTable.holder.parentNode.className.split(' ').join('.'); + eventManager.addEventListener(this.instance.wtTable.holder, 'touchstart', function(event) { + that.instance.touchApplied = true; + if (isChildOf(event.target, classSelector)) { + onTouchStart.call(event.target, event); + } + }); + eventManager.addEventListener(this.instance.wtTable.holder, 'touchend', function(event) { + that.instance.touchApplied = false; + if (isChildOf(event.target, classSelector)) { + onTouchEnd.call(event.target, event); + } + }); + if (!that.instance.momentumScrolling) { + that.instance.momentumScrolling = {}; + } + eventManager.addEventListener(this.instance.wtTable.holder, 'scroll', function(event) { + clearTimeout(that.instance.momentumScrolling._timeout); + if (!that.instance.momentumScrolling.ongoing) { + that.instance.getSetting('onBeforeTouchScroll'); + } + that.instance.momentumScrolling.ongoing = true; + that.instance.momentumScrolling._timeout = setTimeout(function() { + if (!that.instance.touchApplied) { + that.instance.momentumScrolling.ongoing = false; + that.instance.getSetting('onAfterMomentumScroll'); + } + }, 200); + }); + } + eventManager.addEventListener(window, 'resize', function() { + if (that.instance.getSetting('stretchH') !== 'none') { + that.instance.draw(); + } + }); + this.destroy = function() { + clearTimeout(this.dblClickTimeout[0]); + clearTimeout(this.dblClickTimeout[1]); + eventManager.destroy(); + }; +} +WalkontableEvent.prototype.parentCell = function(elem) { + var cell = {}; + var TABLE = this.instance.wtTable.TABLE; + var TD = closest(elem, ['TD', 'TH'], TABLE); + if (TD && isChildOf(TD, TABLE)) { + cell.coords = this.instance.wtTable.getCoords(TD); + cell.TD = TD; + } else if (hasClass(elem, 'wtBorder') && hasClass(elem, 'current')) { + cell.coords = this.instance.selections.current.cellRange.highlight; + cell.TD = this.instance.wtTable.getCell(cell.coords); + } else if (hasClass(elem, 'wtBorder') && hasClass(elem, 'area')) { + if (this.instance.selections.area.cellRange) { + cell.coords = this.instance.selections.area.cellRange.to; + cell.TD = this.instance.wtTable.getCell(cell.coords); + } + } + return cell; +}; +; +window.WalkontableEvent = WalkontableEvent; + +//# +},{"eventManager":41,"helpers/dom/element":45}],9:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableColumnFilter: {get: function() { + return WalkontableColumnFilter; + }}, + __esModule: {value: true} +}); +var WalkontableColumnFilter = function WalkontableColumnFilter(offset, total, countTH) { + this.offset = offset; + this.total = total; + this.countTH = countTH; +}; +($traceurRuntime.createClass)(WalkontableColumnFilter, { + offsetted: function(index) { + return index + this.offset; + }, + unOffsetted: function(index) { + return index - this.offset; + }, + renderedToSource: function(index) { + return this.offsetted(index); + }, + sourceToRendered: function(index) { + return this.unOffsetted(index); + }, + offsettedTH: function(index) { + return index - this.countTH; + }, + unOffsettedTH: function(index) { + return index + this.countTH; + }, + visibleRowHeadedColumnToSourceColumn: function(index) { + return this.renderedToSource(this.offsettedTH(index)); + }, + sourceColumnToVisibleRowHeadedColumn: function(index) { + return this.unOffsettedTH(this.sourceToRendered(index)); + } +}, {}); +; +window.WalkontableColumnFilter = WalkontableColumnFilter; + +//# +},{}],10:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableRowFilter: {get: function() { + return WalkontableRowFilter; + }}, + __esModule: {value: true} +}); +var WalkontableRowFilter = function WalkontableRowFilter(offset, total, countTH) { + this.offset = offset; + this.total = total; + this.countTH = countTH; +}; +($traceurRuntime.createClass)(WalkontableRowFilter, { + offsetted: function(index) { + return index + this.offset; + }, + unOffsetted: function(index) { + return index - this.offset; + }, + renderedToSource: function(index) { + return this.offsetted(index); + }, + sourceToRendered: function(index) { + return this.unOffsetted(index); + }, + offsettedTH: function(index) { + return index - this.countTH; + }, + unOffsettedTH: function(index) { + return index + this.countTH; + }, + visibleColHeadedRowToSourceRow: function(index) { + return this.renderedToSource(this.offsettedTH(index)); + }, + sourceRowToVisibleColHeadedRow: function(index) { + return this.unOffsettedTH(this.sourceToRendered(index)); + } +}, {}); +; +window.WalkontableRowFilter = WalkontableRowFilter; + +//# +},{}],11:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableOverlay: {get: function() { + return WalkontableOverlay; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_object__, + $___46__46__47__46__46__47__46__46__47__46__46__47_eventManager__; +var $__0 = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}), + getScrollableElement = $__0.getScrollableElement, + getTrimmingContainer = $__0.getTrimmingContainer; +var defineGetter = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_object__}).defineGetter; +var eventManagerObject = ($___46__46__47__46__46__47__46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47__46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47__46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47__46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47__46__46__47__46__46__47_eventManager__}).eventManager; +var registeredOverlays = {}; +var WalkontableOverlay = function WalkontableOverlay(wotInstance) { + defineGetter(this, 'wot', wotInstance, {writable: false}); + this.instance = this.wot; + this.type = ''; + this.mainTableScrollableElement = null; + this.TABLE = this.wot.wtTable.TABLE; + this.hider = this.wot.wtTable.hider; + this.spreader = this.wot.wtTable.spreader; + this.holder = this.wot.wtTable.holder; + this.wtRootElement = this.wot.wtTable.wtRootElement; + this.trimmingContainer = getTrimmingContainer(this.hider.parentNode.parentNode); + this.needFullRender = this.shouldBeRendered(); + this.areElementSizesAdjusted = false; +}; +var $WalkontableOverlay = WalkontableOverlay; +($traceurRuntime.createClass)(WalkontableOverlay, { + shouldBeRendered: function() { + return true; + }, + makeClone: function(direction) { + if ($WalkontableOverlay.CLONE_TYPES.indexOf(direction) === -1) { + throw new Error('Clone type "' + direction + '" is not supported.'); + } + var clone = document.createElement('DIV'); + var clonedTable = document.createElement('TABLE'); + clone.className = 'ht_clone_' + direction + ' handsontable'; + clone.style.position = 'absolute'; + clone.style.top = 0; + clone.style.left = 0; + clone.style.overflow = 'hidden'; + clonedTable.className = this.wot.wtTable.TABLE.className; + clone.appendChild(clonedTable); + this.type = direction; + this.wot.wtTable.wtRootElement.parentNode.appendChild(clone); + var preventOverflow = this.wot.getSetting('preventOverflow'); + if (preventOverflow === true || preventOverflow === 'horizontal' && this.type === $WalkontableOverlay.CLONE_TOP || preventOverflow === 'vertical' && this.type === $WalkontableOverlay.CLONE_LEFT) { + this.mainTableScrollableElement = window; + } else { + this.mainTableScrollableElement = getScrollableElement(this.wot.wtTable.TABLE); + } + return new Walkontable({ + cloneSource: this.wot, + cloneOverlay: this, + table: clonedTable + }); + }, + refresh: function() { + var fastDraw = arguments[0] !== (void 0) ? arguments[0] : false; + var nextCycleRenderFlag = this.shouldBeRendered(); + if (this.clone && (this.needFullRender || nextCycleRenderFlag)) { + this.clone.draw(fastDraw); + } + this.needFullRender = nextCycleRenderFlag; + }, + destroy: function() { + eventManagerObject(this.clone).destroy(); + } +}, { + get CLONE_TOP() { + return 'top'; + }, + get CLONE_BOTTOM() { + return 'bottom'; + }, + get CLONE_LEFT() { + return 'left'; + }, + get CLONE_TOP_LEFT_CORNER() { + return 'top_left_corner'; + }, + get CLONE_BOTTOM_LEFT_CORNER() { + return 'bottom_left_corner'; + }, + get CLONE_DEBUG() { + return 'debug'; + }, + get CLONE_TYPES() { + return [$WalkontableOverlay.CLONE_TOP, $WalkontableOverlay.CLONE_BOTTOM, $WalkontableOverlay.CLONE_LEFT, $WalkontableOverlay.CLONE_TOP_LEFT_CORNER, $WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER, $WalkontableOverlay.CLONE_DEBUG]; + }, + registerOverlay: function(type, overlayClass) { + if ($WalkontableOverlay.CLONE_TYPES.indexOf(type) === -1) { + throw new Error(("Unsupported overlay (" + type + ").")); + } + registeredOverlays[type] = overlayClass; + }, + createOverlay: function(type, wot) { + return new registeredOverlays[type](wot); + }, + isOverlayTypeOf: function(overlay, type) { + if (!overlay || !registeredOverlays[type]) { + return false; + } + return overlay instanceof registeredOverlays[type]; + } +}); +; +window.WalkontableOverlay = WalkontableOverlay; + +//# +},{"eventManager":41,"helpers/dom/element":45,"helpers/object":50}],12:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableDebugOverlay: {get: function() { + return WalkontableDebugOverlay; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $___95_base__; +var addClass = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}).addClass; +var WalkontableOverlay = ($___95_base__ = require("_base"), $___95_base__ && $___95_base__.__esModule && $___95_base__ || {default: $___95_base__}).WalkontableOverlay; +var WalkontableDebugOverlay = function WalkontableDebugOverlay(wotInstance) { + $traceurRuntime.superConstructor($WalkontableDebugOverlay).call(this, wotInstance); + this.clone = this.makeClone(WalkontableOverlay.CLONE_DEBUG); + this.clone.wtTable.holder.style.opacity = 0.4; + this.clone.wtTable.holder.style.textShadow = '0 0 2px #ff0000'; + addClass(this.clone.wtTable.holder.parentNode, 'wtDebugVisible'); +}; +var $WalkontableDebugOverlay = WalkontableDebugOverlay; +($traceurRuntime.createClass)(WalkontableDebugOverlay, {}, {}, WalkontableOverlay); +; +window.WalkontableDebugOverlay = WalkontableDebugOverlay; +WalkontableOverlay.registerOverlay(WalkontableOverlay.CLONE_DEBUG, WalkontableDebugOverlay); + +//# +},{"_base":11,"helpers/dom/element":45}],13:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableLeftOverlay: {get: function() { + return WalkontableLeftOverlay; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $___95_base__; +var $__0 = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + getScrollbarWidth = $__0.getScrollbarWidth, + getScrollLeft = $__0.getScrollLeft, + getWindowScrollTop = $__0.getWindowScrollTop, + hasClass = $__0.hasClass, + outerWidth = $__0.outerWidth, + innerHeight = $__0.innerHeight, + removeClass = $__0.removeClass, + setOverlayPosition = $__0.setOverlayPosition; +var WalkontableOverlay = ($___95_base__ = require("_base"), $___95_base__ && $___95_base__.__esModule && $___95_base__ || {default: $___95_base__}).WalkontableOverlay; +var WalkontableLeftOverlay = function WalkontableLeftOverlay(wotInstance) { + $traceurRuntime.superConstructor($WalkontableLeftOverlay).call(this, wotInstance); + this.clone = this.makeClone(WalkontableOverlay.CLONE_LEFT); +}; +var $WalkontableLeftOverlay = WalkontableLeftOverlay; +($traceurRuntime.createClass)(WalkontableLeftOverlay, { + shouldBeRendered: function() { + return this.wot.getSetting('fixedColumnsLeft') || this.wot.getSetting('rowHeaders').length ? true : false; + }, + resetFixedPosition: function() { + if (!this.needFullRender || !this.wot.wtTable.holder.parentNode) { + return; + } + var overlayRoot = this.clone.wtTable.holder.parentNode; + var headerPosition = 0; + var preventOverflow = this.wot.getSetting('preventOverflow'); + if (this.trimmingContainer === window && (!preventOverflow || preventOverflow !== 'horizontal')) { + var box = this.wot.wtTable.hider.getBoundingClientRect(); + var left = Math.ceil(box.left); + var right = Math.ceil(box.right); + var finalLeft; + var finalTop; + finalTop = this.wot.wtTable.hider.style.top; + finalTop = finalTop === '' ? 0 : finalTop; + if (left < 0 && (right - overlayRoot.offsetWidth) > 0) { + finalLeft = -left; + } else { + finalLeft = 0; + } + headerPosition = finalLeft; + finalLeft = finalLeft + 'px'; + setOverlayPosition(overlayRoot, finalLeft, finalTop); + } else { + headerPosition = this.getScrollPosition(); + } + this.adjustHeaderBordersPosition(headerPosition); + this.adjustElementsSize(); + }, + setScrollPosition: function(pos) { + if (this.mainTableScrollableElement === window) { + window.scrollTo(pos, getWindowScrollTop()); + } else { + this.mainTableScrollableElement.scrollLeft = pos; + } + }, + onScroll: function() { + this.wot.getSetting('onScrollVertically'); + }, + sumCellSizes: function(from, to) { + var sum = 0; + var defaultColumnWidth = this.wot.wtSettings.defaultColumnWidth; + while (from < to) { + sum += this.wot.wtTable.getStretchedColumnWidth(from) || defaultColumnWidth; + from++; + } + return sum; + }, + adjustElementsSize: function() { + var force = arguments[0] !== (void 0) ? arguments[0] : false; + if (this.needFullRender || force) { + this.adjustRootElementSize(); + this.adjustRootChildrenSize(); + if (!force) { + this.areElementSizesAdjusted = true; + } + } + }, + adjustRootElementSize: function() { + var masterHolder = this.wot.wtTable.holder; + var scrollbarHeight = masterHolder.clientHeight === masterHolder.offsetHeight ? 0 : getScrollbarWidth(); + var overlayRoot = this.clone.wtTable.holder.parentNode; + var overlayRootStyle = overlayRoot.style; + var preventOverflow = this.wot.getSetting('preventOverflow'); + var tableWidth; + if (this.trimmingContainer !== window || preventOverflow === 'vertical') { + var height = this.wot.wtViewport.getWorkspaceHeight() - scrollbarHeight; + height = Math.min(height, innerHeight(this.wot.wtTable.wtRootElement)); + overlayRootStyle.height = height + 'px'; + } + this.clone.wtTable.holder.style.height = overlayRootStyle.height; + tableWidth = outerWidth(this.clone.wtTable.TABLE); + overlayRootStyle.width = (tableWidth === 0 ? tableWidth : tableWidth + 4) + 'px'; + }, + adjustRootChildrenSize: function() { + var scrollbarWidth = getScrollbarWidth(); + this.clone.wtTable.hider.style.height = this.hider.style.height; + this.clone.wtTable.holder.style.height = this.clone.wtTable.holder.parentNode.style.height; + if (scrollbarWidth === 0) { + scrollbarWidth = 30; + } + this.clone.wtTable.holder.style.width = parseInt(this.clone.wtTable.holder.parentNode.style.width, 10) + scrollbarWidth + 'px'; + }, + applyToDOM: function() { + var total = this.wot.getSetting('totalColumns'); + if (!this.areElementSizesAdjusted) { + this.adjustElementsSize(); + } + if (typeof this.wot.wtViewport.columnsRenderCalculator.startPosition === 'number') { + this.spreader.style.left = this.wot.wtViewport.columnsRenderCalculator.startPosition + 'px'; + } else if (total === 0) { + this.spreader.style.left = '0'; + } else { + throw new Error('Incorrect value of the columnsRenderCalculator'); + } + this.spreader.style.right = ''; + if (this.needFullRender) { + this.syncOverlayOffset(); + } + }, + syncOverlayOffset: function() { + if (typeof this.wot.wtViewport.rowsRenderCalculator.startPosition === 'number') { + this.clone.wtTable.spreader.style.top = this.wot.wtViewport.rowsRenderCalculator.startPosition + 'px'; + } else { + this.clone.wtTable.spreader.style.top = ''; + } + }, + scrollTo: function(sourceCol, beyondRendered) { + var newX = this.getTableParentOffset(); + var sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot; + var mainHolder = sourceInstance.wtTable.holder; + var scrollbarCompensation = 0; + if (beyondRendered && mainHolder.offsetWidth !== mainHolder.clientWidth) { + scrollbarCompensation = getScrollbarWidth(); + } + if (beyondRendered) { + newX += this.sumCellSizes(0, sourceCol + 1); + newX -= this.wot.wtViewport.getViewportWidth(); + } else { + newX += this.sumCellSizes(this.wot.getSetting('fixedColumnsLeft'), sourceCol); + } + newX += scrollbarCompensation; + this.setScrollPosition(newX); + }, + getTableParentOffset: function() { + var preventOverflow = this.wot.getSetting('preventOverflow'); + var offset = 0; + if (!preventOverflow && this.trimmingContainer === window) { + offset = this.wot.wtTable.holderOffset.left; + } + return offset; + }, + getScrollPosition: function() { + return getScrollLeft(this.mainTableScrollableElement); + }, + adjustHeaderBordersPosition: function(position) { + var masterParent = this.wot.wtTable.holder.parentNode; + var rowHeaders = this.wot.getSetting('rowHeaders'); + var fixedColumnsLeft = this.wot.getSetting('fixedColumnsLeft'); + if (fixedColumnsLeft && !rowHeaders.length) { + addClass(masterParent, 'innerBorderLeft'); + } else if (!fixedColumnsLeft && rowHeaders.length) { + var previousState = hasClass(masterParent, 'innerBorderLeft'); + if (position) { + addClass(masterParent, 'innerBorderLeft'); + } else { + removeClass(masterParent, 'innerBorderLeft'); + } + if (!previousState && position || previousState && !position) { + this.wot.wtOverlays.adjustElementsSize(); + } + } + } +}, {}, WalkontableOverlay); +; +window.WalkontableLeftOverlay = WalkontableLeftOverlay; +WalkontableOverlay.registerOverlay(WalkontableOverlay.CLONE_LEFT, WalkontableLeftOverlay); + +//# +},{"_base":11,"helpers/dom/element":45}],14:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableTopOverlay: {get: function() { + return WalkontableTopOverlay; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $___95_base__; +var $__0 = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + getScrollbarWidth = $__0.getScrollbarWidth, + getScrollTop = $__0.getScrollTop, + getWindowScrollLeft = $__0.getWindowScrollLeft, + hasClass = $__0.hasClass, + outerHeight = $__0.outerHeight, + innerWidth = $__0.innerWidth, + removeClass = $__0.removeClass, + setOverlayPosition = $__0.setOverlayPosition; +var WalkontableOverlay = ($___95_base__ = require("_base"), $___95_base__ && $___95_base__.__esModule && $___95_base__ || {default: $___95_base__}).WalkontableOverlay; +var WalkontableTopOverlay = function WalkontableTopOverlay(wotInstance) { + $traceurRuntime.superConstructor($WalkontableTopOverlay).call(this, wotInstance); + this.clone = this.makeClone(WalkontableOverlay.CLONE_TOP); +}; +var $WalkontableTopOverlay = WalkontableTopOverlay; +($traceurRuntime.createClass)(WalkontableTopOverlay, { + shouldBeRendered: function() { + return this.wot.getSetting('fixedRowsTop') || this.wot.getSetting('columnHeaders').length ? true : false; + }, + resetFixedPosition: function() { + if (!this.needFullRender || !this.wot.wtTable.holder.parentNode) { + return; + } + var overlayRoot = this.clone.wtTable.holder.parentNode; + var headerPosition = 0; + var preventOverflow = this.wot.getSetting('preventOverflow'); + if (this.trimmingContainer === window && (!preventOverflow || preventOverflow !== 'vertical')) { + var box = this.wot.wtTable.hider.getBoundingClientRect(); + var top = Math.ceil(box.top); + var bottom = Math.ceil(box.bottom); + var finalLeft; + var finalTop; + finalLeft = this.wot.wtTable.hider.style.left; + finalLeft = finalLeft === '' ? 0 : finalLeft; + if (top < 0 && (bottom - overlayRoot.offsetHeight) > 0) { + finalTop = -top; + } else { + finalTop = 0; + } + headerPosition = finalTop; + finalTop = finalTop + 'px'; + setOverlayPosition(overlayRoot, finalLeft, finalTop); + } else { + headerPosition = this.getScrollPosition(); + } + this.adjustHeaderBordersPosition(headerPosition); + this.adjustElementsSize(); + }, + setScrollPosition: function(pos) { + if (this.mainTableScrollableElement === window) { + window.scrollTo(getWindowScrollLeft(), pos); + } else { + this.mainTableScrollableElement.scrollTop = pos; + } + }, + onScroll: function() { + this.wot.getSetting('onScrollHorizontally'); + }, + sumCellSizes: function(from, to) { + var sum = 0; + var defaultRowHeight = this.wot.wtSettings.settings.defaultRowHeight; + while (from < to) { + var height = this.wot.wtTable.getRowHeight(from); + sum += height === void 0 ? defaultRowHeight : height; + from++; + } + return sum; + }, + adjustElementsSize: function() { + var force = arguments[0] !== (void 0) ? arguments[0] : false; + if (this.needFullRender || force) { + this.adjustRootElementSize(); + this.adjustRootChildrenSize(); + if (!force) { + this.areElementSizesAdjusted = true; + } + } + }, + adjustRootElementSize: function() { + var masterHolder = this.wot.wtTable.holder; + var scrollbarWidth = masterHolder.clientWidth === masterHolder.offsetWidth ? 0 : getScrollbarWidth(); + var overlayRoot = this.clone.wtTable.holder.parentNode; + var overlayRootStyle = overlayRoot.style; + var preventOverflow = this.wot.getSetting('preventOverflow'); + var tableHeight; + if (this.trimmingContainer !== window || preventOverflow === 'horizontal') { + var width = this.wot.wtViewport.getWorkspaceWidth() - scrollbarWidth; + width = Math.min(width, innerWidth(this.wot.wtTable.wtRootElement)); + overlayRootStyle.width = width + 'px'; + } + this.clone.wtTable.holder.style.width = overlayRootStyle.width; + tableHeight = outerHeight(this.clone.wtTable.TABLE); + overlayRootStyle.height = (tableHeight === 0 ? tableHeight : tableHeight + 4) + 'px'; + }, + adjustRootChildrenSize: function() { + var scrollbarWidth = getScrollbarWidth(); + this.clone.wtTable.hider.style.width = this.hider.style.width; + this.clone.wtTable.holder.style.width = this.clone.wtTable.holder.parentNode.style.width; + if (scrollbarWidth === 0) { + scrollbarWidth = 30; + } + this.clone.wtTable.holder.style.height = parseInt(this.clone.wtTable.holder.parentNode.style.height, 10) + scrollbarWidth + 'px'; + }, + applyToDOM: function() { + var total = this.wot.getSetting('totalRows'); + if (!this.areElementSizesAdjusted) { + this.adjustElementsSize(); + } + if (typeof this.wot.wtViewport.rowsRenderCalculator.startPosition === 'number') { + this.spreader.style.top = this.wot.wtViewport.rowsRenderCalculator.startPosition + 'px'; + } else if (total === 0) { + this.spreader.style.top = '0'; + } else { + throw new Error('Incorrect value of the rowsRenderCalculator'); + } + this.spreader.style.bottom = ''; + if (this.needFullRender) { + this.syncOverlayOffset(); + } + }, + syncOverlayOffset: function() { + if (typeof this.wot.wtViewport.columnsRenderCalculator.startPosition === 'number') { + this.clone.wtTable.spreader.style.left = this.wot.wtViewport.columnsRenderCalculator.startPosition + 'px'; + } else { + this.clone.wtTable.spreader.style.left = ''; + } + }, + scrollTo: function(sourceRow, bottomEdge) { + var newY = this.getTableParentOffset(); + var sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot; + var mainHolder = sourceInstance.wtTable.holder; + var scrollbarCompensation = 0; + if (bottomEdge && mainHolder.offsetHeight !== mainHolder.clientHeight) { + scrollbarCompensation = getScrollbarWidth(); + } + if (bottomEdge) { + var fixedRowsBottom = this.wot.getSetting('fixedRowsBottom'); + var fixedRowsTop = this.wot.getSetting('fixedRowsTop'); + var totalRows = this.wot.getSetting('totalRows'); + newY += this.sumCellSizes(0, sourceRow + 1); + newY -= this.wot.wtViewport.getViewportHeight() - this.sumCellSizes(totalRows - fixedRowsBottom, totalRows); + newY += 1; + } else { + newY += this.sumCellSizes(this.wot.getSetting('fixedRowsTop'), sourceRow); + } + newY += scrollbarCompensation; + this.setScrollPosition(newY); + }, + getTableParentOffset: function() { + if (this.mainTableScrollableElement === window) { + return this.wot.wtTable.holderOffset.top; + } else { + return 0; + } + }, + getScrollPosition: function() { + return getScrollTop(this.mainTableScrollableElement); + }, + adjustHeaderBordersPosition: function(position) { + if (this.wot.getSetting('fixedRowsTop') === 0 && this.wot.getSetting('columnHeaders').length > 0) { + var masterParent = this.wot.wtTable.holder.parentNode; + var previousState = hasClass(masterParent, 'innerBorderTop'); + if (position || this.wot.getSetting('totalRows') === 0) { + addClass(masterParent, 'innerBorderTop'); + } else { + removeClass(masterParent, 'innerBorderTop'); + } + if (!previousState && position || previousState && !position) { + this.wot.wtOverlays.adjustElementsSize(); + } + } + if (this.wot.getSetting('rowHeaders').length === 0) { + var secondHeaderCell = this.clone.wtTable.THEAD.querySelectorAll('th:nth-of-type(2)'); + if (secondHeaderCell) { + for (var i = 0; i < secondHeaderCell.length; i++) { + secondHeaderCell[i].style['border-left-width'] = 0; + } + } + } + } +}, {}, WalkontableOverlay); +; +window.WalkontableTopOverlay = WalkontableTopOverlay; +WalkontableOverlay.registerOverlay(WalkontableOverlay.CLONE_TOP, WalkontableTopOverlay); + +//# +},{"_base":11,"helpers/dom/element":45}],15:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableTopLeftCornerOverlay: {get: function() { + return WalkontableTopLeftCornerOverlay; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $___95_base__; +var $__0 = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}), + outerHeight = $__0.outerHeight, + outerWidth = $__0.outerWidth, + setOverlayPosition = $__0.setOverlayPosition; +var WalkontableOverlay = ($___95_base__ = require("_base"), $___95_base__ && $___95_base__.__esModule && $___95_base__ || {default: $___95_base__}).WalkontableOverlay; +var WalkontableTopLeftCornerOverlay = function WalkontableTopLeftCornerOverlay(wotInstance) { + $traceurRuntime.superConstructor($WalkontableTopLeftCornerOverlay).call(this, wotInstance); + this.clone = this.makeClone(WalkontableOverlay.CLONE_TOP_LEFT_CORNER); +}; +var $WalkontableTopLeftCornerOverlay = WalkontableTopLeftCornerOverlay; +($traceurRuntime.createClass)(WalkontableTopLeftCornerOverlay, { + shouldBeRendered: function() { + return (this.wot.getSetting('fixedRowsTop') || this.wot.getSetting('columnHeaders').length) && (this.wot.getSetting('fixedColumnsLeft') || this.wot.getSetting('rowHeaders').length) ? true : false; + }, + resetFixedPosition: function() { + if (!this.wot.wtTable.holder.parentNode) { + return; + } + var overlayRoot = this.clone.wtTable.holder.parentNode; + var tableHeight = outerHeight(this.clone.wtTable.TABLE); + var tableWidth = outerWidth(this.clone.wtTable.TABLE); + var preventOverflow = this.wot.getSetting('preventOverflow'); + if (this.trimmingContainer === window) { + var box = this.wot.wtTable.hider.getBoundingClientRect(); + var top = Math.ceil(box.top); + var left = Math.ceil(box.left); + var bottom = Math.ceil(box.bottom); + var right = Math.ceil(box.right); + var finalLeft = '0'; + var finalTop = '0'; + if (!preventOverflow || preventOverflow === 'vertical') { + if (left < 0 && (right - overlayRoot.offsetWidth) > 0) { + finalLeft = -left + 'px'; + } + } + if (!preventOverflow || preventOverflow === 'horizontal') { + if (top < 0 && (bottom - overlayRoot.offsetHeight) > 0) { + finalTop = -top + 'px'; + } + } + setOverlayPosition(overlayRoot, finalLeft, finalTop); + } + overlayRoot.style.height = (tableHeight === 0 ? tableHeight : tableHeight + 4) + 'px'; + overlayRoot.style.width = (tableWidth === 0 ? tableWidth : tableWidth + 4) + 'px'; + } +}, {}, WalkontableOverlay); +; +window.WalkontableTopLeftCornerOverlay = WalkontableTopLeftCornerOverlay; +WalkontableOverlay.registerOverlay(WalkontableOverlay.CLONE_TOP_LEFT_CORNER, WalkontableTopLeftCornerOverlay); + +//# +},{"_base":11,"helpers/dom/element":45}],16:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableOverlays: {get: function() { + return WalkontableOverlays; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47__46__46__47_helpers_47_unicode__, + $___46__46__47__46__46__47__46__46__47_eventManager__; +var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}), + getScrollableElement = $__0.getScrollableElement, + getScrollbarWidth = $__0.getScrollbarWidth, + getScrollLeft = $__0.getScrollLeft, + getScrollTop = $__0.getScrollTop; +var isKey = ($___46__46__47__46__46__47__46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47__46__46__47__46__46__47_helpers_47_unicode__ && $___46__46__47__46__46__47__46__46__47_helpers_47_unicode__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_unicode__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_unicode__}).isKey; +var EventManager = ($___46__46__47__46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47__46__46__47_eventManager__}).EventManager; +var WalkontableOverlays = function WalkontableOverlays(wotInstance) { + this.wot = wotInstance; + this.instance = this.wot; + this.eventManager = new EventManager(this.wot); + this.wot.update('scrollbarWidth', getScrollbarWidth()); + this.wot.update('scrollbarHeight', getScrollbarWidth()); + this.scrollableElement = getScrollableElement(this.wot.wtTable.TABLE); + this.topOverlay = WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP, this.wot); + if (typeof WalkontableBottomOverlay === 'undefined') { + this.bottomOverlay = {needFullRender: false}; + } else { + this.bottomOverlay = WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM, this.wot); + } + this.leftOverlay = WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_LEFT, this.wot); + if (this.topOverlay.needFullRender && this.leftOverlay.needFullRender) { + this.topLeftCornerOverlay = WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP_LEFT_CORNER, this.wot); + } + if (this.bottomOverlay.needFullRender && this.leftOverlay.needFullRender && typeof WalkontableBottomLeftCornerOverlay !== 'undefined') { + this.bottomLeftCornerOverlay = WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER, this.wot); + } else { + this.bottomLeftCornerOverlay = {needFullRender: false}; + } + if (this.wot.getSetting('debug')) { + this.debug = WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_DEBUG, this.wot); + } + this.destroyed = false; + this.keyPressed = false; + this.spreaderLastSize = { + width: null, + height: null + }; + this.overlayScrollPositions = { + master: { + top: 0, + left: 0 + }, + top: { + top: null, + left: 0 + }, + bottom: { + top: null, + left: 0 + }, + left: { + top: 0, + left: null + } + }; + this.verticalScrolling = false; + this.horizontalScrolling = false; + this.delegatedScrollCallback = false; + this.registerListeners(); +}; +($traceurRuntime.createClass)(WalkontableOverlays, { + refreshAll: function() { + if (!this.wot.drawn) { + return; + } + if (!this.wot.wtTable.holder.parentNode) { + this.destroy(); + return; + } + this.wot.draw(true); + if (this.verticalScrolling) { + this.leftOverlay.onScroll(); + } + if (this.horizontalScrolling) { + this.topOverlay.onScroll(); + } + this.verticalScrolling = false; + this.horizontalScrolling = false; + }, + registerListeners: function() { + var $__3 = this; + this.eventManager.addEventListener(document.documentElement, 'keydown', (function(event) { + return $__3.onKeyDown(event); + })); + this.eventManager.addEventListener(document.documentElement, 'keyup', (function() { + return $__3.onKeyUp(); + })); + this.eventManager.addEventListener(document, 'visibilitychange', (function() { + return $__3.onKeyUp(); + })); + var topOverlayScrollable = this.topOverlay.mainTableScrollableElement; + var leftOverlayScrollable = this.leftOverlay.mainTableScrollableElement; + this.eventManager.addEventListener(topOverlayScrollable, 'scroll', (function(event) { + return $__3.onTableScroll(event); + })); + if (topOverlayScrollable !== leftOverlayScrollable) { + this.eventManager.addEventListener(leftOverlayScrollable, 'scroll', (function(event) { + return $__3.onTableScroll(event); + })); + } + if (this.topOverlay.needFullRender) { + this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder, 'scroll', (function(event) { + return $__3.onTableScroll(event); + })); + this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder, 'wheel', (function(event) { + return $__3.onTableScroll(event); + })); + } + if (this.bottomOverlay.needFullRender) { + this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder, 'scroll', (function(event) { + return $__3.onTableScroll(event); + })); + this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder, 'wheel', (function(event) { + return $__3.onTableScroll(event); + })); + } + if (this.leftOverlay.needFullRender) { + this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder, 'scroll', (function(event) { + return $__3.onTableScroll(event); + })); + this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder, 'wheel', (function(event) { + return $__3.onTableScroll(event); + })); + } + if (this.topOverlay.trimmingContainer !== window && this.leftOverlay.trimmingContainer !== window) { + this.eventManager.addEventListener(window, 'wheel', (function(event) { + var overlay; + var deltaY = event.wheelDeltaY || event.deltaY; + var deltaX = event.wheelDeltaX || event.deltaX; + if ($__3.topOverlay.clone.wtTable.holder.contains(event.realTarget)) { + overlay = 'top'; + } else if ($__3.bottomOverlay.clone && $__3.bottomOverlay.clone.wtTable.holder.contains(event.realTarget)) { + overlay = 'bottom'; + } else if ($__3.leftOverlay.clone.wtTable.holder.contains(event.realTarget)) { + overlay = 'left'; + } + if (overlay == 'top' && deltaY !== 0) { + event.preventDefault(); + } else if (overlay == 'left' && deltaX !== 0) { + event.preventDefault(); + } else if (overlay == 'bottom' && deltaY !== 0) { + event.preventDefault(); + } + })); + } + }, + onTableScroll: function(event) { + if (Handsontable.mobileBrowser) { + return; + } + var masterHorizontal = this.leftOverlay.mainTableScrollableElement; + var masterVertical = this.topOverlay.mainTableScrollableElement; + var target = event.target; + if (this.keyPressed) { + if ((masterVertical !== window && target !== window && !event.target.contains(masterVertical)) || (masterHorizontal !== window && target !== window && !event.target.contains(masterHorizontal))) { + return; + } + } + if (event.type === 'scroll') { + this.syncScrollPositions(event); + } else { + this.translateMouseWheelToScroll(event); + } + }, + onKeyDown: function(event) { + this.keyPressed = isKey(event.keyCode, 'ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT'); + }, + onKeyUp: function() { + this.keyPressed = false; + }, + translateMouseWheelToScroll: function(event) { + var topOverlay = this.topOverlay.clone.wtTable.holder; + var bottomOverlay = this.bottomOverlay.clone ? this.bottomOverlay.clone.wtTable.holder : null; + var leftOverlay = this.leftOverlay.clone.wtTable.holder; + var eventMockup = {type: 'wheel'}; + var tempElem = event.target; + var deltaY = event.wheelDeltaY || (-1) * event.deltaY; + var deltaX = event.wheelDeltaX || (-1) * event.deltaX; + var parentHolder; + while (tempElem != document && tempElem != null) { + if (tempElem.className.indexOf('wtHolder') > -1) { + parentHolder = tempElem; + break; + } + tempElem = tempElem.parentNode; + } + eventMockup.target = parentHolder; + if (parentHolder == topOverlay) { + this.syncScrollPositions(eventMockup, (-0.2) * deltaY); + } else if (parentHolder == bottomOverlay) { + this.syncScrollPositions(eventMockup, (-0.2) * deltaY); + } else if (parentHolder == leftOverlay) { + this.syncScrollPositions(eventMockup, (-0.2) * deltaX); + } + return false; + }, + syncScrollPositions: function(event) { + var fakeScrollValue = arguments[1] !== (void 0) ? arguments[1] : null; + if (this.destroyed) { + return; + } + if (arguments.length === 0) { + this.syncScrollWithMaster(); + return; + } + var masterHorizontal = this.leftOverlay.mainTableScrollableElement; + var masterVertical = this.topOverlay.mainTableScrollableElement; + var target = event.target; + var tempScrollValue = 0; + var scrollValueChanged = false; + var topOverlay; + var leftOverlay; + var bottomOverlay; + var delegatedScroll = false; + var preventOverflow = this.wot.getSetting('preventOverflow'); + if (this.topOverlay.needFullRender) { + topOverlay = this.topOverlay.clone.wtTable.holder; + } + if (this.bottomOverlay.needFullRender) { + bottomOverlay = this.bottomOverlay.clone.wtTable.holder; + } + if (this.leftOverlay.needFullRender) { + leftOverlay = this.leftOverlay.clone.wtTable.holder; + } + if (target === document) { + target = window; + } + if (target === masterHorizontal || target === masterVertical) { + if (preventOverflow) { + tempScrollValue = getScrollLeft(this.scrollableElement); + } else { + tempScrollValue = getScrollLeft(target); + } + if (this.overlayScrollPositions.master.left !== tempScrollValue) { + this.horizontalScrolling = true; + this.overlayScrollPositions.master.left = tempScrollValue; + scrollValueChanged = true; + if (topOverlay) { + topOverlay.scrollLeft = tempScrollValue; + delegatedScroll = (masterHorizontal !== window); + } + if (bottomOverlay) { + bottomOverlay.scrollLeft = tempScrollValue; + delegatedScroll = (masterHorizontal !== window); + } + } + tempScrollValue = getScrollTop(target); + if (this.overlayScrollPositions.master.top !== tempScrollValue) { + this.verticalScrolling = true; + this.overlayScrollPositions.master.top = tempScrollValue; + scrollValueChanged = true; + if (leftOverlay) { + leftOverlay.scrollTop = tempScrollValue; + delegatedScroll = (masterVertical !== window); + } + } + } else if (target === bottomOverlay) { + tempScrollValue = getScrollLeft(target); + if (this.overlayScrollPositions.bottom.left !== tempScrollValue) { + this.horizontalScrolling = true; + this.overlayScrollPositions.bottom.left = tempScrollValue; + scrollValueChanged = true; + masterHorizontal.scrollLeft = tempScrollValue; + } + if (fakeScrollValue !== null) { + scrollValueChanged = true; + masterVertical.scrollTop += fakeScrollValue; + } + } else if (target === topOverlay) { + tempScrollValue = getScrollLeft(target); + if (this.overlayScrollPositions.top.left !== tempScrollValue) { + this.horizontalScrolling = true; + this.overlayScrollPositions.top.left = tempScrollValue; + scrollValueChanged = true; + masterHorizontal.scrollLeft = tempScrollValue; + } + if (fakeScrollValue !== null) { + scrollValueChanged = true; + masterVertical.scrollTop += fakeScrollValue; + } + } else if (target === leftOverlay) { + tempScrollValue = getScrollTop(target); + if (this.overlayScrollPositions.left.top !== tempScrollValue) { + this.verticalScrolling = true; + this.overlayScrollPositions.left.top = tempScrollValue; + scrollValueChanged = true; + masterVertical.scrollTop = tempScrollValue; + } + if (fakeScrollValue !== null) { + scrollValueChanged = true; + masterVertical.scrollLeft += fakeScrollValue; + } + } + if (!this.keyPressed && scrollValueChanged && event.type === 'scroll') { + if (this.delegatedScrollCallback) { + this.delegatedScrollCallback = false; + } else { + this.refreshAll(); + } + if (delegatedScroll) { + this.delegatedScrollCallback = true; + } + } + }, + syncScrollWithMaster: function() { + var master = this.topOverlay.mainTableScrollableElement; + if (this.topOverlay.needFullRender) { + this.topOverlay.clone.wtTable.holder.scrollLeft = master.scrollLeft; + } + if (this.leftOverlay.needFullRender) { + this.leftOverlay.clone.wtTable.holder.scrollTop = master.scrollTop; + } + }, + destroy: function() { + this.eventManager.destroy(); + this.topOverlay.destroy(); + if (this.bottomOverlay.clone) { + this.bottomOverlay.destroy(); + } + this.leftOverlay.destroy(); + if (this.topLeftCornerOverlay) { + this.topLeftCornerOverlay.destroy(); + } + if (this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.clone) { + this.bottomLeftCornerOverlay.destroy(); + } + if (this.debug) { + this.debug.destroy(); + } + this.destroyed = true; + }, + refresh: function() { + var fastDraw = arguments[0] !== (void 0) ? arguments[0] : false; + if (this.topOverlay.areElementSizesAdjusted && this.leftOverlay.areElementSizesAdjusted) { + var container = this.wot.wtTable.wtRootElement.parentNode || this.wot.wtTable.wtRootElement; + var width = container.clientWidth; + var height = container.clientHeight; + if (width !== this.spreaderLastSize.width || height !== this.spreaderLastSize.height) { + this.spreaderLastSize.width = width; + this.spreaderLastSize.height = height; + this.adjustElementsSize(); + } + } + if (this.bottomOverlay.clone) { + this.bottomOverlay.refresh(fastDraw); + } + this.leftOverlay.refresh(fastDraw); + this.topOverlay.refresh(fastDraw); + if (this.topLeftCornerOverlay) { + this.topLeftCornerOverlay.refresh(fastDraw); + } + if (this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.clone) { + this.bottomLeftCornerOverlay.refresh(fastDraw); + } + if (this.debug) { + this.debug.refresh(fastDraw); + } + }, + adjustElementsSize: function() { + var force = arguments[0] !== (void 0) ? arguments[0] : false; + var totalColumns = this.wot.getSetting('totalColumns'); + var totalRows = this.wot.getSetting('totalRows'); + var headerRowSize = this.wot.wtViewport.getRowHeaderWidth(); + var headerColumnSize = this.wot.wtViewport.getColumnHeaderHeight(); + var hiderStyle = this.wot.wtTable.hider.style; + hiderStyle.width = (headerRowSize + this.leftOverlay.sumCellSizes(0, totalColumns)) + 'px'; + hiderStyle.height = (headerColumnSize + this.topOverlay.sumCellSizes(0, totalRows) + 1) + 'px'; + this.topOverlay.adjustElementsSize(force); + this.leftOverlay.adjustElementsSize(force); + if (this.bottomOverlay.clone) { + this.bottomOverlay.adjustElementsSize(force); + } + }, + applyToDOM: function() { + if (!this.topOverlay.areElementSizesAdjusted || !this.leftOverlay.areElementSizesAdjusted) { + this.adjustElementsSize(); + } + this.topOverlay.applyToDOM(); + if (this.bottomOverlay.clone) { + this.bottomOverlay.applyToDOM(); + } + this.leftOverlay.applyToDOM(); + } +}, {}); +; +window.WalkontableOverlays = WalkontableOverlays; + +//# +},{"eventManager":41,"helpers/dom/element":45,"helpers/unicode":53}],17:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableScroll: {get: function() { + return WalkontableScroll; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47__46__46__47_helpers_47_number__; +var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}), + innerHeight = $__0.innerHeight, + innerWidth = $__0.innerWidth, + getScrollLeft = $__0.getScrollLeft, + getScrollTop = $__0.getScrollTop, + offset = $__0.offset; +var $__1 = ($___46__46__47__46__46__47__46__46__47_helpers_47_number__ = require("helpers/number"), $___46__46__47__46__46__47__46__46__47_helpers_47_number__ && $___46__46__47__46__46__47__46__46__47_helpers_47_number__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_number__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_number__}), + rangeEach = $__1.rangeEach, + rangeEachReverse = $__1.rangeEachReverse; +var WalkontableScroll = function WalkontableScroll(wotInstance) { + this.wot = wotInstance; + this.instance = wotInstance; +}; +($traceurRuntime.createClass)(WalkontableScroll, { + scrollViewport: function(coords) { + if (!this.wot.drawn) { + return; + } + var $__3 = this._getVariables(), + topOverlay = $__3.topOverlay, + leftOverlay = $__3.leftOverlay, + totalRows = $__3.totalRows, + totalColumns = $__3.totalColumns, + fixedRowsTop = $__3.fixedRowsTop, + fixedRowsBottom = $__3.fixedRowsBottom, + fixedColumnsLeft = $__3.fixedColumnsLeft; + if (coords.row < 0 || coords.row > totalRows - 1) { + throw new Error(("row " + coords.row + " does not exist")); + } + if (coords.col < 0 || coords.col > totalColumns - 1) { + throw new Error(("column " + coords.col + " does not exist")); + } + if (coords.row >= fixedRowsTop && coords.row < this.getFirstVisibleRow()) { + topOverlay.scrollTo(coords.row); + } else if (coords.row > this.getLastVisibleRow() && coords.row < totalRows - fixedRowsBottom) { + topOverlay.scrollTo(coords.row, true); + } + if (coords.col >= fixedColumnsLeft && coords.col < this.getFirstVisibleColumn()) { + leftOverlay.scrollTo(coords.col); + } else if (coords.col > this.getLastVisibleColumn()) { + leftOverlay.scrollTo(coords.col, true); + } + }, + getFirstVisibleRow: function() { + var $__3 = this._getVariables(), + topOverlay = $__3.topOverlay, + wtTable = $__3.wtTable, + wtViewport = $__3.wtViewport, + totalRows = $__3.totalRows, + fixedRowsTop = $__3.fixedRowsTop; + var firstVisibleRow = wtTable.getFirstVisibleRow(); + if (topOverlay.mainTableScrollableElement === window) { + var rootElementOffset = offset(wtTable.wtRootElement); + var totalTableHeight = innerHeight(wtTable.hider); + var windowHeight = innerHeight(window); + var windowScrollTop = getScrollTop(window); + if (rootElementOffset.top + totalTableHeight - windowHeight <= windowScrollTop) { + var rowsHeight = wtViewport.getColumnHeaderHeight(); + rowsHeight += topOverlay.sumCellSizes(0, fixedRowsTop); + rangeEachReverse(totalRows, 1, (function(row) { + rowsHeight += topOverlay.sumCellSizes(row - 1, row); + if (rootElementOffset.top + totalTableHeight - rowsHeight <= windowScrollTop) { + firstVisibleRow = row; + return false; + } + })); + } + } + return firstVisibleRow; + }, + getLastVisibleRow: function() { + var $__3 = this._getVariables(), + topOverlay = $__3.topOverlay, + wtTable = $__3.wtTable, + wtViewport = $__3.wtViewport, + totalRows = $__3.totalRows; + var lastVisibleRow = wtTable.getLastVisibleRow(); + if (topOverlay.mainTableScrollableElement === window) { + var rootElementOffset = offset(wtTable.wtRootElement); + var windowHeight = innerHeight(window); + var windowScrollTop = getScrollTop(window); + if (rootElementOffset.top > windowScrollTop) { + var rowsHeight = wtViewport.getColumnHeaderHeight(); + rangeEach(1, totalRows, (function(row) { + rowsHeight += topOverlay.sumCellSizes(row - 1, row); + if (rootElementOffset.top + rowsHeight - windowScrollTop >= windowHeight) { + lastVisibleRow = row - 2; + return false; + } + })); + } + } + return lastVisibleRow; + }, + getFirstVisibleColumn: function() { + var $__3 = this._getVariables(), + leftOverlay = $__3.leftOverlay, + wtTable = $__3.wtTable, + wtViewport = $__3.wtViewport, + totalColumns = $__3.totalColumns, + fixedColumnsLeft = $__3.fixedColumnsLeft; + var firstVisibleColumn = wtTable.getFirstVisibleColumn(); + if (leftOverlay.mainTableScrollableElement === window) { + var rootElementOffset = offset(wtTable.wtRootElement); + var totalTableWidth = innerWidth(wtTable.hider); + var windowWidth = innerWidth(window); + var windowScrollLeft = getScrollLeft(window); + if (rootElementOffset.left + totalTableWidth - windowWidth <= windowScrollLeft) { + var columnsWidth = wtViewport.getRowHeaderWidth(); + rangeEachReverse(totalColumns, 1, (function(column) { + columnsWidth += leftOverlay.sumCellSizes(column - 1, column); + if (rootElementOffset.left + totalTableWidth - columnsWidth <= windowScrollLeft) { + firstVisibleColumn = column; + return false; + } + })); + } + } + return firstVisibleColumn; + }, + getLastVisibleColumn: function() { + var $__3 = this._getVariables(), + leftOverlay = $__3.leftOverlay, + wtTable = $__3.wtTable, + wtViewport = $__3.wtViewport, + totalColumns = $__3.totalColumns; + var lastVisibleColumn = wtTable.getLastVisibleColumn(); + if (leftOverlay.mainTableScrollableElement === window) { + var rootElementOffset = offset(wtTable.wtRootElement); + var windowWidth = innerWidth(window); + var windowScrollLeft = getScrollLeft(window); + if (rootElementOffset.left > windowScrollLeft) { + var columnsWidth = wtViewport.getRowHeaderWidth(); + rangeEach(1, totalColumns, (function(column) { + columnsWidth += leftOverlay.sumCellSizes(column - 1, column); + if (rootElementOffset.left + columnsWidth - windowScrollLeft >= windowWidth) { + lastVisibleColumn = column - 2; + return false; + } + })); + } + } + return lastVisibleColumn; + }, + _getVariables: function() { + var wot = this.wot; + var topOverlay = wot.wtOverlays.topOverlay; + var leftOverlay = wot.wtOverlays.leftOverlay; + var wtTable = wot.wtTable; + var wtViewport = wot.wtViewport; + var totalRows = wot.getSetting('totalRows'); + var totalColumns = wot.getSetting('totalColumns'); + var fixedRowsTop = wot.getSetting('fixedRowsTop'); + var fixedRowsBottom = wot.getSetting('fixedRowsBottom'); + var fixedColumnsLeft = wot.getSetting('fixedColumnsLeft'); + return { + topOverlay: topOverlay, + leftOverlay: leftOverlay, + wtTable: wtTable, + wtViewport: wtViewport, + totalRows: totalRows, + totalColumns: totalColumns, + fixedRowsTop: fixedRowsTop, + fixedRowsBottom: fixedRowsBottom, + fixedColumnsLeft: fixedColumnsLeft + }; + } +}, {}); +; +window.WalkontableScroll = WalkontableScroll; + +//# +},{"helpers/dom/element":45,"helpers/number":49}],18:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableSelection: {get: function() { + return WalkontableSelection; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $__border__, + $__cell_47_coords__, + $__cell_47_range__; +var addClass = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}).addClass; +var WalkontableBorder = ($__border__ = require("border"), $__border__ && $__border__.__esModule && $__border__ || {default: $__border__}).WalkontableBorder; +var WalkontableCellCoords = ($__cell_47_coords__ = require("cell/coords"), $__cell_47_coords__ && $__cell_47_coords__.__esModule && $__cell_47_coords__ || {default: $__cell_47_coords__}).WalkontableCellCoords; +var WalkontableCellRange = ($__cell_47_range__ = require("cell/range"), $__cell_47_range__ && $__cell_47_range__.__esModule && $__cell_47_range__ || {default: $__cell_47_range__}).WalkontableCellRange; +var WalkontableSelection = function WalkontableSelection(settings, cellRange) { + this.settings = settings; + this.cellRange = cellRange || null; + this.instanceBorders = {}; +}; +($traceurRuntime.createClass)(WalkontableSelection, { + getBorder: function(wotInstance) { + if (this.instanceBorders[wotInstance.guid]) { + return this.instanceBorders[wotInstance.guid]; + } + this.instanceBorders[wotInstance.guid] = new WalkontableBorder(wotInstance, this.settings); + }, + isEmpty: function() { + return this.cellRange === null; + }, + add: function(coords) { + if (this.isEmpty()) { + this.cellRange = new WalkontableCellRange(coords, coords, coords); + } else { + this.cellRange.expand(coords); + } + }, + replace: function(oldCoords, newCoords) { + if (!this.isEmpty()) { + if (this.cellRange.from.isEqual(oldCoords)) { + this.cellRange.from = newCoords; + return true; + } + if (this.cellRange.to.isEqual(oldCoords)) { + this.cellRange.to = newCoords; + return true; + } + } + return false; + }, + clear: function() { + this.cellRange = null; + }, + getCorners: function() { + var topLeft = this.cellRange.getTopLeftCorner(); + var bottomRight = this.cellRange.getBottomRightCorner(); + return [topLeft.row, topLeft.col, bottomRight.row, bottomRight.col]; + }, + addClassAtCoords: function(wotInstance, sourceRow, sourceColumn, className) { + var TD = wotInstance.wtTable.getCell(new WalkontableCellCoords(sourceRow, sourceColumn)); + if (typeof TD === 'object') { + addClass(TD, className); + } + }, + draw: function(wotInstance) { + if (this.isEmpty()) { + if (this.settings.border) { + var border = this.getBorder(wotInstance); + if (border) { + border.disappear(); + } + } + return; + } + var renderedRows = wotInstance.wtTable.getRenderedRowsCount(); + var renderedColumns = wotInstance.wtTable.getRenderedColumnsCount(); + var corners = this.getCorners(); + var sourceRow, + sourceCol, + TH; + for (var column = 0; column < renderedColumns; column++) { + sourceCol = wotInstance.wtTable.columnFilter.renderedToSource(column); + if (sourceCol >= corners[1] && sourceCol <= corners[3]) { + TH = wotInstance.wtTable.getColumnHeader(sourceCol); + if (TH && this.settings.highlightColumnClassName) { + addClass(TH, this.settings.highlightColumnClassName); + } + } + } + for (var row = 0; row < renderedRows; row++) { + sourceRow = wotInstance.wtTable.rowFilter.renderedToSource(row); + if (sourceRow >= corners[0] && sourceRow <= corners[2]) { + TH = wotInstance.wtTable.getRowHeader(sourceRow); + if (TH && this.settings.highlightRowClassName) { + addClass(TH, this.settings.highlightRowClassName); + } + } + for (var column$__5 = 0; column$__5 < renderedColumns; column$__5++) { + sourceCol = wotInstance.wtTable.columnFilter.renderedToSource(column$__5); + if (sourceRow >= corners[0] && sourceRow <= corners[2] && sourceCol >= corners[1] && sourceCol <= corners[3]) { + if (this.settings.className) { + this.addClassAtCoords(wotInstance, sourceRow, sourceCol, this.settings.className); + } + } else if (sourceRow >= corners[0] && sourceRow <= corners[2]) { + if (this.settings.highlightRowClassName) { + this.addClassAtCoords(wotInstance, sourceRow, sourceCol, this.settings.highlightRowClassName); + } + } else if (sourceCol >= corners[1] && sourceCol <= corners[3]) { + if (this.settings.highlightColumnClassName) { + this.addClassAtCoords(wotInstance, sourceRow, sourceCol, this.settings.highlightColumnClassName); + } + } + } + } + wotInstance.getSetting('onBeforeDrawBorders', corners, this.settings.className); + if (this.settings.border) { + var border$__6 = this.getBorder(wotInstance); + if (border$__6) { + border$__6.appear(corners); + } + } + } +}, {}); +; +window.WalkontableSelection = WalkontableSelection; + +//# +},{"border":2,"cell/coords":5,"cell/range":6,"helpers/dom/element":45}],19:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableSettings: {get: function() { + return WalkontableSettings; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__; +var fastInnerText = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}).fastInnerText; +var WalkontableSettings = function WalkontableSettings(wotInstance, settings) { + var $__1 = this; + this.wot = wotInstance; + this.instance = wotInstance; + this.defaults = { + table: void 0, + debug: false, + externalRowCalculator: false, + stretchH: 'none', + currentRowClassName: null, + currentColumnClassName: null, + preventOverflow: function() { + return false; + }, + data: void 0, + fixedColumnsLeft: 0, + fixedRowsTop: 0, + fixedRowsBottom: 0, + minSpareRows: 0, + rowHeaders: function() { + return []; + }, + columnHeaders: function() { + return []; + }, + totalRows: void 0, + totalColumns: void 0, + cellRenderer: (function(row, column, TD) { + var cellData = $__1.getSetting('data', row, column); + fastInnerText(TD, cellData === void 0 || cellData === null ? '' : cellData); + }), + columnWidth: function(col) { + return; + }, + rowHeight: function(row) { + return; + }, + defaultRowHeight: 23, + defaultColumnWidth: 50, + selections: null, + hideBorderOnMouseDownOver: false, + viewportRowCalculatorOverride: null, + viewportColumnCalculatorOverride: null, + onCellMouseDown: null, + onCellMouseOver: null, + onCellDblClick: null, + onCellCornerMouseDown: null, + onCellCornerDblClick: null, + beforeDraw: null, + onDraw: null, + onBeforeDrawBorders: null, + onScrollVertically: null, + onScrollHorizontally: null, + onBeforeTouchScroll: null, + onAfterMomentumScroll: null, + scrollbarWidth: 10, + scrollbarHeight: 10, + renderAllRows: false, + groups: false + }; + this.settings = {}; + for (var i in this.defaults) { + if (this.defaults.hasOwnProperty(i)) { + if (settings[i] !== void 0) { + this.settings[i] = settings[i]; + } else if (this.defaults[i] === void 0) { + throw new Error('A required setting "' + i + '" was not provided'); + } else { + this.settings[i] = this.defaults[i]; + } + } + } +}; +($traceurRuntime.createClass)(WalkontableSettings, { + update: function(settings, value) { + if (value === void 0) { + for (var i in settings) { + if (settings.hasOwnProperty(i)) { + this.settings[i] = settings[i]; + } + } + } else { + this.settings[settings] = value; + } + return this.wot; + }, + getSetting: function(key, param1, param2, param3, param4) { + if (typeof this.settings[key] === 'function') { + return this.settings[key](param1, param2, param3, param4); + } else if (param1 !== void 0 && Array.isArray(this.settings[key])) { + return this.settings[key][param1]; + } else { + return this.settings[key]; + } + }, + has: function(key) { + return !!this.settings[key]; + } +}, {}); +; +window.WalkontableSettings = WalkontableSettings; + +//# +},{"helpers/dom/element":45}],20:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableTable: {get: function() { + return WalkontableTable; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $__cell_47_coords__, + $__cell_47_range__, + $__filter_47_column__, + $__filter_47_row__, + $__tableRenderer__; +var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}), + getStyle = $__0.getStyle, + getTrimmingContainer = $__0.getTrimmingContainer, + hasClass = $__0.hasClass, + index = $__0.index, + offset = $__0.offset, + removeClass = $__0.removeClass, + removeTextNodes = $__0.removeTextNodes, + overlayContainsElement = $__0.overlayContainsElement; +var WalkontableCellCoords = ($__cell_47_coords__ = require("cell/coords"), $__cell_47_coords__ && $__cell_47_coords__.__esModule && $__cell_47_coords__ || {default: $__cell_47_coords__}).WalkontableCellCoords; +var WalkontableCellRange = ($__cell_47_range__ = require("cell/range"), $__cell_47_range__ && $__cell_47_range__.__esModule && $__cell_47_range__ || {default: $__cell_47_range__}).WalkontableCellRange; +var WalkontableColumnFilter = ($__filter_47_column__ = require("filter/column"), $__filter_47_column__ && $__filter_47_column__.__esModule && $__filter_47_column__ || {default: $__filter_47_column__}).WalkontableColumnFilter; +var WalkontableRowFilter = ($__filter_47_row__ = require("filter/row"), $__filter_47_row__ && $__filter_47_row__.__esModule && $__filter_47_row__ || {default: $__filter_47_row__}).WalkontableRowFilter; +var WalkontableTableRenderer = ($__tableRenderer__ = require("tableRenderer"), $__tableRenderer__ && $__tableRenderer__.__esModule && $__tableRenderer__ || {default: $__tableRenderer__}).WalkontableTableRenderer; +var WalkontableTable = function WalkontableTable(wotInstance, table) { + this.wot = wotInstance; + this.instance = this.wot; + this.TABLE = table; + this.TBODY = null; + this.THEAD = null; + this.COLGROUP = null; + this.tableOffset = 0; + this.holderOffset = 0; + removeTextNodes(this.TABLE); + this.spreader = this.createSpreader(this.TABLE); + this.hider = this.createHider(this.spreader); + this.holder = this.createHolder(this.hider); + this.wtRootElement = this.holder.parentNode; + this.alignOverlaysWithTrimmingContainer(); + this.fixTableDomTree(); + this.colgroupChildrenLength = this.COLGROUP.childNodes.length; + this.theadChildrenLength = this.THEAD.firstChild ? this.THEAD.firstChild.childNodes.length : 0; + this.tbodyChildrenLength = this.TBODY.childNodes.length; + this.rowFilter = null; + this.columnFilter = null; +}; +($traceurRuntime.createClass)(WalkontableTable, { + fixTableDomTree: function() { + this.TBODY = this.TABLE.querySelector('tbody'); + if (!this.TBODY) { + this.TBODY = document.createElement('tbody'); + this.TABLE.appendChild(this.TBODY); + } + this.THEAD = this.TABLE.querySelector('thead'); + if (!this.THEAD) { + this.THEAD = document.createElement('thead'); + this.TABLE.insertBefore(this.THEAD, this.TBODY); + } + this.COLGROUP = this.TABLE.querySelector('colgroup'); + if (!this.COLGROUP) { + this.COLGROUP = document.createElement('colgroup'); + this.TABLE.insertBefore(this.COLGROUP, this.THEAD); + } + if (this.wot.getSetting('columnHeaders').length && !this.THEAD.childNodes.length) { + this.THEAD.appendChild(document.createElement('TR')); + } + }, + createSpreader: function(table) { + var parent = table.parentNode; + var spreader; + if (!parent || parent.nodeType !== 1 || !hasClass(parent, 'wtHolder')) { + spreader = document.createElement('div'); + spreader.className = 'wtSpreader'; + if (parent) { + parent.insertBefore(spreader, table); + } + spreader.appendChild(table); + } + spreader.style.position = 'relative'; + return spreader; + }, + createHider: function(spreader) { + var parent = spreader.parentNode; + var hider; + if (!parent || parent.nodeType !== 1 || !hasClass(parent, 'wtHolder')) { + hider = document.createElement('div'); + hider.className = 'wtHider'; + if (parent) { + parent.insertBefore(hider, spreader); + } + hider.appendChild(spreader); + } + return hider; + }, + createHolder: function(hider) { + var parent = hider.parentNode; + var holder; + if (!parent || parent.nodeType !== 1 || !hasClass(parent, 'wtHolder')) { + holder = document.createElement('div'); + holder.style.position = 'relative'; + holder.className = 'wtHolder'; + if (parent) { + parent.insertBefore(holder, hider); + } + if (!this.isWorkingOnClone()) { + holder.parentNode.className += 'ht_master handsontable'; + } + holder.appendChild(hider); + } + return holder; + }, + alignOverlaysWithTrimmingContainer: function() { + var trimmingElement = getTrimmingContainer(this.wtRootElement); + if (!this.isWorkingOnClone()) { + this.holder.parentNode.style.position = 'relative'; + if (trimmingElement === window) { + var preventOverflow = this.wot.getSetting('preventOverflow'); + if (!preventOverflow) { + this.holder.style.overflow = 'visible'; + this.wtRootElement.style.overflow = 'visible'; + } + } else { + this.holder.style.width = getStyle(trimmingElement, 'width'); + this.holder.style.height = getStyle(trimmingElement, 'height'); + this.holder.style.overflow = ''; + } + } + }, + isWorkingOnClone: function() { + return !!this.wot.cloneSource; + }, + draw: function(fastDraw) { + var totalRows = this.instance.getSetting('totalRows'); + if (!this.isWorkingOnClone()) { + this.holderOffset = offset(this.holder); + fastDraw = this.wot.wtViewport.createRenderCalculators(fastDraw); + } + if (fastDraw) { + if (!this.isWorkingOnClone()) { + this.wot.wtViewport.createVisibleCalculators(); + } + if (this.wot.wtOverlays) { + this.wot.wtOverlays.refresh(true); + } + } else { + if (this.isWorkingOnClone()) { + this.tableOffset = this.wot.cloneSource.wtTable.tableOffset; + } else { + this.tableOffset = offset(this.TABLE); + } + var startRow; + if (WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_DEBUG) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_TOP) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_TOP_LEFT_CORNER)) { + startRow = 0; + } else if (WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM) || WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)) { + startRow = totalRows - this.wot.getSetting('fixedRowsBottom'); + } else { + startRow = this.wot.wtViewport.rowsRenderCalculator.startRow; + } + var startColumn; + if (WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_DEBUG) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_LEFT) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_TOP_LEFT_CORNER) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)) { + startColumn = 0; + } else { + startColumn = this.wot.wtViewport.columnsRenderCalculator.startColumn; + } + this.rowFilter = new WalkontableRowFilter(startRow, totalRows, this.wot.getSetting('columnHeaders').length); + this.columnFilter = new WalkontableColumnFilter(startColumn, this.wot.getSetting('totalColumns'), this.wot.getSetting('rowHeaders').length); + this._doDraw(); + this.alignOverlaysWithTrimmingContainer(); + } + this.refreshSelections(fastDraw); + if (!this.isWorkingOnClone()) { + this.wot.wtOverlays.topOverlay.resetFixedPosition(); + if (this.wot.wtOverlays.bottomOverlay.clone) { + this.wot.wtOverlays.bottomOverlay.resetFixedPosition(); + } + this.wot.wtOverlays.leftOverlay.resetFixedPosition(); + if (this.wot.wtOverlays.topLeftCornerOverlay) { + this.wot.wtOverlays.topLeftCornerOverlay.resetFixedPosition(); + } + if (this.instance.wtOverlays.bottomLeftCornerOverlay && this.instance.wtOverlays.bottomLeftCornerOverlay.clone) { + this.wot.wtOverlays.bottomLeftCornerOverlay.resetFixedPosition(); + } + } + this.wot.drawn = true; + return this; + }, + _doDraw: function() { + var wtRenderer = new WalkontableTableRenderer(this); + wtRenderer.render(); + }, + removeClassFromCells: function(className) { + var nodes = this.TABLE.querySelectorAll('.' + className); + for (var i = 0, + len = nodes.length; i < len; i++) { + removeClass(nodes[i], className); + } + }, + refreshSelections: function(fastDraw) { + if (!this.wot.selections) { + return; + } + var len = this.wot.selections.length; + if (fastDraw) { + for (var i = 0; i < len; i++) { + if (this.wot.selections[i].settings.className) { + this.removeClassFromCells(this.wot.selections[i].settings.className); + } + if (this.wot.selections[i].settings.highlightRowClassName) { + this.removeClassFromCells(this.wot.selections[i].settings.highlightRowClassName); + } + if (this.wot.selections[i].settings.highlightColumnClassName) { + this.removeClassFromCells(this.wot.selections[i].settings.highlightColumnClassName); + } + } + } + for (var i$__7 = 0; i$__7 < len; i$__7++) { + this.wot.selections[i$__7].draw(this.wot, fastDraw); + } + }, + getCell: function(coords) { + if (this.isRowBeforeRenderedRows(coords.row)) { + return -1; + } else if (this.isRowAfterRenderedRows(coords.row)) { + return -2; + } + var TR = this.TBODY.childNodes[this.rowFilter.sourceToRendered(coords.row)]; + if (TR) { + return TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(coords.col)]; + } + }, + getColumnHeader: function(col) { + var level = arguments[1] !== (void 0) ? arguments[1] : 0; + var TR = this.THEAD.childNodes[level]; + if (TR) { + return TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(col)]; + } + }, + getRowHeader: function(row) { + if (this.columnFilter.sourceColumnToVisibleRowHeadedColumn(0) === 0) { + return null; + } + var TR = this.TBODY.childNodes[this.rowFilter.sourceToRendered(row)]; + if (TR) { + return TR.childNodes[0]; + } + }, + getCoords: function(TD) { + var TR = TD.parentNode; + var row = index(TR); + if (TR.parentNode === this.THEAD) { + row = this.rowFilter.visibleColHeadedRowToSourceRow(row); + } else { + row = this.rowFilter.renderedToSource(row); + } + var col = this.columnFilter.visibleRowHeadedColumnToSourceColumn(TD.cellIndex); + return new WalkontableCellCoords(row, col); + }, + getTrForRow: function(row) { + return this.TBODY.childNodes[this.rowFilter.sourceToRendered(row)]; + }, + getFirstRenderedRow: function() { + return this.wot.wtViewport.rowsRenderCalculator.startRow; + }, + getFirstVisibleRow: function() { + return this.wot.wtViewport.rowsVisibleCalculator.startRow; + }, + getFirstRenderedColumn: function() { + return this.wot.wtViewport.columnsRenderCalculator.startColumn; + }, + getFirstVisibleColumn: function() { + return this.wot.wtViewport.columnsVisibleCalculator.startColumn; + }, + getLastRenderedRow: function() { + return this.wot.wtViewport.rowsRenderCalculator.endRow; + }, + getLastVisibleRow: function() { + return this.wot.wtViewport.rowsVisibleCalculator.endRow; + }, + getLastRenderedColumn: function() { + return this.wot.wtViewport.columnsRenderCalculator.endColumn; + }, + getLastVisibleColumn: function() { + return this.wot.wtViewport.columnsVisibleCalculator.endColumn; + }, + isRowBeforeRenderedRows: function(row) { + return (this.rowFilter.sourceToRendered(row) < 0 && row >= 0); + }, + isRowAfterViewport: function(row) { + return (this.rowFilter.sourceToRendered(row) > this.getLastVisibleRow()); + }, + isRowAfterRenderedRows: function(row) { + return (this.rowFilter.sourceToRendered(row) > this.getLastRenderedRow()); + }, + isColumnBeforeViewport: function(column) { + return this.columnFilter.sourceToRendered(column) < 0 && column >= 0; + }, + isColumnAfterViewport: function(column) { + return (this.columnFilter.sourceToRendered(column) > this.getLastVisibleColumn()); + }, + isLastRowFullyVisible: function() { + return this.getLastVisibleRow() === this.getLastRenderedRow(); + }, + isLastColumnFullyVisible: function() { + return this.getLastVisibleColumn() === this.getLastRenderedColumn(); + }, + getRenderedColumnsCount: function() { + if (WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_DEBUG)) { + return this.wot.getSetting('totalColumns'); + } else if (WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_LEFT) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_TOP_LEFT_CORNER) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)) { + return this.wot.getSetting('fixedColumnsLeft'); + } else { + return this.wot.wtViewport.columnsRenderCalculator.count; + } + }, + getRenderedRowsCount: function() { + if (WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_DEBUG)) { + return this.wot.getSetting('totalRows'); + } else if (WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_TOP) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_TOP_LEFT_CORNER)) { + return this.wot.getSetting('fixedRowsTop'); + } else if (WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)) { + return this.instance.getSetting('fixedRowsBottom'); + } + return this.wot.wtViewport.rowsRenderCalculator.count; + }, + getVisibleRowsCount: function() { + return this.wot.wtViewport.rowsVisibleCalculator.count; + }, + allRowsInViewport: function() { + return this.wot.getSetting('totalRows') == this.getVisibleRowsCount(); + }, + getRowHeight: function(sourceRow) { + var height = this.wot.wtSettings.settings.rowHeight(sourceRow); + var oversizedHeight = this.wot.wtViewport.oversizedRows[sourceRow]; + if (oversizedHeight !== void 0) { + height = height === void 0 ? oversizedHeight : Math.max(height, oversizedHeight); + } + return height; + }, + getColumnHeaderHeight: function(level) { + var height = this.wot.wtSettings.settings.defaultRowHeight; + var oversizedHeight = this.wot.wtViewport.oversizedColumnHeaders[level]; + if (oversizedHeight !== void 0) { + height = height ? Math.max(height, oversizedHeight) : oversizedHeight; + } + return height; + }, + getVisibleColumnsCount: function() { + return this.wot.wtViewport.columnsVisibleCalculator.count; + }, + allColumnsInViewport: function() { + return this.wot.getSetting('totalColumns') == this.getVisibleColumnsCount(); + }, + getColumnWidth: function(sourceColumn) { + var width = this.wot.wtSettings.settings.columnWidth; + if (typeof width === 'function') { + width = width(sourceColumn); + } else if (typeof width === 'object') { + width = width[sourceColumn]; + } + return width || this.wot.wtSettings.settings.defaultColumnWidth; + }, + getStretchedColumnWidth: function(sourceColumn) { + var columnWidth = this.getColumnWidth(sourceColumn); + var width = [void 0, null].indexOf(columnWidth) === -1 ? columnWidth : this.instance.wtSettings.settings.defaultColumnWidth; + var calculator = this.wot.wtViewport.columnsRenderCalculator; + if (calculator) { + var stretchedWidth = calculator.getStretchedColumnWidth(sourceColumn, width); + if (stretchedWidth) { + width = stretchedWidth; + } + } + return width; + } +}, {}); +; +window.WalkontableTable = WalkontableTable; + +//# +},{"cell/coords":5,"cell/range":6,"filter/column":9,"filter/row":10,"helpers/dom/element":45,"tableRenderer":21}],21:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableTableRenderer: {get: function() { + return WalkontableTableRenderer; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__; +var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + empty = $__0.empty, + getScrollbarWidth = $__0.getScrollbarWidth, + hasClass = $__0.hasClass, + innerHeight = $__0.innerHeight, + outerWidth = $__0.outerWidth; +var WalkontableTableRenderer = function WalkontableTableRenderer(wtTable) { + this.wtTable = wtTable; + this.wot = wtTable.instance; + this.instance = wtTable.instance; + this.rowFilter = wtTable.rowFilter; + this.columnFilter = wtTable.columnFilter; + this.TABLE = wtTable.TABLE; + this.THEAD = wtTable.THEAD; + this.TBODY = wtTable.TBODY; + this.COLGROUP = wtTable.COLGROUP; + this.rowHeaders = []; + this.rowHeaderCount = 0; + this.columnHeaders = []; + this.columnHeaderCount = 0; + this.fixedRowsTop = 0; + this.fixedRowsBottom = 0; +}; +($traceurRuntime.createClass)(WalkontableTableRenderer, { + render: function() { + if (!this.wtTable.isWorkingOnClone()) { + this.wot.getSetting('beforeDraw', true); + } + this.rowHeaders = this.wot.getSetting('rowHeaders'); + this.rowHeaderCount = this.rowHeaders.length; + this.fixedRowsTop = this.wot.getSetting('fixedRowsTop'); + this.fixedRowsBottom = this.wot.getSetting('fixedRowsBottom'); + this.columnHeaders = this.wot.getSetting('columnHeaders'); + this.columnHeaderCount = this.columnHeaders.length; + var columnsToRender = this.wtTable.getRenderedColumnsCount(); + var rowsToRender = this.wtTable.getRenderedRowsCount(); + var totalColumns = this.wot.getSetting('totalColumns'); + var totalRows = this.wot.getSetting('totalRows'); + var workspaceWidth; + var adjusted = false; + if (WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)) { + this.columnHeaders = []; + this.columnHeaderCount = 0; + } + if (totalColumns > 0) { + this.adjustAvailableNodes(); + adjusted = true; + this.renderColumnHeaders(); + this.renderRows(totalRows, rowsToRender, columnsToRender); + if (!this.wtTable.isWorkingOnClone()) { + workspaceWidth = this.wot.wtViewport.getWorkspaceWidth(); + this.wot.wtViewport.containerWidth = null; + } + this.adjustColumnHeaderHeights(); + this.adjustColumnWidths(columnsToRender); + this.markOversizedColumns(); + } + if (!adjusted) { + this.adjustAvailableNodes(); + } + this.removeRedundantRows(rowsToRender); + if (!this.wtTable.isWorkingOnClone()) { + this.markOversizedRows(); + this.wot.wtViewport.createVisibleCalculators(); + this.wot.wtOverlays.refresh(false); + var hiderWidth = outerWidth(this.wtTable.hider); + var tableWidth = outerWidth(this.wtTable.TABLE); + if (hiderWidth !== 0 && (tableWidth !== hiderWidth)) { + this.adjustColumnWidths(columnsToRender); + } + this.wot.wtOverlays.applyToDOM(); + if (workspaceWidth !== this.wot.wtViewport.getWorkspaceWidth()) { + this.wot.wtViewport.containerWidth = null; + var firstRendered = this.wtTable.getFirstRenderedColumn(); + var lastRendered = this.wtTable.getLastRenderedColumn(); + for (var i = firstRendered; i < lastRendered; i++) { + var width = this.wtTable.getStretchedColumnWidth(i); + var renderedIndex = this.columnFilter.sourceToRendered(i); + this.COLGROUP.childNodes[renderedIndex + this.rowHeaderCount].style.width = width + 'px'; + } + } + this.wot.getSetting('onDraw', true); + } else if (WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM)) { + var masterOverlay = this.wot.cloneOverlay.instance; + this.wot.cloneOverlay.markOversizedFixedBottomRows(); + masterOverlay.wtOverlays.adjustElementsSize(); + } + }, + removeRedundantRows: function(renderedRowsCount) { + while (this.wtTable.tbodyChildrenLength > renderedRowsCount) { + this.TBODY.removeChild(this.TBODY.lastChild); + this.wtTable.tbodyChildrenLength--; + } + }, + renderRows: function(totalRows, rowsToRender, columnsToRender) { + var lastTD, + TR; + var visibleRowIndex = 0; + var sourceRowIndex = this.rowFilter.renderedToSource(visibleRowIndex); + var isWorkingOnClone = this.wtTable.isWorkingOnClone(); + while (sourceRowIndex < totalRows && sourceRowIndex >= 0) { + if (visibleRowIndex > 1000) { + console.error('Security brake: Too much TRs. Please define height for your table, which will enforce scrollbars.'); + } + if (rowsToRender !== void 0 && visibleRowIndex === rowsToRender) { + break; + } + TR = this.getOrCreateTrForRow(visibleRowIndex, TR); + this.renderRowHeaders(sourceRowIndex, TR); + this.adjustColumns(TR, columnsToRender + this.rowHeaderCount); + lastTD = this.renderCells(sourceRowIndex, TR, columnsToRender); + if (!isWorkingOnClone || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM)) { + this.resetOversizedRow(sourceRowIndex); + } + if (TR.firstChild) { + var height = this.wot.wtTable.getRowHeight(sourceRowIndex); + if (height) { + height--; + TR.firstChild.style.height = height + 'px'; + } else { + TR.firstChild.style.height = ''; + } + } + visibleRowIndex++; + sourceRowIndex = this.rowFilter.renderedToSource(visibleRowIndex); + } + }, + resetOversizedRow: function(sourceRow) { + if (this.wot.getSetting('externalRowCalculator')) { + return; + } + if (this.wot.wtViewport.oversizedRows && this.wot.wtViewport.oversizedRows[sourceRow]) { + this.wot.wtViewport.oversizedRows[sourceRow] = void 0; + } + }, + markOversizedRows: function() { + if (this.wot.getSetting('externalRowCalculator')) { + return; + } + var rowCount = this.instance.wtTable.TBODY.childNodes.length; + var expectedTableHeight = rowCount * this.instance.wtSettings.settings.defaultRowHeight; + var actualTableHeight = innerHeight(this.instance.wtTable.TBODY) - 1; + var previousRowHeight; + var rowInnerHeight; + var sourceRowIndex; + var currentTr; + var rowHeader; + var totalRows = this.instance.getSetting('totalRows'); + if (expectedTableHeight === actualTableHeight && !this.instance.getSetting('fixedRowsBottom')) { + return; + } + while (rowCount) { + rowCount--; + sourceRowIndex = this.instance.wtTable.rowFilter.renderedToSource(rowCount); + previousRowHeight = this.instance.wtTable.getRowHeight(sourceRowIndex); + currentTr = this.instance.wtTable.getTrForRow(sourceRowIndex); + rowHeader = currentTr.querySelector('th'); + if (rowHeader) { + rowInnerHeight = innerHeight(rowHeader); + } else { + rowInnerHeight = innerHeight(currentTr) - 1; + } + if ((!previousRowHeight && this.instance.wtSettings.settings.defaultRowHeight < rowInnerHeight || previousRowHeight < rowInnerHeight)) { + this.instance.wtViewport.oversizedRows[sourceRowIndex] = ++rowInnerHeight; + } + } + }, + markOversizedColumns: function() { + var overlayName = this.wot.getOverlayName(); + if (!this.columnHeaderCount || this.wot.wtViewport.isMarkedOversizedColumn[overlayName] || this.wtTable.isWorkingOnClone()) { + return; + } + var columnCount = this.wtTable.getRenderedColumnsCount(); + for (var i = 0; i < this.columnHeaderCount; i++) { + for (var renderedColumnIndex = (-1) * this.rowHeaderCount; renderedColumnIndex < columnCount; renderedColumnIndex++) { + this.markIfOversizedColumnHeader(renderedColumnIndex); + } + } + this.wot.wtViewport.isMarkedOversizedColumn[overlayName] = true; + }, + adjustColumnHeaderHeights: function() { + var columnHeaders = this.wot.getSetting('columnHeaders'); + var childs = this.wot.wtTable.THEAD.childNodes; + var oversizedCols = this.wot.wtViewport.oversizedColumnHeaders; + for (var i = 0, + len = columnHeaders.length; i < len; i++) { + if (oversizedCols[i]) { + if (childs[i].childNodes.length === 0) { + return; + } + childs[i].childNodes[0].style.height = oversizedCols[i] + 'px'; + } + } + }, + markIfOversizedColumnHeader: function(col) { + var sourceColIndex = this.wot.wtTable.columnFilter.renderedToSource(col); + var level = this.columnHeaderCount; + var defaultRowHeight = this.wot.wtSettings.settings.defaultRowHeight; + var previousColHeaderHeight; + var currentHeader; + var currentHeaderHeight; + while (level) { + level--; + previousColHeaderHeight = this.wot.wtTable.getColumnHeaderHeight(level); + currentHeader = this.wot.wtTable.getColumnHeader(sourceColIndex, level); + if (!currentHeader) { + continue; + } + currentHeaderHeight = innerHeight(currentHeader); + if (!previousColHeaderHeight && defaultRowHeight < currentHeaderHeight || previousColHeaderHeight < currentHeaderHeight) { + this.wot.wtViewport.oversizedColumnHeaders[level] = currentHeaderHeight; + } + } + }, + renderCells: function(sourceRowIndex, TR, columnsToRender) { + var TD; + var sourceColIndex; + for (var visibleColIndex = 0; visibleColIndex < columnsToRender; visibleColIndex++) { + sourceColIndex = this.columnFilter.renderedToSource(visibleColIndex); + if (visibleColIndex === 0) { + TD = TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(sourceColIndex)]; + } else { + TD = TD.nextSibling; + } + if (TD.nodeName == 'TH') { + TD = replaceThWithTd(TD, TR); + } + if (!hasClass(TD, 'hide')) { + TD.className = ''; + } + TD.removeAttribute('style'); + this.wot.wtSettings.settings.cellRenderer(sourceRowIndex, sourceColIndex, TD); + } + return TD; + }, + adjustColumnWidths: function(columnsToRender) { + var scrollbarCompensation = 0; + var sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot; + var mainHolder = sourceInstance.wtTable.holder; + if (mainHolder.offsetHeight < mainHolder.scrollHeight) { + scrollbarCompensation = getScrollbarWidth(); + } + this.wot.wtViewport.columnsRenderCalculator.refreshStretching(this.wot.wtViewport.getViewportWidth() - scrollbarCompensation); + for (var renderedColIndex = 0; renderedColIndex < columnsToRender; renderedColIndex++) { + var width = this.wtTable.getStretchedColumnWidth(this.columnFilter.renderedToSource(renderedColIndex)); + this.COLGROUP.childNodes[renderedColIndex + this.rowHeaderCount].style.width = width + 'px'; + } + }, + appendToTbody: function(TR) { + this.TBODY.appendChild(TR); + this.wtTable.tbodyChildrenLength++; + }, + getOrCreateTrForRow: function(rowIndex, currentTr) { + var TR; + if (rowIndex >= this.wtTable.tbodyChildrenLength) { + TR = this.createRow(); + this.appendToTbody(TR); + } else if (rowIndex === 0) { + TR = this.TBODY.firstChild; + } else { + TR = currentTr.nextSibling; + } + if (TR.className) { + TR.removeAttribute('class'); + } + return TR; + }, + createRow: function() { + var TR = document.createElement('TR'); + for (var visibleColIndex = 0; visibleColIndex < this.rowHeaderCount; visibleColIndex++) { + TR.appendChild(document.createElement('TH')); + } + return TR; + }, + renderRowHeader: function(row, col, TH) { + TH.className = ''; + TH.removeAttribute('style'); + this.rowHeaders[col](row, TH, col); + }, + renderRowHeaders: function(row, TR) { + for (var TH = TR.firstChild, + visibleColIndex = 0; visibleColIndex < this.rowHeaderCount; visibleColIndex++) { + if (!TH) { + TH = document.createElement('TH'); + TR.appendChild(TH); + } else if (TH.nodeName == 'TD') { + TH = replaceTdWithTh(TH, TR); + } + this.renderRowHeader(row, visibleColIndex, TH); + TH = TH.nextSibling; + } + }, + adjustAvailableNodes: function() { + this.adjustColGroups(); + this.adjustThead(); + }, + renderColumnHeaders: function() { + var overlayName = this.wot.getOverlayName(); + if (!this.columnHeaderCount) { + return; + } + var columnCount = this.wtTable.getRenderedColumnsCount(); + for (var i = 0; i < this.columnHeaderCount; i++) { + var TR = this.getTrForColumnHeaders(i); + for (var renderedColumnIndex = (-1) * this.rowHeaderCount; renderedColumnIndex < columnCount; renderedColumnIndex++) { + var sourceCol = this.columnFilter.renderedToSource(renderedColumnIndex); + this.renderColumnHeader(i, sourceCol, TR.childNodes[renderedColumnIndex + this.rowHeaderCount]); + } + } + }, + adjustColGroups: function() { + var columnCount = this.wtTable.getRenderedColumnsCount(); + while (this.wtTable.colgroupChildrenLength < columnCount + this.rowHeaderCount) { + this.COLGROUP.appendChild(document.createElement('COL')); + this.wtTable.colgroupChildrenLength++; + } + while (this.wtTable.colgroupChildrenLength > columnCount + this.rowHeaderCount) { + this.COLGROUP.removeChild(this.COLGROUP.lastChild); + this.wtTable.colgroupChildrenLength--; + } + if (this.rowHeaderCount) { + addClass(this.COLGROUP.childNodes[0], 'rowHeader'); + } + }, + adjustThead: function() { + var columnCount = this.wtTable.getRenderedColumnsCount(); + var TR = this.THEAD.firstChild; + if (this.columnHeaders.length) { + for (var i = 0, + len = this.columnHeaders.length; i < len; i++) { + TR = this.THEAD.childNodes[i]; + if (!TR) { + TR = document.createElement('TR'); + this.THEAD.appendChild(TR); + } + this.theadChildrenLength = TR.childNodes.length; + while (this.theadChildrenLength < columnCount + this.rowHeaderCount) { + TR.appendChild(document.createElement('TH')); + this.theadChildrenLength++; + } + while (this.theadChildrenLength > columnCount + this.rowHeaderCount) { + TR.removeChild(TR.lastChild); + this.theadChildrenLength--; + } + } + var theadChildrenLength = this.THEAD.childNodes.length; + if (theadChildrenLength > this.columnHeaders.length) { + for (var i$__2 = this.columnHeaders.length; i$__2 < theadChildrenLength; i$__2++) { + this.THEAD.removeChild(this.THEAD.lastChild); + } + } + } else if (TR) { + empty(TR); + } + }, + getTrForColumnHeaders: function(index) { + return this.THEAD.childNodes[index]; + }, + renderColumnHeader: function(row, col, TH) { + TH.className = ''; + TH.removeAttribute('style'); + return this.columnHeaders[row](col, TH, row); + }, + adjustColumns: function(TR, desiredCount) { + var count = TR.childNodes.length; + while (count < desiredCount) { + var TD = document.createElement('TD'); + TR.appendChild(TD); + count++; + } + while (count > desiredCount) { + TR.removeChild(TR.lastChild); + count--; + } + }, + removeRedundantColumns: function(columnsToRender) { + while (this.wtTable.tbodyChildrenLength > columnsToRender) { + this.TBODY.removeChild(this.TBODY.lastChild); + this.wtTable.tbodyChildrenLength--; + } + } +}, {}); +function replaceTdWithTh(TD, TR) { + var TH = document.createElement('TH'); + TR.insertBefore(TH, TD); + TR.removeChild(TD); + return TH; +} +function replaceThWithTd(TH, TR) { + var TD = document.createElement('TD'); + TR.insertBefore(TD, TH); + TR.removeChild(TH); + return TD; +} +; +window.WalkontableTableRenderer = WalkontableTableRenderer; + +//# +},{"helpers/dom/element":45}],22:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableViewport: {get: function() { + return WalkontableViewport; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47__46__46__47_eventManager__, + $__calculator_47_viewportColumns__, + $__calculator_47_viewportRows__; +var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}), + getScrollbarWidth = $__0.getScrollbarWidth, + getScrollTop = $__0.getScrollTop, + getStyle = $__0.getStyle, + offset = $__0.offset, + outerHeight = $__0.outerHeight, + outerWidth = $__0.outerWidth; +var EventManager = ($___46__46__47__46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47__46__46__47_eventManager__}).EventManager; +var WalkontableViewportColumnsCalculator = ($__calculator_47_viewportColumns__ = require("calculator/viewportColumns"), $__calculator_47_viewportColumns__ && $__calculator_47_viewportColumns__.__esModule && $__calculator_47_viewportColumns__ || {default: $__calculator_47_viewportColumns__}).WalkontableViewportColumnsCalculator; +var WalkontableViewportRowsCalculator = ($__calculator_47_viewportRows__ = require("calculator/viewportRows"), $__calculator_47_viewportRows__ && $__calculator_47_viewportRows__.__esModule && $__calculator_47_viewportRows__ || {default: $__calculator_47_viewportRows__}).WalkontableViewportRowsCalculator; +var WalkontableViewport = function WalkontableViewport(wotInstance) { + var $__4 = this; + this.wot = wotInstance; + this.instance = this.wot; + this.oversizedRows = []; + this.oversizedColumnHeaders = []; + this.isMarkedOversizedColumn = {}; + this.clientHeight = 0; + this.containerWidth = NaN; + this.rowHeaderWidth = NaN; + this.rowsVisibleCalculator = null; + this.columnsVisibleCalculator = null; + this.eventManager = new EventManager(this.wot); + this.eventManager.addEventListener(window, 'resize', (function() { + $__4.clientHeight = $__4.getWorkspaceHeight(); + })); +}; +($traceurRuntime.createClass)(WalkontableViewport, { + getWorkspaceHeight: function() { + var trimmingContainer = this.instance.wtOverlays.topOverlay.trimmingContainer; + var elemHeight; + var height = 0; + if (trimmingContainer === window) { + height = document.documentElement.clientHeight; + } else { + elemHeight = outerHeight(trimmingContainer); + height = (elemHeight > 0 && trimmingContainer.clientHeight > 0) ? trimmingContainer.clientHeight : Infinity; + } + return height; + }, + getWorkspaceWidth: function() { + var width; + var totalColumns = this.wot.getSetting('totalColumns'); + var trimmingContainer = this.instance.wtOverlays.leftOverlay.trimmingContainer; + var overflow; + var stretchSetting = this.wot.getSetting('stretchH'); + var docOffsetWidth = document.documentElement.offsetWidth; + var preventOverflow = this.wot.getSetting('preventOverflow'); + if (preventOverflow) { + return outerWidth(this.instance.wtTable.wtRootElement); + } + if (Handsontable.freezeOverlays) { + width = Math.min(docOffsetWidth - this.getWorkspaceOffset().left, docOffsetWidth); + } else { + width = Math.min(this.getContainerFillWidth(), docOffsetWidth - this.getWorkspaceOffset().left, docOffsetWidth); + } + if (trimmingContainer === window && totalColumns > 0 && this.sumColumnWidths(0, totalColumns - 1) > width) { + return document.documentElement.clientWidth; + } + if (trimmingContainer !== window) { + overflow = getStyle(this.instance.wtOverlays.leftOverlay.trimmingContainer, 'overflow'); + if (overflow == 'scroll' || overflow == 'hidden' || overflow == 'auto') { + return Math.max(width, trimmingContainer.clientWidth); + } + } + if (stretchSetting === 'none' || !stretchSetting) { + return Math.max(width, outerWidth(this.instance.wtTable.TABLE)); + } else { + return width; + } + }, + hasVerticalScroll: function() { + return this.getWorkspaceActualHeight() > this.getWorkspaceHeight(); + }, + hasHorizontalScroll: function() { + return this.getWorkspaceActualWidth() > this.getWorkspaceWidth(); + }, + sumColumnWidths: function(from, length) { + var sum = 0; + while (from < length) { + sum += this.wot.wtTable.getColumnWidth(from); + from++; + } + return sum; + }, + getContainerFillWidth: function() { + if (this.containerWidth) { + return this.containerWidth; + } + var mainContainer = this.instance.wtTable.holder; + var fillWidth; + var dummyElement; + dummyElement = document.createElement('div'); + dummyElement.style.width = '100%'; + dummyElement.style.height = '1px'; + mainContainer.appendChild(dummyElement); + fillWidth = dummyElement.offsetWidth; + this.containerWidth = fillWidth; + mainContainer.removeChild(dummyElement); + return fillWidth; + }, + getWorkspaceOffset: function() { + return offset(this.wot.wtTable.TABLE); + }, + getWorkspaceActualHeight: function() { + return outerHeight(this.wot.wtTable.TABLE); + }, + getWorkspaceActualWidth: function() { + return outerWidth(this.wot.wtTable.TABLE) || outerWidth(this.wot.wtTable.TBODY) || outerWidth(this.wot.wtTable.THEAD); + }, + getColumnHeaderHeight: function() { + if (isNaN(this.columnHeaderHeight)) { + this.columnHeaderHeight = outerHeight(this.wot.wtTable.THEAD); + } + return this.columnHeaderHeight; + }, + getViewportHeight: function() { + var containerHeight = this.getWorkspaceHeight(); + var columnHeaderHeight; + if (containerHeight === Infinity) { + return containerHeight; + } + columnHeaderHeight = this.getColumnHeaderHeight(); + if (columnHeaderHeight > 0) { + containerHeight -= columnHeaderHeight; + } + return containerHeight; + }, + getRowHeaderWidth: function() { + if (this.wot.cloneSource) { + return this.wot.cloneSource.wtViewport.getRowHeaderWidth(); + } + if (isNaN(this.rowHeaderWidth)) { + var rowHeaders = this.instance.getSetting('rowHeaders'); + if (rowHeaders.length) { + var TH = this.instance.wtTable.TABLE.querySelector('TH'); + this.rowHeaderWidth = 0; + for (var i = 0, + len = rowHeaders.length; i < len; i++) { + if (TH) { + this.rowHeaderWidth += outerWidth(TH); + TH = TH.nextSibling; + } else { + this.rowHeaderWidth += 50; + } + } + } else { + this.rowHeaderWidth = 0; + } + } + return this.rowHeaderWidth; + }, + getViewportWidth: function() { + var containerWidth = this.getWorkspaceWidth(); + var rowHeaderWidth; + if (containerWidth === Infinity) { + return containerWidth; + } + rowHeaderWidth = this.getRowHeaderWidth(); + if (rowHeaderWidth > 0) { + return containerWidth - rowHeaderWidth; + } + return containerWidth; + }, + createRowsCalculator: function() { + var visible = arguments[0] !== (void 0) ? arguments[0] : false; + var $__4 = this; + var height; + var pos; + var fixedRowsTop; + var scrollbarHeight; + var fixedRowsBottom; + var fixedRowsHeight; + var totalRows; + this.rowHeaderWidth = NaN; + if (this.wot.wtSettings.settings.renderAllRows) { + height = Infinity; + } else { + height = this.getViewportHeight(); + } + pos = this.wot.wtOverlays.topOverlay.getScrollPosition() - this.wot.wtOverlays.topOverlay.getTableParentOffset(); + if (pos < 0) { + pos = 0; + } + fixedRowsTop = this.wot.getSetting('fixedRowsTop'); + fixedRowsBottom = this.wot.getSetting('fixedRowsBottom'); + totalRows = this.wot.getSetting('totalRows'); + if (fixedRowsTop) { + fixedRowsHeight = this.wot.wtOverlays.topOverlay.sumCellSizes(0, fixedRowsTop); + pos += fixedRowsHeight; + height -= fixedRowsHeight; + } + if (fixedRowsBottom && this.wot.wtOverlays.bottomOverlay.clone) { + fixedRowsHeight = this.wot.wtOverlays.bottomOverlay.sumCellSizes(totalRows - fixedRowsBottom, totalRows); + height -= fixedRowsHeight; + } + if (this.wot.wtTable.holder.clientHeight === this.wot.wtTable.holder.offsetHeight) { + scrollbarHeight = 0; + } else { + scrollbarHeight = getScrollbarWidth(); + } + return new WalkontableViewportRowsCalculator(height, pos, this.wot.getSetting('totalRows'), (function(sourceRow) { + return $__4.wot.wtTable.getRowHeight(sourceRow); + }), visible ? null : this.wot.wtSettings.settings.viewportRowCalculatorOverride, visible, scrollbarHeight); + }, + createColumnsCalculator: function() { + var visible = arguments[0] !== (void 0) ? arguments[0] : false; + var $__4 = this; + var width = this.getViewportWidth(); + var pos; + var fixedColumnsLeft; + this.columnHeaderHeight = NaN; + pos = this.wot.wtOverlays.leftOverlay.getScrollPosition() - this.wot.wtOverlays.leftOverlay.getTableParentOffset(); + if (pos < 0) { + pos = 0; + } + fixedColumnsLeft = this.wot.getSetting('fixedColumnsLeft'); + if (fixedColumnsLeft) { + var fixedColumnsWidth = this.wot.wtOverlays.leftOverlay.sumCellSizes(0, fixedColumnsLeft); + pos += fixedColumnsWidth; + width -= fixedColumnsWidth; + } + if (this.wot.wtTable.holder.clientWidth !== this.wot.wtTable.holder.offsetWidth) { + width -= getScrollbarWidth(); + } + return new WalkontableViewportColumnsCalculator(width, pos, this.wot.getSetting('totalColumns'), (function(sourceCol) { + return $__4.wot.wtTable.getColumnWidth(sourceCol); + }), visible ? null : this.wot.wtSettings.settings.viewportColumnCalculatorOverride, visible, this.wot.getSetting('stretchH')); + }, + createRenderCalculators: function() { + var fastDraw = arguments[0] !== (void 0) ? arguments[0] : false; + if (fastDraw) { + var proposedRowsVisibleCalculator = this.createRowsCalculator(true); + var proposedColumnsVisibleCalculator = this.createColumnsCalculator(true); + if (!(this.areAllProposedVisibleRowsAlreadyRendered(proposedRowsVisibleCalculator) && this.areAllProposedVisibleColumnsAlreadyRendered(proposedColumnsVisibleCalculator))) { + fastDraw = false; + } + } + if (!fastDraw) { + this.rowsRenderCalculator = this.createRowsCalculator(); + this.columnsRenderCalculator = this.createColumnsCalculator(); + } + this.rowsVisibleCalculator = null; + this.columnsVisibleCalculator = null; + return fastDraw; + }, + createVisibleCalculators: function() { + this.rowsVisibleCalculator = this.createRowsCalculator(true); + this.columnsVisibleCalculator = this.createColumnsCalculator(true); + }, + areAllProposedVisibleRowsAlreadyRendered: function(proposedRowsVisibleCalculator) { + if (this.rowsVisibleCalculator) { + if (proposedRowsVisibleCalculator.startRow < this.rowsRenderCalculator.startRow || (proposedRowsVisibleCalculator.startRow === this.rowsRenderCalculator.startRow && proposedRowsVisibleCalculator.startRow > 0)) { + return false; + } else if (proposedRowsVisibleCalculator.endRow > this.rowsRenderCalculator.endRow || (proposedRowsVisibleCalculator.endRow === this.rowsRenderCalculator.endRow && proposedRowsVisibleCalculator.endRow < this.wot.getSetting('totalRows') - 1)) { + return false; + } else { + return true; + } + } + return false; + }, + areAllProposedVisibleColumnsAlreadyRendered: function(proposedColumnsVisibleCalculator) { + if (this.columnsVisibleCalculator) { + if (proposedColumnsVisibleCalculator.startColumn < this.columnsRenderCalculator.startColumn || (proposedColumnsVisibleCalculator.startColumn === this.columnsRenderCalculator.startColumn && proposedColumnsVisibleCalculator.startColumn > 0)) { + return false; + } else if (proposedColumnsVisibleCalculator.endColumn > this.columnsRenderCalculator.endColumn || (proposedColumnsVisibleCalculator.endColumn === this.columnsRenderCalculator.endColumn && proposedColumnsVisibleCalculator.endColumn < this.wot.getSetting('totalColumns') - 1)) { + return false; + } else { + return true; + } + } + return false; + } +}, {}); +; +window.WalkontableViewport = WalkontableViewport; + +//# +},{"calculator/viewportColumns":3,"calculator/viewportRows":4,"eventManager":41,"helpers/dom/element":45}],23:[function(require,module,exports){ +"use strict"; +var $__shims_47_classes__, + $__es6collections__, + $__pluginHooks__, + $__core__, + $__renderers_47__95_cellDecorator__, + $__cellTypes__, + $___46__46__47_plugins_47_jqueryHandsontable__, + $__helpers_47_array__, + $__helpers_47_browser__, + $__helpers_47_data__, + $__helpers_47_function__, + $__helpers_47_mixed__, + $__helpers_47_number__, + $__helpers_47_object__, + $__helpers_47_setting__, + $__helpers_47_string__, + $__helpers_47_unicode__, + $__helpers_47_dom_47_element__, + $__helpers_47_dom_47_event__; +Handsontable = function Handsontable(rootElement, userSettings) { + var instance = new Handsontable.Core(rootElement, userSettings || {}); + instance.init(); + return instance; +}; +($__shims_47_classes__ = require("shims/classes"), $__shims_47_classes__ && $__shims_47_classes__.__esModule && $__shims_47_classes__ || {default: $__shims_47_classes__}); +($__es6collections__ = require("es6collections"), $__es6collections__ && $__es6collections__.__esModule && $__es6collections__ || {default: $__es6collections__}); +var Hooks = ($__pluginHooks__ = require("pluginHooks"), $__pluginHooks__ && $__pluginHooks__.__esModule && $__pluginHooks__ || {default: $__pluginHooks__}).Hooks; +if (!Handsontable.hooks) { + Handsontable.hooks = new Hooks(); +} +($__core__ = require("core"), $__core__ && $__core__.__esModule && $__core__ || {default: $__core__}); +($__renderers_47__95_cellDecorator__ = require("renderers/_cellDecorator"), $__renderers_47__95_cellDecorator__ && $__renderers_47__95_cellDecorator__.__esModule && $__renderers_47__95_cellDecorator__ || {default: $__renderers_47__95_cellDecorator__}); +($__cellTypes__ = require("cellTypes"), $__cellTypes__ && $__cellTypes__.__esModule && $__cellTypes__ || {default: $__cellTypes__}); +($___46__46__47_plugins_47_jqueryHandsontable__ = require("plugins/jqueryHandsontable"), $___46__46__47_plugins_47_jqueryHandsontable__ && $___46__46__47_plugins_47_jqueryHandsontable__.__esModule && $___46__46__47_plugins_47_jqueryHandsontable__ || {default: $___46__46__47_plugins_47_jqueryHandsontable__}); +var arrayHelpers = ($__helpers_47_array__ = require("helpers/array"), $__helpers_47_array__ && $__helpers_47_array__.__esModule && $__helpers_47_array__ || {default: $__helpers_47_array__}); +var browserHelpers = ($__helpers_47_browser__ = require("helpers/browser"), $__helpers_47_browser__ && $__helpers_47_browser__.__esModule && $__helpers_47_browser__ || {default: $__helpers_47_browser__}); +var dataHelpers = ($__helpers_47_data__ = require("helpers/data"), $__helpers_47_data__ && $__helpers_47_data__.__esModule && $__helpers_47_data__ || {default: $__helpers_47_data__}); +var functionHelpers = ($__helpers_47_function__ = require("helpers/function"), $__helpers_47_function__ && $__helpers_47_function__.__esModule && $__helpers_47_function__ || {default: $__helpers_47_function__}); +var mixedHelpers = ($__helpers_47_mixed__ = require("helpers/mixed"), $__helpers_47_mixed__ && $__helpers_47_mixed__.__esModule && $__helpers_47_mixed__ || {default: $__helpers_47_mixed__}); +var numberHelpers = ($__helpers_47_number__ = require("helpers/number"), $__helpers_47_number__ && $__helpers_47_number__.__esModule && $__helpers_47_number__ || {default: $__helpers_47_number__}); +var objectHelpers = ($__helpers_47_object__ = require("helpers/object"), $__helpers_47_object__ && $__helpers_47_object__.__esModule && $__helpers_47_object__ || {default: $__helpers_47_object__}); +var settingHelpers = ($__helpers_47_setting__ = require("helpers/setting"), $__helpers_47_setting__ && $__helpers_47_setting__.__esModule && $__helpers_47_setting__ || {default: $__helpers_47_setting__}); +var stringHelpers = ($__helpers_47_string__ = require("helpers/string"), $__helpers_47_string__ && $__helpers_47_string__.__esModule && $__helpers_47_string__ || {default: $__helpers_47_string__}); +var unicodeHelpers = ($__helpers_47_unicode__ = require("helpers/unicode"), $__helpers_47_unicode__ && $__helpers_47_unicode__.__esModule && $__helpers_47_unicode__ || {default: $__helpers_47_unicode__}); +var domHelpers = ($__helpers_47_dom_47_element__ = require("helpers/dom/element"), $__helpers_47_dom_47_element__ && $__helpers_47_dom_47_element__.__esModule && $__helpers_47_dom_47_element__ || {default: $__helpers_47_dom_47_element__}); +var domEventHelpers = ($__helpers_47_dom_47_event__ = require("helpers/dom/event"), $__helpers_47_dom_47_event__ && $__helpers_47_dom_47_event__.__esModule && $__helpers_47_dom_47_event__ || {default: $__helpers_47_dom_47_event__}); +var HELPERS = [arrayHelpers, browserHelpers, dataHelpers, functionHelpers, mixedHelpers, numberHelpers, objectHelpers, settingHelpers, stringHelpers, unicodeHelpers]; +var DOM = [domHelpers, domEventHelpers]; +Handsontable.buildDate = 'Fri Jan 08 2016 13:02:33 GMT+0100 (CET)'; +Handsontable.packageName = 'handsontable'; +Handsontable.version = '0.20.3'; +var baseVersion = '@@baseVersion'; +if (!/^@@/.test(baseVersion)) { + Handsontable.baseVersion = baseVersion; +} +Handsontable.plugins = {}; +Handsontable.helper = {}; +Handsontable.dom = {}; +Handsontable.Dom = Handsontable.dom; +arrayHelpers.arrayEach(HELPERS, (function(helper) { + arrayHelpers.arrayEach(Object.getOwnPropertyNames(helper), (function(key) { + if (key.charAt(0) !== '_') { + Handsontable.helper[key] = helper[key]; + } + })); +})); +arrayHelpers.arrayEach(DOM, (function(helper) { + arrayHelpers.arrayEach(Object.getOwnPropertyNames(helper), (function(key) { + if (key.charAt(0) !== '_') { + Handsontable.dom[key] = helper[key]; + } + })); +})); + +//# +},{"cellTypes":24,"core":25,"es6collections":"es6collections","helpers/array":42,"helpers/browser":43,"helpers/data":44,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/function":47,"helpers/mixed":48,"helpers/number":49,"helpers/object":50,"helpers/setting":51,"helpers/string":52,"helpers/unicode":53,"pluginHooks":56,"plugins/jqueryHandsontable":1,"renderers/_cellDecorator":89,"shims/classes":96}],24:[function(require,module,exports){ +"use strict"; +var $__helpers_47_browser__, + $__editors__, + $__renderers__, + $__editors_47_autocompleteEditor__, + $__editors_47_checkboxEditor__, + $__editors_47_dateEditor__, + $__editors_47_dropdownEditor__, + $__editors_47_handsontableEditor__, + $__editors_47_mobileTextEditor__, + $__editors_47_numericEditor__, + $__editors_47_passwordEditor__, + $__editors_47_selectEditor__, + $__editors_47_textEditor__, + $__renderers_47_autocompleteRenderer__, + $__renderers_47_checkboxRenderer__, + $__renderers_47_htmlRenderer__, + $__renderers_47_numericRenderer__, + $__renderers_47_passwordRenderer__, + $__renderers_47_textRenderer__, + $__validators_47_autocompleteValidator__, + $__validators_47_dateValidator__, + $__validators_47_numericValidator__; +var isMobileBrowser = ($__helpers_47_browser__ = require("helpers/browser"), $__helpers_47_browser__ && $__helpers_47_browser__.__esModule && $__helpers_47_browser__ || {default: $__helpers_47_browser__}).isMobileBrowser; +var getEditorConstructor = ($__editors__ = require("editors"), $__editors__ && $__editors__.__esModule && $__editors__ || {default: $__editors__}).getEditorConstructor; +var getRenderer = ($__renderers__ = require("renderers"), $__renderers__ && $__renderers__.__esModule && $__renderers__ || {default: $__renderers__}).getRenderer; +var AutocompleteEditor = ($__editors_47_autocompleteEditor__ = require("editors/autocompleteEditor"), $__editors_47_autocompleteEditor__ && $__editors_47_autocompleteEditor__.__esModule && $__editors_47_autocompleteEditor__ || {default: $__editors_47_autocompleteEditor__}).AutocompleteEditor; +var CheckboxEditor = ($__editors_47_checkboxEditor__ = require("editors/checkboxEditor"), $__editors_47_checkboxEditor__ && $__editors_47_checkboxEditor__.__esModule && $__editors_47_checkboxEditor__ || {default: $__editors_47_checkboxEditor__}).CheckboxEditor; +var DateEditor = ($__editors_47_dateEditor__ = require("editors/dateEditor"), $__editors_47_dateEditor__ && $__editors_47_dateEditor__.__esModule && $__editors_47_dateEditor__ || {default: $__editors_47_dateEditor__}).DateEditor; +var DropdownEditor = ($__editors_47_dropdownEditor__ = require("editors/dropdownEditor"), $__editors_47_dropdownEditor__ && $__editors_47_dropdownEditor__.__esModule && $__editors_47_dropdownEditor__ || {default: $__editors_47_dropdownEditor__}).DropdownEditor; +var HandsontableEditor = ($__editors_47_handsontableEditor__ = require("editors/handsontableEditor"), $__editors_47_handsontableEditor__ && $__editors_47_handsontableEditor__.__esModule && $__editors_47_handsontableEditor__ || {default: $__editors_47_handsontableEditor__}).HandsontableEditor; +var MobileTextEditor = ($__editors_47_mobileTextEditor__ = require("editors/mobileTextEditor"), $__editors_47_mobileTextEditor__ && $__editors_47_mobileTextEditor__.__esModule && $__editors_47_mobileTextEditor__ || {default: $__editors_47_mobileTextEditor__}).MobileTextEditor; +var NumericEditor = ($__editors_47_numericEditor__ = require("editors/numericEditor"), $__editors_47_numericEditor__ && $__editors_47_numericEditor__.__esModule && $__editors_47_numericEditor__ || {default: $__editors_47_numericEditor__}).NumericEditor; +var PasswordEditor = ($__editors_47_passwordEditor__ = require("editors/passwordEditor"), $__editors_47_passwordEditor__ && $__editors_47_passwordEditor__.__esModule && $__editors_47_passwordEditor__ || {default: $__editors_47_passwordEditor__}).PasswordEditor; +var SelectEditor = ($__editors_47_selectEditor__ = require("editors/selectEditor"), $__editors_47_selectEditor__ && $__editors_47_selectEditor__.__esModule && $__editors_47_selectEditor__ || {default: $__editors_47_selectEditor__}).SelectEditor; +var TextEditor = ($__editors_47_textEditor__ = require("editors/textEditor"), $__editors_47_textEditor__ && $__editors_47_textEditor__.__esModule && $__editors_47_textEditor__ || {default: $__editors_47_textEditor__}).TextEditor; +var AutocompleteRenderer = ($__renderers_47_autocompleteRenderer__ = require("renderers/autocompleteRenderer"), $__renderers_47_autocompleteRenderer__ && $__renderers_47_autocompleteRenderer__.__esModule && $__renderers_47_autocompleteRenderer__ || {default: $__renderers_47_autocompleteRenderer__}).AutocompleteRenderer; +var CheckboxRenderer = ($__renderers_47_checkboxRenderer__ = require("renderers/checkboxRenderer"), $__renderers_47_checkboxRenderer__ && $__renderers_47_checkboxRenderer__.__esModule && $__renderers_47_checkboxRenderer__ || {default: $__renderers_47_checkboxRenderer__}).CheckboxRenderer; +var HtmlRenderer = ($__renderers_47_htmlRenderer__ = require("renderers/htmlRenderer"), $__renderers_47_htmlRenderer__ && $__renderers_47_htmlRenderer__.__esModule && $__renderers_47_htmlRenderer__ || {default: $__renderers_47_htmlRenderer__}).HtmlRenderer; +var NumericRenderer = ($__renderers_47_numericRenderer__ = require("renderers/numericRenderer"), $__renderers_47_numericRenderer__ && $__renderers_47_numericRenderer__.__esModule && $__renderers_47_numericRenderer__ || {default: $__renderers_47_numericRenderer__}).NumericRenderer; +var PasswordRenderer = ($__renderers_47_passwordRenderer__ = require("renderers/passwordRenderer"), $__renderers_47_passwordRenderer__ && $__renderers_47_passwordRenderer__.__esModule && $__renderers_47_passwordRenderer__ || {default: $__renderers_47_passwordRenderer__}).PasswordRenderer; +var TextRenderer = ($__renderers_47_textRenderer__ = require("renderers/textRenderer"), $__renderers_47_textRenderer__ && $__renderers_47_textRenderer__.__esModule && $__renderers_47_textRenderer__ || {default: $__renderers_47_textRenderer__}).TextRenderer; +var AutocompleteValidator = ($__validators_47_autocompleteValidator__ = require("validators/autocompleteValidator"), $__validators_47_autocompleteValidator__ && $__validators_47_autocompleteValidator__.__esModule && $__validators_47_autocompleteValidator__ || {default: $__validators_47_autocompleteValidator__}).AutocompleteValidator; +var DateValidator = ($__validators_47_dateValidator__ = require("validators/dateValidator"), $__validators_47_dateValidator__ && $__validators_47_dateValidator__.__esModule && $__validators_47_dateValidator__ || {default: $__validators_47_dateValidator__}).DateValidator; +var NumericValidator = ($__validators_47_numericValidator__ = require("validators/numericValidator"), $__validators_47_numericValidator__ && $__validators_47_numericValidator__.__esModule && $__validators_47_numericValidator__ || {default: $__validators_47_numericValidator__}).NumericValidator; +Handsontable.mobileBrowser = isMobileBrowser(); +Handsontable.AutocompleteCell = { + editor: getEditorConstructor('autocomplete'), + renderer: getRenderer('autocomplete'), + validator: Handsontable.AutocompleteValidator +}; +Handsontable.CheckboxCell = { + editor: getEditorConstructor('checkbox'), + renderer: getRenderer('checkbox') +}; +Handsontable.TextCell = { + editor: Handsontable.mobileBrowser ? getEditorConstructor('mobile') : getEditorConstructor('text'), + renderer: getRenderer('text') +}; +Handsontable.NumericCell = { + editor: getEditorConstructor('numeric'), + renderer: getRenderer('numeric'), + validator: Handsontable.NumericValidator, + dataType: 'number' +}; +Handsontable.DateCell = { + editor: getEditorConstructor('date'), + validator: Handsontable.DateValidator, + renderer: getRenderer('autocomplete') +}; +Handsontable.HandsontableCell = { + editor: getEditorConstructor('handsontable'), + renderer: getRenderer('autocomplete') +}; +Handsontable.PasswordCell = { + editor: getEditorConstructor('password'), + renderer: getRenderer('password'), + copyable: false +}; +Handsontable.DropdownCell = { + editor: getEditorConstructor('dropdown'), + renderer: getRenderer('autocomplete'), + validator: Handsontable.AutocompleteValidator +}; +Handsontable.cellTypes = { + text: Handsontable.TextCell, + date: Handsontable.DateCell, + numeric: Handsontable.NumericCell, + checkbox: Handsontable.CheckboxCell, + autocomplete: Handsontable.AutocompleteCell, + handsontable: Handsontable.HandsontableCell, + password: Handsontable.PasswordCell, + dropdown: Handsontable.DropdownCell +}; +Handsontable.cellLookup = {validator: { + numeric: Handsontable.NumericValidator, + autocomplete: Handsontable.AutocompleteValidator + }}; + +//# +},{"editors":29,"editors/autocompleteEditor":31,"editors/checkboxEditor":32,"editors/dateEditor":33,"editors/dropdownEditor":34,"editors/handsontableEditor":35,"editors/mobileTextEditor":36,"editors/numericEditor":37,"editors/passwordEditor":38,"editors/selectEditor":39,"editors/textEditor":40,"helpers/browser":43,"renderers":88,"renderers/autocompleteRenderer":90,"renderers/checkboxRenderer":91,"renderers/htmlRenderer":92,"renderers/numericRenderer":93,"renderers/passwordRenderer":94,"renderers/textRenderer":95,"validators/autocompleteValidator":100,"validators/dateValidator":101,"validators/numericValidator":102}],25:[function(require,module,exports){ +"use strict"; +var $__numeral__, + $__helpers_47_dom_47_element__, + $__helpers_47_setting__, + $__dataMap__, + $__editorManager__, + $__eventManager__, + $__helpers_47_object__, + $__helpers_47_array__, + $__plugins__, + $__renderers__, + $__helpers_47_string__, + $__helpers_47_number__, + $__tableView__, + $__dataSource__, + $__helpers_47_data__, + $__3rdparty_47_walkontable_47_src_47_cell_47_coords__, + $__3rdparty_47_walkontable_47_src_47_cell_47_range__, + $__3rdparty_47_walkontable_47_src_47_selection__, + $__3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__; +var numeral = ($__numeral__ = require("numeral"), $__numeral__ && $__numeral__.__esModule && $__numeral__ || {default: $__numeral__}).default; +var $__1 = ($__helpers_47_dom_47_element__ = require("helpers/dom/element"), $__helpers_47_dom_47_element__ && $__helpers_47_dom_47_element__.__esModule && $__helpers_47_dom_47_element__ || {default: $__helpers_47_dom_47_element__}), + addClass = $__1.addClass, + empty = $__1.empty, + isChildOfWebComponentTable = $__1.isChildOfWebComponentTable, + removeClass = $__1.removeClass; +var columnFactory = ($__helpers_47_setting__ = require("helpers/setting"), $__helpers_47_setting__ && $__helpers_47_setting__.__esModule && $__helpers_47_setting__ || {default: $__helpers_47_setting__}).columnFactory; +var DataMap = ($__dataMap__ = require("dataMap"), $__dataMap__ && $__dataMap__.__esModule && $__dataMap__ || {default: $__dataMap__}).DataMap; +var EditorManager = ($__editorManager__ = require("editorManager"), $__editorManager__ && $__editorManager__.__esModule && $__editorManager__ || {default: $__editorManager__}).EditorManager; +var eventManagerObject = ($__eventManager__ = require("eventManager"), $__eventManager__ && $__eventManager__.__esModule && $__eventManager__ || {default: $__eventManager__}).eventManager; +var $__6 = ($__helpers_47_object__ = require("helpers/object"), $__helpers_47_object__ && $__helpers_47_object__.__esModule && $__helpers_47_object__ || {default: $__helpers_47_object__}), + extend = $__6.extend, + duckSchema = $__6.duckSchema, + isObjectEquals = $__6.isObjectEquals, + deepClone = $__6.deepClone; +var arrayFlatten = ($__helpers_47_array__ = require("helpers/array"), $__helpers_47_array__ && $__helpers_47_array__.__esModule && $__helpers_47_array__ || {default: $__helpers_47_array__}).arrayFlatten; +var getPlugin = ($__plugins__ = require("plugins"), $__plugins__ && $__plugins__.__esModule && $__plugins__ || {default: $__plugins__}).getPlugin; +var getRenderer = ($__renderers__ = require("renderers"), $__renderers__ && $__renderers__.__esModule && $__renderers__ || {default: $__renderers__}).getRenderer; +var randomString = ($__helpers_47_string__ = require("helpers/string"), $__helpers_47_string__ && $__helpers_47_string__.__esModule && $__helpers_47_string__ || {default: $__helpers_47_string__}).randomString; +var rangeEach = ($__helpers_47_number__ = require("helpers/number"), $__helpers_47_number__ && $__helpers_47_number__.__esModule && $__helpers_47_number__ || {default: $__helpers_47_number__}).rangeEach; +var TableView = ($__tableView__ = require("tableView"), $__tableView__ && $__tableView__.__esModule && $__tableView__ || {default: $__tableView__}).TableView; +var DataSource = ($__dataSource__ = require("dataSource"), $__dataSource__ && $__dataSource__.__esModule && $__dataSource__ || {default: $__dataSource__}).DataSource; +var $__14 = ($__helpers_47_data__ = require("helpers/data"), $__helpers_47_data__ && $__helpers_47_data__.__esModule && $__helpers_47_data__ || {default: $__helpers_47_data__}), + translateRowsToColumns = $__14.translateRowsToColumns, + cellMethodLookupFactory = $__14.cellMethodLookupFactory, + spreadsheetColumnLabel = $__14.spreadsheetColumnLabel; +var WalkontableCellCoords = ($__3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $__3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $__3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $__3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $__3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords; +var WalkontableCellRange = ($__3rdparty_47_walkontable_47_src_47_cell_47_range__ = require("3rdparty/walkontable/src/cell/range"), $__3rdparty_47_walkontable_47_src_47_cell_47_range__ && $__3rdparty_47_walkontable_47_src_47_cell_47_range__.__esModule && $__3rdparty_47_walkontable_47_src_47_cell_47_range__ || {default: $__3rdparty_47_walkontable_47_src_47_cell_47_range__}).WalkontableCellRange; +var WalkontableSelection = ($__3rdparty_47_walkontable_47_src_47_selection__ = require("3rdparty/walkontable/src/selection"), $__3rdparty_47_walkontable_47_src_47_selection__ && $__3rdparty_47_walkontable_47_src_47_selection__.__esModule && $__3rdparty_47_walkontable_47_src_47_selection__ || {default: $__3rdparty_47_walkontable_47_src_47_selection__}).WalkontableSelection; +var WalkontableViewportColumnsCalculator = ($__3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__ = require("3rdparty/walkontable/src/calculator/viewportColumns"), $__3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__ && $__3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__.__esModule && $__3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__ || {default: $__3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__}).WalkontableViewportColumnsCalculator; +Handsontable.activeGuid = null; +Handsontable.Core = function Core(rootElement, userSettings) { + var priv, + datamap, + dataSource, + grid, + selection, + editorManager, + instance = this, + GridSettings = function() {}, + eventManager = eventManagerObject(instance); + extend(GridSettings.prototype, DefaultSettings.prototype); + extend(GridSettings.prototype, userSettings); + extend(GridSettings.prototype, expandType(userSettings)); + this.rootElement = rootElement; + this.isHotTableEnv = isChildOfWebComponentTable(this.rootElement); + Handsontable.eventManager.isHotTableEnv = this.isHotTableEnv; + this.container = document.createElement('DIV'); + this.renderCall = false; + rootElement.insertBefore(this.container, rootElement.firstChild); + this.guid = 'ht_' + randomString(); + if (!this.rootElement.id || this.rootElement.id.substring(0, 3) === 'ht_') { + this.rootElement.id = this.guid; + } + priv = { + cellSettings: [], + columnSettings: [], + columnsSettingConflicts: ['data', 'width'], + settings: new GridSettings(), + selRange: null, + isPopulated: null, + scrollable: null, + firstRun: true + }; + grid = { + alter: function(action, index, amount, source, keepEmptyRows) { + var delta; + amount = amount || 1; + switch (action) { + case 'insert_row': + if (instance.getSettings().maxRows === instance.countSourceRows()) { + return; + } + delta = datamap.createRow(index, amount); + if (delta) { + if (selection.isSelected() && priv.selRange.from.row >= index) { + priv.selRange.from.row = priv.selRange.from.row + delta; + selection.transformEnd(delta, 0); + } else { + selection.refreshBorders(); + } + } + break; + case 'insert_col': + delta = datamap.createCol(index, amount); + if (delta) { + if (Array.isArray(instance.getSettings().colHeaders)) { + var spliceArray = [index, 0]; + spliceArray.length += delta; + Array.prototype.splice.apply(instance.getSettings().colHeaders, spliceArray); + } + if (selection.isSelected() && priv.selRange.from.col >= index) { + priv.selRange.from.col = priv.selRange.from.col + delta; + selection.transformEnd(0, delta); + } else { + selection.refreshBorders(); + } + } + break; + case 'remove_row': + datamap.removeRow(index, amount); + priv.cellSettings.splice(index, amount); + var totalRows = instance.countRows(); + var fixedRowsTop = instance.getSettings().fixedRowsTop; + if (fixedRowsTop >= index + 1) { + instance.getSettings().fixedRowsTop -= Math.min(amount, fixedRowsTop - index); + } + var fixedRowsBottom = instance.getSettings().fixedRowsBottom; + if (fixedRowsBottom && index >= totalRows - fixedRowsBottom) { + instance.getSettings().fixedRowsBottom -= Math.min(amount, fixedRowsBottom); + } + grid.adjustRowsAndCols(); + selection.refreshBorders(); + break; + case 'remove_col': + datamap.removeCol(index, amount); + for (var row = 0, + len = datamap.getAll().length; row < len; row++) { + if (row in priv.cellSettings) { + priv.cellSettings[row].splice(index, amount); + } + } + var fixedColumnsLeft = instance.getSettings().fixedColumnsLeft; + if (fixedColumnsLeft >= index + 1) { + instance.getSettings().fixedColumnsLeft -= Math.min(amount, fixedColumnsLeft - index); + } + if (Array.isArray(instance.getSettings().colHeaders)) { + if (typeof index == 'undefined') { + index = -1; + } + instance.getSettings().colHeaders.splice(index, amount); + } + grid.adjustRowsAndCols(); + selection.refreshBorders(); + break; + default: + throw new Error('There is no such action "' + action + '"'); + break; + } + if (!keepEmptyRows) { + grid.adjustRowsAndCols(); + } + }, + adjustRowsAndCols: function() { + if (priv.settings.minRows) { + var rows = instance.countRows(); + if (rows < priv.settings.minRows) { + for (var r = 0, + minRows = priv.settings.minRows; r < minRows - rows; r++) { + datamap.createRow(instance.countRows(), 1, true); + } + } + } + if (priv.settings.minSpareRows) { + var emptyRows = instance.countEmptyRows(true); + if (emptyRows < priv.settings.minSpareRows) { + for (; emptyRows < priv.settings.minSpareRows && instance.countRows() < priv.settings.maxRows; emptyRows++) { + datamap.createRow(instance.countRows(), 1, true); + } + } + } + { + var emptyCols; + if (priv.settings.minCols || priv.settings.minSpareCols) { + emptyCols = instance.countEmptyCols(true); + } + if (priv.settings.minCols && !priv.settings.columns && instance.countCols() < priv.settings.minCols) { + for (; instance.countCols() < priv.settings.minCols; emptyCols++) { + datamap.createCol(instance.countCols(), 1, true); + } + } + if (priv.settings.minSpareCols && !priv.settings.columns && instance.dataType === 'array' && emptyCols < priv.settings.minSpareCols) { + for (; emptyCols < priv.settings.minSpareCols && instance.countCols() < priv.settings.maxCols; emptyCols++) { + datamap.createCol(instance.countCols(), 1, true); + } + } + } + var rowCount = instance.countRows(); + var colCount = instance.countCols(); + if (rowCount === 0 || colCount === 0) { + selection.deselect(); + } + if (selection.isSelected()) { + var selectionChanged = false; + var fromRow = priv.selRange.from.row; + var fromCol = priv.selRange.from.col; + var toRow = priv.selRange.to.row; + var toCol = priv.selRange.to.col; + if (fromRow > rowCount - 1) { + fromRow = rowCount - 1; + selectionChanged = true; + if (toRow > fromRow) { + toRow = fromRow; + } + } else if (toRow > rowCount - 1) { + toRow = rowCount - 1; + selectionChanged = true; + if (fromRow > toRow) { + fromRow = toRow; + } + } + if (fromCol > colCount - 1) { + fromCol = colCount - 1; + selectionChanged = true; + if (toCol > fromCol) { + toCol = fromCol; + } + } else if (toCol > colCount - 1) { + toCol = colCount - 1; + selectionChanged = true; + if (fromCol > toCol) { + fromCol = toCol; + } + } + if (selectionChanged) { + instance.selectCell(fromRow, fromCol, toRow, toCol); + } + } + if (instance.view) { + instance.view.wt.wtOverlays.adjustElementsSize(); + } + }, + populateFromArray: function(start, input, end, source, method, direction, deltas) { + var r, + rlen, + c, + clen, + setData = [], + current = {}; + rlen = input.length; + if (rlen === 0) { + return false; + } + var repeatCol, + repeatRow, + cmax, + rmax, + baseEnd = { + row: end === null ? null : end.row, + col: end === null ? null : end.col + }; + switch (method) { + case 'shift_down': + repeatCol = end ? end.col - start.col + 1 : 0; + repeatRow = end ? end.row - start.row + 1 : 0; + input = translateRowsToColumns(input); + for (c = 0, clen = input.length, cmax = Math.max(clen, repeatCol); c < cmax; c++) { + if (c < clen) { + for (r = 0, rlen = input[c].length; r < repeatRow - rlen; r++) { + input[c].push(input[c][r % rlen]); + } + input[c].unshift(start.col + c, start.row, 0); + instance.spliceCol.apply(instance, input[c]); + } else { + input[c % clen][0] = start.col + c; + instance.spliceCol.apply(instance, input[c % clen]); + } + } + break; + case 'shift_right': + repeatCol = end ? end.col - start.col + 1 : 0; + repeatRow = end ? end.row - start.row + 1 : 0; + for (r = 0, rlen = input.length, rmax = Math.max(rlen, repeatRow); r < rmax; r++) { + if (r < rlen) { + for (c = 0, clen = input[r].length; c < repeatCol - clen; c++) { + input[r].push(input[r][c % clen]); + } + input[r].unshift(start.row + r, start.col, 0); + instance.spliceRow.apply(instance, input[r]); + } else { + input[r % rlen][0] = start.row + r; + instance.spliceRow.apply(instance, input[r % rlen]); + } + } + break; + case 'overwrite': + default: + current.row = start.row; + current.col = start.col; + var selected = { + row: (end && start) ? (end.row - start.row + 1) : 1, + col: (end && start) ? (end.col - start.col + 1) : 1 + }; + var skippedRow = 0; + var skippedColumn = 0; + var pushData = true; + var cellMeta; + var getInputValue = function getInputValue(row) { + var col = arguments[1] !== (void 0) ? arguments[1] : null; + var rowValue = input[row % input.length]; + if (col !== null) { + return rowValue[col % rowValue.length]; + } + return rowValue; + }; + var rowInputLength = input.length; + var rowSelectionLength = end ? end.row - start.row + 1 : 0; + if (end) { + rlen = rowSelectionLength; + } else { + rlen = Math.max(rowInputLength, rowSelectionLength); + } + for (r = 0; r < rlen; r++) { + if ((end && current.row > end.row && rowSelectionLength > rowInputLength) || (!priv.settings.allowInsertRow && current.row > instance.countRows() - 1) || (current.row >= priv.settings.maxRows)) { + break; + } + var logicalRow = r - skippedRow; + var colInputLength = getInputValue(logicalRow).length; + var colSelectionLength = end ? end.col - start.col + 1 : 0; + if (end) { + clen = colSelectionLength; + } else { + clen = Math.max(colInputLength, colSelectionLength); + } + current.col = start.col; + cellMeta = instance.getCellMeta(current.row, current.col); + if ((source === 'paste' || source === 'autofill') && cellMeta.skipRowOnPaste) { + skippedRow++; + current.row++; + rlen++; + continue; + } + skippedColumn = 0; + for (c = 0; c < clen; c++) { + if ((end && current.col > end.col && colSelectionLength > colInputLength) || (!priv.settings.allowInsertColumn && current.col > instance.countCols() - 1) || (current.col >= priv.settings.maxCols)) { + break; + } + cellMeta = instance.getCellMeta(current.row, current.col); + if ((source === 'paste' || source === 'autofill') && cellMeta.skipColumnOnPaste) { + skippedColumn++; + current.col++; + clen++; + continue; + } + if (cellMeta.readOnly) { + current.col++; + continue; + } + var logicalColumn = c - skippedColumn; + var value = getInputValue(logicalRow, logicalColumn); + var orgValue = instance.getDataAtCell(current.row, current.col); + var index = { + row: logicalRow, + col: logicalColumn + }; + if (source === 'autofill') { + var result = instance.runHooks('beforeAutofillInsidePopulate', index, direction, input, deltas, {}, selected); + if (result) { + value = typeof(result.value) === 'undefined' ? value : result.value; + } + } + if (value !== null && typeof value === 'object') { + if (orgValue === null || typeof orgValue !== 'object') { + pushData = false; + } else { + var orgValueSchema = duckSchema(orgValue[0] || orgValue); + var valueSchema = duckSchema(value[0] || value); + if (isObjectEquals(orgValueSchema, valueSchema)) { + value = deepClone(value); + } else { + pushData = false; + } + } + } else if (orgValue !== null && typeof orgValue === 'object') { + pushData = false; + } + if (pushData) { + setData.push([current.row, current.col, value]); + } + pushData = true; + current.col++; + } + current.row++; + } + instance.setDataAtCell(setData, null, null, source || 'populateFromArray'); + break; + } + } + }; + this.selection = selection = { + inProgress: false, + selectedHeader: { + cols: false, + rows: false + }, + setSelectedHeaders: function(rows, cols) { + instance.selection.selectedHeader.rows = rows; + instance.selection.selectedHeader.cols = cols; + }, + begin: function() { + instance.selection.inProgress = true; + }, + finish: function() { + var sel = instance.getSelected(); + Handsontable.hooks.run(instance, 'afterSelectionEnd', sel[0], sel[1], sel[2], sel[3]); + Handsontable.hooks.run(instance, 'afterSelectionEndByProp', sel[0], instance.colToProp(sel[1]), sel[2], instance.colToProp(sel[3])); + instance.selection.inProgress = false; + }, + isInProgress: function() { + return instance.selection.inProgress; + }, + setRangeStart: function(coords, keepEditorOpened) { + Handsontable.hooks.run(instance, 'beforeSetRangeStart', coords); + priv.selRange = new WalkontableCellRange(coords, coords, coords); + selection.setRangeEnd(coords, null, keepEditorOpened); + }, + setRangeEnd: function(coords, scrollToCell, keepEditorOpened) { + if (priv.selRange === null) { + return; + } + var disableVisualSelection, + isHeaderSelected = false, + areCoordsPositive = true; + var firstVisibleRow = instance.view.wt.wtTable.getFirstVisibleRow(); + var firstVisibleColumn = instance.view.wt.wtTable.getFirstVisibleColumn(); + var newRangeCoords = { + row: null, + col: null + }; + Handsontable.hooks.run(instance, 'beforeSetRangeEnd', coords); + instance.selection.begin(); + newRangeCoords.row = coords.row < 0 ? firstVisibleRow : coords.row; + newRangeCoords.col = coords.col < 0 ? firstVisibleColumn : coords.col; + priv.selRange.to = new WalkontableCellCoords(newRangeCoords.row, newRangeCoords.col); + if (!priv.settings.multiSelect) { + priv.selRange.from = coords; + } + instance.view.wt.selections.current.clear(); + disableVisualSelection = instance.getCellMeta(priv.selRange.highlight.row, priv.selRange.highlight.col).disableVisualSelection; + if (typeof disableVisualSelection === 'string') { + disableVisualSelection = [disableVisualSelection]; + } + if (disableVisualSelection === false || Array.isArray(disableVisualSelection) && disableVisualSelection.indexOf('current') === -1) { + instance.view.wt.selections.current.add(priv.selRange.highlight); + } + instance.view.wt.selections.area.clear(); + if ((disableVisualSelection === false || Array.isArray(disableVisualSelection) && disableVisualSelection.indexOf('area') === -1) && selection.isMultiple()) { + instance.view.wt.selections.area.add(priv.selRange.from); + instance.view.wt.selections.area.add(priv.selRange.to); + } + if (priv.settings.currentRowClassName || priv.settings.currentColClassName) { + instance.view.wt.selections.highlight.clear(); + instance.view.wt.selections.highlight.add(priv.selRange.from); + instance.view.wt.selections.highlight.add(priv.selRange.to); + } + Handsontable.hooks.run(instance, 'afterSelection', priv.selRange.from.row, priv.selRange.from.col, priv.selRange.to.row, priv.selRange.to.col); + Handsontable.hooks.run(instance, 'afterSelectionByProp', priv.selRange.from.row, datamap.colToProp(priv.selRange.from.col), priv.selRange.to.row, datamap.colToProp(priv.selRange.to.col)); + if ((priv.selRange.from.row === 0 && priv.selRange.to.row === instance.countRows() - 1 && instance.countRows() > 1) || (priv.selRange.from.col === 0 && priv.selRange.to.col === instance.countCols() - 1 && instance.countCols() > 1)) { + isHeaderSelected = true; + } + if (coords.row < 0 || coords.col < 0) { + areCoordsPositive = false; + } + if (scrollToCell !== false && !isHeaderSelected && areCoordsPositive) { + if (priv.selRange.from && !selection.isMultiple()) { + instance.view.scrollViewport(priv.selRange.from); + } else { + instance.view.scrollViewport(coords); + } + } + selection.refreshBorders(null, keepEditorOpened); + }, + refreshBorders: function(revertOriginal, keepEditor) { + if (!keepEditor) { + editorManager.destroyEditor(revertOriginal); + } + instance.view.render(); + if (selection.isSelected() && !keepEditor) { + editorManager.prepareEditor(); + } + }, + isMultiple: function() { + var isMultiple = !(priv.selRange.to.col === priv.selRange.from.col && priv.selRange.to.row === priv.selRange.from.row), + modifier = Handsontable.hooks.run(instance, 'afterIsMultipleSelection', isMultiple); + if (isMultiple) { + return modifier; + } + }, + transformStart: function(rowDelta, colDelta, force, keepEditorOpened) { + var delta = new WalkontableCellCoords(rowDelta, colDelta), + rowTransformDir = 0, + colTransformDir = 0, + totalRows, + totalCols, + coords, + fixedRowsBottom; + instance.runHooks('modifyTransformStart', delta); + totalRows = instance.countRows(); + totalCols = instance.countCols(); + fixedRowsBottom = instance.getSettings().fixedRowsBottom; + if (priv.selRange.highlight.row + rowDelta > totalRows - 1) { + if (force && priv.settings.minSpareRows > 0 && !(fixedRowsBottom && priv.selRange.highlight.row >= totalRows - fixedRowsBottom - 1)) { + instance.alter('insert_row', totalRows); + totalRows = instance.countRows(); + } else if (priv.settings.autoWrapCol) { + delta.row = 1 - totalRows; + delta.col = priv.selRange.highlight.col + delta.col == totalCols - 1 ? 1 - totalCols : 1; + } + } else if (priv.settings.autoWrapCol && priv.selRange.highlight.row + delta.row < 0 && priv.selRange.highlight.col + delta.col >= 0) { + delta.row = totalRows - 1; + delta.col = priv.selRange.highlight.col + delta.col == 0 ? totalCols - 1 : -1; + } + if (priv.selRange.highlight.col + delta.col > totalCols - 1) { + if (force && priv.settings.minSpareCols > 0) { + instance.alter('insert_col', totalCols); + totalCols = instance.countCols(); + } else if (priv.settings.autoWrapRow) { + delta.row = priv.selRange.highlight.row + delta.row == totalRows - 1 ? 1 - totalRows : 1; + delta.col = 1 - totalCols; + } + } else if (priv.settings.autoWrapRow && priv.selRange.highlight.col + delta.col < 0 && priv.selRange.highlight.row + delta.row >= 0) { + delta.row = priv.selRange.highlight.row + delta.row == 0 ? totalRows - 1 : -1; + delta.col = totalCols - 1; + } + coords = new WalkontableCellCoords(priv.selRange.highlight.row + delta.row, priv.selRange.highlight.col + delta.col); + if (coords.row < 0) { + rowTransformDir = -1; + coords.row = 0; + } else if (coords.row > 0 && coords.row >= totalRows) { + rowTransformDir = 1; + coords.row = totalRows - 1; + } + if (coords.col < 0) { + colTransformDir = -1; + coords.col = 0; + } else if (coords.col > 0 && coords.col >= totalCols) { + colTransformDir = 1; + coords.col = totalCols - 1; + } + instance.runHooks('afterModifyTransformStart', coords, rowTransformDir, colTransformDir); + selection.setRangeStart(coords, keepEditorOpened); + }, + transformEnd: function(rowDelta, colDelta) { + var delta = new WalkontableCellCoords(rowDelta, colDelta), + rowTransformDir = 0, + colTransformDir = 0, + totalRows, + totalCols, + coords; + instance.runHooks('modifyTransformEnd', delta); + totalRows = instance.countRows(); + totalCols = instance.countCols(); + coords = new WalkontableCellCoords(priv.selRange.to.row + delta.row, priv.selRange.to.col + delta.col); + if (coords.row < 0) { + rowTransformDir = -1; + coords.row = 0; + } else if (coords.row > 0 && coords.row >= totalRows) { + rowTransformDir = 1; + coords.row = totalRows - 1; + } + if (coords.col < 0) { + colTransformDir = -1; + coords.col = 0; + } else if (coords.col > 0 && coords.col >= totalCols) { + colTransformDir = 1; + coords.col = totalCols - 1; + } + instance.runHooks('afterModifyTransformEnd', coords, rowTransformDir, colTransformDir); + selection.setRangeEnd(coords, true); + }, + isSelected: function() { + return (priv.selRange !== null); + }, + inInSelection: function(coords) { + if (!selection.isSelected()) { + return false; + } + return priv.selRange.includes(coords); + }, + deselect: function() { + if (!selection.isSelected()) { + return; + } + instance.selection.inProgress = false; + priv.selRange = null; + instance.view.wt.selections.current.clear(); + instance.view.wt.selections.area.clear(); + if (priv.settings.currentRowClassName || priv.settings.currentColClassName) { + instance.view.wt.selections.highlight.clear(); + } + editorManager.destroyEditor(); + selection.refreshBorders(); + Handsontable.hooks.run(instance, 'afterDeselect'); + }, + selectAll: function() { + if (!priv.settings.multiSelect) { + return; + } + selection.setRangeStart(new WalkontableCellCoords(0, 0)); + selection.setRangeEnd(new WalkontableCellCoords(instance.countRows() - 1, instance.countCols() - 1), false); + }, + empty: function() { + if (!selection.isSelected()) { + return; + } + var topLeft = priv.selRange.getTopLeftCorner(); + var bottomRight = priv.selRange.getBottomRightCorner(); + var r, + c, + changes = []; + for (r = topLeft.row; r <= bottomRight.row; r++) { + for (c = topLeft.col; c <= bottomRight.col; c++) { + if (!instance.getCellMeta(r, c).readOnly) { + changes.push([r, c, '']); + } + } + } + instance.setDataAtCell(changes); + } + }; + this.init = function() { + dataSource = new DataSource(instance, priv.settings.data); + Handsontable.hooks.run(instance, 'beforeInit'); + if (Handsontable.mobileBrowser) { + addClass(instance.rootElement, 'mobile'); + } + this.updateSettings(priv.settings, true); + this.view = new TableView(this); + editorManager = new EditorManager(instance, priv, selection, datamap); + this.forceFullRender = true; + Handsontable.hooks.run(instance, 'init'); + this.view.render(); + if (typeof priv.firstRun === 'object') { + Handsontable.hooks.run(instance, 'afterChange', priv.firstRun[0], priv.firstRun[1]); + priv.firstRun = false; + } + Handsontable.hooks.run(instance, 'afterInit'); + }; + function ValidatorsQueue() { + var resolved = false; + return { + validatorsInQueue: 0, + valid: true, + addValidatorToQueue: function() { + this.validatorsInQueue++; + resolved = false; + }, + removeValidatorFormQueue: function() { + this.validatorsInQueue = this.validatorsInQueue - 1 < 0 ? 0 : this.validatorsInQueue - 1; + this.checkIfQueueIsEmpty(); + }, + onQueueEmpty: function(valid) {}, + checkIfQueueIsEmpty: function() { + if (this.validatorsInQueue == 0 && resolved == false) { + resolved = true; + this.onQueueEmpty(this.valid); + } + } + }; + } + function validateChanges(changes, source, callback) { + var waitingForValidator = new ValidatorsQueue(); + waitingForValidator.onQueueEmpty = resolve; + for (var i = changes.length - 1; i >= 0; i--) { + if (changes[i] === null) { + changes.splice(i, 1); + } else { + var row = changes[i][0]; + var col = datamap.propToCol(changes[i][1]); + var logicalCol = instance.runHooks('modifyCol', col); + var cellProperties = instance.getCellMeta(row, logicalCol); + if (cellProperties.type === 'numeric' && typeof changes[i][3] === 'string') { + if (changes[i][3].length > 0 && (/^-?[\d\s]*(\.|\,)?\d*$/.test(changes[i][3]) || cellProperties.format)) { + var len = changes[i][3].length; + if (typeof cellProperties.language == 'undefined') { + numeral.language('en'); + } else if (changes[i][3].indexOf('.') === len - 3 && changes[i][3].indexOf(',') === -1) { + numeral.language('en'); + } else { + numeral.language(cellProperties.language); + } + if (numeral.validate(changes[i][3])) { + changes[i][3] = numeral().unformat(changes[i][3]); + } + } + } + if (instance.getCellValidator(cellProperties)) { + waitingForValidator.addValidatorToQueue(); + instance.validateCell(changes[i][3], cellProperties, (function(i, cellProperties) { + return function(result) { + if (typeof result !== 'boolean') { + throw new Error('Validation error: result is not boolean'); + } + if (result === false && cellProperties.allowInvalid === false) { + changes.splice(i, 1); + cellProperties.valid = true; + --i; + } + waitingForValidator.removeValidatorFormQueue(); + }; + })(i, cellProperties), source); + } + } + } + waitingForValidator.checkIfQueueIsEmpty(); + function resolve() { + var beforeChangeResult; + if (changes.length) { + beforeChangeResult = Handsontable.hooks.run(instance, 'beforeChange', changes, source); + if (typeof beforeChangeResult === 'function') { + console.warn('Your beforeChange callback returns a function. It\'s not supported since Handsontable 0.12.1 (and the returned function will not be executed).'); + } else if (beforeChangeResult === false) { + changes.splice(0, changes.length); + } + } + callback(); + } + } + function applyChanges(changes, source) { + var i = changes.length - 1; + if (i < 0) { + return; + } + for (; 0 <= i; i--) { + if (changes[i] === null) { + changes.splice(i, 1); + continue; + } + if (changes[i][2] == null && changes[i][3] == null) { + continue; + } + if (priv.settings.allowInsertRow) { + while (changes[i][0] > instance.countRows() - 1) { + datamap.createRow(); + } + } + if (instance.dataType === 'array' && priv.settings.allowInsertColumn) { + while (datamap.propToCol(changes[i][1]) > instance.countCols() - 1) { + datamap.createCol(); + } + } + datamap.set(changes[i][0], changes[i][1], changes[i][3]); + } + instance.forceFullRender = true; + grid.adjustRowsAndCols(); + Handsontable.hooks.run(instance, 'beforeChangeRender', changes, source); + selection.refreshBorders(null, true); + instance.view.wt.wtOverlays.adjustElementsSize(); + Handsontable.hooks.run(instance, 'afterChange', changes, source || 'edit'); + } + this.validateCell = function(value, cellProperties, callback, source) { + var validator = instance.getCellValidator(cellProperties); + function done(valid) { + var col = cellProperties.physicalCol, + row = cellProperties.physicalRow, + td = instance.getCell(row, col, true); + if (td) { + instance.view.wt.wtSettings.settings.cellRenderer(row, col, td); + } + callback(valid); + } + if (Object.prototype.toString.call(validator) === '[object RegExp]') { + validator = (function(validator) { + return function(value, callback) { + callback(validator.test(value)); + }; + })(validator); + } + if (typeof validator == 'function') { + value = Handsontable.hooks.run(instance, 'beforeValidate', value, cellProperties.row, cellProperties.prop, source); + instance._registerTimeout(setTimeout(function() { + validator.call(cellProperties, value, function(valid) { + valid = Handsontable.hooks.run(instance, 'afterValidate', valid, value, cellProperties.row, cellProperties.prop, source); + cellProperties.valid = valid; + done(valid); + Handsontable.hooks.run(instance, 'postAfterValidate', valid, value, cellProperties.row, cellProperties.prop, source); + }); + }, 0)); + } else { + cellProperties.valid = true; + done(cellProperties.valid); + } + }; + function setDataInputToArray(row, propOrCol, value) { + if (typeof row === 'object') { + return row; + } else { + return [[row, propOrCol, value]]; + } + } + this.setDataAtCell = function(row, col, value, source) { + var input = setDataInputToArray(row, col, value), + i, + ilen, + changes = [], + prop; + for (i = 0, ilen = input.length; i < ilen; i++) { + if (typeof input[i] !== 'object') { + throw new Error('Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter'); + } + if (typeof input[i][1] !== 'number') { + throw new Error('Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`'); + } + prop = datamap.colToProp(input[i][1]); + changes.push([input[i][0], prop, datamap.get(input[i][0], prop), input[i][2]]); + } + if (!source && typeof row === 'object') { + source = col; + } + validateChanges(changes, source, function() { + applyChanges(changes, source); + }); + }; + this.setDataAtRowProp = function(row, prop, value, source) { + var input = setDataInputToArray(row, prop, value), + i, + ilen, + changes = []; + for (i = 0, ilen = input.length; i < ilen; i++) { + changes.push([input[i][0], input[i][1], datamap.get(input[i][0], input[i][1]), input[i][2]]); + } + if (!source && typeof row === 'object') { + source = prop; + } + validateChanges(changes, source, function() { + applyChanges(changes, source); + }); + }; + this.listen = function() { + Handsontable.activeGuid = instance.guid; + }; + this.unlisten = function() { + Handsontable.activeGuid = null; + }; + this.isListening = function() { + return Handsontable.activeGuid === instance.guid; + }; + this.destroyEditor = function(revertOriginal) { + selection.refreshBorders(revertOriginal); + }; + this.populateFromArray = function(row, col, input, endRow, endCol, source, method, direction, deltas) { + var c; + if (!(typeof input === 'object' && typeof input[0] === 'object')) { + throw new Error('populateFromArray parameter `input` must be an array of arrays'); + } + c = typeof endRow === 'number' ? new WalkontableCellCoords(endRow, endCol) : null; + return grid.populateFromArray(new WalkontableCellCoords(row, col), input, c, source, method, direction, deltas); + }; + this.spliceCol = function(col, index, amount) { + return datamap.spliceCol.apply(datamap, arguments); + }; + this.spliceRow = function(row, index, amount) { + return datamap.spliceRow.apply(datamap, arguments); + }; + this.getSelected = function() { + if (selection.isSelected()) { + return [priv.selRange.from.row, priv.selRange.from.col, priv.selRange.to.row, priv.selRange.to.col]; + } + }; + this.getSelectedRange = function() { + if (selection.isSelected()) { + return priv.selRange; + } + }; + this.render = function() { + if (instance.view) { + instance.renderCall = true; + instance.forceFullRender = true; + selection.refreshBorders(null, true); + } + }; + this.loadData = function(data) { + if (typeof data === 'object' && data !== null) { + if (!(data.push && data.splice)) { + data = [data]; + } + } else if (data === null) { + data = []; + var row; + for (var r = 0, + rlen = priv.settings.startRows; r < rlen; r++) { + row = []; + for (var c = 0, + clen = priv.settings.startCols; c < clen; c++) { + row.push(null); + } + data.push(row); + } + } else { + throw new Error('loadData only accepts array of objects or array of arrays (' + typeof data + ' given)'); + } + priv.isPopulated = false; + GridSettings.prototype.data = data; + if (Array.isArray(priv.settings.dataSchema) || Array.isArray(data[0])) { + instance.dataType = 'array'; + } else if (typeof priv.settings.dataSchema === 'function') { + instance.dataType = 'function'; + } else { + instance.dataType = 'object'; + } + datamap = new DataMap(instance, priv, GridSettings); + dataSource.data = data; + dataSource.dataType = instance.dataType; + dataSource.colToProp = datamap.colToProp.bind(datamap); + dataSource.propToCol = datamap.propToCol.bind(datamap); + clearCellSettingCache(); + grid.adjustRowsAndCols(); + Handsontable.hooks.run(instance, 'afterLoadData', priv.firstRun); + if (priv.firstRun) { + priv.firstRun = [null, 'loadData']; + } else { + Handsontable.hooks.run(instance, 'afterChange', null, 'loadData'); + instance.render(); + } + priv.isPopulated = true; + function clearCellSettingCache() { + priv.cellSettings.length = 0; + } + }; + this.getData = function(r, c, r2, c2) { + if (typeof r === 'undefined') { + return datamap.getAll(); + } else { + return datamap.getRange(new WalkontableCellCoords(r, c), new WalkontableCellCoords(r2, c2), datamap.DESTINATION_RENDERER); + } + }; + this.getCopyableText = function(startRow, startCol, endRow, endCol) { + return datamap.getCopyableText(new WalkontableCellCoords(startRow, startCol), new WalkontableCellCoords(endRow, endCol)); + }; + this.getCopyableData = function(row, column) { + return datamap.getCopyable(row, datamap.colToProp(column)); + }; + this.getSchema = function() { + return datamap.getSchema(); + }; + this.updateSettings = function(settings, init) { + var i, + clen; + if (typeof settings.rows !== 'undefined') { + throw new Error('"rows" setting is no longer supported. do you mean startRows, minRows or maxRows?'); + } + if (typeof settings.cols !== 'undefined') { + throw new Error('"cols" setting is no longer supported. do you mean startCols, minCols or maxCols?'); + } + for (i in settings) { + if (i === 'data') { + continue; + } else { + if (Handsontable.hooks.getRegistered().indexOf(i) > -1) { + if (typeof settings[i] === 'function' || Array.isArray(settings[i])) { + instance.addHook(i, settings[i]); + } + } else { + if (!init && settings.hasOwnProperty(i)) { + GridSettings.prototype[i] = settings[i]; + } + } + } + } + if (settings.data === void 0 && priv.settings.data === void 0) { + instance.loadData(null); + } else if (settings.data !== void 0) { + instance.loadData(settings.data); + } else if (settings.columns !== void 0) { + datamap.createMap(); + } + clen = instance.countCols(); + priv.cellSettings.length = 0; + if (clen > 0) { + var proto, + column; + for (i = 0; i < clen; i++) { + priv.columnSettings[i] = columnFactory(GridSettings, priv.columnsSettingConflicts); + proto = priv.columnSettings[i].prototype; + if (GridSettings.prototype.columns) { + column = GridSettings.prototype.columns[i]; + extend(proto, column); + extend(proto, expandType(column)); + } + } + } + if (typeof settings.cell !== 'undefined') { + for (i in settings.cell) { + if (settings.cell.hasOwnProperty(i)) { + var cell = settings.cell[i]; + instance.setCellMetaObject(cell.row, cell.col, cell); + } + } + } + Handsontable.hooks.run(instance, 'afterCellMetaReset'); + if (typeof settings.className !== 'undefined') { + if (GridSettings.prototype.className) { + removeClass(instance.rootElement, GridSettings.prototype.className); + } + if (settings.className) { + addClass(instance.rootElement, settings.className); + } + } + if (typeof settings.height != 'undefined') { + var height = settings.height; + if (typeof height == 'function') { + height = height(); + } + instance.rootElement.style.height = height + 'px'; + } + if (typeof settings.width != 'undefined') { + var width = settings.width; + if (typeof width == 'function') { + width = width(); + } + instance.rootElement.style.width = width + 'px'; + } + if (height) { + instance.rootElement.style.overflow = 'hidden'; + } + if (!init) { + Handsontable.hooks.run(instance, 'afterUpdateSettings'); + } + grid.adjustRowsAndCols(); + if (instance.view && !priv.firstRun) { + instance.forceFullRender = true; + selection.refreshBorders(null, true); + } + }; + this.getValue = function() { + var sel = instance.getSelected(); + if (GridSettings.prototype.getValue) { + if (typeof GridSettings.prototype.getValue === 'function') { + return GridSettings.prototype.getValue.call(instance); + } else if (sel) { + return instance.getData()[sel[0]][GridSettings.prototype.getValue]; + } + } else if (sel) { + return instance.getDataAtCell(sel[0], sel[1]); + } + }; + function expandType(obj) { + if (!obj.hasOwnProperty('type')) { + return; + } + var type, + expandedType = {}; + if (typeof obj.type === 'object') { + type = obj.type; + } else if (typeof obj.type === 'string') { + type = Handsontable.cellTypes[obj.type]; + if (type === void 0) { + throw new Error('You declared cell type "' + obj.type + '" as a string that is not mapped to a known object. Cell type must be an object or a string mapped to an object in Handsontable.cellTypes'); + } + } + for (var i in type) { + if (type.hasOwnProperty(i) && !obj.hasOwnProperty(i)) { + expandedType[i] = type[i]; + } + } + return expandedType; + } + this.getSettings = function() { + return priv.settings; + }; + this.clear = function() { + selection.selectAll(); + selection.empty(); + }; + this.alter = function(action, index, amount, source, keepEmptyRows) { + grid.alter(action, index, amount, source, keepEmptyRows); + }; + this.getCell = function(row, col, topmost) { + return instance.view.getCellAtCoords(new WalkontableCellCoords(row, col), topmost); + }; + this.getCoords = function(elem) { + return this.view.wt.wtTable.getCoords.call(this.view.wt.wtTable, elem); + }; + this.colToProp = function(col) { + return datamap.colToProp(col); + }; + this.propToCol = function(prop) { + return datamap.propToCol(prop); + }; + this.getDataAtCell = function(row, col) { + return datamap.get(row, datamap.colToProp(col)); + }; + this.getDataAtRowProp = function(row, prop) { + return datamap.get(row, prop); + }; + this.getDataAtCol = function(col) { + var out = []; + return out.concat.apply(out, datamap.getRange(new WalkontableCellCoords(0, col), new WalkontableCellCoords(priv.settings.data.length - 1, col), datamap.DESTINATION_RENDERER)); + }; + this.getDataAtProp = function(prop) { + var out = [], + range; + range = datamap.getRange(new WalkontableCellCoords(0, datamap.propToCol(prop)), new WalkontableCellCoords(priv.settings.data.length - 1, datamap.propToCol(prop)), datamap.DESTINATION_RENDERER); + return out.concat.apply(out, range); + }; + this.getSourceData = function(r, c, r2, c2) { + var data; + if (r === void 0) { + data = dataSource.getData(); + } else { + data = dataSource.getByRange(new WalkontableCellCoords(r, c), new WalkontableCellCoords(r2, c2)); + } + return data; + }; + this.getSourceDataAtCol = function(column) { + return dataSource.getAtColumn(column); + }; + this.getSourceDataAtRow = function(row) { + return dataSource.getAtRow(row); + }; + this.getSourceDataAtCell = function(row, column) { + return dataSource.getAtCell(row, column); + }; + this.getDataAtRow = function(row) { + var data = datamap.getRange(new WalkontableCellCoords(row, 0), new WalkontableCellCoords(row, this.countCols() - 1), datamap.DESTINATION_RENDERER); + return data[0]; + }; + this.getDataType = function(rowFrom, columnFrom, rowTo, columnTo) { + var $__19 = this; + var previousType = null; + var currentType = null; + if (rowFrom === void 0) { + rowFrom = 0; + rowTo = this.countRows(); + columnFrom = 0; + columnTo = this.countCols(); + } + if (rowTo === void 0) { + rowTo = rowFrom; + } + if (columnTo === void 0) { + columnTo = columnFrom; + } + var type = 'mixed'; + rangeEach(Math.min(rowFrom, rowTo), Math.max(rowFrom, rowTo), (function(row) { + var isTypeEqual = true; + rangeEach(Math.min(columnFrom, columnTo), Math.max(columnFrom, columnTo), (function(column) { + var cellType = $__19.getCellMeta(row, column); + currentType = cellType.type; + if (previousType) { + isTypeEqual = previousType === currentType; + } else { + previousType = currentType; + } + return isTypeEqual; + })); + type = isTypeEqual ? currentType : 'mixed'; + return isTypeEqual; + })); + return type; + }; + this.removeCellMeta = function(row, col, key) { + var cellMeta = instance.getCellMeta(row, col); + if (cellMeta[key] != undefined) { + delete priv.cellSettings[row][col][key]; + } + }; + this.setCellMetaObject = function(row, col, prop) { + if (typeof prop === 'object') { + for (var key in prop) { + if (prop.hasOwnProperty(key)) { + var value = prop[key]; + this.setCellMeta(row, col, key, value); + } + } + } + }; + this.setCellMeta = function(row, col, key, val) { + if (!priv.cellSettings[row]) { + priv.cellSettings[row] = []; + } + if (!priv.cellSettings[row][col]) { + priv.cellSettings[row][col] = new priv.columnSettings[col](); + } + priv.cellSettings[row][col][key] = val; + Handsontable.hooks.run(instance, 'afterSetCellMeta', row, col, key, val); + }; + this.getCellsMeta = function() { + return arrayFlatten(priv.cellSettings); + }; + this.getCellMeta = function(row, col) { + var prop = datamap.colToProp(col), + cellProperties; + var physicalRow = row; + var physicalCol = col; + row = translateRowIndex(row); + col = translateColIndex(col); + if (!priv.columnSettings[col]) { + priv.columnSettings[col] = columnFactory(GridSettings, priv.columnsSettingConflicts); + } + if (!priv.cellSettings[row]) { + priv.cellSettings[row] = []; + } + if (!priv.cellSettings[row][col]) { + priv.cellSettings[row][col] = new priv.columnSettings[col](); + } + cellProperties = priv.cellSettings[row][col]; + cellProperties.row = row; + cellProperties.col = col; + cellProperties.physicalRow = physicalRow; + cellProperties.physicalCol = physicalCol; + cellProperties.prop = prop; + cellProperties.instance = instance; + Handsontable.hooks.run(instance, 'beforeGetCellMeta', row, col, cellProperties); + extend(cellProperties, expandType(cellProperties)); + if (cellProperties.cells) { + var settings = cellProperties.cells.call(cellProperties, row, col, prop); + if (settings) { + extend(cellProperties, settings); + extend(cellProperties, expandType(settings)); + } + } + Handsontable.hooks.run(instance, 'afterGetCellMeta', row, col, cellProperties); + return cellProperties; + }; + this.isColumnModificationAllowed = function() { + return !(instance.dataType === 'object' || instance.getSettings().columns); + }; + function translateRowIndex(row) { + return Handsontable.hooks.run(instance, 'modifyRow', row); + } + function translateColIndex(col) { + return Handsontable.hooks.run(instance, 'modifyCol', col); + } + var rendererLookup = cellMethodLookupFactory('renderer'); + this.getCellRenderer = function(row, col) { + var renderer = rendererLookup.call(this, row, col); + return getRenderer(renderer); + }; + this.getCellEditor = cellMethodLookupFactory('editor'); + this.getCellValidator = cellMethodLookupFactory('validator'); + this.validateCells = function(callback) { + var waitingForValidator = new ValidatorsQueue(); + waitingForValidator.onQueueEmpty = callback; + var i = instance.countRows() - 1; + while (i >= 0) { + var j = instance.countCols() - 1; + while (j >= 0) { + waitingForValidator.addValidatorToQueue(); + instance.validateCell(instance.getDataAtCell(i, j), instance.getCellMeta(i, j), function(result) { + if (typeof result !== 'boolean') { + throw new Error('Validation error: result is not boolean'); + } + if (result === false) { + waitingForValidator.valid = false; + } + waitingForValidator.removeValidatorFormQueue(); + }, 'validateCells'); + j--; + } + i--; + } + waitingForValidator.checkIfQueueIsEmpty(); + }; + this.getRowHeader = function(row) { + var rowHeader = priv.settings.rowHeaders; + if (row !== void 0) { + row = Handsontable.hooks.run(instance, 'modifyRowHeader', row); + } + if (row === void 0) { + rowHeader = []; + rangeEach(instance.countRows() - 1, (function(i) { + rowHeader.push(instance.getRowHeader(i)); + })); + } else if (Array.isArray(rowHeader) && rowHeader[row] !== void 0) { + rowHeader = rowHeader[row]; + } else if (typeof rowHeader === 'function') { + rowHeader = rowHeader(row); + } else if (rowHeader && typeof rowHeader !== 'string' && typeof rowHeader !== 'number') { + rowHeader = row + 1; + } + return rowHeader; + }; + this.hasRowHeaders = function() { + return !!priv.settings.rowHeaders; + }; + this.hasColHeaders = function() { + if (priv.settings.colHeaders !== void 0 && priv.settings.colHeaders !== null) { + return !!priv.settings.colHeaders; + } + for (var i = 0, + ilen = instance.countCols(); i < ilen; i++) { + if (instance.getColHeader(i)) { + return true; + } + } + return false; + }; + this.getColHeader = function(col) { + col = Handsontable.hooks.run(instance, 'modifyColHeader', col); + if (col === void 0) { + var out = []; + for (var i = 0, + ilen = instance.countCols(); i < ilen; i++) { + out.push(instance.getColHeader(i)); + } + return out; + } else { + var baseCol = col; + col = Handsontable.hooks.run(instance, 'modifyCol', col); + if (priv.settings.columns && priv.settings.columns[col] && priv.settings.columns[col].title) { + return priv.settings.columns[col].title; + } else if (Array.isArray(priv.settings.colHeaders) && priv.settings.colHeaders[col] !== void 0) { + return priv.settings.colHeaders[col]; + } else if (typeof priv.settings.colHeaders === 'function') { + return priv.settings.colHeaders(col); + } else if (priv.settings.colHeaders && typeof priv.settings.colHeaders !== 'string' && typeof priv.settings.colHeaders !== 'number') { + return spreadsheetColumnLabel(baseCol); + } else { + return priv.settings.colHeaders; + } + } + }; + this._getColWidthFromSettings = function(col) { + var cellProperties = instance.getCellMeta(0, col); + var width = cellProperties.width; + if (width === void 0 || width === priv.settings.width) { + width = cellProperties.colWidths; + } + if (width !== void 0 && width !== null) { + switch (typeof width) { + case 'object': + width = width[col]; + break; + case 'function': + width = width(col); + break; + } + if (typeof width === 'string') { + width = parseInt(width, 10); + } + } + return width; + }; + this.getColWidth = function(col) { + var width = instance._getColWidthFromSettings(col); + width = Handsontable.hooks.run(instance, 'modifyColWidth', width, col); + if (width === void 0) { + width = WalkontableViewportColumnsCalculator.DEFAULT_WIDTH; + } + return width; + }; + this._getRowHeightFromSettings = function(row) { + var height = priv.settings.rowHeights; + if (height !== void 0 && height !== null) { + switch (typeof height) { + case 'object': + height = height[row]; + break; + case 'function': + height = height(row); + break; + } + if (typeof height === 'string') { + height = parseInt(height, 10); + } + } + return height; + }; + this.getRowHeight = function(row) { + var height = instance._getRowHeightFromSettings(row); + height = Handsontable.hooks.run(instance, 'modifyRowHeight', height, row); + return height; + }; + this.countSourceRows = function() { + return instance.getSourceData() ? instance.getSourceData().length : 0; + }; + this.countRows = function() { + return datamap.getLength(); + }; + this.countCols = function() { + if (instance.dataType === 'object' || instance.dataType === 'function') { + if (priv.settings.columns && priv.settings.columns.length) { + return priv.settings.columns.length; + } else { + return datamap.colToPropCache.length; + } + } else if (instance.dataType === 'array') { + if (priv.settings.columns && priv.settings.columns.length) { + return priv.settings.columns.length; + } else if (priv.settings.data && priv.settings.data[0] && priv.settings.data[0].length) { + return priv.settings.data[0].length; + } else { + return 0; + } + } + }; + this.getColspanOffset = function(col, level) { + var colspanSum = 0; + if (instance.colspanArray) { + for (var i = 0; i < col; i++) { + colspanSum += instance.colspanArray[level][i] - 1 || 0; + } + return colspanSum; + } + var colspanSum = 0; + var TRindex = instance.view.wt.wtTable.THEAD.childNodes.length - level - 1; + var TR = instance.view.wt.wtTable.THEAD.querySelector('tr:nth-child(' + parseInt(TRindex + 1, 10) + ')'); + var rowHeadersCount = instance.view.wt.wtSettings.settings.rowHeaders().length; + for (var i = rowHeadersCount; i < rowHeadersCount + col; i++) { + if (TR.childNodes[i].hasAttribute('colspan')) { + colspanSum += parseInt(TR.childNodes[i].getAttribute('colspan'), 10) - 1; + } + } + return colspanSum; + }; + this.getHeaderColspan = function(col, level) { + var TRindex = instance.view.wt.wtTable.THEAD.childNodes.length - level - 1; + var rowHeadersCount = instance.view.wt.wtSettings.settings.rowHeaders().length; + var TR = instance.view.wt.wtTable.THEAD.querySelector('tr:nth-child(' + parseInt(TRindex + 1, 10) + ')'); + var offsettedColIndex = rowHeadersCount + col - instance.view.wt.wtViewport.columnsRenderCalculator.startColumn; + if (TR.childNodes[offsettedColIndex].hasAttribute('colspan')) { + return parseInt(TR.childNodes[offsettedColIndex].getAttribute('colspan'), 10); + } + return 0; + }; + this.rowOffset = function() { + return instance.view.wt.wtTable.getFirstRenderedRow(); + }; + this.colOffset = function() { + return instance.view.wt.wtTable.getFirstRenderedColumn(); + }; + this.countRenderedRows = function() { + return instance.view.wt.drawn ? instance.view.wt.wtTable.getRenderedRowsCount() : -1; + }; + this.countVisibleRows = function() { + return instance.view.wt.drawn ? instance.view.wt.wtTable.getVisibleRowsCount() : -1; + }; + this.countRenderedCols = function() { + return instance.view.wt.drawn ? instance.view.wt.wtTable.getRenderedColumnsCount() : -1; + }; + this.countVisibleCols = function() { + return instance.view.wt.drawn ? instance.view.wt.wtTable.getVisibleColumnsCount() : -1; + }; + this.countEmptyRows = function(ending) { + var i = instance.countRows() - 1, + empty = 0, + row; + while (i >= 0) { + row = Handsontable.hooks.run(this, 'modifyRow', i); + if (instance.isEmptyRow(row)) { + empty++; + } else if (ending) { + break; + } + i--; + } + return empty; + }; + this.countEmptyCols = function(ending) { + if (instance.countRows() < 1) { + return 0; + } + var i = instance.countCols() - 1, + empty = 0; + while (i >= 0) { + if (instance.isEmptyCol(i)) { + empty++; + } else if (ending) { + break; + } + i--; + } + return empty; + }; + this.isEmptyRow = function(row) { + return priv.settings.isEmptyRow.call(instance, row); + }; + this.isEmptyCol = function(col) { + return priv.settings.isEmptyCol.call(instance, col); + }; + this.selectCell = function(row, col, endRow, endCol, scrollToCell, changeListener) { + var coords; + changeListener = typeof changeListener === 'undefined' || changeListener === true; + if (typeof row !== 'number' || row < 0 || row >= instance.countRows()) { + return false; + } + if (typeof col !== 'number' || col < 0 || col >= instance.countCols()) { + return false; + } + if (typeof endRow !== 'undefined') { + if (typeof endRow !== 'number' || endRow < 0 || endRow >= instance.countRows()) { + return false; + } + if (typeof endCol !== 'number' || endCol < 0 || endCol >= instance.countCols()) { + return false; + } + } + coords = new WalkontableCellCoords(row, col); + priv.selRange = new WalkontableCellRange(coords, coords, coords); + if (changeListener) { + instance.listen(); + } + if (typeof endRow === 'undefined') { + selection.setRangeEnd(priv.selRange.from, scrollToCell); + } else { + selection.setRangeEnd(new WalkontableCellCoords(endRow, endCol), scrollToCell); + } + instance.selection.finish(); + return true; + }; + this.selectCellByProp = function(row, prop, endRow, endProp, scrollToCell) { + arguments[1] = datamap.propToCol(arguments[1]); + if (typeof arguments[3] !== 'undefined') { + arguments[3] = datamap.propToCol(arguments[3]); + } + return instance.selectCell.apply(instance, arguments); + }; + this.deselectCell = function() { + selection.deselect(); + }; + this.destroy = function() { + instance._clearTimeouts(); + if (instance.view) { + instance.view.destroy(); + } + if (dataSource) { + dataSource.destroy(); + } + dataSource = null; + empty(instance.rootElement); + eventManager.destroy(); + Handsontable.hooks.run(instance, 'afterDestroy'); + Handsontable.hooks.destroy(instance); + for (var i in instance) { + if (instance.hasOwnProperty(i)) { + if (typeof instance[i] === 'function') { + instance[i] = postMortem; + } else if (i !== 'guid') { + instance[i] = null; + } + } + } + priv = null; + datamap = null; + grid = null; + selection = null; + editorManager = null; + instance = null; + GridSettings = null; + }; + function postMortem() { + throw new Error('This method cannot be called because this Handsontable instance has been destroyed'); + } + this.getActiveEditor = function() { + return editorManager.getActiveEditor(); + }; + this.getPlugin = function(pluginName) { + return getPlugin(this, pluginName); + }; + this.getInstance = function() { + return instance; + }; + this.addHook = function(key, callback) { + Handsontable.hooks.add(key, callback, instance); + }; + this.hasHook = function(key) { + return Handsontable.hooks.has(key, instance); + }; + this.addHookOnce = function(key, callback) { + Handsontable.hooks.once(key, callback, instance); + }; + this.removeHook = function(key, callback) { + Handsontable.hooks.remove(key, callback, instance); + }; + this.runHooks = function(key, p1, p2, p3, p4, p5, p6) { + return Handsontable.hooks.run(instance, key, p1, p2, p3, p4, p5, p6); + }; + this.timeouts = []; + this._registerTimeout = function(handle) { + this.timeouts.push(handle); + }; + this._clearTimeouts = function() { + for (var i = 0, + ilen = this.timeouts.length; i < ilen; i++) { + clearTimeout(this.timeouts[i]); + } + }; + this.version = Handsontable.version; + Handsontable.hooks.run(instance, 'construct'); +}; +var DefaultSettings = function() {}; +DefaultSettings.prototype = { + data: void 0, + dataSchema: void 0, + width: void 0, + height: void 0, + startRows: 5, + startCols: 5, + rowHeaders: null, + colHeaders: null, + colWidths: void 0, + rowHeights: void 0, + columns: void 0, + cells: void 0, + cell: [], + comments: false, + customBorders: false, + minRows: 0, + minCols: 0, + maxRows: Infinity, + maxCols: Infinity, + minSpareRows: 0, + minSpareCols: 0, + allowInsertRow: true, + allowInsertColumn: true, + allowRemoveRow: true, + allowRemoveColumn: true, + multiSelect: true, + fillHandle: true, + fixedRowsTop: 0, + fixedRowsBottom: 0, + fixedColumnsLeft: 0, + outsideClickDeselects: true, + enterBeginsEditing: true, + enterMoves: { + row: 1, + col: 0 + }, + tabMoves: { + row: 0, + col: 1 + }, + autoWrapRow: false, + autoWrapCol: false, + copyRowsLimit: 1000, + copyColsLimit: 1000, + pasteMode: 'overwrite', + persistentState: false, + currentRowClassName: void 0, + currentColClassName: void 0, + className: void 0, + tableClassName: void 0, + stretchH: 'none', + isEmptyRow: function(row) { + var col, + colLen, + value, + meta; + for (col = 0, colLen = this.countCols(); col < colLen; col++) { + value = this.getDataAtCell(row, col); + if (value !== '' && value !== null && typeof value !== 'undefined') { + if (typeof value === 'object') { + meta = this.getCellMeta(row, col); + return isObjectEquals(this.getSchema()[meta.prop], value); + } + return false; + } + } + return true; + }, + isEmptyCol: function(col) { + var row, + rowLen, + value; + for (row = 0, rowLen = this.countRows(); row < rowLen; row++) { + value = this.getDataAtCell(row, col); + if (value !== '' && value !== null && typeof value !== 'undefined') { + return false; + } + } + return true; + }, + observeDOMVisibility: true, + allowInvalid: true, + invalidCellClassName: 'htInvalid', + placeholder: false, + placeholderCellClassName: 'htPlaceholder', + readOnlyCellClassName: 'htDimmed', + renderer: void 0, + commentedCellClassName: 'htCommentCell', + fragmentSelection: false, + readOnly: false, + skipColumnOnPaste: false, + search: false, + type: 'text', + copyable: true, + editor: void 0, + autoComplete: void 0, + visibleRows: 10, + trimDropdown: true, + debug: false, + wordWrap: true, + noWordWrapClassName: 'htNoWrap', + contextMenu: void 0, + contextMenuCopyPaste: void 0, + copyPaste: void 0, + undo: void 0, + columnSorting: void 0, + manualColumnMove: void 0, + manualColumnResize: void 0, + manualRowMove: void 0, + manualRowResize: void 0, + mergeCells: false, + viewportRowRenderingOffset: 'auto', + viewportColumnRenderingOffset: 'auto', + validator: void 0, + disableVisualSelection: false, + sortIndicator: false, + manualColumnFreeze: void 0, + trimWhitespace: true, + settings: void 0, + source: void 0, + title: void 0, + checkedTemplate: void 0, + uncheckedTemplate: void 0, + label: void 0, + format: void 0, + language: void 0, + selectOptions: void 0, + autoColumnSize: void 0, + autoRowSize: void 0, + dateFormat: void 0, + correctFormat: false, + defaultDate: void 0, + strict: void 0, + renderAllRows: void 0, + preventOverflow: false +}; +Handsontable.DefaultSettings = DefaultSettings; + +//# +},{"3rdparty/walkontable/src/calculator/viewportColumns":3,"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/selection":18,"dataMap":26,"dataSource":27,"editorManager":28,"eventManager":41,"helpers/array":42,"helpers/data":44,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/setting":51,"helpers/string":52,"numeral":"numeral","plugins":57,"renderers":88,"tableView":97}],26:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + DataMap: {get: function() { + return DataMap; + }}, + __esModule: {value: true} +}); +var $__SheetClip__, + $__helpers_47_data__, + $__helpers_47_setting__, + $__helpers_47_object__, + $__helpers_47_array__, + $__helpers_47_number__, + $__multiMap__; +var SheetClip = ($__SheetClip__ = require("SheetClip"), $__SheetClip__ && $__SheetClip__.__esModule && $__SheetClip__ || {default: $__SheetClip__}).default; +var cellMethodLookupFactory = ($__helpers_47_data__ = require("helpers/data"), $__helpers_47_data__ && $__helpers_47_data__.__esModule && $__helpers_47_data__ || {default: $__helpers_47_data__}).cellMethodLookupFactory; +var columnFactory = ($__helpers_47_setting__ = require("helpers/setting"), $__helpers_47_setting__ && $__helpers_47_setting__.__esModule && $__helpers_47_setting__ || {default: $__helpers_47_setting__}).columnFactory; +var $__3 = ($__helpers_47_object__ = require("helpers/object"), $__helpers_47_object__ && $__helpers_47_object__.__esModule && $__helpers_47_object__ || {default: $__helpers_47_object__}), + duckSchema = $__3.duckSchema, + deepExtend = $__3.deepExtend; +var $__4 = ($__helpers_47_array__ = require("helpers/array"), $__helpers_47_array__ && $__helpers_47_array__.__esModule && $__helpers_47_array__ || {default: $__helpers_47_array__}), + extendArray = $__4.extendArray, + to2dArray = $__4.to2dArray; +var rangeEach = ($__helpers_47_number__ = require("helpers/number"), $__helpers_47_number__ && $__helpers_47_number__.__esModule && $__helpers_47_number__ || {default: $__helpers_47_number__}).rangeEach; +var MultiMap = ($__multiMap__ = require("multiMap"), $__multiMap__ && $__multiMap__.__esModule && $__multiMap__ || {default: $__multiMap__}).MultiMap; +function DataMap(instance, priv, GridSettings) { + this.instance = instance; + this.priv = priv; + this.GridSettings = GridSettings; + this.dataSource = this.instance.getSettings().data; + if (this.dataSource[0]) { + this.duckSchema = this.recursiveDuckSchema(this.dataSource[0]); + } else { + this.duckSchema = {}; + } + this.createMap(); +} +DataMap.prototype.DESTINATION_RENDERER = 1; +DataMap.prototype.DESTINATION_CLIPBOARD_GENERATOR = 2; +DataMap.prototype.recursiveDuckSchema = function(object) { + return duckSchema(object); +}; +DataMap.prototype.recursiveDuckColumns = function(schema, lastCol, parent) { + var prop, + i; + if (typeof lastCol === 'undefined') { + lastCol = 0; + parent = ''; + } + if (typeof schema === 'object' && !Array.isArray(schema)) { + for (i in schema) { + if (schema.hasOwnProperty(i)) { + if (schema[i] === null) { + prop = parent + i; + this.colToPropCache.push(prop); + this.propToColCache.set(prop, lastCol); + lastCol++; + } else { + lastCol = this.recursiveDuckColumns(schema[i], lastCol, i + '.'); + } + } + } + } + return lastCol; +}; +DataMap.prototype.createMap = function() { + var i, + ilen, + schema = this.getSchema(); + if (typeof schema === 'undefined') { + throw new Error('trying to create `columns` definition but you didnt\' provide `schema` nor `data`'); + } + this.colToPropCache = []; + this.propToColCache = new MultiMap(); + var columns = this.instance.getSettings().columns; + if (columns) { + for (i = 0, ilen = columns.length; i < ilen; i++) { + if (typeof columns[i].data != 'undefined') { + this.colToPropCache[i] = columns[i].data; + this.propToColCache.set(columns[i].data, i); + } + } + } else { + this.recursiveDuckColumns(schema); + } +}; +DataMap.prototype.colToProp = function(col) { + col = Handsontable.hooks.run(this.instance, 'modifyCol', col); + if (this.colToPropCache && typeof this.colToPropCache[col] !== 'undefined') { + return this.colToPropCache[col]; + } + return col; +}; +DataMap.prototype.propToCol = function(prop) { + var col; + if (typeof this.propToColCache.get(prop) === 'undefined') { + col = prop; + } else { + col = this.propToColCache.get(prop); + } + col = Handsontable.hooks.run(this.instance, 'modifyCol', col); + return col; +}; +DataMap.prototype.getSchema = function() { + var schema = this.instance.getSettings().dataSchema; + if (schema) { + if (typeof schema === 'function') { + return schema(); + } + return schema; + } + return this.duckSchema; +}; +DataMap.prototype.createRow = function(index, amount, createdAutomatically) { + var row, + colCount = this.instance.countCols(), + numberOfCreatedRows = 0, + currentIndex; + if (!amount) { + amount = 1; + } + if (typeof index !== 'number' || index >= this.instance.countSourceRows()) { + index = this.instance.countSourceRows(); + } + currentIndex = index; + var maxRows = this.instance.getSettings().maxRows; + while (numberOfCreatedRows < amount && this.instance.countSourceRows() < maxRows) { + if (this.instance.dataType === 'array') { + row = []; + for (var c = 0; c < colCount; c++) { + row.push(null); + } + } else if (this.instance.dataType === 'function') { + row = this.instance.getSettings().dataSchema(index); + } else { + row = {}; + deepExtend(row, this.getSchema()); + } + if (index === this.instance.countSourceRows()) { + this.dataSource.push(row); + } else { + this.dataSource.splice(index, 0, row); + } + numberOfCreatedRows++; + currentIndex++; + } + Handsontable.hooks.run(this.instance, 'afterCreateRow', index, numberOfCreatedRows, createdAutomatically); + this.instance.forceFullRender = true; + return numberOfCreatedRows; +}; +DataMap.prototype.createCol = function(index, amount, createdAutomatically) { + if (!this.instance.isColumnModificationAllowed()) { + throw new Error('Cannot create new column. When data source in an object, ' + 'you can only have as much columns as defined in first data row, data schema or in the \'columns\' setting.' + 'If you want to be able to add new columns, you have to use array datasource.'); + } + var rlen = this.instance.countSourceRows(), + data = this.dataSource, + constructor, + numberOfCreatedCols = 0, + currentIndex; + if (!amount) { + amount = 1; + } + currentIndex = index; + var maxCols = this.instance.getSettings().maxCols; + while (numberOfCreatedCols < amount && this.instance.countCols() < maxCols) { + constructor = columnFactory(this.GridSettings, this.priv.columnsSettingConflicts); + if (typeof index !== 'number' || index >= this.instance.countCols()) { + for (var r = 0; r < rlen; r++) { + if (typeof data[r] === 'undefined') { + data[r] = []; + } + data[r].push(null); + } + this.priv.columnSettings.push(constructor); + } else { + for (var r = 0; r < rlen; r++) { + data[r].splice(currentIndex, 0, null); + } + this.priv.columnSettings.splice(currentIndex, 0, constructor); + } + numberOfCreatedCols++; + currentIndex++; + } + Handsontable.hooks.run(this.instance, 'afterCreateCol', index, numberOfCreatedCols, createdAutomatically); + this.instance.forceFullRender = true; + return numberOfCreatedCols; +}; +DataMap.prototype.removeRow = function(index, amount) { + if (!amount) { + amount = 1; + } + if (typeof index !== 'number') { + index = -amount; + } + index = (this.instance.countSourceRows() + index) % this.instance.countSourceRows(); + var logicRows = this.physicalRowsToLogical(index, amount); + var actionWasNotCancelled = Handsontable.hooks.run(this.instance, 'beforeRemoveRow', index, amount, logicRows); + if (actionWasNotCancelled === false) { + return; + } + var data = this.dataSource; + var newData = data.filter(function(row, index) { + return logicRows.indexOf(index) == -1; + }); + data.length = 0; + Array.prototype.push.apply(data, newData); + Handsontable.hooks.run(this.instance, 'afterRemoveRow', index, amount, logicRows); + this.instance.forceFullRender = true; +}; +DataMap.prototype.removeCol = function(index, amount) { + if (this.instance.dataType === 'object' || this.instance.getSettings().columns) { + throw new Error('cannot remove column with object data source or columns option specified'); + } + if (!amount) { + amount = 1; + } + if (typeof index !== 'number') { + index = -amount; + } + index = (this.instance.countCols() + index) % this.instance.countCols(); + var actionWasNotCancelled = Handsontable.hooks.run(this.instance, 'beforeRemoveCol', index, amount); + if (actionWasNotCancelled === false) { + return; + } + var data = this.dataSource; + for (var r = 0, + rlen = this.instance.countSourceRows(); r < rlen; r++) { + data[r].splice(index, amount); + } + this.priv.columnSettings.splice(index, amount); + Handsontable.hooks.run(this.instance, 'afterRemoveCol', index, amount); + this.instance.forceFullRender = true; +}; +DataMap.prototype.spliceCol = function(col, index, amount) { + var elements = 4 <= arguments.length ? [].slice.call(arguments, 3) : []; + var colData = this.instance.getDataAtCol(col); + var removed = colData.slice(index, index + amount); + var after = colData.slice(index + amount); + extendArray(elements, after); + var i = 0; + while (i < amount) { + elements.push(null); + i++; + } + to2dArray(elements); + this.instance.populateFromArray(index, col, elements, null, null, 'spliceCol'); + return removed; +}; +DataMap.prototype.spliceRow = function(row, index, amount) { + var elements = 4 <= arguments.length ? [].slice.call(arguments, 3) : []; + var rowData = this.instance.getSourceDataAtRow(row); + var removed = rowData.slice(index, index + amount); + var after = rowData.slice(index + amount); + extendArray(elements, after); + var i = 0; + while (i < amount) { + elements.push(null); + i++; + } + this.instance.populateFromArray(row, index, [elements], null, null, 'spliceRow'); + return removed; +}; +DataMap.prototype.get = function(row, prop) { + row = Handsontable.hooks.run(this.instance, 'modifyRow', row); + if (typeof prop === 'string' && prop.indexOf('.') > -1) { + var sliced = prop.split('.'); + var out = this.dataSource[row]; + if (!out) { + return null; + } + for (var i = 0, + ilen = sliced.length; i < ilen; i++) { + out = out[sliced[i]]; + if (typeof out === 'undefined') { + return null; + } + } + return out; + } else if (typeof prop === 'function') { + return prop(this.dataSource.slice(row, row + 1)[0]); + } + if (this.dataSource[row] && this.dataSource[row].hasOwnProperty && this.dataSource[row].hasOwnProperty(prop)) { + return this.dataSource[row][prop]; + } + return null; +}; +var copyableLookup = cellMethodLookupFactory('copyable', false); +DataMap.prototype.getCopyable = function(row, prop) { + if (copyableLookup.call(this.instance, row, this.propToCol(prop))) { + return this.get(row, prop); + } + return ''; +}; +DataMap.prototype.set = function(row, prop, value, source) { + row = Handsontable.hooks.run(this.instance, 'modifyRow', row, source || 'datamapGet'); + if (typeof prop === 'string' && prop.indexOf('.') > -1) { + var sliced = prop.split('.'); + var out = this.dataSource[row]; + for (var i = 0, + ilen = sliced.length - 1; i < ilen; i++) { + if (typeof out[sliced[i]] === 'undefined') { + out[sliced[i]] = {}; + } + out = out[sliced[i]]; + } + out[sliced[i]] = value; + } else if (typeof prop === 'function') { + prop(this.dataSource.slice(row, row + 1)[0], value); + } else { + this.dataSource[row][prop] = value; + } +}; +DataMap.prototype.physicalRowsToLogical = function(index, amount) { + var totalRows = this.instance.countSourceRows(); + var physicRow = (totalRows + index) % totalRows; + var logicRows = []; + var rowsToRemove = amount; + var row; + while (physicRow < totalRows && rowsToRemove) { + row = Handsontable.hooks.run(this.instance, 'modifyRow', physicRow); + logicRows.push(row); + rowsToRemove--; + physicRow++; + } + return logicRows; +}; +DataMap.prototype.clear = function() { + for (var r = 0; r < this.instance.countSourceRows(); r++) { + for (var c = 0; c < this.instance.countCols(); c++) { + this.set(r, this.colToProp(c), ''); + } + } +}; +DataMap.prototype.getLength = function() { + var $__7 = this; + var length = this.instance.countSourceRows(); + if (Handsontable.hooks.has('modifyRow', this.instance)) { + rangeEach(this.instance.countSourceRows() - 1, (function(row) { + row = Handsontable.hooks.run($__7.instance, 'modifyRow', row); + if (row === null) { + length--; + } + })); + } + return length; +}; +DataMap.prototype.getAll = function() { + var start = { + row: 0, + col: 0 + }; + var end = { + row: Math.max(this.instance.countSourceRows() - 1, 0), + col: Math.max(this.instance.countCols() - 1, 0) + }; + if (start.row - end.row === 0 && !this.instance.countSourceRows()) { + return []; + } + return this.getRange(start, end, DataMap.prototype.DESTINATION_RENDERER); +}; +DataMap.prototype.getRange = function(start, end, destination) { + var r, + rlen, + c, + clen, + output = [], + row, + rowExists; + var getFn = destination === this.DESTINATION_CLIPBOARD_GENERATOR ? this.getCopyable : this.get; + rlen = Math.max(start.row, end.row); + clen = Math.max(start.col, end.col); + for (r = Math.min(start.row, end.row); r <= rlen; r++) { + row = []; + var physicalRow = Handsontable.hooks.run(this.instance, 'modifyRow', r); + for (c = Math.min(start.col, end.col); c <= clen; c++) { + var rowValue; + if (physicalRow === null) { + break; + } + row.push(getFn.call(this, r, this.colToProp(c))); + } + if (physicalRow !== null) { + output.push(row); + } + } + return output; +}; +DataMap.prototype.getText = function(start, end) { + return SheetClip.stringify(this.getRange(start, end, this.DESTINATION_RENDERER)); +}; +DataMap.prototype.getCopyableText = function(start, end) { + return SheetClip.stringify(this.getRange(start, end, this.DESTINATION_CLIPBOARD_GENERATOR)); +}; +; +Handsontable.DataMap = DataMap; + +//# +},{"SheetClip":"SheetClip","helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51,"multiMap":55}],27:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + DataSource: {get: function() { + return DataSource; + }}, + __esModule: {value: true} +}); +var $__helpers_47_data__, + $__helpers_47_setting__, + $__helpers_47_object__, + $__helpers_47_array__, + $__helpers_47_number__; +var cellMethodLookupFactory = ($__helpers_47_data__ = require("helpers/data"), $__helpers_47_data__ && $__helpers_47_data__.__esModule && $__helpers_47_data__ || {default: $__helpers_47_data__}).cellMethodLookupFactory; +var columnFactory = ($__helpers_47_setting__ = require("helpers/setting"), $__helpers_47_setting__ && $__helpers_47_setting__.__esModule && $__helpers_47_setting__ || {default: $__helpers_47_setting__}).columnFactory; +var $__2 = ($__helpers_47_object__ = require("helpers/object"), $__helpers_47_object__ && $__helpers_47_object__.__esModule && $__helpers_47_object__ || {default: $__helpers_47_object__}), + duckSchema = $__2.duckSchema, + deepExtend = $__2.deepExtend, + getProperty = $__2.getProperty; +var $__3 = ($__helpers_47_array__ = require("helpers/array"), $__helpers_47_array__ && $__helpers_47_array__.__esModule && $__helpers_47_array__ || {default: $__helpers_47_array__}), + extendArray = $__3.extendArray, + arrayEach = $__3.arrayEach; +var rangeEach = ($__helpers_47_number__ = require("helpers/number"), $__helpers_47_number__ && $__helpers_47_number__.__esModule && $__helpers_47_number__ || {default: $__helpers_47_number__}).rangeEach; +var DataSource = function DataSource(hotInstance, dataSource) { + this.hot = hotInstance; + this.data = dataSource; + this.dataType = 'array'; + this.colToProp = (function() {}); + this.propToCol = (function() {}); +}; +($traceurRuntime.createClass)(DataSource, { + getData: function() { + return this.data; + }, + getAtColumn: function(column) { + var $__5 = this; + var result = []; + arrayEach(this.data, (function(row) { + var property = $__5.colToProp(column); + if (typeof property === 'string') { + row = getProperty(row, property); + } else { + row = row[property]; + } + result.push(row); + })); + return result; + }, + getAtRow: function(row) { + return this.data[row]; + }, + getAtCell: function(row, column) { + return this.data[row][this.colToProp(column)]; + }, + getByRange: function(start, end) { + var $__5 = this; + var startRow = Math.min(start.row, end.row); + var startCol = Math.min(start.col, end.col); + var endRow = Math.max(start.row, end.row); + var endCol = Math.max(start.col, end.col); + var result = []; + rangeEach(startRow, endRow, (function(currentRow) { + var row = $__5.getAtRow(currentRow); + var newRow; + if ($__5.dataType === 'array') { + newRow = row.slice(startCol, endCol); + } else if ($__5.dataType === 'object') { + newRow = {}; + rangeEach(startCol, endCol, (function(column) { + var prop = $__5.colToProp(column); + newRow[prop] = row[prop]; + })); + } + result.push(newRow); + })); + return result; + }, + destroy: function() { + this.data = null; + this.hot = null; + } +}, {}); +; + +//# +},{"helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51}],28:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + EditorManager: {get: function() { + return EditorManager; + }}, + __esModule: {value: true} +}); +var $__3rdparty_47_walkontable_47_src_47_cell_47_coords__, + $__helpers_47_unicode__, + $__helpers_47_dom_47_event__, + $__editors__, + $__eventManager__; +var WalkontableCellCoords = ($__3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $__3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $__3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $__3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $__3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords; +var $__1 = ($__helpers_47_unicode__ = require("helpers/unicode"), $__helpers_47_unicode__ && $__helpers_47_unicode__.__esModule && $__helpers_47_unicode__ || {default: $__helpers_47_unicode__}), + KEY_CODES = $__1.KEY_CODES, + isMetaKey = $__1.isMetaKey, + isCtrlKey = $__1.isCtrlKey; +var $__2 = ($__helpers_47_dom_47_event__ = require("helpers/dom/event"), $__helpers_47_dom_47_event__ && $__helpers_47_dom_47_event__.__esModule && $__helpers_47_dom_47_event__ || {default: $__helpers_47_dom_47_event__}), + stopPropagation = $__2.stopPropagation, + stopImmediatePropagation = $__2.stopImmediatePropagation, + isImmediatePropagationStopped = $__2.isImmediatePropagationStopped; +var getEditor = ($__editors__ = require("editors"), $__editors__ && $__editors__.__esModule && $__editors__ || {default: $__editors__}).getEditor; +var eventManagerObject = ($__eventManager__ = require("eventManager"), $__eventManager__ && $__eventManager__.__esModule && $__eventManager__ || {default: $__eventManager__}).eventManager; +; +Handsontable.EditorManager = EditorManager; +function EditorManager(instance, priv, selection) { + var _this = this, + destroyed = false, + eventManager, + activeEditor; + eventManager = eventManagerObject(instance); + function moveSelectionAfterEnter(shiftKey) { + var enterMoves = typeof priv.settings.enterMoves === 'function' ? priv.settings.enterMoves(event) : priv.settings.enterMoves; + if (shiftKey) { + selection.transformStart(-enterMoves.row, -enterMoves.col); + } else { + selection.transformStart(enterMoves.row, enterMoves.col, true); + } + } + function moveSelectionUp(shiftKey) { + if (shiftKey) { + selection.transformEnd(-1, 0); + } else { + selection.transformStart(-1, 0); + } + } + function moveSelectionDown(shiftKey) { + if (shiftKey) { + selection.transformEnd(1, 0); + } else { + selection.transformStart(1, 0); + } + } + function moveSelectionRight(shiftKey) { + if (shiftKey) { + selection.transformEnd(0, 1); + } else { + selection.transformStart(0, 1); + } + } + function moveSelectionLeft(shiftKey) { + if (shiftKey) { + selection.transformEnd(0, -1); + } else { + selection.transformStart(0, -1); + } + } + function onKeyDown(event) { + var ctrlDown, + rangeModifier; + if (!instance.isListening()) { + return; + } + Handsontable.hooks.run(instance, 'beforeKeyDown', event); + if (destroyed) { + return; + } + if (isImmediatePropagationStopped(event)) { + return; + } + priv.lastKeyCode = event.keyCode; + if (!selection.isSelected()) { + return; + } + ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey; + if (activeEditor && !activeEditor.isWaiting()) { + if (!isMetaKey(event.keyCode) && !isCtrlKey(event.keyCode) && !ctrlDown && !_this.isEditorOpened()) { + _this.openEditor('', event); + return; + } + } + rangeModifier = event.shiftKey ? selection.setRangeEnd : selection.setRangeStart; + switch (event.keyCode) { + case KEY_CODES.A: + if (!_this.isEditorOpened() && ctrlDown) { + selection.selectAll(); + event.preventDefault(); + stopPropagation(event); + } + break; + case KEY_CODES.ARROW_UP: + if (_this.isEditorOpened() && !activeEditor.isWaiting()) { + _this.closeEditorAndSaveChanges(ctrlDown); + } + moveSelectionUp(event.shiftKey); + event.preventDefault(); + stopPropagation(event); + break; + case KEY_CODES.ARROW_DOWN: + if (_this.isEditorOpened() && !activeEditor.isWaiting()) { + _this.closeEditorAndSaveChanges(ctrlDown); + } + moveSelectionDown(event.shiftKey); + event.preventDefault(); + stopPropagation(event); + break; + case KEY_CODES.ARROW_RIGHT: + if (_this.isEditorOpened() && !activeEditor.isWaiting()) { + _this.closeEditorAndSaveChanges(ctrlDown); + } + moveSelectionRight(event.shiftKey); + event.preventDefault(); + stopPropagation(event); + break; + case KEY_CODES.ARROW_LEFT: + if (_this.isEditorOpened() && !activeEditor.isWaiting()) { + _this.closeEditorAndSaveChanges(ctrlDown); + } + moveSelectionLeft(event.shiftKey); + event.preventDefault(); + stopPropagation(event); + break; + case KEY_CODES.TAB: + var tabMoves = typeof priv.settings.tabMoves === 'function' ? priv.settings.tabMoves(event) : priv.settings.tabMoves; + if (event.shiftKey) { + selection.transformStart(-tabMoves.row, -tabMoves.col); + } else { + selection.transformStart(tabMoves.row, tabMoves.col, true); + } + event.preventDefault(); + stopPropagation(event); + break; + case KEY_CODES.BACKSPACE: + case KEY_CODES.DELETE: + selection.empty(event); + _this.prepareEditor(); + event.preventDefault(); + break; + case KEY_CODES.F2: + _this.openEditor(null, event); + if (activeEditor) { + activeEditor.enableFullEditMode(); + } + event.preventDefault(); + break; + case KEY_CODES.ENTER: + if (_this.isEditorOpened()) { + if (activeEditor && activeEditor.state !== Handsontable.EditorState.WAITING) { + _this.closeEditorAndSaveChanges(ctrlDown); + } + moveSelectionAfterEnter(event.shiftKey); + } else { + if (instance.getSettings().enterBeginsEditing) { + _this.openEditor(null, event); + if (activeEditor) { + activeEditor.enableFullEditMode(); + } + } else { + moveSelectionAfterEnter(event.shiftKey); + } + } + event.preventDefault(); + stopImmediatePropagation(event); + break; + case KEY_CODES.ESCAPE: + if (_this.isEditorOpened()) { + _this.closeEditorAndRestoreOriginalValue(ctrlDown); + } + event.preventDefault(); + break; + case KEY_CODES.HOME: + if (event.ctrlKey || event.metaKey) { + rangeModifier(new WalkontableCellCoords(0, priv.selRange.from.col)); + } else { + rangeModifier(new WalkontableCellCoords(priv.selRange.from.row, 0)); + } + event.preventDefault(); + stopPropagation(event); + break; + case KEY_CODES.END: + if (event.ctrlKey || event.metaKey) { + rangeModifier(new WalkontableCellCoords(instance.countRows() - 1, priv.selRange.from.col)); + } else { + rangeModifier(new WalkontableCellCoords(priv.selRange.from.row, instance.countCols() - 1)); + } + event.preventDefault(); + stopPropagation(event); + break; + case KEY_CODES.PAGE_UP: + selection.transformStart(-instance.countVisibleRows(), 0); + event.preventDefault(); + stopPropagation(event); + break; + case KEY_CODES.PAGE_DOWN: + selection.transformStart(instance.countVisibleRows(), 0); + event.preventDefault(); + stopPropagation(event); + break; + } + } + function init() { + instance.addHook('afterDocumentKeyDown', onKeyDown); + eventManager.addEventListener(document.documentElement, 'keydown', function(event) { + instance.runHooks('afterDocumentKeyDown', event); + }); + function onDblClick(event, coords, elem) { + if (elem.nodeName == 'TD') { + _this.openEditor(); + if (activeEditor) { + activeEditor.enableFullEditMode(); + } + } + } + instance.view.wt.update('onCellDblClick', onDblClick); + instance.addHook('afterDestroy', function() { + destroyed = true; + }); + } + this.destroyEditor = function(revertOriginal) { + this.closeEditor(revertOriginal); + }; + this.getActiveEditor = function() { + return activeEditor; + }; + this.prepareEditor = function() { + var row, + col, + prop, + td, + originalValue, + cellProperties, + editorClass; + if (activeEditor && activeEditor.isWaiting()) { + this.closeEditor(false, false, function(dataSaved) { + if (dataSaved) { + _this.prepareEditor(); + } + }); + return; + } + row = priv.selRange.highlight.row; + col = priv.selRange.highlight.col; + prop = instance.colToProp(col); + td = instance.getCell(row, col); + originalValue = instance.getDataAtCell(row, col); + cellProperties = instance.getCellMeta(row, col); + editorClass = instance.getCellEditor(cellProperties); + if (editorClass) { + activeEditor = Handsontable.editors.getEditor(editorClass, instance); + activeEditor.prepare(row, col, prop, td, originalValue, cellProperties); + } else { + activeEditor = void 0; + } + }; + this.isEditorOpened = function() { + return activeEditor && activeEditor.isOpened(); + }; + this.openEditor = function(initialValue, event) { + if (activeEditor && !activeEditor.cellProperties.readOnly) { + activeEditor.beginEditing(initialValue, event); + } else if (activeEditor && activeEditor.cellProperties.readOnly) { + if (event && event.keyCode === KEY_CODES.ENTER) { + moveSelectionAfterEnter(); + } + } + }; + this.closeEditor = function(restoreOriginalValue, ctrlDown, callback) { + if (activeEditor) { + activeEditor.finishEditing(restoreOriginalValue, ctrlDown, callback); + } else { + if (callback) { + callback(false); + } + } + }; + this.closeEditorAndSaveChanges = function(ctrlDown) { + return this.closeEditor(false, ctrlDown); + }; + this.closeEditorAndRestoreOriginalValue = function(ctrlDown) { + return this.closeEditor(true, ctrlDown); + }; + init(); +} + +//# +},{"3rdparty/walkontable/src/cell/coords":5,"editors":29,"eventManager":41,"helpers/dom/event":46,"helpers/unicode":53}],29:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + registerEditor: {get: function() { + return registerEditor; + }}, + getEditor: {get: function() { + return getEditor; + }}, + hasEditor: {get: function() { + return hasEditor; + }}, + getEditorConstructor: {get: function() { + return getEditorConstructor; + }}, + __esModule: {value: true} +}); +var $__helpers_47_string__; +var toUpperCaseFirst = ($__helpers_47_string__ = require("helpers/string"), $__helpers_47_string__ && $__helpers_47_string__.__esModule && $__helpers_47_string__ || {default: $__helpers_47_string__}).toUpperCaseFirst; +; +var registeredEditorNames = {}, + registeredEditorClasses = new WeakMap(); +Handsontable.editors = Handsontable.editors || {}; +Handsontable.editors.registerEditor = registerEditor; +Handsontable.editors.getEditor = getEditor; +function RegisteredEditor(editorClass) { + var Clazz, + instances; + instances = {}; + Clazz = editorClass; + this.getConstructor = function() { + return editorClass; + }; + this.getInstance = function(hotInstance) { + if (!(hotInstance.guid in instances)) { + instances[hotInstance.guid] = new Clazz(hotInstance); + } + return instances[hotInstance.guid]; + }; +} +function registerEditor(editorName, editorClass) { + var editor = new RegisteredEditor(editorClass); + if (typeof editorName === 'string') { + registeredEditorNames[editorName] = editor; + Handsontable.editors[toUpperCaseFirst(editorName) + 'Editor'] = editorClass; + } + registeredEditorClasses.set(editorClass, editor); +} +function getEditor(editorName, hotInstance) { + var editor; + if (typeof editorName == 'function') { + if (!(registeredEditorClasses.get(editorName))) { + registerEditor(null, editorName); + } + editor = registeredEditorClasses.get(editorName); + } else if (typeof editorName == 'string') { + editor = registeredEditorNames[editorName]; + } else { + throw Error('Only strings and functions can be passed as "editor" parameter '); + } + if (!editor) { + throw Error('No editor registered under name "' + editorName + '"'); + } + return editor.getInstance(hotInstance); +} +function getEditorConstructor(editorName) { + var editor; + if (typeof editorName == 'string') { + editor = registeredEditorNames[editorName]; + } else { + throw Error('Only strings and functions can be passed as "editor" parameter '); + } + if (!editor) { + throw Error('No editor registered under name "' + editorName + '"'); + } + return editor.getConstructor(); +} +function hasEditor(editorName) { + return registeredEditorNames[editorName] ? true : false; +} + +//# +},{"helpers/string":52}],30:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + BaseEditor: {get: function() { + return BaseEditor; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_mixed__, + $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__; +var stringify = ($___46__46__47_helpers_47_mixed__ = require("helpers/mixed"), $___46__46__47_helpers_47_mixed__ && $___46__46__47_helpers_47_mixed__.__esModule && $___46__46__47_helpers_47_mixed__ || {default: $___46__46__47_helpers_47_mixed__}).stringify; +var WalkontableCellCoords = ($___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords; +; +Handsontable.editors = Handsontable.editors || {}; +Handsontable.editors.BaseEditor = BaseEditor; +Handsontable.EditorState = { + VIRGIN: 'STATE_VIRGIN', + EDITING: 'STATE_EDITING', + WAITING: 'STATE_WAITING', + FINISHED: 'STATE_FINISHED' +}; +function BaseEditor(instance) { + this.instance = instance; + this.state = Handsontable.EditorState.VIRGIN; + this._opened = false; + this._fullEditMode = false; + this._closeCallback = null; + this.init(); +} +BaseEditor.prototype._fireCallbacks = function(result) { + if (this._closeCallback) { + this._closeCallback(result); + this._closeCallback = null; + } +}; +BaseEditor.prototype.init = function() {}; +BaseEditor.prototype.getValue = function() { + throw Error('Editor getValue() method unimplemented'); +}; +BaseEditor.prototype.setValue = function(newValue) { + throw Error('Editor setValue() method unimplemented'); +}; +BaseEditor.prototype.open = function() { + throw Error('Editor open() method unimplemented'); +}; +BaseEditor.prototype.close = function() { + throw Error('Editor close() method unimplemented'); +}; +BaseEditor.prototype.prepare = function(row, col, prop, td, originalValue, cellProperties) { + this.TD = td; + this.row = row; + this.col = col; + this.prop = prop; + this.originalValue = originalValue; + this.cellProperties = cellProperties; + if (this.instance.view.isMouseDown() && document.activeElement && document.activeElement !== document.body) { + document.activeElement.blur(); + } else if (!document.activeElement) { + document.body.focus(); + } + this.state = Handsontable.EditorState.VIRGIN; +}; +BaseEditor.prototype.extend = function() { + var baseClass = this.constructor; + function Editor() { + baseClass.apply(this, arguments); + } + function inherit(Child, Parent) { + function Bridge() {} + Bridge.prototype = Parent.prototype; + Child.prototype = new Bridge(); + Child.prototype.constructor = Child; + return Child; + } + return inherit(Editor, baseClass); +}; +BaseEditor.prototype.saveValue = function(val, ctrlDown) { + var sel, + tmp; + if (ctrlDown) { + sel = this.instance.getSelected(); + if (sel[0] > sel[2]) { + tmp = sel[0]; + sel[0] = sel[2]; + sel[2] = tmp; + } + if (sel[1] > sel[3]) { + tmp = sel[1]; + sel[1] = sel[3]; + sel[3] = tmp; + } + this.instance.populateFromArray(sel[0], sel[1], val, sel[2], sel[3], 'edit'); + } else { + this.instance.populateFromArray(this.row, this.col, val, null, null, 'edit'); + } +}; +BaseEditor.prototype.beginEditing = function(initialValue, event) { + if (this.state != Handsontable.EditorState.VIRGIN) { + return; + } + this.instance.view.scrollViewport(new WalkontableCellCoords(this.row, this.col)); + this.instance.view.render(); + this.state = Handsontable.EditorState.EDITING; + initialValue = typeof initialValue == 'string' ? initialValue : this.originalValue; + this.setValue(stringify(initialValue)); + this.open(event); + this._opened = true; + this.focus(); + this.instance.view.render(); +}; +BaseEditor.prototype.finishEditing = function(restoreOriginalValue, ctrlDown, callback) { + var _this = this, + val; + if (callback) { + var previousCloseCallback = this._closeCallback; + this._closeCallback = function(result) { + if (previousCloseCallback) { + previousCloseCallback(result); + } + callback(result); + }; + } + if (this.isWaiting()) { + return; + } + if (this.state == Handsontable.EditorState.VIRGIN) { + this.instance._registerTimeout(setTimeout(function() { + _this._fireCallbacks(true); + }, 0)); + return; + } + if (this.state == Handsontable.EditorState.EDITING) { + if (restoreOriginalValue) { + this.cancelChanges(); + this.instance.view.render(); + return; + } + if (this.instance.getSettings().trimWhitespace) { + val = [[typeof this.getValue() === 'string' ? String.prototype.trim.call(this.getValue() || '') : this.getValue()]]; + } else { + val = [[this.getValue()]]; + } + this.state = Handsontable.EditorState.WAITING; + this.saveValue(val, ctrlDown); + if (this.instance.getCellValidator(this.cellProperties)) { + this.instance.addHookOnce('postAfterValidate', function(result) { + _this.state = Handsontable.EditorState.FINISHED; + _this.discardEditor(result); + }); + } else { + this.state = Handsontable.EditorState.FINISHED; + this.discardEditor(true); + } + } +}; +BaseEditor.prototype.cancelChanges = function() { + this.state = Handsontable.EditorState.FINISHED; + this.discardEditor(); +}; +BaseEditor.prototype.discardEditor = function(result) { + if (this.state !== Handsontable.EditorState.FINISHED) { + return; + } + if (result === false && this.cellProperties.allowInvalid !== true) { + this.instance.selectCell(this.row, this.col); + this.focus(); + this.state = Handsontable.EditorState.EDITING; + this._fireCallbacks(false); + } else { + this.close(); + this._opened = false; + this._fullEditMode = false; + this.state = Handsontable.EditorState.VIRGIN; + this._fireCallbacks(true); + } +}; +BaseEditor.prototype.enableFullEditMode = function() { + this._fullEditMode = true; +}; +BaseEditor.prototype.isInFullEditMode = function() { + return this._fullEditMode; +}; +BaseEditor.prototype.isOpened = function() { + return this._opened; +}; +BaseEditor.prototype.isWaiting = function() { + return this.state === Handsontable.EditorState.WAITING; +}; +BaseEditor.prototype.checkEditorSection = function() { + var totalRows = this.instance.countRows(); + var section = ''; + if (this.row < this.instance.getSettings().fixedRowsTop) { + if (this.col < this.instance.getSettings().fixedColumnsLeft) { + section = 'top-left-corner'; + } else { + section = 'top'; + } + } else if (this.instance.getSettings().fixedRowsBottom && this.row >= totalRows - this.instance.getSettings().fixedRowsBottom) { + if (this.col < this.instance.getSettings().fixedColumnsLeft) { + section = 'bottom-left-corner'; + } else { + section = 'bottom'; + } + } else { + if (this.col < this.instance.getSettings().fixedColumnsLeft) { + section = 'left'; + } + } + return section; +}; + +//# +},{"3rdparty/walkontable/src/cell/coords":5,"helpers/mixed":48}],31:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + AutocompleteEditor: {get: function() { + return AutocompleteEditor; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_unicode__, + $___46__46__47_helpers_47_mixed__, + $___46__46__47_helpers_47_array__, + $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_editors__, + $__handsontableEditor__; +var $__0 = ($___46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47_helpers_47_unicode__ && $___46__46__47_helpers_47_unicode__.__esModule && $___46__46__47_helpers_47_unicode__ || {default: $___46__46__47_helpers_47_unicode__}), + KEY_CODES = $__0.KEY_CODES, + isPrintableChar = $__0.isPrintableChar; +var stringify = ($___46__46__47_helpers_47_mixed__ = require("helpers/mixed"), $___46__46__47_helpers_47_mixed__ && $___46__46__47_helpers_47_mixed__.__esModule && $___46__46__47_helpers_47_mixed__ || {default: $___46__46__47_helpers_47_mixed__}).stringify; +var pivot = ($___46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47_helpers_47_array__ && $___46__46__47_helpers_47_array__.__esModule && $___46__46__47_helpers_47_array__ || {default: $___46__46__47_helpers_47_array__}).pivot; +var $__3 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}), + addClass = $__3.addClass, + getCaretPosition = $__3.getCaretPosition, + getScrollbarWidth = $__3.getScrollbarWidth, + getSelectionEndPosition = $__3.getSelectionEndPosition, + outerWidth = $__3.outerWidth, + setCaretPosition = $__3.setCaretPosition; +var $__4 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}), + getEditorConstructor = $__4.getEditorConstructor, + registerEditor = $__4.registerEditor; +var HandsontableEditor = ($__handsontableEditor__ = require("handsontableEditor"), $__handsontableEditor__ && $__handsontableEditor__.__esModule && $__handsontableEditor__ || {default: $__handsontableEditor__}).HandsontableEditor; +var AutocompleteEditor = HandsontableEditor.prototype.extend(); +AutocompleteEditor.prototype.init = function() { + HandsontableEditor.prototype.init.apply(this, arguments); + this.query = null; + this.choices = []; +}; +AutocompleteEditor.prototype.createElements = function() { + HandsontableEditor.prototype.createElements.apply(this, arguments); + addClass(this.htContainer, 'autocompleteEditor'); + addClass(this.htContainer, window.navigator.platform.indexOf('Mac') === -1 ? '' : 'htMacScroll'); +}; +var skipOne = false; +function onBeforeKeyDown(event) { + skipOne = false; + var editor = this.getActiveEditor(); + if (isPrintableChar(event.keyCode) || event.keyCode === KEY_CODES.BACKSPACE || event.keyCode === KEY_CODES.DELETE || event.keyCode === KEY_CODES.INSERT) { + var timeOffset = 0; + if (event.keyCode === KEY_CODES.C && (event.ctrlKey || event.metaKey)) { + return; + } + if (!editor.isOpened()) { + timeOffset += 10; + } + if (editor.htEditor) { + editor.instance._registerTimeout(setTimeout(function() { + editor.queryChoices(editor.TEXTAREA.value); + skipOne = true; + }, timeOffset)); + } + } +} +AutocompleteEditor.prototype.prepare = function() { + this.instance.addHook('beforeKeyDown', onBeforeKeyDown); + HandsontableEditor.prototype.prepare.apply(this, arguments); +}; +AutocompleteEditor.prototype.open = function() { + this.TEXTAREA_PARENT.style.overflow = 'auto'; + HandsontableEditor.prototype.open.apply(this, arguments); + this.TEXTAREA_PARENT.style.overflow = ''; + var choicesListHot = this.htEditor.getInstance(); + var that = this; + var trimDropdown = this.cellProperties.trimDropdown === void 0 ? true : this.cellProperties.trimDropdown; + this.TEXTAREA.style.visibility = 'visible'; + this.focus(); + choicesListHot.updateSettings({ + colWidths: trimDropdown ? [outerWidth(this.TEXTAREA) - 2] : void 0, + width: trimDropdown ? outerWidth(this.TEXTAREA) + getScrollbarWidth() + 2 : void 0, + afterRenderer: function(TD, row, col, prop, value) { + var caseSensitive = this.getCellMeta(row, col).filteringCaseSensitive === true, + indexOfMatch, + match, + value = stringify(value); + if (value) { + indexOfMatch = caseSensitive ? value.indexOf(this.query) : value.toLowerCase().indexOf(that.query.toLowerCase()); + if (indexOfMatch != -1) { + match = value.substr(indexOfMatch, that.query.length); + TD.innerHTML = value.replace(match, '' + match + ''); + } + } + }, + autoColumnSize: true, + modifyColWidth: function(width, col) { + var autoWidths = this.getPlugin('autoColumnSize').widths; + if (autoWidths[col]) { + width = autoWidths[col]; + } + return trimDropdown ? width : width + 15; + } + }); + this.htEditor.view.wt.wtTable.holder.parentNode.style['padding-right'] = getScrollbarWidth() + 2 + 'px'; + if (skipOne) { + skipOne = false; + } + that.instance._registerTimeout(setTimeout(function() { + that.queryChoices(that.TEXTAREA.value); + }, 0)); +}; +AutocompleteEditor.prototype.close = function() { + HandsontableEditor.prototype.close.apply(this, arguments); +}; +AutocompleteEditor.prototype.queryChoices = function(query) { + this.query = query; + if (typeof this.cellProperties.source == 'function') { + var that = this; + this.cellProperties.source(query, function(choices) { + that.updateChoicesList(choices); + }); + } else if (Array.isArray(this.cellProperties.source)) { + var choices; + if (!query || this.cellProperties.filter === false) { + choices = this.cellProperties.source; + } else { + var filteringCaseSensitive = this.cellProperties.filteringCaseSensitive === true; + var lowerCaseQuery = query.toLowerCase(); + choices = this.cellProperties.source.filter(function(choice) { + if (filteringCaseSensitive) { + return choice.indexOf(query) != -1; + } else { + return choice.toLowerCase().indexOf(lowerCaseQuery) != -1; + } + }); + } + this.updateChoicesList(choices); + } else { + this.updateChoicesList([]); + } +}; +AutocompleteEditor.prototype.updateChoicesList = function(choices) { + var pos = getCaretPosition(this.TEXTAREA), + endPos = getSelectionEndPosition(this.TEXTAREA); + var orderByRelevance = AutocompleteEditor.sortByRelevance(this.getValue(), choices, this.cellProperties.filteringCaseSensitive); + var highlightIndex; + if (this.cellProperties.filter == false) { + highlightIndex = orderByRelevance[0]; + } else { + var sorted = []; + for (var i = 0, + choicesCount = orderByRelevance.length; i < choicesCount; i++) { + sorted.push(choices[orderByRelevance[i]]); + } + highlightIndex = 0; + choices = sorted; + } + this.choices = choices; + this.htEditor.loadData(pivot([choices])); + this.updateDropdownHeight(); + if (this.cellProperties.strict === true) { + this.highlightBestMatchingChoice(highlightIndex); + } + this.instance.listen(); + this.TEXTAREA.focus(); + setCaretPosition(this.TEXTAREA, pos, (pos == endPos ? void 0 : endPos)); +}; +AutocompleteEditor.prototype.updateDropdownHeight = function() { + var currentDropdownWidth = this.htEditor.getColWidth(0) + getScrollbarWidth() + 2; + var trimDropdown = this.cellProperties.trimDropdown === void 0 ? true : this.cellProperties.trimDropdown; + this.htEditor.updateSettings({ + height: this.getDropdownHeight(), + width: trimDropdown ? void 0 : currentDropdownWidth + }); + this.htEditor.view.wt.wtTable.alignOverlaysWithTrimmingContainer(); +}; +AutocompleteEditor.prototype.finishEditing = function(restoreOriginalValue) { + if (!restoreOriginalValue) { + this.instance.removeHook('beforeKeyDown', onBeforeKeyDown); + } + HandsontableEditor.prototype.finishEditing.apply(this, arguments); +}; +AutocompleteEditor.prototype.highlightBestMatchingChoice = function(index) { + if (typeof index === 'number') { + this.htEditor.selectCell(index, 0); + } else { + this.htEditor.deselectCell(); + } +}; +AutocompleteEditor.sortByRelevance = function(value, choices, caseSensitive) { + var choicesRelevance = [], + currentItem, + valueLength = value.length, + valueIndex, + charsLeft, + result = [], + i, + choicesCount; + if (valueLength === 0) { + for (i = 0, choicesCount = choices.length; i < choicesCount; i++) { + result.push(i); + } + return result; + } + for (i = 0, choicesCount = choices.length; i < choicesCount; i++) { + currentItem = stringify(choices[i]); + if (caseSensitive) { + valueIndex = currentItem.indexOf(value); + } else { + valueIndex = currentItem.toLowerCase().indexOf(value.toLowerCase()); + } + if (valueIndex == -1) { + continue; + } + charsLeft = currentItem.length - valueIndex - valueLength; + choicesRelevance.push({ + baseIndex: i, + index: valueIndex, + charsLeft: charsLeft, + value: currentItem + }); + } + choicesRelevance.sort(function(a, b) { + if (b.index === -1) { + return -1; + } + if (a.index === -1) { + return 1; + } + if (a.index < b.index) { + return -1; + } else if (b.index < a.index) { + return 1; + } else if (a.index === b.index) { + if (a.charsLeft < b.charsLeft) { + return -1; + } else if (a.charsLeft > b.charsLeft) { + return 1; + } else { + return 0; + } + } + }); + for (i = 0, choicesCount = choicesRelevance.length; i < choicesCount; i++) { + result.push(choicesRelevance[i].baseIndex); + } + return result; +}; +AutocompleteEditor.prototype.getDropdownHeight = function() { + var firstRowHeight = this.htEditor.getInstance().getRowHeight(0) || 23; + var _visibleRows = this.cellProperties.visibleRows; + return this.choices.length >= _visibleRows ? _visibleRows * firstRowHeight : this.choices.length * firstRowHeight + 8; +}; +AutocompleteEditor.prototype.allowKeyEventPropagation = function(keyCode) { + var selected = {row: this.htEditor.getSelectedRange() ? this.htEditor.getSelectedRange().from.row : -1}; + var allowed = false; + if (keyCode === KEY_CODES.ARROW_DOWN && selected.row < this.htEditor.countRows() - 1) { + allowed = true; + } + if (keyCode === KEY_CODES.ARROW_UP && selected.row > -1) { + allowed = true; + } + return allowed; +}; +; +registerEditor('autocomplete', AutocompleteEditor); + +//# +},{"editors":29,"handsontableEditor":35,"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/unicode":53}],32:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + CheckboxEditor: {get: function() { + return CheckboxEditor; + }}, + __esModule: {value: true} +}); +var $___46__46__47_editors__, + $___95_baseEditor__, + $___46__46__47_helpers_47_dom_47_element__; +var registerEditor = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}).registerEditor; +var BaseEditor = ($___95_baseEditor__ = require("_baseEditor"), $___95_baseEditor__ && $___95_baseEditor__.__esModule && $___95_baseEditor__ || {default: $___95_baseEditor__}).BaseEditor; +var hasClass = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}).hasClass; +var CheckboxEditor = function CheckboxEditor() { + $traceurRuntime.superConstructor($CheckboxEditor).apply(this, arguments); +}; +var $CheckboxEditor = CheckboxEditor; +($traceurRuntime.createClass)(CheckboxEditor, { + beginEditing: function() { + var checkbox = this.TD.querySelector('input[type="checkbox"]'); + if (!hasClass(checkbox, 'htBadValue')) { + checkbox.click(); + } + }, + finishEditing: function() {}, + init: function() {}, + open: function() {}, + close: function() {}, + getValue: function() {}, + setValue: function() {}, + focus: function() {} +}, {}, BaseEditor); +; +registerEditor('checkbox', CheckboxEditor); + +//# +},{"_baseEditor":30,"editors":29,"helpers/dom/element":45}],33:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + DateEditor: {get: function() { + return DateEditor; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_helpers_47_object__, + $___46__46__47_eventManager__, + $___46__46__47_editors__, + $___46__46__47_helpers_47_unicode__, + $___46__46__47_helpers_47_dom_47_event__, + $__textEditor__, + $__moment__, + $__pikaday__; +var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + outerHeight = $__0.outerHeight; +var deepExtend = ($___46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47_helpers_47_object__ && $___46__46__47_helpers_47_object__.__esModule && $___46__46__47_helpers_47_object__ || {default: $___46__46__47_helpers_47_object__}).deepExtend; +var EventManager = ($___46__46__47_eventManager__ = require("eventManager"), $___46__46__47_eventManager__ && $___46__46__47_eventManager__.__esModule && $___46__46__47_eventManager__ || {default: $___46__46__47_eventManager__}).EventManager; +var $__3 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}), + getEditor = $__3.getEditor, + registerEditor = $__3.registerEditor; +var isMetaKey = ($___46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47_helpers_47_unicode__ && $___46__46__47_helpers_47_unicode__.__esModule && $___46__46__47_helpers_47_unicode__ || {default: $___46__46__47_helpers_47_unicode__}).isMetaKey; +var stopPropagation = ($___46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47_helpers_47_dom_47_event__ && $___46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47_helpers_47_dom_47_event__}).stopPropagation; +var TextEditor = ($__textEditor__ = require("textEditor"), $__textEditor__ && $__textEditor__.__esModule && $__textEditor__ || {default: $__textEditor__}).TextEditor; +var moment = ($__moment__ = require("moment"), $__moment__ && $__moment__.__esModule && $__moment__ || {default: $__moment__}).default; +var Pikaday = ($__pikaday__ = require("pikaday"), $__pikaday__ && $__pikaday__.__esModule && $__pikaday__ || {default: $__pikaday__}).default; +Handsontable.editors = Handsontable.editors || {}; +Handsontable.editors.DateEditor = DateEditor; +var DateEditor = function DateEditor(hotInstance) { + this.$datePicker = null; + this.datePicker = null; + this.datePickerStyle = null; + this.defaultDateFormat = 'DD/MM/YYYY'; + this.isCellEdited = false; + this.parentDestroyed = false; + $traceurRuntime.superConstructor($DateEditor).call(this, hotInstance); +}; +var $DateEditor = DateEditor; +($traceurRuntime.createClass)(DateEditor, { + init: function() { + var $__9 = this; + if (typeof moment !== 'function') { + throw new Error('You need to include moment.js to your project.'); + } + if (typeof Pikaday !== 'function') { + throw new Error('You need to include Pikaday to your project.'); + } + $traceurRuntime.superGet(this, $DateEditor.prototype, "init").call(this); + this.instance.addHook('afterDestroy', (function() { + $__9.parentDestroyed = true; + $__9.destroyElements(); + })); + }, + createElements: function() { + $traceurRuntime.superGet(this, $DateEditor.prototype, "createElements").call(this); + this.datePicker = document.createElement('DIV'); + this.datePickerStyle = this.datePicker.style; + this.datePickerStyle.position = 'absolute'; + this.datePickerStyle.top = 0; + this.datePickerStyle.left = 0; + this.datePickerStyle.zIndex = 9999; + addClass(this.datePicker, 'htDatepickerHolder'); + document.body.appendChild(this.datePicker); + this.$datePicker = new Pikaday(this.getDatePickerConfig()); + var eventManager = new EventManager(this); + eventManager.addEventListener(this.datePicker, 'mousedown', (function(event) { + return stopPropagation(event); + })); + this.hideDatepicker(); + }, + destroyElements: function() { + this.$datePicker.destroy(); + }, + prepare: function(row, col, prop, td, originalValue, cellProperties) { + this._opened = false; + $traceurRuntime.superGet(this, $DateEditor.prototype, "prepare").call(this, row, col, prop, td, originalValue, cellProperties); + }, + open: function() { + var event = arguments[0] !== (void 0) ? arguments[0] : null; + $traceurRuntime.superGet(this, $DateEditor.prototype, "open").call(this); + this.showDatepicker(event); + }, + close: function() { + var $__9 = this; + this._opened = false; + this.instance._registerTimeout(setTimeout((function() { + $__9.instance.selection.refreshBorders(); + }), 0)); + $traceurRuntime.superGet(this, $DateEditor.prototype, "close").call(this); + }, + finishEditing: function() { + var isCancelled = arguments[0] !== (void 0) ? arguments[0] : false; + var ctrlDown = arguments[1] !== (void 0) ? arguments[1] : false; + if (isCancelled) { + var value = this.originalValue; + if (value !== void 0) { + this.setValue(value); + } + } + this.hideDatepicker(); + $traceurRuntime.superGet(this, $DateEditor.prototype, "finishEditing").call(this, isCancelled, ctrlDown); + }, + showDatepicker: function(event) { + this.$datePicker.config(this.getDatePickerConfig()); + var offset = this.TD.getBoundingClientRect(); + var dateFormat = this.cellProperties.dateFormat || this.defaultDateFormat; + var datePickerConfig = this.$datePicker.config(); + var dateStr; + var isMouseDown = this.instance.view.isMouseDown(); + var isMeta = event ? isMetaKey(event.keyCode) : false; + this.datePickerStyle.top = (window.pageYOffset + offset.top + outerHeight(this.TD)) + 'px'; + this.datePickerStyle.left = (window.pageXOffset + offset.left) + 'px'; + this.$datePicker._onInputFocus = function() {}; + datePickerConfig.format = dateFormat; + if (this.originalValue) { + dateStr = this.originalValue; + if (moment(dateStr, dateFormat, true).isValid()) { + this.$datePicker.setMoment(moment(dateStr, dateFormat), true); + } + if (!isMeta && !isMouseDown) { + this.setValue(''); + } + } else { + if (this.cellProperties.defaultDate) { + dateStr = this.cellProperties.defaultDate; + datePickerConfig.defaultDate = dateStr; + if (moment(dateStr, dateFormat, true).isValid()) { + this.$datePicker.setMoment(moment(dateStr, dateFormat), true); + } + if (!isMeta && !isMouseDown) { + this.setValue(''); + } + } else { + this.$datePicker.gotoToday(); + } + } + this.datePickerStyle.display = 'block'; + this.$datePicker.show(); + }, + hideDatepicker: function() { + this.datePickerStyle.display = 'none'; + this.$datePicker.hide(); + }, + getDatePickerConfig: function() { + var $__9 = this; + var htInput = this.TEXTAREA; + var options = {}; + if (this.cellProperties && this.cellProperties.datePickerConfig) { + deepExtend(options, this.cellProperties.datePickerConfig); + } + var origOnSelect = options.onSelect; + var origOnClose = options.onClose; + options.field = htInput; + options.trigger = htInput; + options.container = this.datePicker; + options.bound = false; + options.format = options.format || this.defaultDateFormat; + options.reposition = options.reposition || false; + options.onSelect = (function(dateStr) { + if (!isNaN(dateStr.getTime())) { + dateStr = moment(dateStr).format($__9.cellProperties.dateFormat || $__9.defaultDateFormat); + } + $__9.setValue(dateStr); + $__9.hideDatepicker(); + if (origOnSelect) { + origOnSelect(); + } + }); + options.onClose = (function() { + if (!$__9.parentDestroyed) { + $__9.finishEditing(false); + } + if (origOnClose) { + origOnClose(); + } + }); + return options; + } +}, {}, TextEditor); +; +registerEditor('date', DateEditor); + +//# +},{"editors":29,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,"moment":"moment","pikaday":"pikaday","textEditor":40}],34:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + DropdownEditor: {get: function() { + return DropdownEditor; + }}, + __esModule: {value: true} +}); +var $___46__46__47_editors__, + $__autocompleteEditor__; +var $__0 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}), + getEditor = $__0.getEditor, + registerEditor = $__0.registerEditor; +var AutocompleteEditor = ($__autocompleteEditor__ = require("autocompleteEditor"), $__autocompleteEditor__ && $__autocompleteEditor__.__esModule && $__autocompleteEditor__ || {default: $__autocompleteEditor__}).AutocompleteEditor; +var DropdownEditor = function DropdownEditor() { + $traceurRuntime.superConstructor($DropdownEditor).apply(this, arguments); +}; +var $DropdownEditor = DropdownEditor; +($traceurRuntime.createClass)(DropdownEditor, {prepare: function(row, col, prop, td, originalValue, cellProperties) { + $traceurRuntime.superGet(this, $DropdownEditor.prototype, "prepare").call(this, row, col, prop, td, originalValue, cellProperties); + this.cellProperties.filter = false; + this.cellProperties.strict = true; + }}, {}, AutocompleteEditor); +Handsontable.hooks.add('beforeValidate', function(value, row, col, source) { + var cellMeta = this.getCellMeta(row, col); + if (cellMeta.editor === Handsontable.editors.DropdownEditor) { + if (cellMeta.strict === void 0) { + cellMeta.filter = false; + cellMeta.strict = true; + } + } +}); +; +registerEditor('dropdown', DropdownEditor); + +//# +},{"autocompleteEditor":31,"editors":29}],35:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + HandsontableEditor: {get: function() { + return HandsontableEditor; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_unicode__, + $___46__46__47_helpers_47_object__, + $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_helpers_47_dom_47_event__, + $___46__46__47_editors__, + $__textEditor__; +var KEY_CODES = ($___46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47_helpers_47_unicode__ && $___46__46__47_helpers_47_unicode__.__esModule && $___46__46__47_helpers_47_unicode__ || {default: $___46__46__47_helpers_47_unicode__}).KEY_CODES; +var extend = ($___46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47_helpers_47_object__ && $___46__46__47_helpers_47_object__.__esModule && $___46__46__47_helpers_47_object__ || {default: $___46__46__47_helpers_47_object__}).extend; +var setCaretPosition = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}).setCaretPosition; +var $__3 = ($___46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47_helpers_47_dom_47_event__ && $___46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47_helpers_47_dom_47_event__}), + stopImmediatePropagation = $__3.stopImmediatePropagation, + isImmediatePropagationStopped = $__3.isImmediatePropagationStopped; +var $__4 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}), + getEditor = $__4.getEditor, + registerEditor = $__4.registerEditor; +var TextEditor = ($__textEditor__ = require("textEditor"), $__textEditor__ && $__textEditor__.__esModule && $__textEditor__ || {default: $__textEditor__}).TextEditor; +var HandsontableEditor = TextEditor.prototype.extend(); +HandsontableEditor.prototype.createElements = function() { + TextEditor.prototype.createElements.apply(this, arguments); + var DIV = document.createElement('DIV'); + DIV.className = 'handsontableEditor'; + this.TEXTAREA_PARENT.appendChild(DIV); + this.htContainer = DIV; + this.assignHooks(); +}; +HandsontableEditor.prototype.prepare = function(td, row, col, prop, value, cellProperties) { + TextEditor.prototype.prepare.apply(this, arguments); + var parent = this; + var options = { + startRows: 0, + startCols: 0, + minRows: 0, + minCols: 0, + className: 'listbox', + copyPaste: false, + autoColumnSize: false, + autoRowSize: false, + readOnly: true, + fillHandle: false, + afterOnCellMouseDown: function() { + var value = this.getValue(); + if (value !== void 0) { + parent.setValue(value); + } + parent.instance.destroyEditor(); + } + }; + if (this.cellProperties.handsontable) { + extend(options, cellProperties.handsontable); + } + this.htOptions = options; +}; +var onBeforeKeyDown = function(event) { + if (isImmediatePropagationStopped(event)) { + return; + } + var editor = this.getActiveEditor(); + var innerHOT = editor.htEditor.getInstance(); + var rowToSelect; + if (event.keyCode == KEY_CODES.ARROW_DOWN) { + if (innerHOT.getSelected()) { + var selectedRow = innerHOT.getSelected()[0]; + var lastRow = innerHOT.countRows() - 1; + rowToSelect = Math.min(lastRow, selectedRow + 1); + } else { + rowToSelect = 0; + } + } else if (event.keyCode == KEY_CODES.ARROW_UP) { + if (innerHOT.getSelected()) { + var selectedRow = innerHOT.getSelected()[0]; + rowToSelect = selectedRow - 1; + } + } + if (rowToSelect !== void 0) { + if (rowToSelect < 0) { + innerHOT.deselectCell(); + } else { + innerHOT.selectCell(rowToSelect, 0); + } + if (innerHOT.getData().length) { + event.preventDefault(); + stopImmediatePropagation(event); + editor.instance.listen(); + editor.TEXTAREA.focus(); + } + } +}; +HandsontableEditor.prototype.open = function() { + this.instance.addHook('beforeKeyDown', onBeforeKeyDown); + TextEditor.prototype.open.apply(this, arguments); + if (this.htEditor) { + this.htEditor.destroy(); + } + this.htEditor = new Handsontable(this.htContainer, this.htOptions); + if (this.cellProperties.strict) { + this.htEditor.selectCell(0, 0); + this.TEXTAREA.style.visibility = 'hidden'; + } else { + this.htEditor.deselectCell(); + this.TEXTAREA.style.visibility = 'visible'; + } + setCaretPosition(this.TEXTAREA, 0, this.TEXTAREA.value.length); +}; +HandsontableEditor.prototype.close = function() { + this.instance.removeHook('beforeKeyDown', onBeforeKeyDown); + this.instance.listen(); + TextEditor.prototype.close.apply(this, arguments); +}; +HandsontableEditor.prototype.focus = function() { + this.instance.listen(); + TextEditor.prototype.focus.apply(this, arguments); +}; +HandsontableEditor.prototype.beginEditing = function(initialValue) { + var onBeginEditing = this.instance.getSettings().onBeginEditing; + if (onBeginEditing && onBeginEditing() === false) { + return; + } + TextEditor.prototype.beginEditing.apply(this, arguments); +}; +HandsontableEditor.prototype.finishEditing = function(isCancelled, ctrlDown) { + if (this.htEditor && this.htEditor.isListening()) { + this.instance.listen(); + } + if (this.htEditor && this.htEditor.getSelected()) { + var value = this.htEditor.getInstance().getValue(); + if (value !== void 0) { + this.setValue(value); + } + } + return TextEditor.prototype.finishEditing.apply(this, arguments); +}; +HandsontableEditor.prototype.assignHooks = function() { + var _this = this; + this.instance.addHook('afterDestroy', function() { + if (_this.htEditor) { + _this.htEditor.destroy(); + } + }); +}; +; +registerEditor('handsontable', HandsontableEditor); + +//# +},{"editors":29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,"textEditor":40}],36:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + MobileTextEditor: {get: function() { + return MobileTextEditor; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_unicode__, + $___46__46__47_helpers_47_dom_47_event__, + $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_editors__, + $___95_baseEditor__, + $___46__46__47_eventManager__; +var KEY_CODES = ($___46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47_helpers_47_unicode__ && $___46__46__47_helpers_47_unicode__.__esModule && $___46__46__47_helpers_47_unicode__ || {default: $___46__46__47_helpers_47_unicode__}).KEY_CODES; +var $__1 = ($___46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47_helpers_47_dom_47_event__ && $___46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47_helpers_47_dom_47_event__}), + stopImmediatePropagation = $__1.stopImmediatePropagation, + isImmediatePropagationStopped = $__1.isImmediatePropagationStopped; +var $__2 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}), + addClass = $__2.addClass, + getScrollLeft = $__2.getScrollLeft, + getScrollTop = $__2.getScrollTop, + hasClass = $__2.hasClass, + isChildOf = $__2.isChildOf, + offset = $__2.offset, + outerHeight = $__2.outerHeight, + outerWidth = $__2.outerWidth, + removeClass = $__2.removeClass, + setCaretPosition = $__2.setCaretPosition; +var $__3 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}), + getEditor = $__3.getEditor, + registerEditor = $__3.registerEditor; +var BaseEditor = ($___95_baseEditor__ = require("_baseEditor"), $___95_baseEditor__ && $___95_baseEditor__.__esModule && $___95_baseEditor__ || {default: $___95_baseEditor__}).BaseEditor; +var eventManagerObject = ($___46__46__47_eventManager__ = require("eventManager"), $___46__46__47_eventManager__ && $___46__46__47_eventManager__.__esModule && $___46__46__47_eventManager__ || {default: $___46__46__47_eventManager__}).eventManager; +var MobileTextEditor = BaseEditor.prototype.extend(), + domDimensionsCache = {}; +var createControls = function() { + this.controls = {}; + this.controls.leftButton = document.createElement('DIV'); + this.controls.leftButton.className = 'leftButton'; + this.controls.rightButton = document.createElement('DIV'); + this.controls.rightButton.className = 'rightButton'; + this.controls.upButton = document.createElement('DIV'); + this.controls.upButton.className = 'upButton'; + this.controls.downButton = document.createElement('DIV'); + this.controls.downButton.className = 'downButton'; + for (var button in this.controls) { + if (this.controls.hasOwnProperty(button)) { + this.positionControls.appendChild(this.controls[button]); + } + } +}; +MobileTextEditor.prototype.valueChanged = function() { + return this.initValue != this.getValue(); +}; +MobileTextEditor.prototype.init = function() { + var that = this; + this.eventManager = eventManagerObject(this.instance); + this.createElements(); + this.bindEvents(); + this.instance.addHook('afterDestroy', function() { + that.destroy(); + }); +}; +MobileTextEditor.prototype.getValue = function() { + return this.TEXTAREA.value; +}; +MobileTextEditor.prototype.setValue = function(newValue) { + this.initValue = newValue; + this.TEXTAREA.value = newValue; +}; +MobileTextEditor.prototype.createElements = function() { + this.editorContainer = document.createElement('DIV'); + this.editorContainer.className = 'htMobileEditorContainer'; + this.cellPointer = document.createElement('DIV'); + this.cellPointer.className = 'cellPointer'; + this.moveHandle = document.createElement('DIV'); + this.moveHandle.className = 'moveHandle'; + this.inputPane = document.createElement('DIV'); + this.inputPane.className = 'inputs'; + this.positionControls = document.createElement('DIV'); + this.positionControls.className = 'positionControls'; + this.TEXTAREA = document.createElement('TEXTAREA'); + addClass(this.TEXTAREA, 'handsontableInput'); + this.inputPane.appendChild(this.TEXTAREA); + this.editorContainer.appendChild(this.cellPointer); + this.editorContainer.appendChild(this.moveHandle); + this.editorContainer.appendChild(this.inputPane); + this.editorContainer.appendChild(this.positionControls); + createControls.call(this); + document.body.appendChild(this.editorContainer); +}; +MobileTextEditor.prototype.onBeforeKeyDown = function(event) { + var instance = this; + var that = instance.getActiveEditor(); + if (event.target !== that.TEXTAREA || isImmediatePropagationStopped(event)) { + return; + } + switch (event.keyCode) { + case KEY_CODES.ENTER: + that.close(); + event.preventDefault(); + break; + case KEY_CODES.BACKSPACE: + stopImmediatePropagation(event); + break; + } +}; +MobileTextEditor.prototype.open = function() { + this.instance.addHook('beforeKeyDown', this.onBeforeKeyDown); + addClass(this.editorContainer, 'active'); + removeClass(this.cellPointer, 'hidden'); + this.updateEditorPosition(); +}; +MobileTextEditor.prototype.focus = function() { + this.TEXTAREA.focus(); + setCaretPosition(this.TEXTAREA, this.TEXTAREA.value.length); +}; +MobileTextEditor.prototype.close = function() { + this.TEXTAREA.blur(); + this.instance.removeHook('beforeKeyDown', this.onBeforeKeyDown); + removeClass(this.editorContainer, 'active'); +}; +MobileTextEditor.prototype.scrollToView = function() { + var coords = this.instance.getSelectedRange().highlight; + this.instance.view.scrollViewport(coords); +}; +MobileTextEditor.prototype.hideCellPointer = function() { + if (!hasClass(this.cellPointer, 'hidden')) { + addClass(this.cellPointer, 'hidden'); + } +}; +MobileTextEditor.prototype.updateEditorPosition = function(x, y) { + if (x && y) { + x = parseInt(x, 10); + y = parseInt(y, 10); + this.editorContainer.style.top = y + 'px'; + this.editorContainer.style.left = x + 'px'; + } else { + var selection = this.instance.getSelected(), + selectedCell = this.instance.getCell(selection[0], selection[1]); + if (!domDimensionsCache.cellPointer) { + domDimensionsCache.cellPointer = { + height: outerHeight(this.cellPointer), + width: outerWidth(this.cellPointer) + }; + } + if (!domDimensionsCache.editorContainer) { + domDimensionsCache.editorContainer = {width: outerWidth(this.editorContainer)}; + } + if (selectedCell !== undefined) { + var scrollLeft = this.instance.view.wt.wtOverlays.leftOverlay.trimmingContainer == window ? 0 : getScrollLeft(this.instance.view.wt.wtOverlays.leftOverlay.holder); + var scrollTop = this.instance.view.wt.wtOverlays.topOverlay.trimmingContainer == window ? 0 : getScrollTop(this.instance.view.wt.wtOverlays.topOverlay.holder); + var selectedCellOffset = offset(selectedCell), + selectedCellWidth = outerWidth(selectedCell), + currentScrollPosition = { + x: scrollLeft, + y: scrollTop + }; + this.editorContainer.style.top = parseInt(selectedCellOffset.top + outerHeight(selectedCell) - currentScrollPosition.y + domDimensionsCache.cellPointer.height, 10) + 'px'; + this.editorContainer.style.left = parseInt((window.innerWidth / 2) - (domDimensionsCache.editorContainer.width / 2), 10) + 'px'; + if (selectedCellOffset.left + selectedCellWidth / 2 > parseInt(this.editorContainer.style.left, 10) + domDimensionsCache.editorContainer.width) { + this.editorContainer.style.left = window.innerWidth - domDimensionsCache.editorContainer.width + 'px'; + } else if (selectedCellOffset.left + selectedCellWidth / 2 < parseInt(this.editorContainer.style.left, 10) + 20) { + this.editorContainer.style.left = 0 + 'px'; + } + this.cellPointer.style.left = parseInt(selectedCellOffset.left - (domDimensionsCache.cellPointer.width / 2) - offset(this.editorContainer).left + (selectedCellWidth / 2) - currentScrollPosition.x, 10) + 'px'; + } + } +}; +MobileTextEditor.prototype.updateEditorData = function() { + var selected = this.instance.getSelected(), + selectedValue = this.instance.getDataAtCell(selected[0], selected[1]); + this.row = selected[0]; + this.col = selected[1]; + this.setValue(selectedValue); + this.updateEditorPosition(); +}; +MobileTextEditor.prototype.prepareAndSave = function() { + var val; + if (!this.valueChanged()) { + return true; + } + if (this.instance.getSettings().trimWhitespace) { + val = [[String.prototype.trim.call(this.getValue())]]; + } else { + val = [[this.getValue()]]; + } + this.saveValue(val); +}; +MobileTextEditor.prototype.bindEvents = function() { + var that = this; + this.eventManager.addEventListener(this.controls.leftButton, 'touchend', function(event) { + that.prepareAndSave(); + that.instance.selection.transformStart(0, -1, null, true); + that.updateEditorData(); + event.preventDefault(); + }); + this.eventManager.addEventListener(this.controls.rightButton, 'touchend', function(event) { + that.prepareAndSave(); + that.instance.selection.transformStart(0, 1, null, true); + that.updateEditorData(); + event.preventDefault(); + }); + this.eventManager.addEventListener(this.controls.upButton, 'touchend', function(event) { + that.prepareAndSave(); + that.instance.selection.transformStart(-1, 0, null, true); + that.updateEditorData(); + event.preventDefault(); + }); + this.eventManager.addEventListener(this.controls.downButton, 'touchend', function(event) { + that.prepareAndSave(); + that.instance.selection.transformStart(1, 0, null, true); + that.updateEditorData(); + event.preventDefault(); + }); + this.eventManager.addEventListener(this.moveHandle, 'touchstart', function(event) { + if (event.touches.length == 1) { + var touch = event.touches[0], + onTouchPosition = { + x: that.editorContainer.offsetLeft, + y: that.editorContainer.offsetTop + }, + onTouchOffset = { + x: touch.pageX - onTouchPosition.x, + y: touch.pageY - onTouchPosition.y + }; + that.eventManager.addEventListener(this, 'touchmove', function(event) { + var touch = event.touches[0]; + that.updateEditorPosition(touch.pageX - onTouchOffset.x, touch.pageY - onTouchOffset.y); + that.hideCellPointer(); + event.preventDefault(); + }); + } + }); + this.eventManager.addEventListener(document.body, 'touchend', function(event) { + if (!isChildOf(event.target, that.editorContainer) && !isChildOf(event.target, that.instance.rootElement)) { + that.close(); + } + }); + this.eventManager.addEventListener(this.instance.view.wt.wtOverlays.leftOverlay.holder, 'scroll', function(event) { + if (that.instance.view.wt.wtOverlays.leftOverlay.trimmingContainer != window) { + that.hideCellPointer(); + } + }); + this.eventManager.addEventListener(this.instance.view.wt.wtOverlays.topOverlay.holder, 'scroll', function(event) { + if (that.instance.view.wt.wtOverlays.topOverlay.trimmingContainer != window) { + that.hideCellPointer(); + } + }); +}; +MobileTextEditor.prototype.destroy = function() { + this.eventManager.clear(); + this.editorContainer.parentNode.removeChild(this.editorContainer); +}; +; +registerEditor('mobile', MobileTextEditor); + +//# +},{"_baseEditor":30,"editors":29,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],37:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + NumericEditor: {get: function() { + return NumericEditor; + }}, + __esModule: {value: true} +}); +var $__numeral__, + $___46__46__47_editors__, + $__textEditor__; +var numeral = ($__numeral__ = require("numeral"), $__numeral__ && $__numeral__.__esModule && $__numeral__ || {default: $__numeral__}).default; +var $__1 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}), + getEditor = $__1.getEditor, + registerEditor = $__1.registerEditor; +var TextEditor = ($__textEditor__ = require("textEditor"), $__textEditor__ && $__textEditor__.__esModule && $__textEditor__ || {default: $__textEditor__}).TextEditor; +var NumericEditor = function NumericEditor() { + $traceurRuntime.superConstructor($NumericEditor).apply(this, arguments); +}; +var $NumericEditor = NumericEditor; +($traceurRuntime.createClass)(NumericEditor, {beginEditing: function(initialValue) { + if (typeof initialValue === 'undefined' && this.originalValue) { + if (typeof this.cellProperties.language !== 'undefined') { + numeral.language(this.cellProperties.language); + } + var decimalDelimiter = numeral.languageData().delimiters.decimal; + initialValue = ('' + this.originalValue).replace('.', decimalDelimiter); + } + $traceurRuntime.superGet(this, $NumericEditor.prototype, "beginEditing").call(this, initialValue); + }}, {}, TextEditor); +; +registerEditor('numeric', NumericEditor); + +//# +},{"editors":29,"numeral":"numeral","textEditor":40}],38:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + PasswordEditor: {get: function() { + return PasswordEditor; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_editors__, + $__textEditor__; +var empty = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}).empty; +var $__1 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}), + getEditor = $__1.getEditor, + registerEditor = $__1.registerEditor; +var TextEditor = ($__textEditor__ = require("textEditor"), $__textEditor__ && $__textEditor__.__esModule && $__textEditor__ || {default: $__textEditor__}).TextEditor; +var PasswordEditor = function PasswordEditor() { + $traceurRuntime.superConstructor($PasswordEditor).apply(this, arguments); +}; +var $PasswordEditor = PasswordEditor; +($traceurRuntime.createClass)(PasswordEditor, {createElements: function() { + $traceurRuntime.superGet(this, $PasswordEditor.prototype, "createElements").call(this); + this.TEXTAREA = document.createElement('input'); + this.TEXTAREA.setAttribute('type', 'password'); + this.TEXTAREA.className = 'handsontableInput'; + this.textareaStyle = this.TEXTAREA.style; + this.textareaStyle.width = 0; + this.textareaStyle.height = 0; + empty(this.TEXTAREA_PARENT); + this.TEXTAREA_PARENT.appendChild(this.TEXTAREA); + }}, {}, TextEditor); +; +registerEditor('password', PasswordEditor); + +//# +},{"editors":29,"helpers/dom/element":45,"textEditor":40}],39:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + SelectEditor: {get: function() { + return SelectEditor; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_helpers_47_dom_47_event__, + $___46__46__47_helpers_47_unicode__, + $___46__46__47_editors__, + $___95_baseEditor__; +var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + empty = $__0.empty, + fastInnerHTML = $__0.fastInnerHTML, + getComputedStyle = $__0.getComputedStyle, + getCssTransform = $__0.getCssTransform, + getScrollableElement = $__0.getScrollableElement, + offset = $__0.offset, + outerHeight = $__0.outerHeight, + outerWidth = $__0.outerWidth, + resetCssTransform = $__0.resetCssTransform; +var stopImmediatePropagation = ($___46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47_helpers_47_dom_47_event__ && $___46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47_helpers_47_dom_47_event__}).stopImmediatePropagation; +var KEY_CODES = ($___46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47_helpers_47_unicode__ && $___46__46__47_helpers_47_unicode__.__esModule && $___46__46__47_helpers_47_unicode__ || {default: $___46__46__47_helpers_47_unicode__}).KEY_CODES; +var $__3 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}), + getEditor = $__3.getEditor, + registerEditor = $__3.registerEditor; +var BaseEditor = ($___95_baseEditor__ = require("_baseEditor"), $___95_baseEditor__ && $___95_baseEditor__.__esModule && $___95_baseEditor__ || {default: $___95_baseEditor__}).BaseEditor; +var SelectEditor = BaseEditor.prototype.extend(); +SelectEditor.prototype.init = function() { + this.select = document.createElement('SELECT'); + addClass(this.select, 'htSelectEditor'); + this.select.style.display = 'none'; + this.instance.rootElement.appendChild(this.select); + this.registerHooks(); +}; +SelectEditor.prototype.registerHooks = function() { + var $__5 = this; + this.instance.addHook('afterScrollHorizontally', (function() { + return $__5.refreshDimensions(); + })); + this.instance.addHook('afterScrollVertically', (function() { + return $__5.refreshDimensions(); + })); + this.instance.addHook('afterColumnResize', (function() { + return $__5.refreshDimensions(); + })); + this.instance.addHook('afterRowResize', (function() { + return $__5.refreshDimensions(); + })); +}; +SelectEditor.prototype.prepare = function() { + BaseEditor.prototype.prepare.apply(this, arguments); + var selectOptions = this.cellProperties.selectOptions; + var options; + if (typeof selectOptions == 'function') { + options = this.prepareOptions(selectOptions(this.row, this.col, this.prop)); + } else { + options = this.prepareOptions(selectOptions); + } + empty(this.select); + for (var option in options) { + if (options.hasOwnProperty(option)) { + var optionElement = document.createElement('OPTION'); + optionElement.value = option; + fastInnerHTML(optionElement, options[option]); + this.select.appendChild(optionElement); + } + } +}; +SelectEditor.prototype.prepareOptions = function(optionsToPrepare) { + var preparedOptions = {}; + if (Array.isArray(optionsToPrepare)) { + for (var i = 0, + len = optionsToPrepare.length; i < len; i++) { + preparedOptions[optionsToPrepare[i]] = optionsToPrepare[i]; + } + } else if (typeof optionsToPrepare == 'object') { + preparedOptions = optionsToPrepare; + } + return preparedOptions; +}; +SelectEditor.prototype.getValue = function() { + return this.select.value; +}; +SelectEditor.prototype.setValue = function(value) { + this.select.value = value; +}; +var onBeforeKeyDown = function(event) { + var instance = this; + var editor = instance.getActiveEditor(); + switch (event.keyCode) { + case KEY_CODES.ARROW_UP: + var previousOptionIndex = editor.select.selectedIndex - 1; + if (previousOptionIndex >= 0) { + editor.select[previousOptionIndex].selected = true; + } + stopImmediatePropagation(event); + event.preventDefault(); + break; + case KEY_CODES.ARROW_DOWN: + var nextOptionIndex = editor.select.selectedIndex + 1; + if (nextOptionIndex <= editor.select.length - 1) { + editor.select[nextOptionIndex].selected = true; + } + stopImmediatePropagation(event); + event.preventDefault(); + break; + } +}; +SelectEditor.prototype.open = function() { + this._opened = true; + this.refreshDimensions(); + this.select.style.display = ''; + this.instance.addHook('beforeKeyDown', onBeforeKeyDown); +}; +SelectEditor.prototype.close = function() { + this._opened = false; + this.select.style.display = 'none'; + this.instance.removeHook('beforeKeyDown', onBeforeKeyDown); +}; +SelectEditor.prototype.focus = function() { + this.select.focus(); +}; +SelectEditor.prototype.refreshDimensions = function() { + if (this.state !== Handsontable.EditorState.EDITING) { + return; + } + this.TD = this.getEditedCell(); + if (!this.TD) { + this.close(); + return; + } + var width = outerWidth(this.TD) + 1, + height = outerHeight(this.TD) + 1, + currentOffset = offset(this.TD), + containerOffset = offset(this.instance.rootElement), + scrollableContainer = getScrollableElement(this.TD), + editTop = currentOffset.top - containerOffset.top - 1 - (scrollableContainer.scrollTop || 0), + editLeft = currentOffset.left - containerOffset.left - 1 - (scrollableContainer.scrollLeft || 0), + editorSection = this.checkEditorSection(), + cssTransformOffset; + var settings = this.instance.getSettings(); + var rowHeadersCount = settings.rowHeaders ? 1 : 0; + var colHeadersCount = settings.colHeaders ? 1 : 0; + switch (editorSection) { + case 'top': + cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode); + break; + case 'left': + cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode); + break; + case 'top-left-corner': + cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode); + break; + case 'bottom-left-corner': + cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode); + break; + case 'bottom': + cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode); + break; + } + if (this.instance.getSelected()[0] === 0) { + editTop += 1; + } + if (this.instance.getSelected()[1] === 0) { + editLeft += 1; + } + var selectStyle = this.select.style; + if (cssTransformOffset && cssTransformOffset != -1) { + selectStyle[cssTransformOffset[0]] = cssTransformOffset[1]; + } else { + resetCssTransform(this.select); + } + var cellComputedStyle = getComputedStyle(this.TD); + if (parseInt(cellComputedStyle.borderTopWidth, 10) > 0) { + height -= 1; + } + if (parseInt(cellComputedStyle.borderLeftWidth, 10) > 0) { + width -= 1; + } + selectStyle.height = height + 'px'; + selectStyle.minWidth = width + 'px'; + selectStyle.top = editTop + 'px'; + selectStyle.left = editLeft + 'px'; + selectStyle.margin = '0px'; +}; +SelectEditor.prototype.getEditedCell = function() { + var editorSection = this.checkEditorSection(), + editedCell; + switch (editorSection) { + case 'top': + editedCell = this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({ + row: this.row, + col: this.col + }); + this.select.style.zIndex = 101; + break; + case 'corner': + editedCell = this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({ + row: this.row, + col: this.col + }); + this.select.style.zIndex = 103; + break; + case 'left': + editedCell = this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({ + row: this.row, + col: this.col + }); + this.select.style.zIndex = 102; + break; + default: + editedCell = this.instance.getCell(this.row, this.col); + this.select.style.zIndex = ''; + break; + } + return editedCell != -1 && editedCell != -2 ? editedCell : void 0; +}; +; +registerEditor('select', SelectEditor); + +//# +},{"_baseEditor":30,"editors":29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],40:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + TextEditor: {get: function() { + return TextEditor; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_dom_47_element__, + $__autoResize__, + $___95_baseEditor__, + $___46__46__47_eventManager__, + $___46__46__47_editors__, + $___46__46__47_helpers_47_unicode__, + $___46__46__47_helpers_47_dom_47_event__; +var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + getCaretPosition = $__0.getCaretPosition, + getComputedStyle = $__0.getComputedStyle, + getCssTransform = $__0.getCssTransform, + getScrollableElement = $__0.getScrollableElement, + innerWidth = $__0.innerWidth, + offset = $__0.offset, + resetCssTransform = $__0.resetCssTransform, + setCaretPosition = $__0.setCaretPosition; +var autoResize = ($__autoResize__ = require("autoResize"), $__autoResize__ && $__autoResize__.__esModule && $__autoResize__ || {default: $__autoResize__}).default; +var BaseEditor = ($___95_baseEditor__ = require("_baseEditor"), $___95_baseEditor__ && $___95_baseEditor__.__esModule && $___95_baseEditor__ || {default: $___95_baseEditor__}).BaseEditor; +var eventManagerObject = ($___46__46__47_eventManager__ = require("eventManager"), $___46__46__47_eventManager__ && $___46__46__47_eventManager__.__esModule && $___46__46__47_eventManager__ || {default: $___46__46__47_eventManager__}).eventManager; +var $__4 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}), + getEditor = $__4.getEditor, + registerEditor = $__4.registerEditor; +var KEY_CODES = ($___46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47_helpers_47_unicode__ && $___46__46__47_helpers_47_unicode__.__esModule && $___46__46__47_helpers_47_unicode__ || {default: $___46__46__47_helpers_47_unicode__}).KEY_CODES; +var $__6 = ($___46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47_helpers_47_dom_47_event__ && $___46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47_helpers_47_dom_47_event__}), + stopPropagation = $__6.stopPropagation, + stopImmediatePropagation = $__6.stopImmediatePropagation, + isImmediatePropagationStopped = $__6.isImmediatePropagationStopped; +var TextEditor = BaseEditor.prototype.extend(); +TextEditor.prototype.init = function() { + var that = this; + this.createElements(); + this.eventManager = eventManagerObject(this); + this.bindEvents(); + this.autoResize = autoResize(); + this.instance.addHook('afterDestroy', function() { + that.destroy(); + }); +}; +TextEditor.prototype.getValue = function() { + return this.TEXTAREA.value; +}; +TextEditor.prototype.setValue = function(newValue) { + this.TEXTAREA.value = newValue; +}; +var onBeforeKeyDown = function onBeforeKeyDown(event) { + var instance = this, + that = instance.getActiveEditor(), + ctrlDown; + ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey; + if (event.target !== that.TEXTAREA || isImmediatePropagationStopped(event)) { + return; + } + if (event.keyCode === 17 || event.keyCode === 224 || event.keyCode === 91 || event.keyCode === 93) { + stopImmediatePropagation(event); + return; + } + switch (event.keyCode) { + case KEY_CODES.ARROW_RIGHT: + if (that.isInFullEditMode()) { + if ((!that.isWaiting() && !that.allowKeyEventPropagation) || (!that.isWaiting() && that.allowKeyEventPropagation && !that.allowKeyEventPropagation(event.keyCode))) { + stopImmediatePropagation(event); + } + } + break; + case KEY_CODES.ARROW_LEFT: + if (that.isInFullEditMode()) { + if ((!that.isWaiting() && !that.allowKeyEventPropagation) || (!that.isWaiting() && that.allowKeyEventPropagation && !that.allowKeyEventPropagation(event.keyCode))) { + stopImmediatePropagation(event); + } + } + break; + case KEY_CODES.ARROW_UP: + case KEY_CODES.ARROW_DOWN: + if (that.isInFullEditMode()) { + if ((!that.isWaiting() && !that.allowKeyEventPropagation) || (!that.isWaiting() && that.allowKeyEventPropagation && !that.allowKeyEventPropagation(event.keyCode))) { + stopImmediatePropagation(event); + } + } + break; + case KEY_CODES.ENTER: + var selected = that.instance.getSelected(); + var isMultipleSelection = !(selected[0] === selected[2] && selected[1] === selected[3]); + if ((ctrlDown && !isMultipleSelection) || event.altKey) { + if (that.isOpened()) { + var caretPosition = getCaretPosition(that.TEXTAREA), + value = that.getValue(); + var newValue = value.slice(0, caretPosition) + '\n' + value.slice(caretPosition); + that.setValue(newValue); + setCaretPosition(that.TEXTAREA, caretPosition + 1); + } else { + that.beginEditing(that.originalValue + '\n'); + } + stopImmediatePropagation(event); + } + event.preventDefault(); + break; + case KEY_CODES.A: + case KEY_CODES.X: + case KEY_CODES.C: + case KEY_CODES.V: + if (ctrlDown) { + stopImmediatePropagation(event); + } + break; + case KEY_CODES.BACKSPACE: + case KEY_CODES.DELETE: + case KEY_CODES.HOME: + case KEY_CODES.END: + stopImmediatePropagation(event); + break; + } + if ([KEY_CODES.ARROW_UP, KEY_CODES.ARROW_RIGHT, KEY_CODES.ARROW_DOWN, KEY_CODES.ARROW_LEFT].indexOf(event.keyCode) === -1) { + that.autoResize.resize(String.fromCharCode(event.keyCode)); + } +}; +TextEditor.prototype.open = function() { + this.refreshDimensions(); + this.instance.addHook('beforeKeyDown', onBeforeKeyDown); +}; +TextEditor.prototype.close = function(tdOutside) { + this.textareaParentStyle.display = 'none'; + this.autoResize.unObserve(); + if (document.activeElement === this.TEXTAREA) { + this.instance.listen(); + } + this.instance.removeHook('beforeKeyDown', onBeforeKeyDown); +}; +TextEditor.prototype.focus = function() { + this.TEXTAREA.focus(); + setCaretPosition(this.TEXTAREA, this.TEXTAREA.value.length); +}; +TextEditor.prototype.createElements = function() { + this.TEXTAREA = document.createElement('TEXTAREA'); + addClass(this.TEXTAREA, 'handsontableInput'); + this.textareaStyle = this.TEXTAREA.style; + this.textareaStyle.width = 0; + this.textareaStyle.height = 0; + this.TEXTAREA_PARENT = document.createElement('DIV'); + addClass(this.TEXTAREA_PARENT, 'handsontableInputHolder'); + this.textareaParentStyle = this.TEXTAREA_PARENT.style; + this.textareaParentStyle.top = 0; + this.textareaParentStyle.left = 0; + this.textareaParentStyle.display = 'none'; + this.TEXTAREA_PARENT.appendChild(this.TEXTAREA); + this.instance.rootElement.appendChild(this.TEXTAREA_PARENT); + var that = this; + this.instance._registerTimeout(setTimeout(function() { + that.refreshDimensions(); + }, 0)); +}; +TextEditor.prototype.getEditedCell = function() { + var editorSection = this.checkEditorSection(), + editedCell; + switch (editorSection) { + case 'top': + editedCell = this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({ + row: this.row, + col: this.col + }); + this.textareaParentStyle.zIndex = 101; + break; + case 'top-left-corner': + editedCell = this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({ + row: this.row, + col: this.col + }); + this.textareaParentStyle.zIndex = 103; + break; + case 'bottom-left-corner': + editedCell = this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell({ + row: this.row, + col: this.col + }); + this.textareaParentStyle.zIndex = 103; + break; + case 'left': + editedCell = this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({ + row: this.row, + col: this.col + }); + this.textareaParentStyle.zIndex = 102; + break; + case 'bottom': + editedCell = this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.getCell({ + row: this.row, + col: this.col + }); + this.textareaParentStyle.zIndex = 102; + break; + default: + editedCell = this.instance.getCell(this.row, this.col); + this.textareaParentStyle.zIndex = ''; + break; + } + return editedCell != -1 && editedCell != -2 ? editedCell : void 0; +}; +TextEditor.prototype.refreshDimensions = function() { + if (this.state !== Handsontable.EditorState.EDITING) { + return; + } + this.TD = this.getEditedCell(); + if (!this.TD) { + this.close(true); + return; + } + var currentOffset = offset(this.TD), + containerOffset = offset(this.instance.rootElement), + scrollableContainer = getScrollableElement(this.TD), + totalRowsCount = this.instance.countRows(), + editTop = currentOffset.top - containerOffset.top - 1 - (scrollableContainer.scrollTop || 0), + editLeft = currentOffset.left - containerOffset.left - 1 - (scrollableContainer.scrollLeft || 0), + settings = this.instance.getSettings(), + rowHeadersCount = settings.rowHeaders ? 1 : 0, + colHeadersCount = settings.colHeaders ? 1 : 0, + editorSection = this.checkEditorSection(), + backgroundColor = this.TD.style.backgroundColor, + cssTransformOffset; + switch (editorSection) { + case 'top': + cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode); + break; + case 'left': + cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode); + break; + case 'top-left-corner': + cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode); + break; + case 'bottom-left-corner': + cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode); + break; + case 'bottom': + cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode); + break; + } + if (colHeadersCount && this.instance.getSelected()[0] === 0 || (settings.fixedRowsBottom && this.instance.getSelected()[0] === totalRowsCount - settings.fixedRowsBottom)) { + editTop += 1; + } + if (this.instance.getSelected()[1] === 0) { + editLeft += 1; + } + if (cssTransformOffset && cssTransformOffset != -1) { + this.textareaParentStyle[cssTransformOffset[0]] = cssTransformOffset[1]; + } else { + resetCssTransform(this.textareaParentStyle); + } + this.textareaParentStyle.top = editTop + 'px'; + this.textareaParentStyle.left = editLeft + 'px'; + var cellTopOffset = this.TD.offsetTop - this.instance.view.wt.wtOverlays.topOverlay.getScrollPosition(), + cellLeftOffset = this.TD.offsetLeft - this.instance.view.wt.wtOverlays.leftOverlay.getScrollPosition(); + var width = innerWidth(this.TD) - 8; + var maxWidth = this.instance.view.maximumVisibleElementWidth(cellLeftOffset) - 9; + var height = this.TD.scrollHeight + 1; + var maxHeight = Math.max(this.instance.view.maximumVisibleElementHeight(cellTopOffset) - 2, 23); + var cellComputedStyle = getComputedStyle(this.TD); + this.TEXTAREA.style.fontSize = cellComputedStyle.fontSize; + this.TEXTAREA.style.fontFamily = cellComputedStyle.fontFamily; + this.TEXTAREA.style.backgroundColor = ''; + this.TEXTAREA.style.backgroundColor = backgroundColor ? backgroundColor : getComputedStyle(this.TEXTAREA).backgroundColor; + this.autoResize.init(this.TEXTAREA, { + minHeight: Math.min(height, maxHeight), + maxHeight: maxHeight, + minWidth: Math.min(width, maxWidth), + maxWidth: maxWidth + }, true); + this.textareaParentStyle.display = 'block'; +}; +TextEditor.prototype.bindEvents = function() { + var editor = this; + this.eventManager.addEventListener(this.TEXTAREA, 'cut', function(event) { + stopPropagation(event); + }); + this.eventManager.addEventListener(this.TEXTAREA, 'paste', function(event) { + stopPropagation(event); + }); + this.instance.addHook('afterScrollHorizontally', function() { + editor.refreshDimensions(); + }); + this.instance.addHook('afterScrollVertically', function() { + editor.refreshDimensions(); + }); + this.instance.addHook('afterColumnResize', function() { + editor.refreshDimensions(); + editor.focus(); + }); + this.instance.addHook('afterRowResize', function() { + editor.refreshDimensions(); + editor.focus(); + }); + this.instance.addHook('afterDestroy', function() { + editor.eventManager.destroy(); + }); +}; +TextEditor.prototype.destroy = function() { + this.eventManager.destroy(); +}; +; +registerEditor('text', TextEditor); + +//# +},{"_baseEditor":30,"autoResize":"autoResize","editors":29,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],41:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + EventManager: {get: function() { + return EventManager; + }}, + eventManager: {get: function() { + return eventManager; + }}, + __esModule: {value: true} +}); +var $__helpers_47_dom_47_element__, + $__helpers_47_browser__; +var $__0 = ($__helpers_47_dom_47_element__ = require("helpers/dom/element"), $__helpers_47_dom_47_element__ && $__helpers_47_dom_47_element__.__esModule && $__helpers_47_dom_47_element__ || {default: $__helpers_47_dom_47_element__}), + polymerWrap = $__0.polymerWrap, + closest = $__0.closest; +var isWebComponentSupportedNatively = ($__helpers_47_browser__ = require("helpers/browser"), $__helpers_47_browser__ && $__helpers_47_browser__.__esModule && $__helpers_47_browser__ || {default: $__helpers_47_browser__}).isWebComponentSupportedNatively; +var EventManager = function EventManager() { + var context = arguments[0] !== (void 0) ? arguments[0] : null; + this.context = context || this; + if (!this.context.eventListeners) { + this.context.eventListeners = []; + } +}; +($traceurRuntime.createClass)(EventManager, { + addEventListener: function(element, eventName, callback) { + var $__2 = this; + var context = this.context; + function callbackProxy(event) { + if (event.target == void 0 && event.srcElement != void 0) { + if (event.definePoperty) { + event.definePoperty('target', {value: event.srcElement}); + } else { + event.target = event.srcElement; + } + } + if (event.preventDefault == void 0) { + if (event.definePoperty) { + event.definePoperty('preventDefault', {value: function() { + this.returnValue = false; + }}); + } else { + event.preventDefault = function() { + this.returnValue = false; + }; + } + } + event = extendEvent(context, event); + callback.call(this, event); + } + this.context.eventListeners.push({ + element: element, + event: eventName, + callback: callback, + callbackProxy: callbackProxy + }); + if (window.addEventListener) { + element.addEventListener(eventName, callbackProxy, false); + } else { + element.attachEvent('on' + eventName, callbackProxy); + } + Handsontable.countEventManagerListeners++; + return (function() { + $__2.removeEventListener(element, eventName, callback); + }); + }, + removeEventListener: function(element, eventName, callback) { + var len = this.context.eventListeners.length; + var tmpEvent; + while (len--) { + tmpEvent = this.context.eventListeners[len]; + if (tmpEvent.event == eventName && tmpEvent.element == element) { + if (callback && callback != tmpEvent.callback) { + continue; + } + this.context.eventListeners.splice(len, 1); + if (tmpEvent.element.removeEventListener) { + tmpEvent.element.removeEventListener(tmpEvent.event, tmpEvent.callbackProxy, false); + } else { + tmpEvent.element.detachEvent('on' + tmpEvent.event, tmpEvent.callbackProxy); + } + Handsontable.countEventManagerListeners--; + } + } + }, + clearEvents: function() { + if (!this.context) { + return; + } + var len = this.context.eventListeners.length; + while (len--) { + var event = this.context.eventListeners[len]; + if (event) { + this.removeEventListener(event.element, event.event, event.callback); + } + } + }, + clear: function() { + this.clearEvents(); + }, + destroy: function() { + this.clearEvents(); + this.context = null; + }, + fireEvent: function(element, eventName) { + var options = { + bubbles: true, + cancelable: (eventName !== 'mousemove'), + view: window, + detail: 0, + screenX: 0, + screenY: 0, + clientX: 1, + clientY: 1, + ctrlKey: false, + altKey: false, + shiftKey: false, + metaKey: false, + button: 0, + relatedTarget: undefined + }; + var event; + if (document.createEvent) { + event = document.createEvent('MouseEvents'); + event.initMouseEvent(eventName, options.bubbles, options.cancelable, options.view, options.detail, options.screenX, options.screenY, options.clientX, options.clientY, options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, options.button, options.relatedTarget || document.body.parentNode); + } else { + event = document.createEventObject(); + } + if (element.dispatchEvent) { + element.dispatchEvent(event); + } else { + element.fireEvent('on' + eventName, event); + } + } +}, {}); +function extendEvent(context, event) { + var componentName = 'HOT-TABLE'; + var isHotTableSpotted; + var fromElement; + var realTarget; + var target; + var len; + event.isTargetWebComponent = false; + event.realTarget = event.target; + if (!Handsontable.eventManager.isHotTableEnv) { + return event; + } + event = polymerWrap(event); + len = event.path ? event.path.length : 0; + while (len--) { + if (event.path[len].nodeName === componentName) { + isHotTableSpotted = true; + } else if (isHotTableSpotted && event.path[len].shadowRoot) { + target = event.path[len]; + break; + } + if (len === 0 && !target) { + target = event.path[len]; + } + } + if (!target) { + target = event.target; + } + event.isTargetWebComponent = true; + if (isWebComponentSupportedNatively()) { + event.realTarget = event.srcElement || event.toElement; + } else if (context instanceof Handsontable.Core || context instanceof Walkontable) { + if (context instanceof Handsontable.Core) { + fromElement = context.view ? context.view.wt.wtTable.TABLE : null; + } else if (context instanceof Walkontable) { + fromElement = context.wtTable.TABLE.parentNode.parentNode; + } + realTarget = closest(event.target, [componentName], fromElement); + if (realTarget) { + event.realTarget = fromElement.querySelector(componentName) || event.target; + } else { + event.realTarget = event.target; + } + } + Object.defineProperty(event, 'target', { + get: function() { + return polymerWrap(target); + }, + enumerable: true, + configurable: true + }); + return event; +} +; +// window.Handsontable = window.Handsontable || {}; +Handsontable.countEventManagerListeners = 0; +Handsontable.eventManager = eventManager; +function eventManager(context) { + return new EventManager(context); +} + +//# +},{"helpers/browser":43,"helpers/dom/element":45}],42:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + to2dArray: {get: function() { + return to2dArray; + }}, + extendArray: {get: function() { + return extendArray; + }}, + pivot: {get: function() { + return pivot; + }}, + arrayReduce: {get: function() { + return arrayReduce; + }}, + arrayFilter: {get: function() { + return arrayFilter; + }}, + arrayMap: {get: function() { + return arrayMap; + }}, + arrayEach: {get: function() { + return arrayEach; + }}, + arraySum: {get: function() { + return arraySum; + }}, + arrayMax: {get: function() { + return arrayMax; + }}, + arrayMin: {get: function() { + return arrayMin; + }}, + arrayAvg: {get: function() { + return arrayAvg; + }}, + arrayFlatten: {get: function() { + return arrayFlatten; + }}, + arrayUnique: {get: function() { + return arrayUnique; + }}, + __esModule: {value: true} +}); +function to2dArray(arr) { + var i = 0, + ilen = arr.length; + while (i < ilen) { + arr[i] = [arr[i]]; + i++; + } +} +function extendArray(arr, extension) { + var i = 0, + ilen = extension.length; + while (i < ilen) { + arr.push(extension[i]); + i++; + } +} +function pivot(arr) { + var pivotedArr = []; + if (!arr || arr.length === 0 || !arr[0] || arr[0].length === 0) { + return pivotedArr; + } + var rowCount = arr.length; + var colCount = arr[0].length; + for (var i = 0; i < rowCount; i++) { + for (var j = 0; j < colCount; j++) { + if (!pivotedArr[j]) { + pivotedArr[j] = []; + } + pivotedArr[j][i] = arr[i][j]; + } + } + return pivotedArr; +} +function arrayReduce(array, iteratee, accumulator, initFromArray) { + var index = -1, + length = array.length; + if (initFromArray && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; +} +function arrayFilter(array, predicate) { + var index = -1, + length = array.length, + resIndex = -1, + result = []; + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[++resIndex] = value; + } + } + return result; +} +function arrayMap(array, iteratee) { + var index = -1, + length = array.length, + resIndex = -1, + result = []; + while (++index < length) { + var value = array[index]; + result[++resIndex] = iteratee(value, index, array); + } + return result; +} +function arrayEach(array, iteratee) { + var index = -1, + length = array.length; + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; +} +function arraySum(array) { + return arrayReduce(array, (function(a, b) { + return (a + b); + }), 0); +} +function arrayMax(array) { + return arrayReduce(array, (function(a, b) { + return (a > b ? a : b); + }), Array.isArray(array) ? array[0] : void 0); +} +function arrayMin(array) { + return arrayReduce(array, (function(a, b) { + return (a < b ? a : b); + }), Array.isArray(array) ? array[0] : void 0); +} +function arrayAvg(array) { + if (!array.length) { + return 0; + } + return arraySum(array) / array.length; +} +function arrayFlatten(array) { + return arrayReduce(array, (function(initial, value) { + return initial.concat(Array.isArray(value) ? arrayFlatten(value) : value); + }), []); +} +function arrayUnique(array) { + var unique = []; + arrayEach(array, (function(value) { + if (unique.indexOf(value) === -1) { + unique.push(value); + } + })); + return unique; +} + +//# +},{}],43:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + isIE8: {get: function() { + return isIE8; + }}, + isIE9: {get: function() { + return isIE9; + }}, + isSafari: {get: function() { + return isSafari; + }}, + isChrome: {get: function() { + return isChrome; + }}, + isMobileBrowser: {get: function() { + return isMobileBrowser; + }}, + isTouchSupported: {get: function() { + return isTouchSupported; + }}, + isWebComponentSupportedNatively: {get: function() { + return isWebComponentSupportedNatively; + }}, + hasCaptionProblem: {get: function() { + return hasCaptionProblem; + }}, + __esModule: {value: true} +}); +var _isIE8 = !(document.createTextNode('test').textContent); +function isIE8() { + return _isIE8; +} +var _isIE9 = !!(document.documentMode); +function isIE9() { + return _isIE9; +} +var _isSafari = (/Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor)); +function isSafari() { + return _isSafari; +} +var _isChrome = (/Chrome/.test(navigator.userAgent) && /Google/.test(navigator.vendor)); +function isChrome() { + return _isChrome; +} +function isMobileBrowser(userAgent) { + if (!userAgent) { + userAgent = navigator.userAgent; + } + return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent)); +} +function isTouchSupported() { + return ('ontouchstart' in window); +} +function isWebComponentSupportedNatively() { + var test = document.createElement('div'); + return test.createShadowRoot && test.createShadowRoot.toString().match(/\[native code\]/) ? true : false; +} +var _hasCaptionProblem; +function detectCaptionProblem() { + var TABLE = document.createElement('TABLE'); + TABLE.style.borderSpacing = 0; + TABLE.style.borderWidth = 0; + TABLE.style.padding = 0; + var TBODY = document.createElement('TBODY'); + TABLE.appendChild(TBODY); + TBODY.appendChild(document.createElement('TR')); + TBODY.firstChild.appendChild(document.createElement('TD')); + TBODY.firstChild.firstChild.innerHTML = 't
t'; + var CAPTION = document.createElement('CAPTION'); + CAPTION.innerHTML = 'c
c
c
c'; + CAPTION.style.padding = 0; + CAPTION.style.margin = 0; + TABLE.insertBefore(CAPTION, TBODY); + document.body.appendChild(TABLE); + _hasCaptionProblem = (TABLE.offsetHeight < 2 * TABLE.lastChild.offsetHeight); + document.body.removeChild(TABLE); +} +function hasCaptionProblem() { + if (_hasCaptionProblem === void 0) { + detectCaptionProblem(); + } + return _hasCaptionProblem; +} + +//# +},{}],44:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + spreadsheetColumnLabel: {get: function() { + return spreadsheetColumnLabel; + }}, + createSpreadsheetData: {get: function() { + return createSpreadsheetData; + }}, + createSpreadsheetObjectData: {get: function() { + return createSpreadsheetObjectData; + }}, + createEmptySpreadsheetData: {get: function() { + return createEmptySpreadsheetData; + }}, + translateRowsToColumns: {get: function() { + return translateRowsToColumns; + }}, + cellMethodLookupFactory: {get: function() { + return cellMethodLookupFactory; + }}, + __esModule: {value: true} +}); +var $__object__; +var getPrototypeOf = ($__object__ = require("object"), $__object__ && $__object__.__esModule && $__object__ || {default: $__object__}).getPrototypeOf; +function spreadsheetColumnLabel(index) { + var dividend = index + 1; + var columnLabel = ''; + var modulo; + while (dividend > 0) { + modulo = (dividend - 1) % 26; + columnLabel = String.fromCharCode(65 + modulo) + columnLabel; + dividend = parseInt((dividend - modulo) / 26, 10); + } + return columnLabel; +} +function createSpreadsheetData(rowCount, colCount) { + rowCount = typeof rowCount === 'number' ? rowCount : 100; + colCount = typeof colCount === 'number' ? colCount : 4; + var rows = [], + i, + j; + for (i = 0; i < rowCount; i++) { + var row = []; + for (j = 0; j < colCount; j++) { + row.push(spreadsheetColumnLabel(j) + (i + 1)); + } + rows.push(row); + } + return rows; +} +function createSpreadsheetObjectData(rowCount, colCount) { + rowCount = typeof rowCount === 'number' ? rowCount : 100; + colCount = typeof colCount === 'number' ? colCount : 4; + var rows = [], + i, + j; + for (i = 0; i < rowCount; i++) { + var row = {}; + for (j = 0; j < colCount; j++) { + row['prop' + j] = spreadsheetColumnLabel(j) + (i + 1); + } + rows.push(row); + } + return rows; +} +function createEmptySpreadsheetData(rows, columns) { + var data = []; + var row; + for (var i = 0; i < rows; i++) { + row = []; + for (var j = 0; j < columns; j++) { + row.push(''); + } + data.push(row); + } + return data; +} +function translateRowsToColumns(input) { + var i, + ilen, + j, + jlen, + output = [], + olen = 0; + for (i = 0, ilen = input.length; i < ilen; i++) { + for (j = 0, jlen = input[i].length; j < jlen; j++) { + if (j == olen) { + output.push([]); + olen++; + } + output[j].push(input[i][j]); + } + } + return output; +} +function cellMethodLookupFactory(methodName, allowUndefined) { + allowUndefined = typeof allowUndefined == 'undefined' ? true : allowUndefined; + return function cellMethodLookup(row, col) { + return (function getMethodFromProperties(properties) { + if (!properties) { + return; + } else if (properties.hasOwnProperty(methodName) && properties[methodName] !== void 0) { + return properties[methodName]; + } else if (properties.hasOwnProperty('type') && properties.type) { + var type; + if (typeof properties.type != 'string') { + throw new Error('Cell type must be a string '); + } + type = translateTypeNameToObject(properties.type); + if (type.hasOwnProperty(methodName)) { + return type[methodName]; + } else if (allowUndefined) { + return; + } + } + return getMethodFromProperties(getPrototypeOf(properties)); + })(typeof row == 'number' ? this.getCellMeta(row, col) : row); + }; + function translateTypeNameToObject(typeName) { + var type = Handsontable.cellTypes[typeName]; + if (typeof type == 'undefined') { + throw new Error('You declared cell type "' + typeName + '" as a string that is not mapped to a known object. ' + 'Cell type must be an object or a string mapped to an object in Handsontable.cellTypes'); + } + return type; + } +} + +//# +},{"object":50}],45:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + closest: {get: function() { + return closest; + }}, + isChildOf: {get: function() { + return isChildOf; + }}, + isChildOfWebComponentTable: {get: function() { + return isChildOfWebComponentTable; + }}, + polymerWrap: {get: function() { + return polymerWrap; + }}, + polymerUnwrap: {get: function() { + return polymerUnwrap; + }}, + index: {get: function() { + return index; + }}, + overlayContainsElement: {get: function() { + return overlayContainsElement; + }}, + hasClass: {get: function() { + return hasClass; + }}, + addClass: {get: function() { + return addClass; + }}, + removeClass: {get: function() { + return removeClass; + }}, + removeTextNodes: {get: function() { + return removeTextNodes; + }}, + empty: {get: function() { + return empty; + }}, + HTML_CHARACTERS: {get: function() { + return HTML_CHARACTERS; + }}, + fastInnerHTML: {get: function() { + return fastInnerHTML; + }}, + fastInnerText: {get: function() { + return fastInnerText; + }}, + isVisible: {get: function() { + return isVisible; + }}, + offset: {get: function() { + return offset; + }}, + getWindowScrollTop: {get: function() { + return getWindowScrollTop; + }}, + getWindowScrollLeft: {get: function() { + return getWindowScrollLeft; + }}, + getScrollTop: {get: function() { + return getScrollTop; + }}, + getScrollLeft: {get: function() { + return getScrollLeft; + }}, + getScrollableElement: {get: function() { + return getScrollableElement; + }}, + getTrimmingContainer: {get: function() { + return getTrimmingContainer; + }}, + getStyle: {get: function() { + return getStyle; + }}, + getComputedStyle: {get: function() { + return getComputedStyle; + }}, + outerWidth: {get: function() { + return outerWidth; + }}, + outerHeight: {get: function() { + return outerHeight; + }}, + innerHeight: {get: function() { + return innerHeight; + }}, + innerWidth: {get: function() { + return innerWidth; + }}, + addEvent: {get: function() { + return addEvent; + }}, + removeEvent: {get: function() { + return removeEvent; + }}, + getCaretPosition: {get: function() { + return getCaretPosition; + }}, + getSelectionEndPosition: {get: function() { + return getSelectionEndPosition; + }}, + getSelectionText: {get: function() { + return getSelectionText; + }}, + setCaretPosition: {get: function() { + return setCaretPosition; + }}, + getScrollbarWidth: {get: function() { + return getScrollbarWidth; + }}, + setOverlayPosition: {get: function() { + return setOverlayPosition; + }}, + getCssTransform: {get: function() { + return getCssTransform; + }}, + resetCssTransform: {get: function() { + return resetCssTransform; + }}, + isInput: {get: function() { + return isInput; + }}, + isOutsideInput: {get: function() { + return isOutsideInput; + }}, + requestAnimationFrame: {get: function() { + return requestAnimationFrame; + }}, + cancelAnimationFrame: {get: function() { + return cancelAnimationFrame; + }}, + __esModule: {value: true} +}); +var $___46__46__47_browser__; +var $__0 = ($___46__46__47_browser__ = require("../browser"), $___46__46__47_browser__ && $___46__46__47_browser__.__esModule && $___46__46__47_browser__ || {default: $___46__46__47_browser__}), + isIE8 = $__0.isIE8, + isIE9 = $__0.isIE9, + isSafari = $__0.isSafari, + hasCaptionProblem = $__0.hasCaptionProblem; +function closest(element, nodes, until) { + while (element != null && element !== until) { + if (element.nodeType === Node.ELEMENT_NODE && (nodes.indexOf(element.nodeName) > -1 || nodes.indexOf(element) > -1)) { + return element; + } + if (element.host && element.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { + element = element.host; + } else { + element = element.parentNode; + } + } + return null; +} +function isChildOf(child, parent) { + var node = child.parentNode; + var queriedParents = []; + if (typeof parent === 'string') { + queriedParents = Array.prototype.slice.call(document.querySelectorAll(parent), 0); + } else { + queriedParents.push(parent); + } + while (node != null) { + if (queriedParents.indexOf(node) > -1) { + return true; + } + node = node.parentNode; + } + return false; +} +function isChildOfWebComponentTable(element) { + var hotTableName = 'hot-table', + result = false, + parentNode; + parentNode = polymerWrap(element); + function isHotTable(element) { + return element.nodeType === Node.ELEMENT_NODE && element.nodeName === hotTableName.toUpperCase(); + } + while (parentNode != null) { + if (isHotTable(parentNode)) { + result = true; + break; + } else if (parentNode.host && parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { + result = isHotTable(parentNode.host); + if (result) { + break; + } + parentNode = parentNode.host; + } + parentNode = parentNode.parentNode; + } + return result; +} +function polymerWrap(element) { + return typeof Polymer !== 'undefined' && typeof wrap === 'function' ? wrap(element) : element; +} +function polymerUnwrap(element) { + return typeof Polymer !== 'undefined' && typeof unwrap === 'function' ? unwrap(element) : element; +} +function index(element) { + var i = 0; + if (element.previousSibling) { + while (element = element.previousSibling) { + ++i; + } + } + return i; +} +function overlayContainsElement(overlayType, element) { + var overlayElement = document.querySelector('.ht_clone_' + overlayType); + return overlayElement ? overlayElement.contains(element) : null; +} +var classListSupport = document.documentElement.classList ? true : false; +var _hasClass, + _addClass, + _removeClass; +function filterEmptyClassNames(classNames) { + var len = 0, + result = []; + if (!classNames || !classNames.length) { + return result; + } + while (classNames[len]) { + result.push(classNames[len]); + len++; + } + return result; +} +if (classListSupport) { + var isSupportMultipleClassesArg = (function() { + var element = document.createElement('div'); + element.classList.add('test', 'test2'); + return element.classList.contains('test2'); + }()); + _hasClass = function _hasClass(element, className) { + if (className === '') { + return false; + } + return element.classList.contains(className); + }; + _addClass = function _addClass(element, className) { + var len = 0; + if (typeof className === 'string') { + className = className.split(' '); + } + className = filterEmptyClassNames(className); + if (isSupportMultipleClassesArg) { + element.classList.add.apply(element.classList, className); + } else { + while (className && className[len]) { + element.classList.add(className[len]); + len++; + } + } + }; + _removeClass = function _removeClass(element, className) { + var len = 0; + if (typeof className === 'string') { + className = className.split(' '); + } + className = filterEmptyClassNames(className); + if (isSupportMultipleClassesArg) { + element.classList.remove.apply(element.classList, className); + } else { + while (className && className[len]) { + element.classList.remove(className[len]); + len++; + } + } + }; +} else { + var createClassNameRegExp = function createClassNameRegExp(className) { + return new RegExp('(\\s|^)' + className + '(\\s|$)'); + }; + _hasClass = function _hasClass(element, className) { + return element.className.match(createClassNameRegExp(className)) ? true : false; + }; + _addClass = function _addClass(element, className) { + var len = 0, + _className = element.className; + if (typeof className === 'string') { + className = className.split(' '); + } + if (_className === '') { + _className = className.join(' '); + } else { + while (className && className[len]) { + if (!createClassNameRegExp(className[len]).test(_className)) { + _className += ' ' + className[len]; + } + len++; + } + } + element.className = _className; + }; + _removeClass = function _removeClass(element, className) { + var len = 0, + _className = element.className; + if (typeof className === 'string') { + className = className.split(' '); + } + while (className && className[len]) { + _className = _className.replace(createClassNameRegExp(className[len]), ' ').trim(); + len++; + } + if (element.className !== _className) { + element.className = _className; + } + }; +} +function hasClass(element, className) { + return _hasClass(element, className); +} +function addClass(element, className) { + return _addClass(element, className); +} +function removeClass(element, className) { + return _removeClass(element, className); +} +function removeTextNodes(element, parent) { + if (element.nodeType === 3) { + parent.removeChild(element); + } else if (['TABLE', 'THEAD', 'TBODY', 'TFOOT', 'TR'].indexOf(element.nodeName) > -1) { + var childs = element.childNodes; + for (var i = childs.length - 1; i >= 0; i--) { + removeTextNodes(childs[i], element); + } + } +} +function empty(element) { + var child; + while (child = element.lastChild) { + element.removeChild(child); + } +} +var HTML_CHARACTERS = /(<(.*)>|&(.*);)/; +function fastInnerHTML(element, content) { + if (HTML_CHARACTERS.test(content)) { + element.innerHTML = content; + } else { + fastInnerText(element, content); + } +} +var textContextSupport = document.createTextNode('test').textContent ? true : false; +function fastInnerText(element, content) { + var child = element.firstChild; + if (child && child.nodeType === 3 && child.nextSibling === null) { + if (textContextSupport) { + child.textContent = content; + } else { + child.data = content; + } + } else { + empty(element); + element.appendChild(document.createTextNode(content)); + } +} +function isVisible(elem) { + var next = elem; + while (polymerUnwrap(next) !== document.documentElement) { + if (next === null) { + return false; + } else if (next.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { + if (next.host) { + if (next.host.impl) { + return isVisible(next.host.impl); + } else if (next.host) { + return isVisible(next.host); + } else { + throw new Error('Lost in Web Components world'); + } + } else { + return false; + } + } else if (next.style.display === 'none') { + return false; + } + next = next.parentNode; + } + return true; +} +function offset(elem) { + var offsetLeft, + offsetTop, + lastElem, + docElem, + box; + docElem = document.documentElement; + if (hasCaptionProblem() && elem.firstChild && elem.firstChild.nodeName === 'CAPTION') { + box = elem.getBoundingClientRect(); + return { + top: box.top + (window.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0), + left: box.left + (window.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0) + }; + } + offsetLeft = elem.offsetLeft; + offsetTop = elem.offsetTop; + lastElem = elem; + while (elem = elem.offsetParent) { + if (elem === document.body) { + break; + } + offsetLeft += elem.offsetLeft; + offsetTop += elem.offsetTop; + lastElem = elem; + } + if (lastElem && lastElem.style.position === 'fixed') { + offsetLeft += window.pageXOffset || docElem.scrollLeft; + offsetTop += window.pageYOffset || docElem.scrollTop; + } + return { + left: offsetLeft, + top: offsetTop + }; +} +function getWindowScrollTop() { + var res = window.scrollY; + if (res === void 0) { + res = document.documentElement.scrollTop; + } + return res; +} +function getWindowScrollLeft() { + var res = window.scrollX; + if (res === void 0) { + res = document.documentElement.scrollLeft; + } + return res; +} +function getScrollTop(element) { + if (element === window) { + return getWindowScrollTop(); + } else { + return element.scrollTop; + } +} +function getScrollLeft(element) { + if (element === window) { + return getWindowScrollLeft(); + } else { + return element.scrollLeft; + } +} +function getScrollableElement(element) { + var el = element.parentNode, + props = ['auto', 'scroll'], + overflow, + overflowX, + overflowY, + computedStyle = '', + computedOverflow = '', + computedOverflowY = '', + computedOverflowX = ''; + while (el && el.style && document.body !== el) { + overflow = el.style.overflow; + overflowX = el.style.overflowX; + overflowY = el.style.overflowY; + if (overflow == 'scroll' || overflowX == 'scroll' || overflowY == 'scroll') { + return el; + } else if (window.getComputedStyle) { + computedStyle = window.getComputedStyle(el); + computedOverflow = computedStyle.getPropertyValue('overflow'); + computedOverflowY = computedStyle.getPropertyValue('overflow-y'); + computedOverflowX = computedStyle.getPropertyValue('overflow-x'); + if (computedOverflow === 'scroll' || computedOverflowX === 'scroll' || computedOverflowY === 'scroll') { + return el; + } + } + if (el.clientHeight <= el.scrollHeight && (props.indexOf(overflowY) !== -1 || props.indexOf(overflow) !== -1 || props.indexOf(computedOverflow) !== -1 || props.indexOf(computedOverflowY) !== -1)) { + return el; + } + if (el.clientWidth <= el.scrollWidth && (props.indexOf(overflowX) !== -1 || props.indexOf(overflow) !== -1 || props.indexOf(computedOverflow) !== -1 || props.indexOf(computedOverflowX) !== -1)) { + return el; + } + el = el.parentNode; + } + return window; +} +function getTrimmingContainer(base) { + var el = base.parentNode; + while (el && el.style && document.body !== el) { + if (el.style.overflow !== 'visible' && el.style.overflow !== '') { + return el; + } else if (window.getComputedStyle) { + var computedStyle = window.getComputedStyle(el); + if (computedStyle.getPropertyValue('overflow') !== 'visible' && computedStyle.getPropertyValue('overflow') !== '') { + return el; + } + } + el = el.parentNode; + } + return window; +} +function getStyle(element, prop) { + if (!element) { + return; + } else if (element === window) { + if (prop === 'width') { + return window.innerWidth + 'px'; + } else if (prop === 'height') { + return window.innerHeight + 'px'; + } + return; + } + var styleProp = element.style[prop], + computedStyle; + if (styleProp !== '' && styleProp !== void 0) { + return styleProp; + } else { + computedStyle = getComputedStyle(element); + if (computedStyle[prop] !== '' && computedStyle[prop] !== void 0) { + return computedStyle[prop]; + } + return void 0; + } +} +function getComputedStyle(element) { + return element.currentStyle || document.defaultView.getComputedStyle(element); +} +function outerWidth(element) { + return element.offsetWidth; +} +function outerHeight(elem) { + if (hasCaptionProblem() && elem.firstChild && elem.firstChild.nodeName === 'CAPTION') { + return elem.offsetHeight + elem.firstChild.offsetHeight; + } else { + return elem.offsetHeight; + } +} +function innerHeight(element) { + return element.clientHeight || element.innerHeight; +} +function innerWidth(element) { + return element.clientWidth || element.innerWidth; +} +function addEvent(element, event, callback) { + if (window.addEventListener) { + element.addEventListener(event, callback, false); + } else { + element.attachEvent('on' + event, callback); + } +} +function removeEvent(element, event, callback) { + if (window.removeEventListener) { + element.removeEventListener(event, callback, false); + } else { + element.detachEvent('on' + event, callback); + } +} +function getCaretPosition(el) { + if (el.selectionStart) { + return el.selectionStart; + } else if (document.selection) { + el.focus(); + var r = document.selection.createRange(); + if (r == null) { + return 0; + } + var re = el.createTextRange(); + var rc = re.duplicate(); + re.moveToBookmark(r.getBookmark()); + rc.setEndPoint('EndToStart', re); + return rc.text.length; + } + return 0; +} +function getSelectionEndPosition(el) { + if (el.selectionEnd) { + return el.selectionEnd; + } else if (document.selection) { + var r = document.selection.createRange(); + if (r == null) { + return 0; + } + var re = el.createTextRange(); + return re.text.indexOf(r.text) + r.text.length; + } +} +function getSelectionText() { + var text = ''; + if (window.getSelection) { + text = window.getSelection().toString(); + } else if (document.selection && document.selection.type !== 'Control') { + text = document.selection.createRange().text; + } + return text; +} +function setCaretPosition(element, pos, endPos) { + if (endPos === void 0) { + endPos = pos; + } + if (element.setSelectionRange) { + element.focus(); + try { + element.setSelectionRange(pos, endPos); + } catch (err) { + var elementParent = element.parentNode; + var parentDisplayValue = elementParent.style.display; + elementParent.style.display = 'block'; + element.setSelectionRange(pos, endPos); + elementParent.style.display = parentDisplayValue; + } + } else if (element.createTextRange) { + var range = element.createTextRange(); + range.collapse(true); + range.moveEnd('character', endPos); + range.moveStart('character', pos); + range.select(); + } +} +var cachedScrollbarWidth; +function walkontableCalculateScrollbarWidth() { + var inner = document.createElement('p'); + inner.style.width = '100%'; + inner.style.height = '200px'; + var outer = document.createElement('div'); + outer.style.position = 'absolute'; + outer.style.top = '0px'; + outer.style.left = '0px'; + outer.style.visibility = 'hidden'; + outer.style.width = '200px'; + outer.style.height = '150px'; + outer.style.overflow = 'hidden'; + outer.appendChild(inner); + (document.body || document.documentElement).appendChild(outer); + var w1 = inner.offsetWidth; + outer.style.overflow = 'scroll'; + var w2 = inner.offsetWidth; + if (w1 == w2) { + w2 = outer.clientWidth; + } + (document.body || document.documentElement).removeChild(outer); + return (w1 - w2); +} +function getScrollbarWidth() { + if (cachedScrollbarWidth === void 0) { + cachedScrollbarWidth = walkontableCalculateScrollbarWidth(); + } + return cachedScrollbarWidth; +} +function setOverlayPosition(overlayElem, left, top) { + if (isIE8() || isIE9()) { + overlayElem.style.top = top; + overlayElem.style.left = left; + } else if (isSafari()) { + overlayElem.style['-webkit-transform'] = 'translate3d(' + left + ',' + top + ',0)'; + } else { + overlayElem.style.transform = 'translate3d(' + left + ',' + top + ',0)'; + } +} +function getCssTransform(element) { + var transform; + if (element.style.transform && (transform = element.style.transform) !== '') { + return ['transform', transform]; + } else if (element.style['-webkit-transform'] && (transform = element.style['-webkit-transform']) !== '') { + return ['-webkit-transform', transform]; + } + return -1; +} +function resetCssTransform(element) { + if (element.transform && element.transform !== '') { + element.transform = ''; + } else if (element['-webkit-transform'] && element['-webkit-transform'] !== '') { + element['-webkit-transform'] = ''; + } +} +function isInput(element) { + var inputs = ['INPUT', 'SELECT', 'TEXTAREA']; + return inputs.indexOf(element.nodeName) > -1 || element.contentEditable === 'true'; +} +function isOutsideInput(element) { + return isInput(element) && element.className.indexOf('handsontableInput') == -1 && element.className.indexOf('copyPaste') == -1; +} +var lastTime = 0; +var vendors = ['ms', 'moz', 'webkit', 'o']; +var _requestAnimationFrame = window.requestAnimationFrame; +var _cancelAnimationFrame = window.cancelAnimationFrame; +for (var x = 0; x < vendors.length && !_requestAnimationFrame; ++x) { + _requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame']; + _cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame']; +} +if (!_requestAnimationFrame) { + _requestAnimationFrame = function(callback) { + var currTime = new Date().getTime(); + var timeToCall = Math.max(0, 16 - (currTime - lastTime)); + var id = window.setTimeout(function() { + callback(currTime + timeToCall); + }, timeToCall); + lastTime = currTime + timeToCall; + return id; + }; +} +if (!_cancelAnimationFrame) { + _cancelAnimationFrame = function(id) { + clearTimeout(id); + }; +} +function requestAnimationFrame(callback) { + return _requestAnimationFrame.call(window, callback); +} +function cancelAnimationFrame(id) { + _cancelAnimationFrame.call(window, id); +} + +//# +},{"../browser":43}],46:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + stopImmediatePropagation: {get: function() { + return stopImmediatePropagation; + }}, + isImmediatePropagationStopped: {get: function() { + return isImmediatePropagationStopped; + }}, + stopPropagation: {get: function() { + return stopPropagation; + }}, + pageX: {get: function() { + return pageX; + }}, + pageY: {get: function() { + return pageY; + }}, + __esModule: {value: true} +}); +function stopImmediatePropagation(event) { + event.isImmediatePropagationEnabled = false; + event.cancelBubble = true; +} +function isImmediatePropagationStopped(event) { + return event.isImmediatePropagationEnabled === false; +} +function stopPropagation(event) { + if (typeof event.stopPropagation === 'function') { + event.stopPropagation(); + } else { + event.cancelBubble = true; + } +} +function pageX(event) { + if (event.pageX) { + return event.pageX; + } + var scrollLeft = getWindowScrollLeft(); + var cursorX = event.clientX + scrollLeft; + return cursorX; +} +function pageY(event) { + if (event.pageY) { + return event.pageY; + } + var scrollTop = getWindowScrollTop(); + var cursorY = event.clientY + scrollTop; + return cursorY; +} + +//# +},{}],47:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + proxy: {get: function() { + return proxy; + }}, + throttle: {get: function() { + return throttle; + }}, + throttleAfterHits: {get: function() { + return throttleAfterHits; + }}, + __esModule: {value: true} +}); +function proxy(fun, context) { + return function() { + return fun.apply(context, arguments); + }; +} +function throttle(func) { + var wait = arguments[1] !== (void 0) ? arguments[1] : 200; + var lastCalled = 0; + var result = {lastCallThrottled: true}; + var lastTimer = null; + function _throttle() { + var $__0 = this; + var args = arguments; + var stamp = Date.now(); + var needCall = false; + result.lastCallThrottled = true; + if (!lastCalled) { + lastCalled = stamp; + needCall = true; + } + var remaining = wait - (stamp - lastCalled); + if (needCall) { + result.lastCallThrottled = false; + func.apply(this, args); + } else { + if (lastTimer) { + clearTimeout(lastTimer); + } + lastTimer = setTimeout((function() { + result.lastCallThrottled = false; + func.apply($__0, args); + lastCalled = 0; + lastTimer = void 0; + }), remaining); + } + return result; + } + return _throttle; +} +function throttleAfterHits(func) { + var wait = arguments[1] !== (void 0) ? arguments[1] : 200; + var hits = arguments[2] !== (void 0) ? arguments[2] : 10; + var funcThrottle = throttle(func, wait); + var remainHits = hits; + function _clearHits() { + remainHits = hits; + } + function _throttleAfterHits() { + if (remainHits) { + remainHits--; + return func.apply(this, arguments); + } + return funcThrottle.apply(this, arguments); + } + _throttleAfterHits.clearHits = _clearHits; + return _throttleAfterHits; +} + +//# +},{}],48:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + stringify: {get: function() { + return stringify; + }}, + __esModule: {value: true} +}); +function stringify(value) { + switch (typeof value) { + case 'string': + case 'number': + return value + ''; + case 'object': + if (value === null) { + return ''; + } else { + return value.toString(); + } + break; + case 'undefined': + return ''; + default: + return value.toString(); + } +} + +//# +},{}],49:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + isNumeric: {get: function() { + return isNumeric; + }}, + rangeEach: {get: function() { + return rangeEach; + }}, + rangeEachReverse: {get: function() { + return rangeEachReverse; + }}, + valueAccordingPercent: {get: function() { + return valueAccordingPercent; + }}, + __esModule: {value: true} +}); +function isNumeric(n) { + var t = typeof n; + return t == 'number' ? !isNaN(n) && isFinite(n) : t == 'string' ? !n.length ? false : n.length == 1 ? /\d/.test(n) : /^\s*[+-]?\s*(?:(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?)|(?:0x[a-f\d]+))\s*$/i.test(n) : t == 'object' ? !!n && typeof n.valueOf() == 'number' && !(n instanceof Date) : false; +} +function rangeEach(rangeFrom, rangeTo, iteratee) { + var index = -1; + if (typeof rangeTo === 'function') { + iteratee = rangeTo; + rangeTo = rangeFrom; + } else { + index = rangeFrom - 1; + } + while (++index <= rangeTo) { + if (iteratee(index) === false) { + break; + } + } +} +function rangeEachReverse(rangeFrom, rangeTo, iteratee) { + var index = rangeFrom + 1; + if (typeof rangeTo === 'function') { + iteratee = rangeTo; + rangeTo = 0; + } + while (--index >= rangeTo) { + if (iteratee(index) === false) { + break; + } + } +} +function valueAccordingPercent(value, percent) { + percent = parseInt(percent.toString().replace('%', ''), 10); + percent = parseInt(value * percent / 100); + return percent; +} + +//# +},{}],50:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + duckSchema: {get: function() { + return duckSchema; + }}, + inherit: {get: function() { + return inherit; + }}, + extend: {get: function() { + return extend; + }}, + deepExtend: {get: function() { + return deepExtend; + }}, + deepClone: {get: function() { + return deepClone; + }}, + clone: {get: function() { + return clone; + }}, + mixin: {get: function() { + return mixin; + }}, + isObjectEquals: {get: function() { + return isObjectEquals; + }}, + isObject: {get: function() { + return isObject; + }}, + getPrototypeOf: {get: function() { + return getPrototypeOf; + }}, + defineGetter: {get: function() { + return defineGetter; + }}, + objectEach: {get: function() { + return objectEach; + }}, + getProperty: {get: function() { + return getProperty; + }}, + __esModule: {value: true} +}); +var $__array__; +var arrayEach = ($__array__ = require("array"), $__array__ && $__array__.__esModule && $__array__ || {default: $__array__}).arrayEach; +function duckSchema(object) { + var schema; + if (Array.isArray(object)) { + schema = []; + } else { + schema = {}; + objectEach(object, function(value, key) { + if (value && typeof value === 'object' && !Array.isArray(value)) { + schema[key] = duckSchema(value); + } else if (Array.isArray(value)) { + if (value.length && typeof value[0] === 'object' && !Array.isArray(value[0])) { + schema[key] = [duckSchema(value[0])]; + } else { + schema[key] = []; + } + } else { + schema[key] = null; + } + }); + } + return schema; +} +function inherit(Child, Parent) { + Parent.prototype.constructor = Parent; + Child.prototype = new Parent(); + Child.prototype.constructor = Child; + return Child; +} +function extend(target, extension) { + objectEach(extension, function(value, key) { + target[key] = value; + }); + return target; +} +function deepExtend(target, extension) { + objectEach(extension, function(value, key) { + if (extension[key] && typeof extension[key] === 'object') { + if (!target[key]) { + if (Array.isArray(extension[key])) { + target[key] = []; + } else { + target[key] = {}; + } + } + deepExtend(target[key], extension[key]); + } else { + target[key] = extension[key]; + } + }); +} +function deepClone(obj) { + if (typeof obj === 'object') { + return JSON.parse(JSON.stringify(obj)); + } + return obj; +} +function clone(object) { + var result = {}; + objectEach(object, (function(value, key) { + result[key] = value; + })); + return result; +} +function mixin(Base) { + for (var mixins = [], + $__1 = 1; $__1 < arguments.length; $__1++) + mixins[$__1 - 1] = arguments[$__1]; + if (!Base.MIXINS) { + Base.MIXINS = []; + } + arrayEach(mixins, (function(mixin) { + Base.MIXINS.push(mixin.MIXIN_NAME); + objectEach(mixin, (function(value, key) { + if (Base.prototype[key] !== void 0) { + throw new Error(("Mixin conflict. Property '" + key + "' already exist and cannot be overwritten.")); + } + if (typeof value === 'function') { + Base.prototype[key] = value; + } else { + var getter = function _getter(propertyName, initialValue) { + propertyName = '_' + propertyName; + var initValue = (function(value) { + if (Array.isArray(value) || isObject(value)) { + value = deepClone(value); + } + return value; + }); + return function() { + if (this[propertyName] === void 0) { + this[propertyName] = initValue(initialValue); + } + return this[propertyName]; + }; + }; + var setter = function _setter(propertyName) { + propertyName = '_' + propertyName; + return function(value) { + this[propertyName] = value; + }; + }; + Object.defineProperty(Base.prototype, key, { + get: getter(key, value), + set: setter(key), + configurable: true + }); + } + })); + })); + return Base; +} +function isObjectEquals(object1, object2) { + return JSON.stringify(object1) === JSON.stringify(object2); +} +function isObject(obj) { + return Object.prototype.toString.call(obj) == '[object Object]'; +} +function getPrototypeOf(obj) { + var prototype; + if (typeof obj.__proto__ == 'object') { + prototype = obj.__proto__; + } else { + var oldConstructor, + constructor = obj.constructor; + if (typeof obj.constructor == 'function') { + oldConstructor = constructor; + if (delete obj.constructor) { + constructor = obj.constructor; + obj.constructor = oldConstructor; + } + } + prototype = constructor ? constructor.prototype : null; + } + return prototype; +} +function defineGetter(object, property, value, options) { + options.value = value; + options.writable = options.writable !== false; + options.enumerable = options.enumerable !== false; + options.configurable = options.configurable !== false; + Object.defineProperty(object, property, options); +} +function objectEach(object, iteratee) { + for (var key in object) { + if (!object.hasOwnProperty || (object.hasOwnProperty && object.hasOwnProperty(key))) { + if (iteratee(object[key], key, object) === false) { + break; + } + } + } + return object; +} +function getProperty(object, name) { + var names = name.split('.'); + var result = object; + objectEach(names, (function(name) { + result = result[name]; + if (result === void 0) { + result = void 0; + return false; + } + })); + return result; +} + +//# +},{"array":42}],51:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + columnFactory: {get: function() { + return columnFactory; + }}, + __esModule: {value: true} +}); +var $__object__; +var inherit = ($__object__ = require("object"), $__object__ && $__object__.__esModule && $__object__ || {default: $__object__}).inherit; +function columnFactory(GridSettings, conflictList) { + function ColumnSettings() {} + ; + inherit(ColumnSettings, GridSettings); + for (var i = 0, + len = conflictList.length; i < len; i++) { + ColumnSettings.prototype[conflictList[i]] = void 0; + } + return ColumnSettings; +} + +//# +},{"object":50}],52:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + toUpperCaseFirst: {get: function() { + return toUpperCaseFirst; + }}, + startsWith: {get: function() { + return startsWith; + }}, + endsWith: {get: function() { + return endsWith; + }}, + equalsIgnoreCase: {get: function() { + return equalsIgnoreCase; + }}, + randomString: {get: function() { + return randomString; + }}, + isPercentValue: {get: function() { + return isPercentValue; + }}, + substitute: {get: function() { + return substitute; + }}, + padStart: {get: function() { + return padStart; + }}, + __esModule: {value: true} +}); +var $__mixed__, + $__number__; +var stringify = ($__mixed__ = require("mixed"), $__mixed__ && $__mixed__.__esModule && $__mixed__ || {default: $__mixed__}).stringify; +var rangeEach = ($__number__ = require("number"), $__number__ && $__number__.__esModule && $__number__ || {default: $__number__}).rangeEach; +function toUpperCaseFirst(string) { + return string[0].toUpperCase() + string.substr(1); +} +function startsWith(string, needle) { + var result = true; + rangeEach(needle.length - 1, (function(index) { + if (string.charAt(index) !== needle.charAt(index)) { + result = false; + return false; + } + })); + return result; +} +function endsWith(string, needle) { + var result = true; + var needleLength = needle.length - 1; + var stringLength = string.length - 1; + rangeEach(needleLength, (function(index) { + var stringIndex = stringLength - index; + var needleIndex = needleLength - index; + if (string.charAt(stringIndex) !== needle.charAt(needleIndex)) { + result = false; + return false; + } + })); + return result; +} +function equalsIgnoreCase() { + for (var strings = [], + $__2 = 0; $__2 < arguments.length; $__2++) + strings[$__2] = arguments[$__2]; + var unique = []; + var length = strings.length; + while (length--) { + var string = stringify(strings[length]).toLowerCase(); + if (unique.indexOf(string) === -1) { + unique.push(string); + } + } + return unique.length === 1; +} +function randomString() { + function s4() { + return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); + } + return s4() + s4() + s4() + s4(); +} +function isPercentValue(value) { + return /^([0-9][0-9]?\%$)|(^100\%$)/.test(value); +} +function substitute(template) { + var variables = arguments[1] !== (void 0) ? arguments[1] : {}; + return (template + '').replace(/(?:\\)?\[([^\[\]]+)]/g, function(match, name) { + if (match.charAt(0) === '\\') { + return match.substr(1, match.length - 1); + } + return variables[name] === void 0 ? '' : variables[name]; + }); +} +function padStart(string, maxLength) { + var fillString = arguments[2] !== (void 0) ? arguments[2] : ' '; + string = string + ''; + if (string.length >= maxLength) { + return string; + } + fillString = String(fillString); + var fillStringLength = fillString.length; + if (!fillStringLength) { + fillString = ' '; + } + var fillLen = maxLength - string.length; + var timesToRepeat = Math.ceil(fillLen / fillString.length); + var truncatedString = ''; + rangeEach(timesToRepeat, (function(index) { + truncatedString += fillString; + })); + truncatedString = truncatedString.slice(0, fillLen); + return truncatedString + string; +} +; + +//# +},{"mixed":48,"number":49}],53:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + KEY_CODES: {get: function() { + return KEY_CODES; + }}, + isPrintableChar: {get: function() { + return isPrintableChar; + }}, + isMetaKey: {get: function() { + return isMetaKey; + }}, + isCtrlKey: {get: function() { + return isCtrlKey; + }}, + isKey: {get: function() { + return isKey; + }}, + __esModule: {value: true} +}); +var $__array__; +var arrayEach = ($__array__ = require("array"), $__array__ && $__array__.__esModule && $__array__ || {default: $__array__}).arrayEach; +var KEY_CODES = { + MOUSE_LEFT: 1, + MOUSE_RIGHT: 3, + MOUSE_MIDDLE: 2, + BACKSPACE: 8, + COMMA: 188, + INSERT: 45, + DELETE: 46, + END: 35, + ENTER: 13, + ESCAPE: 27, + CONTROL_LEFT: 91, + COMMAND_LEFT: 17, + COMMAND_RIGHT: 93, + ALT: 18, + HOME: 36, + PAGE_DOWN: 34, + PAGE_UP: 33, + PERIOD: 190, + SPACE: 32, + SHIFT: 16, + CAPS_LOCK: 20, + TAB: 9, + ARROW_RIGHT: 39, + ARROW_LEFT: 37, + ARROW_UP: 38, + ARROW_DOWN: 40, + F1: 112, + F2: 113, + F3: 114, + F4: 115, + F5: 116, + F6: 117, + F7: 118, + F8: 119, + F9: 120, + F10: 121, + F11: 122, + F12: 123, + A: 65, + X: 88, + C: 67, + V: 86 +}; +function isPrintableChar(keyCode) { + return ((keyCode == 32) || (keyCode >= 48 && keyCode <= 57) || (keyCode >= 96 && keyCode <= 111) || (keyCode >= 186 && keyCode <= 192) || (keyCode >= 219 && keyCode <= 222) || keyCode >= 226 || (keyCode >= 65 && keyCode <= 90)); +} +function isMetaKey(keyCode) { + var metaKeys = [KEY_CODES.ARROW_DOWN, KEY_CODES.ARROW_UP, KEY_CODES.ARROW_LEFT, KEY_CODES.ARROW_RIGHT, KEY_CODES.HOME, KEY_CODES.END, KEY_CODES.DELETE, KEY_CODES.BACKSPACE, KEY_CODES.F1, KEY_CODES.F2, KEY_CODES.F3, KEY_CODES.F4, KEY_CODES.F5, KEY_CODES.F6, KEY_CODES.F7, KEY_CODES.F8, KEY_CODES.F9, KEY_CODES.F10, KEY_CODES.F11, KEY_CODES.F12, KEY_CODES.TAB, KEY_CODES.PAGE_DOWN, KEY_CODES.PAGE_UP, KEY_CODES.ENTER, KEY_CODES.ESCAPE, KEY_CODES.SHIFT, KEY_CODES.CAPS_LOCK, KEY_CODES.ALT]; + return metaKeys.indexOf(keyCode) !== -1; +} +function isCtrlKey(keyCode) { + return [KEY_CODES.CONTROL_LEFT, 224, KEY_CODES.COMMAND_LEFT, KEY_CODES.COMMAND_RIGHT].indexOf(keyCode) !== -1; +} +function isKey(keyCode, baseCode) { + var keys = baseCode.split('|'); + var result = false; + arrayEach(keys, function(key) { + if (keyCode === KEY_CODES[key]) { + result = true; + return false; + } + }); + return result; +} + +//# +},{"array":42}],54:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + localHooks: {get: function() { + return localHooks; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_array__, + $___46__46__47_helpers_47_object__; +var arrayEach = ($___46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47_helpers_47_array__ && $___46__46__47_helpers_47_array__.__esModule && $___46__46__47_helpers_47_array__ || {default: $___46__46__47_helpers_47_array__}).arrayEach; +var defineGetter = ($___46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47_helpers_47_object__ && $___46__46__47_helpers_47_object__.__esModule && $___46__46__47_helpers_47_object__ || {default: $___46__46__47_helpers_47_object__}).defineGetter; +var MIXIN_NAME = 'localHooks'; +var localHooks = { + _localHooks: Object.create(null), + addLocalHook: function(key, callback) { + if (!this._localHooks[key]) { + this._localHooks[key] = []; + } + this._localHooks[key].push(callback); + }, + runLocalHooks: function(key) { + for (var params = [], + $__3 = 1; $__3 < arguments.length; $__3++) + params[$__3 - 1] = arguments[$__3]; + var $__2 = this; + if (this._localHooks[key]) { + arrayEach(this._localHooks[key], (function(callback) { + return callback.apply($__2, params); + })); + } + }, + clearLocalHooks: function() { + this._localHooks = {}; + } +}; +defineGetter(localHooks, 'MIXIN_NAME', MIXIN_NAME, { + writable: false, + enumerable: false +}); +; +Handsontable.utils = Handsontable.utils || {}; +Handsontable.utils.localHooks = localHooks; + +//# +},{"helpers/array":42,"helpers/object":50}],55:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + MultiMap: {get: function() { + return MultiMap; + }}, + __esModule: {value: true} +}); +; +window.MultiMap = MultiMap; +function MultiMap() { + var map = { + arrayMap: [], + weakMap: new WeakMap() + }; + return { + get: function(key) { + if (canBeAnArrayMapKey(key)) { + return map.arrayMap[key]; + } else if (canBeAWeakMapKey(key)) { + return map.weakMap.get(key); + } + }, + set: function(key, value) { + if (canBeAnArrayMapKey(key)) { + map.arrayMap[key] = value; + } else if (canBeAWeakMapKey(key)) { + map.weakMap.set(key, value); + } else { + throw new Error('Invalid key type'); + } + }, + delete: function(key) { + if (canBeAnArrayMapKey(key)) { + delete map.arrayMap[key]; + } else if (canBeAWeakMapKey(key)) { + map.weakMap.delete(key); + } + } + }; + function canBeAnArrayMapKey(obj) { + return obj !== null && !isNaNSymbol(obj) && (typeof obj == 'string' || typeof obj == 'number'); + } + function canBeAWeakMapKey(obj) { + return obj !== null && (typeof obj == 'object' || typeof obj == 'function'); + } + function isNaNSymbol(obj) { + return obj !== obj; + } +} + +//# +},{}],56:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + Hooks: {get: function() { + return Hooks; + }}, + __esModule: {value: true} +}); +var $__helpers_47_array__, + $__helpers_47_object__; +var REGISTERED_HOOKS = ['afterCellMetaReset', 'afterChange', 'afterChangesObserved', 'afterContextMenuDefaultOptions', 'afterContextMenuHide', 'afterContextMenuShow', 'afterCopyLimit', 'afterCreateCol', 'afterCreateRow', 'afterDeselect', 'afterDestroy', 'afterDocumentKeyDown', 'afterGetCellMeta', 'afterGetColHeader', 'afterGetRowHeader', 'afterInit', 'afterLoadData', 'afterMomentumScroll', 'afterOnCellCornerMouseDown', 'afterOnCellMouseDown', 'afterOnCellMouseOver', 'afterRemoveCol', 'afterRemoveRow', 'afterRender', 'afterRenderer', 'afterScrollHorizontally', 'afterScrollVertically', 'afterSelection', 'afterSelectionByProp', 'afterSelectionEnd', 'afterSelectionEndByProp', 'afterSetCellMeta', 'afterUpdateSettings', 'afterValidate', 'beforeAutofill', 'beforeCellAlignment', 'beforeChange', 'beforeChangeRender', 'beforeDrawBorders', 'beforeGetCellMeta', 'beforeInit', 'beforeInitWalkontable', 'beforeKeyDown', 'beforeOnCellMouseDown', 'beforeRemoveCol', 'beforeRemoveRow', 'beforeRender', 'beforeSetRangeEnd', 'beforeTouchScroll', 'beforeValidate', 'construct', 'init', 'modifyCol', 'modifyColHeader', 'modifyColWidth', 'modifyRow', 'modifyRowHeader', 'modifyRowHeight', 'persistentStateLoad', 'persistentStateReset', 'persistentStateSave', 'beforeColumnSort', 'afterColumnSort', 'afterAutofillApplyValues', 'modifyCopyableRange', 'beforeColumnMove', 'afterColumnMove', 'beforeRowMove', 'afterRowMove', 'beforeColumnResize', 'afterColumnResize', 'beforeRowResize', 'afterRowResize']; +var arrayEach = ($__helpers_47_array__ = require("helpers/array"), $__helpers_47_array__ && $__helpers_47_array__.__esModule && $__helpers_47_array__ || {default: $__helpers_47_array__}).arrayEach; +var objectEach = ($__helpers_47_object__ = require("helpers/object"), $__helpers_47_object__ && $__helpers_47_object__.__esModule && $__helpers_47_object__ || {default: $__helpers_47_object__}).objectEach; +var Hooks = function Hooks() { + this.globalBucket = this.createEmptyBucket(); +}; +($traceurRuntime.createClass)(Hooks, { + createEmptyBucket: function() { + var bucket = Object.create(null); + arrayEach(REGISTERED_HOOKS, (function(hook) { + return (bucket[hook] = []); + })); + return bucket; + }, + getBucket: function() { + var context = arguments[0] !== (void 0) ? arguments[0] : null; + if (context) { + if (!context.pluginHookBucket) { + context.pluginHookBucket = this.createEmptyBucket(); + } + return context.pluginHookBucket; + } + return this.globalBucket; + }, + add: function(key, callback) { + var context = arguments[2] !== (void 0) ? arguments[2] : null; + var $__2 = this; + if (Array.isArray(callback)) { + arrayEach(callback, (function(c) { + return ($__2.add(key, c, context)); + })); + } else { + var bucket = this.getBucket(context); + if (typeof bucket[key] === 'undefined') { + this.register(key); + bucket[key] = []; + } + callback.skip = false; + if (bucket[key].indexOf(callback) === -1) { + bucket[key].push(callback); + } + } + return this; + }, + once: function(key, callback) { + var context = arguments[2] !== (void 0) ? arguments[2] : null; + var $__2 = this; + if (Array.isArray(callback)) { + arrayEach(callback, (function(c) { + return ($__2.once(key, c, context)); + })); + } else { + callback.runOnce = true; + this.add(key, callback, context); + } + }, + remove: function(key, callback) { + var context = arguments[2] !== (void 0) ? arguments[2] : null; + var bucket = this.getBucket(context); + if (typeof bucket[key] !== 'undefined') { + if (bucket[key].indexOf(callback) >= 0) { + callback.skip = true; + return true; + } + } + return false; + }, + has: function(key) { + var context = arguments[1] !== (void 0) ? arguments[1] : null; + var bucket = this.getBucket(context); + return bucket[key] !== void 0 && bucket[key].length ? true : false; + }, + run: function(context, key, p1, p2, p3, p4, p5, p6) { + { + var globalHandlers = this.globalBucket[key]; + var index = -1; + var length = globalHandlers ? globalHandlers.length : 0; + if (length) { + while (++index < length) { + if (!globalHandlers[index] || globalHandlers[index].skip) { + continue; + } + var res = globalHandlers[index].call(context, p1, p2, p3, p4, p5, p6); + if (res !== void 0) { + p1 = res; + } + if (globalHandlers[index] && globalHandlers[index].runOnce) { + this.remove(key, globalHandlers[index]); + } + } + } + } + { + var localHandlers = this.getBucket(context)[key]; + var index$__4 = -1; + var length$__5 = localHandlers ? localHandlers.length : 0; + if (length$__5) { + while (++index$__4 < length$__5) { + if (!localHandlers[index$__4] || localHandlers[index$__4].skip) { + continue; + } + var res$__6 = localHandlers[index$__4].call(context, p1, p2, p3, p4, p5, p6); + if (res$__6 !== void 0) { + p1 = res$__6; + } + if (localHandlers[index$__4] && localHandlers[index$__4].runOnce) { + this.remove(key, localHandlers[index$__4], context); + } + } + } + } + return p1; + }, + destroy: function() { + var context = arguments[0] !== (void 0) ? arguments[0] : null; + objectEach(this.getBucket(context), (function(value, key, bucket) { + return (bucket[key].length = 0); + })); + }, + register: function(key) { + if (!this.isRegistered(key)) { + REGISTERED_HOOKS.push(key); + } + }, + deregister: function(key) { + if (this.isRegistered(key)) { + REGISTERED_HOOKS.splice(REGISTERED_HOOKS.indexOf(key), 1); + } + }, + isRegistered: function(key) { + return REGISTERED_HOOKS.indexOf(key) >= 0; + }, + getRegistered: function() { + return REGISTERED_HOOKS; + } +}, {}); +; +Handsontable.utils = Handsontable.utils || {}; +Handsontable.utils.Hooks = Hooks; + +//# +},{"helpers/array":42,"helpers/object":50}],57:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + registerPlugin: {get: function() { + return registerPlugin; + }}, + getPlugin: {get: function() { + return getPlugin; + }}, + getRegistredPluginNames: {get: function() { + return getRegistredPluginNames; + }}, + getPluginName: {get: function() { + return getPluginName; + }}, + __esModule: {value: true} +}); +var $__helpers_47_object__, + $__helpers_47_string__; +var objectEach = ($__helpers_47_object__ = require("helpers/object"), $__helpers_47_object__ && $__helpers_47_object__.__esModule && $__helpers_47_object__ || {default: $__helpers_47_object__}).objectEach; +var toUpperCaseFirst = ($__helpers_47_string__ = require("helpers/string"), $__helpers_47_string__ && $__helpers_47_string__.__esModule && $__helpers_47_string__ || {default: $__helpers_47_string__}).toUpperCaseFirst; +var registeredPlugins = new WeakMap(); +Handsontable.plugins = Handsontable.plugins || {}; +function registerPlugin(pluginName, PluginClass) { + pluginName = toUpperCaseFirst(pluginName); + Handsontable.plugins[pluginName] = PluginClass; + Handsontable.hooks.add('construct', function() { + var holder; + if (!registeredPlugins.has(this)) { + registeredPlugins.set(this, {}); + } + holder = registeredPlugins.get(this); + if (!holder[pluginName]) { + holder[pluginName] = new PluginClass(this); + } + }); + Handsontable.hooks.add('afterDestroy', function() { + if (registeredPlugins.has(this)) { + var pluginsHolder = registeredPlugins.get(this); + objectEach(pluginsHolder, (function(plugin) { + return plugin.destroy(); + })); + registeredPlugins.delete(this); + } + }); +} +function getPlugin(instance, pluginName) { + if (typeof pluginName != 'string') { + throw Error('Only strings can be passed as "plugin" parameter'); + } + var _pluginName = toUpperCaseFirst(pluginName); + if (!registeredPlugins.has(instance) || !registeredPlugins.get(instance)[_pluginName]) { + return void 0; + } + return registeredPlugins.get(instance)[_pluginName]; +} +function getRegistredPluginNames(hotInstance) { + return registeredPlugins.has(hotInstance) ? Object.keys(registeredPlugins.get(hotInstance)) : []; +} +function getPluginName(hotInstance, plugin) { + var pluginName = null; + if (registeredPlugins.has(hotInstance)) { + objectEach(registeredPlugins.get(hotInstance), (function(pluginInstance, name) { + if (pluginInstance === plugin) { + pluginName = name; + } + })); + } + return pluginName; +} +; +Handsontable.plugins.utils = Handsontable.plugins.utils || {}; +Handsontable.plugins.registerPlugin = registerPlugin; + +//# +},{"helpers/object":50,"helpers/string":52}],58:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + default: {get: function() { + return $__default; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_object__, + $___46__46__47_helpers_47_array__, + $___46__46__47_plugins__; +var $__0 = ($___46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47_helpers_47_object__ && $___46__46__47_helpers_47_object__.__esModule && $___46__46__47_helpers_47_object__ || {default: $___46__46__47_helpers_47_object__}), + defineGetter = $__0.defineGetter, + objectEach = $__0.objectEach; +var arrayEach = ($___46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47_helpers_47_array__ && $___46__46__47_helpers_47_array__.__esModule && $___46__46__47_helpers_47_array__ || {default: $___46__46__47_helpers_47_array__}).arrayEach; +var $__2 = ($___46__46__47_plugins__ = require("plugins"), $___46__46__47_plugins__ && $___46__46__47_plugins__.__esModule && $___46__46__47_plugins__ || {default: $___46__46__47_plugins__}), + getRegistredPluginNames = $__2.getRegistredPluginNames, + getPluginName = $__2.getPluginName; +var privatePool = new WeakMap(); +var initializedPlugins = null; +var BasePlugin = function BasePlugin(hotInstance) { + var $__3 = this; + defineGetter(this, 'hot', hotInstance, {writable: false}); + privatePool.set(this, {hooks: {}}); + initializedPlugins = null; + this.pluginName = null; + this.pluginsInitializedCallbacks = []; + this.isPluginsReady = false; + this.enabled = false; + this.initialized = false; + this.hot.addHook('afterPluginsInitialized', (function() { + return $__3.onAfterPluginsInitialized(); + })); + this.hot.addHook('afterUpdateSettings', (function() { + return $__3.onUpdateSettings(); + })); + this.hot.addHook('beforeInit', (function() { + return $__3.init(); + })); +}; +($traceurRuntime.createClass)(BasePlugin, { + init: function() { + this.pluginName = getPluginName(this.hot, this); + if (this.isEnabled && this.isEnabled()) { + this.enablePlugin(); + } + if (!initializedPlugins) { + initializedPlugins = getRegistredPluginNames(this.hot); + } + if (initializedPlugins.indexOf(this.pluginName) >= 0) { + initializedPlugins.splice(initializedPlugins.indexOf(this.pluginName), 1); + } + if (!initializedPlugins.length) { + this.hot.runHooks('afterPluginsInitialized'); + } + this.initialized = true; + }, + enablePlugin: function() { + this.enabled = true; + }, + disablePlugin: function() { + if (this.eventManager) { + this.eventManager.clear(); + } + this.clearHooks(); + this.enabled = false; + }, + addHook: function(name, callback) { + var hooks = privatePool.get(this).hooks[name] = (privatePool.get(this).hooks[name] || []); + this.hot.addHook(name, callback); + hooks.push(callback); + privatePool.get(this).hooks[name] = hooks; + }, + removeHooks: function(name) { + var $__3 = this; + arrayEach(privatePool.get(this).hooks[name] || [], (function(callback) { + $__3.hot.removeHook(name, callback); + })); + }, + clearHooks: function() { + var $__3 = this; + var hooks = privatePool.get(this).hooks; + objectEach(hooks, (function(callbacks, name) { + return $__3.removeHooks(name); + })); + hooks.length = 0; + }, + callOnPluginsReady: function(callback) { + if (this.isPluginsReady) { + callback(); + } else { + this.pluginsInitializedCallbacks.push(callback); + } + }, + onAfterPluginsInitialized: function() { + arrayEach(this.pluginsInitializedCallbacks, (function(callback) { + return callback(); + })); + this.pluginsInitializedCallbacks.length = 0; + this.isPluginsReady = true; + }, + onUpdateSettings: function() { + if (this.isEnabled) { + if (this.enabled && !this.isEnabled()) { + this.disablePlugin(); + } + if (!this.enabled && this.isEnabled()) { + this.enablePlugin(); + } + if (this.enabled && this.isEnabled()) { + this.updatePlugin(); + } + } + }, + updatePlugin: function() {}, + destroy: function() { + var $__3 = this; + if (this.eventManager) { + this.eventManager.destroy(); + } + this.clearHooks(); + objectEach(this, (function(value, property) { + if (property !== 'hot') { + $__3[property] = null; + } + })); + delete this.hot; + } +}, {}); +var $__default = BasePlugin; +Handsontable.plugins.BasePlugin = BasePlugin; + +//# +},{"helpers/array":42,"helpers/object":50,"plugins":57}],59:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + AutoColumnSize: {get: function() { + return AutoColumnSize; + }}, + __esModule: {value: true} +}); +var $___46__46__47__95_base__, + $___46__46__47__46__46__47_helpers_47_array__, + $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_utils_47_ghostTable__, + $___46__46__47__46__46__47_helpers_47_object__, + $___46__46__47__46__46__47_helpers_47_number__, + $___46__46__47__46__46__47_plugins__, + $___46__46__47__46__46__47_utils_47_samplesGenerator__, + $___46__46__47__46__46__47_helpers_47_string__, + $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__; +var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default; +var $__1 = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}), + arrayEach = $__1.arrayEach, + arrayFilter = $__1.arrayFilter; +var $__2 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + cancelAnimationFrame = $__2.cancelAnimationFrame, + requestAnimationFrame = $__2.requestAnimationFrame, + isVisible = $__2.isVisible; +var GhostTable = ($___46__46__47__46__46__47_utils_47_ghostTable__ = require("utils/ghostTable"), $___46__46__47__46__46__47_utils_47_ghostTable__ && $___46__46__47__46__46__47_utils_47_ghostTable__.__esModule && $___46__46__47__46__46__47_utils_47_ghostTable__ || {default: $___46__46__47__46__46__47_utils_47_ghostTable__}).GhostTable; +var $__4 = ($___46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47_helpers_47_object__}), + isObject = $__4.isObject, + objectEach = $__4.objectEach; +var $__5 = ($___46__46__47__46__46__47_helpers_47_number__ = require("helpers/number"), $___46__46__47__46__46__47_helpers_47_number__ && $___46__46__47__46__46__47_helpers_47_number__.__esModule && $___46__46__47__46__46__47_helpers_47_number__ || {default: $___46__46__47__46__46__47_helpers_47_number__}), + valueAccordingPercent = $__5.valueAccordingPercent, + rangeEach = $__5.rangeEach; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var SamplesGenerator = ($___46__46__47__46__46__47_utils_47_samplesGenerator__ = require("utils/samplesGenerator"), $___46__46__47__46__46__47_utils_47_samplesGenerator__ && $___46__46__47__46__46__47_utils_47_samplesGenerator__.__esModule && $___46__46__47__46__46__47_utils_47_samplesGenerator__ || {default: $___46__46__47__46__46__47_utils_47_samplesGenerator__}).SamplesGenerator; +var isPercentValue = ($___46__46__47__46__46__47_helpers_47_string__ = require("helpers/string"), $___46__46__47__46__46__47_helpers_47_string__ && $___46__46__47__46__46__47_helpers_47_string__.__esModule && $___46__46__47__46__46__47_helpers_47_string__ || {default: $___46__46__47__46__46__47_helpers_47_string__}).isPercentValue; +var WalkontableViewportColumnsCalculator = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__ = require("3rdparty/walkontable/src/calculator/viewportColumns"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__}).WalkontableViewportColumnsCalculator; +var AutoColumnSize = function AutoColumnSize(hotInstance) { + var $__10 = this; + $traceurRuntime.superConstructor($AutoColumnSize).call(this, hotInstance); + this.widths = []; + this.ghostTable = new GhostTable(this.hot); + this.samplesGenerator = new SamplesGenerator((function(row, col) { + return $__10.hot.getDataAtCell(row, col); + })); + this.firstCalculation = true; + this.inProgress = false; + this.addHook('beforeColumnResize', (function(col, size, isDblClick) { + return $__10.onBeforeColumnResize(col, size, isDblClick); + })); +}; +var $AutoColumnSize = AutoColumnSize; +($traceurRuntime.createClass)(AutoColumnSize, { + isEnabled: function() { + return this.hot.getSettings().autoColumnSize !== false && !this.hot.getSettings().colWidths; + }, + enablePlugin: function() { + var $__10 = this; + if (this.enabled) { + return; + } + var setting = this.hot.getSettings().autoColumnSize; + var samplingRatio = setting && setting.hasOwnProperty('samplingRatio') ? this.hot.getSettings().autoColumnSize.samplingRatio : void 0; + if (samplingRatio && !isNaN(samplingRatio)) { + this.samplesGenerator.customSampleCount = parseInt(samplingRatio, 10); + } + this.addHook('afterLoadData', (function() { + return $__10.onAfterLoadData(); + })); + this.addHook('beforeChange', (function(changes) { + return $__10.onBeforeChange(changes); + })); + this.addHook('beforeRender', (function(force) { + return $__10.onBeforeRender(force); + })); + this.addHook('modifyColWidth', (function(width, col) { + return $__10.getColumnWidth(col, width); + })); + $traceurRuntime.superGet(this, $AutoColumnSize.prototype, "enablePlugin").call(this); + }, + disablePlugin: function() { + $traceurRuntime.superGet(this, $AutoColumnSize.prototype, "disablePlugin").call(this); + }, + calculateColumnsWidth: function() { + var colRange = arguments[0] !== (void 0) ? arguments[0] : { + from: 0, + to: this.hot.countCols() - 1 + }; + var rowRange = arguments[1] !== (void 0) ? arguments[1] : { + from: 0, + to: this.hot.countRows() - 1 + }; + var force = arguments[2] !== (void 0) ? arguments[2] : false; + var $__10 = this; + if (typeof colRange === 'number') { + colRange = { + from: colRange, + to: colRange + }; + } + if (typeof rowRange === 'number') { + rowRange = { + from: rowRange, + to: rowRange + }; + } + rangeEach(colRange.from, colRange.to, (function(col) { + if (force || ($__10.widths[col] === void 0 && !$__10.hot._getColWidthFromSettings(col))) { + var samples = $__10.samplesGenerator.generateColumnSamples(col, rowRange); + samples.forEach((function(sample, col) { + return $__10.ghostTable.addColumn(col, sample); + })); + } + })); + if (this.ghostTable.columns.length) { + this.ghostTable.getWidths((function(col, width) { + return $__10.widths[col] = width; + })); + this.ghostTable.clean(); + } + }, + calculateAllColumnsWidth: function() { + var rowRange = arguments[0] !== (void 0) ? arguments[0] : { + from: 0, + to: this.hot.countRows() - 1 + }; + var $__10 = this; + var current = 0; + var length = this.hot.countCols() - 1; + var timer = null; + this.inProgress = true; + var loop = (function() { + if (!$__10.hot) { + cancelAnimationFrame(timer); + $__10.inProgress = false; + return; + } + $__10.calculateColumnsWidth({ + from: current, + to: Math.min(current + $AutoColumnSize.CALCULATION_STEP, length) + }, rowRange); + current = current + $AutoColumnSize.CALCULATION_STEP + 1; + if (current < length) { + timer = requestAnimationFrame(loop); + } else { + cancelAnimationFrame(timer); + $__10.inProgress = false; + $__10.hot.view.wt.wtOverlays.adjustElementsSize(true); + if ($__10.hot.view.wt.wtOverlays.leftOverlay.needFullRender) { + $__10.hot.view.wt.wtOverlays.leftOverlay.clone.draw(); + } + } + }); + if (this.firstCalculation && this.getSyncCalculationLimit()) { + this.calculateColumnsWidth({ + from: 0, + to: this.getSyncCalculationLimit() + }, rowRange); + this.firstCalculation = false; + current = this.getSyncCalculationLimit() + 1; + } + if (current < length) { + loop(); + } else { + this.inProgress = false; + } + }, + recalculateAllColumnsWidth: function() { + if (this.hot.view && isVisible(this.hot.view.wt.wtTable.TABLE)) { + this.clearCache(); + this.calculateAllColumnsWidth(); + } + }, + getSyncCalculationLimit: function() { + var limit = $AutoColumnSize.SYNC_CALCULATION_LIMIT; + var colsLimit = this.hot.countCols() - 1; + if (isObject(this.hot.getSettings().autoColumnSize)) { + limit = this.hot.getSettings().autoColumnSize.syncLimit; + if (isPercentValue(limit)) { + limit = valueAccordingPercent(colsLimit, limit); + } else { + limit = limit >> 0; + } + } + return Math.min(limit, colsLimit); + }, + getColumnWidth: function(col) { + var defaultWidth = arguments[1]; + var keepMinimum = arguments[2] !== (void 0) ? arguments[2] : true; + var width = defaultWidth; + if (width === void 0) { + width = this.widths[col]; + if (keepMinimum && typeof width === 'number') { + width = Math.max(width, WalkontableViewportColumnsCalculator.DEFAULT_WIDTH); + } + } + return width; + }, + getFirstVisibleColumn: function() { + var wot = this.hot.view.wt; + if (wot.wtViewport.columnsVisibleCalculator) { + return wot.wtTable.getFirstVisibleColumn(); + } + if (wot.wtViewport.columnsRenderCalculator) { + return wot.wtTable.getFirstRenderedColumn(); + } + return -1; + }, + getLastVisibleColumn: function() { + var wot = this.hot.view.wt; + if (wot.wtViewport.columnsVisibleCalculator) { + return wot.wtTable.getLastVisibleColumn(); + } + if (wot.wtViewport.columnsRenderCalculator) { + return wot.wtTable.getLastRenderedColumn(); + } + return -1; + }, + clearCache: function() { + this.widths.length = 0; + }, + isNeedRecalculate: function() { + return arrayFilter(this.widths, (function(item) { + return (item === void 0); + })).length ? true : false; + }, + onBeforeRender: function() { + var force = this.hot.renderCall; + this.calculateColumnsWidth({ + from: this.getFirstVisibleColumn(), + to: this.getLastVisibleColumn() + }, void 0, force); + if (this.isNeedRecalculate() && !this.inProgress) { + this.calculateAllColumnsWidth(); + } + }, + onAfterLoadData: function() { + var $__10 = this; + if (this.hot.view) { + this.recalculateAllColumnsWidth(); + } else { + setTimeout((function() { + if ($__10.hot) { + $__10.recalculateAllColumnsWidth(); + } + }), 0); + } + }, + onBeforeChange: function(changes) { + var $__10 = this; + arrayEach(changes, (function(data) { + return $__10.widths[data[1]] = void 0; + })); + }, + onBeforeColumnResize: function(col, size, isDblClick) { + if (isDblClick) { + this.calculateColumnsWidth(col, void 0, true); + size = this.getColumnWidth(col, void 0, false); + } + return size; + }, + destroy: function() { + this.ghostTable.clean(); + $traceurRuntime.superGet(this, $AutoColumnSize.prototype, "destroy").call(this); + } +}, { + get CALCULATION_STEP() { + return 50; + }, + get SYNC_CALCULATION_LIMIT() { + return 50; + } +}, BasePlugin); +; +registerPlugin('autoColumnSize', AutoColumnSize); + +//# +},{"3rdparty/walkontable/src/calculator/viewportColumns":3,"_base":58,"helpers/array":42,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/string":52,"plugins":57,"utils/ghostTable":98,"utils/samplesGenerator":99}],60:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + AutoRowSize: {get: function() { + return AutoRowSize; + }}, + __esModule: {value: true} +}); +var $___46__46__47__95_base__, + $___46__46__47__46__46__47_helpers_47_array__, + $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_utils_47_ghostTable__, + $___46__46__47__46__46__47_helpers_47_object__, + $___46__46__47__46__46__47_helpers_47_number__, + $___46__46__47__46__46__47_plugins__, + $___46__46__47__46__46__47_utils_47_samplesGenerator__, + $___46__46__47__46__46__47_helpers_47_string__; +var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default; +var $__1 = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}), + arrayEach = $__1.arrayEach, + arrayFilter = $__1.arrayFilter; +var $__2 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + cancelAnimationFrame = $__2.cancelAnimationFrame, + requestAnimationFrame = $__2.requestAnimationFrame, + isVisible = $__2.isVisible; +var GhostTable = ($___46__46__47__46__46__47_utils_47_ghostTable__ = require("utils/ghostTable"), $___46__46__47__46__46__47_utils_47_ghostTable__ && $___46__46__47__46__46__47_utils_47_ghostTable__.__esModule && $___46__46__47__46__46__47_utils_47_ghostTable__ || {default: $___46__46__47__46__46__47_utils_47_ghostTable__}).GhostTable; +var $__4 = ($___46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47_helpers_47_object__}), + isObject = $__4.isObject, + objectEach = $__4.objectEach; +var $__5 = ($___46__46__47__46__46__47_helpers_47_number__ = require("helpers/number"), $___46__46__47__46__46__47_helpers_47_number__ && $___46__46__47__46__46__47_helpers_47_number__.__esModule && $___46__46__47__46__46__47_helpers_47_number__ || {default: $___46__46__47__46__46__47_helpers_47_number__}), + valueAccordingPercent = $__5.valueAccordingPercent, + rangeEach = $__5.rangeEach; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var SamplesGenerator = ($___46__46__47__46__46__47_utils_47_samplesGenerator__ = require("utils/samplesGenerator"), $___46__46__47__46__46__47_utils_47_samplesGenerator__ && $___46__46__47__46__46__47_utils_47_samplesGenerator__.__esModule && $___46__46__47__46__46__47_utils_47_samplesGenerator__ || {default: $___46__46__47__46__46__47_utils_47_samplesGenerator__}).SamplesGenerator; +var isPercentValue = ($___46__46__47__46__46__47_helpers_47_string__ = require("helpers/string"), $___46__46__47__46__46__47_helpers_47_string__ && $___46__46__47__46__46__47_helpers_47_string__.__esModule && $___46__46__47__46__46__47_helpers_47_string__ || {default: $___46__46__47__46__46__47_helpers_47_string__}).isPercentValue; +var AutoRowSize = function AutoRowSize(hotInstance) { + var $__9 = this; + $traceurRuntime.superConstructor($AutoRowSize).call(this, hotInstance); + this.heights = []; + this.ghostTable = new GhostTable(this.hot); + this.samplesGenerator = new SamplesGenerator((function(row, col) { + return $__9.hot.getDataAtCell(row, col); + })); + this.firstCalculation = true; + this.inProgress = false; + this.addHook('beforeRowResize', (function(row, size, isDblClick) { + return $__9.onBeforeRowResize(row, size, isDblClick); + })); +}; +var $AutoRowSize = AutoRowSize; +($traceurRuntime.createClass)(AutoRowSize, { + isEnabled: function() { + return this.hot.getSettings().autoRowSize === true || isObject(this.hot.getSettings().autoRowSize); + }, + enablePlugin: function() { + var $__9 = this; + if (this.enabled) { + return; + } + var setting = this.hot.getSettings().autoRowSize; + var samplingRatio = setting && setting.hasOwnProperty('samplingRatio') ? this.hot.getSettings().autoRowSize.samplingRatio : void 0; + if (samplingRatio && !isNaN(samplingRatio)) { + this.samplesGenerator.customSampleCount = parseInt(samplingRatio, 10); + } + this.addHook('afterLoadData', (function() { + return $__9.onAfterLoadData(); + })); + this.addHook('beforeChange', (function(changes) { + return $__9.onBeforeChange(changes); + })); + this.addHook('beforeColumnMove', (function() { + return $__9.recalculateAllRowsHeight(); + })); + this.addHook('beforeColumnResize', (function() { + return $__9.recalculateAllRowsHeight(); + })); + this.addHook('beforeColumnSort', (function() { + return $__9.clearCache(); + })); + this.addHook('beforeRender', (function(force) { + return $__9.onBeforeRender(force); + })); + this.addHook('beforeRowMove', (function(rowStart, rowEnd) { + return $__9.onBeforeRowMove(rowStart, rowEnd); + })); + this.addHook('modifyRowHeight', (function(height, row) { + return $__9.getRowHeight(row, height); + })); + $traceurRuntime.superGet(this, $AutoRowSize.prototype, "enablePlugin").call(this); + }, + disablePlugin: function() { + $traceurRuntime.superGet(this, $AutoRowSize.prototype, "disablePlugin").call(this); + }, + calculateRowsHeight: function() { + var rowRange = arguments[0] !== (void 0) ? arguments[0] : { + from: 0, + to: this.hot.countRows() - 1 + }; + var colRange = arguments[1] !== (void 0) ? arguments[1] : { + from: 0, + to: this.hot.countCols() - 1 + }; + var force = arguments[2] !== (void 0) ? arguments[2] : false; + var $__9 = this; + if (typeof rowRange === 'number') { + rowRange = { + from: rowRange, + to: rowRange + }; + } + if (typeof colRange === 'number') { + colRange = { + from: colRange, + to: colRange + }; + } + rangeEach(rowRange.from, rowRange.to, (function(row) { + if (force || $__9.heights[row] === void 0) { + var samples = $__9.samplesGenerator.generateRowSamples(row, colRange); + samples.forEach((function(sample, row) { + return $__9.ghostTable.addRow(row, sample); + })); + } + })); + if (this.ghostTable.rows.length) { + this.ghostTable.getHeights((function(row, height) { + return $__9.heights[row] = height; + })); + this.ghostTable.clean(); + } + }, + calculateAllRowsHeight: function() { + var colRange = arguments[0] !== (void 0) ? arguments[0] : { + from: 0, + to: this.hot.countCols() - 1 + }; + var $__9 = this; + var current = 0; + var length = this.hot.countRows() - 1; + var timer = null; + this.inProgress = true; + var loop = (function() { + if (!$__9.hot) { + cancelAnimationFrame(timer); + $__9.inProgress = false; + return; + } + $__9.calculateRowsHeight({ + from: current, + to: Math.min(current + $AutoRowSize.CALCULATION_STEP, length) + }, colRange); + current = current + $AutoRowSize.CALCULATION_STEP + 1; + if (current < length) { + timer = requestAnimationFrame(loop); + } else { + cancelAnimationFrame(timer); + $__9.inProgress = false; + $__9.hot.view.wt.wtOverlays.adjustElementsSize(true); + if ($__9.hot.view.wt.wtOverlays.leftOverlay.needFullRender) { + $__9.hot.view.wt.wtOverlays.leftOverlay.clone.draw(); + } + } + }); + if (this.firstCalculation && this.getSyncCalculationLimit()) { + this.calculateRowsHeight({ + from: 0, + to: this.getSyncCalculationLimit() + }, colRange); + this.firstCalculation = false; + current = this.getSyncCalculationLimit() + 1; + } + if (current < length) { + loop(); + } else { + this.inProgress = false; + } + }, + recalculateAllRowsHeight: function() { + if (isVisible(this.hot.view.wt.wtTable.TABLE)) { + this.clearCache(); + this.calculateAllRowsHeight(); + } + }, + getSyncCalculationLimit: function() { + var limit = $AutoRowSize.SYNC_CALCULATION_LIMIT; + var rowsLimit = this.hot.countRows() - 1; + if (isObject(this.hot.getSettings().autoRowSize)) { + limit = this.hot.getSettings().autoRowSize.syncLimit; + if (isPercentValue(limit)) { + limit = valueAccordingPercent(rowsLimit, limit); + } else { + limit = limit >> 0; + } + } + return Math.min(limit, rowsLimit); + }, + getRowHeight: function(row) { + var defaultHeight = arguments[1]; + var height = defaultHeight; + if (this.heights[row] !== void 0 && this.heights[row] > (defaultHeight || 0)) { + height = this.heights[row]; + } + return height; + }, + getFirstVisibleRow: function() { + var wot = this.hot.view.wt; + if (wot.wtViewport.rowsVisibleCalculator) { + return wot.wtTable.getFirstVisibleRow(); + } + if (wot.wtViewport.rowsRenderCalculator) { + return wot.wtTable.getFirstRenderedRow(); + } + return -1; + }, + getLastVisibleRow: function() { + var wot = this.hot.view.wt; + if (wot.wtViewport.rowsVisibleCalculator) { + return wot.wtTable.getLastVisibleRow(); + } + if (wot.wtViewport.rowsRenderCalculator) { + return wot.wtTable.getLastRenderedRow(); + } + return -1; + }, + clearCache: function() { + this.heights.length = 0; + }, + clearCacheByRange: function(range) { + var $__9 = this; + if (typeof range === 'number') { + range = { + from: range, + to: range + }; + } + rangeEach(Math.min(range.from, range.to), Math.max(range.from, range.to), (function(row) { + return $__9.heights[row] = void 0; + })); + }, + isNeedRecalculate: function() { + return arrayFilter(this.heights, (function(item) { + return (item === void 0); + })).length ? true : false; + }, + onBeforeRender: function() { + var force = this.hot.renderCall; + this.calculateRowsHeight({ + from: this.getFirstVisibleRow(), + to: this.getLastVisibleRow() + }, void 0, force); + if (this.isNeedRecalculate() && !this.inProgress) { + this.calculateAllRowsHeight(); + } + }, + onBeforeRowMove: function(from, to) { + this.clearCacheByRange({ + from: from, + to: to + }); + this.calculateAllRowsHeight(); + }, + onBeforeRowResize: function(row, size, isDblClick) { + if (isDblClick) { + this.calculateRowsHeight(row, void 0, true); + size = this.getRowHeight(row); + } + return size; + }, + onAfterLoadData: function() { + var $__9 = this; + if (this.hot.view) { + this.recalculateAllRowsHeight(); + } else { + setTimeout((function() { + if ($__9.hot) { + $__9.recalculateAllRowsHeight(); + } + }), 0); + } + }, + onBeforeChange: function(changes) { + var range = null; + if (changes.length === 1) { + range = changes[0][0]; + } else if (changes.length > 1) { + range = { + from: changes[0][0], + to: changes[changes.length - 1][0] + }; + } + if (range !== null) { + this.clearCacheByRange(range); + } + }, + destroy: function() { + this.ghostTable.clean(); + $traceurRuntime.superGet(this, $AutoRowSize.prototype, "destroy").call(this); + } +}, { + get CALCULATION_STEP() { + return 50; + }, + get SYNC_CALCULATION_LIMIT() { + return 500; + } +}, BasePlugin); +; +registerPlugin('autoRowSize', AutoRowSize); + +//# +},{"_base":58,"helpers/array":42,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/string":52,"plugins":57,"utils/ghostTable":98,"utils/samplesGenerator":99}],61:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + Autofill: {get: function() { + return Autofill; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_eventManager__, + $___46__46__47__46__46__47_plugins__, + $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + offset = $__0.offset, + outerHeight = $__0.outerHeight, + outerWidth = $__0.outerWidth; +var eventManagerObject = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).eventManager; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var WalkontableCellCoords = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords; +; +function getDeltas(start, end, data, direction) { + var rlength = data.length, + clength = data ? data[0].length : 0, + deltas = [], + arr = [], + diffRow, + diffCol, + startValue, + endValue, + delta; + diffRow = end.row - start.row; + diffCol = end.col - start.col; + if (['down', 'up'].indexOf(direction) !== -1) { + for (var col = 0; col <= diffCol; col++) { + startValue = parseInt(data[0][col], 10); + endValue = parseInt(data[rlength - 1][col], 10); + delta = (direction === 'down' ? (endValue - startValue) : (startValue - endValue)) / (rlength - 1) || 0; + arr.push(delta); + } + deltas.push(arr); + } + if (['right', 'left'].indexOf(direction) !== -1) { + for (var row = 0; row <= diffRow; row++) { + startValue = parseInt(data[row][0], 10); + endValue = parseInt(data[row][clength - 1], 10); + delta = (direction === 'right' ? (endValue - startValue) : (startValue - endValue)) / (clength - 1) || 0; + arr = []; + arr.push(delta); + deltas.push(arr); + } + } + return deltas; +} +function Autofill(instance) { + var _this = this, + mouseDownOnCellCorner = false, + wtOnCellCornerMouseDown, + wtOnCellMouseOver, + eventManager; + this.instance = instance; + this.addingStarted = false; + eventManager = eventManagerObject(instance); + function mouseUpCallback(event) { + if (!instance.autofill) { + return true; + } + if (instance.autofill.handle && instance.autofill.handle.isDragged) { + if (instance.autofill.handle.isDragged > 1) { + instance.autofill.apply(); + } + instance.autofill.handle.isDragged = 0; + mouseDownOnCellCorner = false; + } + } + function mouseMoveCallback(event) { + var tableBottom, + tableRight; + if (!_this.instance.autofill) { + return false; + } + tableBottom = offset(_this.instance.table).top - (window.pageYOffset || document.documentElement.scrollTop) + outerHeight(_this.instance.table); + tableRight = offset(_this.instance.table).left - (window.pageXOffset || document.documentElement.scrollLeft) + outerWidth(_this.instance.table); + if (_this.addingStarted === false && _this.instance.autofill.handle.isDragged > 0 && event.clientY > tableBottom && event.clientX <= tableRight) { + _this.instance.mouseDragOutside = true; + _this.addingStarted = true; + } else { + _this.instance.mouseDragOutside = false; + } + if (_this.instance.mouseDragOutside) { + setTimeout(function() { + _this.addingStarted = false; + _this.instance.alter('insert_row'); + }, 200); + } + } + eventManager.addEventListener(document, 'mouseup', mouseUpCallback); + eventManager.addEventListener(document, 'mousemove', mouseMoveCallback); + wtOnCellCornerMouseDown = this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown; + this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown = function(event) { + instance.autofill.handle.isDragged = 1; + mouseDownOnCellCorner = true; + wtOnCellCornerMouseDown(event); + }; + wtOnCellMouseOver = this.instance.view.wt.wtSettings.settings.onCellMouseOver; + this.instance.view.wt.wtSettings.settings.onCellMouseOver = function(event, coords, TD, wt) { + if (instance.autofill && mouseDownOnCellCorner && !instance.view.isMouseDown() && instance.autofill.handle && instance.autofill.handle.isDragged) { + instance.autofill.handle.isDragged++; + instance.autofill.showBorder(coords); + instance.autofill.checkIfNewRowNeeded(); + } + wtOnCellMouseOver(event, coords, TD, wt); + }; + this.instance.view.wt.wtSettings.settings.onCellCornerDblClick = function() { + instance.autofill.selectAdjacent(); + }; +} +Autofill.prototype.init = function() { + this.handle = {}; +}; +Autofill.prototype.disable = function() { + this.handle.disabled = true; +}; +Autofill.prototype.selectAdjacent = function() { + var select, + data, + r, + maxR, + c; + if (this.instance.selection.isMultiple()) { + select = this.instance.view.wt.selections.area.getCorners(); + } else { + select = this.instance.view.wt.selections.current.getCorners(); + } + data = this.instance.getData(); + rows: for (r = select[2] + 1; r < this.instance.countRows(); r++) { + for (c = select[1]; c <= select[3]; c++) { + if (data[r][c]) { + break rows; + } + } + if (!!data[r][select[1] - 1] || !!data[r][select[3] + 1]) { + maxR = r; + } + } + if (maxR) { + this.instance.view.wt.selections.fill.clear(); + this.instance.view.wt.selections.fill.add(new WalkontableCellCoords(select[0], select[1])); + this.instance.view.wt.selections.fill.add(new WalkontableCellCoords(maxR, select[3])); + this.apply(); + } +}; +Autofill.prototype.apply = function() { + var drag, + select, + start, + end, + _data, + direction, + deltas, + selRange; + this.handle.isDragged = 0; + if (this.instance.view.wt.selections.fill.isEmpty()) { + return; + } + drag = this.instance.view.wt.selections.fill.getCorners(); + this.instance.view.wt.selections.fill.clear(); + if (this.instance.selection.isMultiple()) { + select = this.instance.view.wt.selections.area.getCorners(); + } else { + select = this.instance.view.wt.selections.current.getCorners(); + } + Handsontable.hooks.run(this.instance, 'afterAutofillApplyValues', select, drag); + if (drag[0] === select[0] && drag[1] < select[1]) { + direction = 'left'; + start = new WalkontableCellCoords(drag[0], drag[1]); + end = new WalkontableCellCoords(drag[2], select[1] - 1); + } else if (drag[0] === select[0] && drag[3] > select[3]) { + direction = 'right'; + start = new WalkontableCellCoords(drag[0], select[3] + 1); + end = new WalkontableCellCoords(drag[2], drag[3]); + } else if (drag[0] < select[0] && drag[1] === select[1]) { + direction = 'up'; + start = new WalkontableCellCoords(drag[0], drag[1]); + end = new WalkontableCellCoords(select[0] - 1, drag[3]); + } else if (drag[2] > select[2] && drag[1] === select[1]) { + direction = 'down'; + start = new WalkontableCellCoords(select[2] + 1, drag[1]); + end = new WalkontableCellCoords(drag[2], drag[3]); + } + if (start && start.row > -1 && start.col > -1) { + selRange = { + from: this.instance.getSelectedRange().from, + to: this.instance.getSelectedRange().to + }; + _data = this.instance.getData(selRange.from.row, selRange.from.col, selRange.to.row, selRange.to.col); + deltas = getDeltas(start, end, _data, direction); + Handsontable.hooks.run(this.instance, 'beforeAutofill', start, end, _data); + this.instance.populateFromArray(start.row, start.col, _data, end.row, end.col, 'autofill', null, direction, deltas); + this.instance.selection.setRangeStart(new WalkontableCellCoords(drag[0], drag[1])); + this.instance.selection.setRangeEnd(new WalkontableCellCoords(drag[2], drag[3])); + } else { + this.instance.selection.refreshBorders(); + } +}; +Autofill.prototype.showBorder = function(coords) { + var topLeft = this.instance.getSelectedRange().getTopLeftCorner(), + bottomRight = this.instance.getSelectedRange().getBottomRightCorner(); + if (this.instance.getSettings().fillHandle !== 'horizontal' && (bottomRight.row < coords.row || topLeft.row > coords.row)) { + coords = new WalkontableCellCoords(coords.row, bottomRight.col); + } else if (this.instance.getSettings().fillHandle !== 'vertical') { + coords = new WalkontableCellCoords(bottomRight.row, coords.col); + } else { + return; + } + this.instance.view.wt.selections.fill.clear(); + this.instance.view.wt.selections.fill.add(this.instance.getSelectedRange().from); + this.instance.view.wt.selections.fill.add(this.instance.getSelectedRange().to); + this.instance.view.wt.selections.fill.add(coords); + this.instance.view.render(); +}; +Autofill.prototype.checkIfNewRowNeeded = function() { + var fillCorners, + selection, + tableRows = this.instance.countRows(), + that = this; + if (this.instance.view.wt.selections.fill.cellRange && this.addingStarted === false) { + selection = this.instance.getSelected(); + fillCorners = this.instance.view.wt.selections.fill.getCorners(); + if (selection[2] < tableRows - 1 && fillCorners[2] === tableRows - 1) { + this.addingStarted = true; + this.instance._registerTimeout(setTimeout(function() { + that.instance.alter('insert_row'); + that.addingStarted = false; + }, 200)); + } + } +}; +Handsontable.hooks.add('afterInit', function() { + var autofill = new Autofill(this); + if (typeof this.getSettings().fillHandle !== 'undefined') { + if (autofill.handle && this.getSettings().fillHandle === false) { + autofill.disable(); + } else if (!autofill.handle && this.getSettings().fillHandle !== false) { + this.autofill = autofill; + this.autofill.init(); + } + } +}); +Handsontable.Autofill = Autofill; + +//# +},{"3rdparty/walkontable/src/cell/coords":5,"eventManager":41,"helpers/dom/element":45,"plugins":57}],62:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + ColumnSorting: {get: function() { + return ColumnSorting; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_helpers_47_array__, + $___46__46__47__46__46__47_eventManager__, + $___46__46__47__95_base__, + $___46__46__47__46__46__47_plugins__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + closest = $__0.closest, + hasClass = $__0.hasClass, + index = $__0.index, + removeClass = $__0.removeClass; +var $__1 = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}), + arrayEach = $__1.arrayEach, + arrayMap = $__1.arrayMap, + arrayReduce = $__1.arrayReduce; +var eventManagerObject = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).eventManager; +var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +Handsontable.hooks.register('beforeColumnSort'); +Handsontable.hooks.register('afterColumnSort'); +var ColumnSorting = function ColumnSorting(hotInstance) { + $traceurRuntime.superConstructor($ColumnSorting).call(this, hotInstance); + this.sortIndicators = []; +}; +var $ColumnSorting = ColumnSorting; +($traceurRuntime.createClass)(ColumnSorting, { + isEnabled: function() { + return !!(this.hot.getSettings().columnSorting); + }, + enablePlugin: function() { + var $__5 = this; + if (this.enabled) { + return; + } + var _this = this; + this.hot.sortIndex = []; + this.hot.sort = function() { + var args = Array.prototype.slice.call(arguments); + return _this.sortByColumn.apply(_this, args); + }; + if (typeof this.hot.getSettings().observeChanges === 'undefined') { + this.enableObserveChangesPlugin(); + } + this.bindColumnSortingAfterClick(); + this.addHook('afterTrimRow', (function(row) { + return $__5.sort(); + })); + this.addHook('afterUntrimRow', (function(row) { + return $__5.sort(); + })); + this.addHook('modifyRow', (function(row) { + return $__5.translateRow(row); + })); + this.addHook('afterUpdateSettings', (function() { + return $__5.onAfterUpdateSettings(); + })); + this.addHook('afterGetColHeader', (function(col, TH) { + return $__5.getColHeader(col, TH); + })); + this.addHook('afterCreateRow', function() { + _this.afterCreateRow.apply(_this, arguments); + }); + this.addHook('afterRemoveRow', function() { + _this.afterRemoveRow.apply(_this, arguments); + }); + this.addHook('afterInit', (function() { + return $__5.sortBySettings(); + })); + this.addHook('afterLoadData', (function() { + $__5.hot.sortIndex = []; + if ($__5.hot.view) { + $__5.sortBySettings(); + } + })); + if (this.hot.view) { + this.sortBySettings(); + } + $traceurRuntime.superGet(this, $ColumnSorting.prototype, "enablePlugin").call(this); + }, + disablePlugin: function() { + this.hot.sort = void 0; + $traceurRuntime.superGet(this, $ColumnSorting.prototype, "disablePlugin").call(this); + }, + onAfterUpdateSettings: function() { + this.sortBySettings(); + }, + sortBySettings: function() { + var sortingSettings = this.hot.getSettings().columnSorting; + var loadedSortingState = this.loadSortingState(); + var sortingColumn; + var sortingOrder; + if (typeof loadedSortingState === 'undefined') { + sortingColumn = sortingSettings.column; + sortingOrder = sortingSettings.sortOrder; + } else { + sortingColumn = loadedSortingState.sortColumn; + sortingOrder = loadedSortingState.sortOrder; + } + this.sortByColumn(sortingColumn, sortingOrder); + }, + setSortingColumn: function(col, order) { + if (typeof col == 'undefined') { + this.hot.sortColumn = void 0; + this.hot.sortOrder = void 0; + return; + } else if (this.hot.sortColumn === col && typeof order == 'undefined') { + if (this.hot.sortOrder === false) { + this.hot.sortOrder = void 0; + } else { + this.hot.sortOrder = !this.hot.sortOrder; + } + } else { + this.hot.sortOrder = typeof order === 'undefined' ? true : order; + } + this.hot.sortColumn = col; + }, + sortByColumn: function(col, order) { + this.setSortingColumn(col, order); + if (typeof this.hot.sortColumn == 'undefined') { + return; + } + Handsontable.hooks.run(this.hot, 'beforeColumnSort', this.hot.sortColumn, this.hot.sortOrder); + this.sort(); + this.hot.render(); + this.saveSortingState(); + Handsontable.hooks.run(this.hot, 'afterColumnSort', this.hot.sortColumn, this.hot.sortOrder); + }, + saveSortingState: function() { + var sortingState = {}; + if (typeof this.hot.sortColumn != 'undefined') { + sortingState.sortColumn = this.hot.sortColumn; + } + if (typeof this.hot.sortOrder != 'undefined') { + sortingState.sortOrder = this.hot.sortOrder; + } + if (sortingState.hasOwnProperty('sortColumn') || sortingState.hasOwnProperty('sortOrder')) { + Handsontable.hooks.run(this.hot, 'persistentStateSave', 'columnSorting', sortingState); + } + }, + loadSortingState: function() { + var storedState = {}; + Handsontable.hooks.run(this.hot, 'persistentStateLoad', 'columnSorting', storedState); + return storedState.value; + }, + bindColumnSortingAfterClick: function() { + if (this.bindedSortEvent) { + return; + } + var eventManager = eventManagerObject(this.hot), + _this = this; + this.bindedSortEvent = true; + eventManager.addEventListener(this.hot.rootElement, 'click', function(e) { + if (hasClass(e.target, 'columnSorting')) { + var col = getColumn(e.target); + if (col === this.lastSortedColumn) { + switch (_this.hot.sortOrder) { + case void 0: + _this.sortOrderClass = 'ascending'; + break; + case true: + _this.sortOrderClass = 'descending'; + break; + case false: + _this.sortOrderClass = void 0; + } + } else { + _this.sortOrderClass = 'ascending'; + } + this.lastSortedColumn = col; + _this.sortByColumn(col); + } + }); + function countRowHeaders() { + var tr = _this.hot.view.TBODY.querySelector('tr'); + var length = 1; + if (tr) { + length = tr.querySelectorAll('th').length; + } + return length; + } + function getColumn(target) { + var TH = closest(target, 'TH'); + return _this.hot.view.wt.wtTable.getFirstRenderedColumn() + index(TH) - countRowHeaders(); + } + }, + enableObserveChangesPlugin: function() { + var _this = this; + this.hot._registerTimeout(setTimeout(function() { + _this.hot.updateSettings({observeChanges: true}); + }, 0)); + }, + defaultSort: function(sortOrder) { + return function(a, b) { + if (typeof a[1] == 'string') { + a[1] = a[1].toLowerCase(); + } + if (typeof b[1] == 'string') { + b[1] = b[1].toLowerCase(); + } + if (a[1] === b[1]) { + return 0; + } + if (a[1] === null || a[1] === '') { + return 1; + } + if (b[1] === null || b[1] === '') { + return -1; + } + if (isNaN(a[1]) && !isNaN(b[1])) { + return sortOrder ? 1 : -1; + } else if (!isNaN(a[1]) && isNaN(b[1])) { + return sortOrder ? -1 : 1; + } + if (a[1] < b[1]) { + return sortOrder ? -1 : 1; + } + if (a[1] > b[1]) { + return sortOrder ? 1 : -1; + } + return 0; + }; + }, + dateSort: function(sortOrder) { + return function(a, b) { + if (a[1] === b[1]) { + return 0; + } + if (a[1] === null || a[1] === '') { + return 1; + } + if (b[1] === null || b[1] === '') { + return -1; + } + var aDate = new Date(a[1]); + var bDate = new Date(b[1]); + if (aDate < bDate) { + return sortOrder ? -1 : 1; + } + if (aDate > bDate) { + return sortOrder ? 1 : -1; + } + return 0; + }; + }, + sort: function() { + if (typeof this.hot.sortOrder == 'undefined') { + this.hot.sortIndex.length = 0; + return; + } + var colMeta, + sortFunction; + this.hot.sortingEnabled = false; + this.hot.sortIndex.length = 0; + var colOffset = this.hot.colOffset(); + for (var i = 0, + ilen = this.hot.countRows() - this.hot.getSettings().minSpareRows; i < ilen; i++) { + this.hot.sortIndex.push([i, this.hot.getDataAtCell(i, this.hot.sortColumn + colOffset)]); + } + colMeta = this.hot.getCellMeta(0, this.hot.sortColumn); + this.sortIndicators[this.hot.sortColumn] = colMeta.sortIndicator; + switch (colMeta.type) { + case 'date': + sortFunction = this.dateSort; + break; + default: + sortFunction = this.defaultSort; + } + this.hot.sortIndex.sort(sortFunction(this.hot.sortOrder)); + for (var i = this.hot.sortIndex.length; i < this.hot.countRows(); i++) { + this.hot.sortIndex.push([i, this.hot.getDataAtCell(i, this.hot.sortColumn + colOffset)]); + } + this.hot.sortingEnabled = true; + }, + translateRow: function(row) { + if (this.hot.sortingEnabled && (typeof this.hot.sortOrder !== 'undefined') && this.hot.sortIndex && this.hot.sortIndex.length && this.hot.sortIndex[row]) { + return this.hot.sortIndex[row][0]; + } + return row; + }, + untranslateRow: function(row) { + if (this.hot.sortingEnabled && this.hot.sortIndex && this.hot.sortIndex.length) { + for (var i = 0; i < this.hot.sortIndex.length; i++) { + if (this.hot.sortIndex[i][0] == row) { + return i; + } + } + } + }, + getColHeader: function(col, TH) { + var headerLink = TH.querySelector('.colHeader'); + var colspan = TH.getAttribute('colspan'); + var TRs = TH.parentNode.parentNode.childNodes; + var headerLevel = Array.prototype.indexOf.call(TRs, TH.parentNode); + headerLevel = headerLevel - TRs.length; + if (!headerLink) { + return; + } + if (this.hot.getSettings().columnSorting && col >= 0 && headerLevel === -1) { + addClass(headerLink, 'columnSorting'); + } + removeClass(headerLink, 'descending'); + removeClass(headerLink, 'ascending'); + if (this.sortIndicators[col]) { + if (col === this.hot.sortColumn) { + if (this.sortOrderClass === 'ascending') { + addClass(headerLink, 'ascending'); + } else if (this.sortOrderClass === 'descending') { + addClass(headerLink, 'descending'); + } + } + } + }, + isSorted: function() { + return typeof this.hot.sortColumn != 'undefined'; + }, + afterCreateRow: function(index, amount) { + if (!this.isSorted()) { + return; + } + for (var i = 0; i < this.hot.sortIndex.length; i++) { + if (this.hot.sortIndex[i][0] >= index) { + this.hot.sortIndex[i][0] += amount; + } + } + for (var i = 0; i < amount; i++) { + this.hot.sortIndex.splice(index + i, 0, [index + i, this.hot.getSourceData()[index + i][this.hot.sortColumn + this.hot.colOffset()]]); + } + this.saveSortingState(); + }, + afterRemoveRow: function(index, amount) { + if (!this.isSorted()) { + return; + } + var removedRows = this.hot.sortIndex.splice(index, amount); + removedRows = arrayMap(removedRows, (function(row) { + return row[0]; + })); + function countRowShift(logicalRow) { + return arrayReduce(removedRows, (function(count, removedLogicalRow) { + if (logicalRow > removedLogicalRow) { + count++; + } + return count; + }), 0); + } + this.hot.sortIndex = arrayMap(this.hot.sortIndex, (function(logicalRow, physicalRow) { + var rowShift = countRowShift(logicalRow[0]); + if (rowShift) { + logicalRow[0] -= rowShift; + } + return logicalRow; + })); + this.saveSortingState(); + } +}, {}, BasePlugin); +; +registerPlugin('columnSorting', ColumnSorting); + +//# +},{"_base":58,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"plugins":57}],63:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + CommentEditor: {get: function() { + return CommentEditor; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_dom_47_element__; +var addClass = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}).addClass; +var CommentEditor = function CommentEditor() { + this.editor = this.createEditor(); + this.editorStyle = this.editor.style; + this.editorStyle.position = 'absolute'; + this.editorStyle.zIndex = 100; + this.hide(); +}; +var $CommentEditor = CommentEditor; +($traceurRuntime.createClass)(CommentEditor, { + setPosition: function(x, y) { + this.editorStyle.left = x + 'px'; + this.editorStyle.top = y + 'px'; + }, + show: function() { + this.editorStyle.display = 'block'; + }, + hide: function() { + this.editorStyle.display = 'none'; + }, + isVisible: function() { + return this.editorStyle.display === 'block'; + }, + setValue: function() { + var value = arguments[0] !== (void 0) ? arguments[0] : ''; + value = value || ''; + this.getInputElement().value = value; + }, + getValue: function() { + return this.getInputElement().value; + }, + isFocused: function() { + return document.activeElement === this.getInputElement(); + }, + focus: function() { + this.getInputElement().focus(); + }, + createEditor: function() { + var container = document.querySelector('.' + $CommentEditor.CLASS_EDITOR_CONTAINER); + var editor; + var textArea; + if (!container) { + container = document.createElement('div'); + addClass(container, $CommentEditor.CLASS_EDITOR_CONTAINER); + document.body.appendChild(container); + } + editor = document.createElement('div'); + addClass(editor, $CommentEditor.CLASS_EDITOR); + textArea = document.createElement('textarea'); + addClass(textArea, $CommentEditor.CLASS_INPUT); + editor.appendChild(textArea); + container.appendChild(editor); + return editor; + }, + getInputElement: function() { + return this.editor.querySelector('.' + $CommentEditor.CLASS_INPUT); + }, + destroy: function() { + this.editor.parentNode.removeChild(this.editor); + this.editor = null; + this.editorStyle = null; + } +}, { + get CLASS_EDITOR_CONTAINER() { + return 'htCommentsContainer'; + }, + get CLASS_EDITOR() { + return 'htComments'; + }, + get CLASS_INPUT() { + return 'htCommentTextArea'; + }, + get CLASS_CELL() { + return 'htCommentCell'; + } +}); +; + +//# +},{"helpers/dom/element":45}],64:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + Comments: {get: function() { + return Comments; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_eventManager__, + $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__, + $___46__46__47__46__46__47_plugins__, + $___46__46__47__95_base__, + $__commentEditor__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + closest = $__0.closest, + getWindowScrollLeft = $__0.getWindowScrollLeft, + getWindowScrollTop = $__0.getWindowScrollTop, + hasClass = $__0.hasClass, + offset = $__0.offset; +var EventManager = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).EventManager; +var WalkontableCellCoords = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords; +var $__3 = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}), + registerPlugin = $__3.registerPlugin, + getPlugin = $__3.getPlugin; +var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default; +var CommentEditor = ($__commentEditor__ = require("commentEditor"), $__commentEditor__ && $__commentEditor__.__esModule && $__commentEditor__ || {default: $__commentEditor__}).CommentEditor; +var Comments = function Comments(hotInstance) { + $traceurRuntime.superConstructor($Comments).call(this, hotInstance); + this.editor = null; + this.eventManager = null; + this.range = {}; + this.mouseDown = false; + this.contextMenuEvent = false; + this.timer = null; +}; +var $Comments = Comments; +($traceurRuntime.createClass)(Comments, { + isEnabled: function() { + return this.hot.getSettings().comments; + }, + enablePlugin: function() { + var $__6 = this; + if (this.enabled) { + return; + } + if (!this.editor) { + this.editor = new CommentEditor(); + } + if (!this.eventManager) { + this.eventManager = new EventManager(this); + } + this.addHook('afterContextMenuDefaultOptions', (function(options) { + return $__6.addToContextMenu(options); + })); + this.addHook('afterRenderer', (function(TD, row, col, prop, value, cellProperties) { + return $__6.onAfterRenderer(TD, cellProperties); + })); + this.addHook('afterScrollHorizontally', (function() { + return $__6.refreshEditorPosition(); + })); + this.addHook('afterScrollVertically', (function() { + return $__6.refreshEditorPosition(); + })); + this.addHook('afterColumnResize', (function() { + return $__6.refreshEditorPosition(); + })); + this.addHook('afterRowResize', (function() { + return $__6.refreshEditorPosition(); + })); + this.registerListeners(); + $traceurRuntime.superGet(this, $Comments.prototype, "enablePlugin").call(this); + }, + disablePlugin: function() { + $traceurRuntime.superGet(this, $Comments.prototype, "disablePlugin").call(this); + }, + registerListeners: function() { + var $__6 = this; + this.eventManager.addEventListener(document, 'mouseover', (function(event) { + return $__6.onMouseOver(event); + })); + this.eventManager.addEventListener(document, 'mousedown', (function(event) { + return $__6.onMouseDown(event); + })); + this.eventManager.addEventListener(document, 'mousemove', (function(event) { + return $__6.onMouseMove(event); + })); + this.eventManager.addEventListener(document, 'mouseup', (function(event) { + return $__6.onMouseUp(event); + })); + this.eventManager.addEventListener(this.editor.getInputElement(), 'blur', (function(event) { + return $__6.onEditorBlur(event); + })); + }, + setRange: function(range) { + this.range = range; + }, + clearRange: function() { + this.range = {}; + }, + targetIsCellWithComment: function(event) { + return hasClass(event.target, 'htCommentCell') && closest(event.target, [this.hot.rootElement]) ? true : false; + }, + targetIsCommentTextArea: function(event) { + return this.editor.getInputElement() === event.target; + }, + saveComment: function() { + if (!this.range.from) { + throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())'); + } + var comment = this.editor.getValue(); + var row = this.range.from.row; + var col = this.range.from.col; + this.hot.setCellMeta(row, col, 'comment', comment); + this.hot.render(); + }, + saveCommentAtCell: function(row, col) { + this.setRange({from: new WalkontableCellCoords(row, col)}); + this.saveComment(); + }, + removeComment: function() { + if (!this.range.from) { + throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())'); + } + this.hot.removeCellMeta(this.range.from.row, this.range.from.col, 'comment'); + this.hot.render(); + this.hide(); + }, + removeCommentAtCell: function(row, col) { + this.setRange({from: new WalkontableCellCoords(row, col)}); + this.removeComment(); + }, + show: function() { + if (!this.range.from) { + throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())'); + } + var meta = this.hot.getCellMeta(this.range.from.row, this.range.from.col); + this.refreshEditorPosition(true); + this.editor.setValue(meta.comment || ''); + this.editor.show(); + return true; + }, + showAtCell: function(row, col) { + this.setRange({from: new WalkontableCellCoords(row, col)}); + return this.show(); + }, + hide: function() { + this.editor.hide(); + }, + refreshEditorPosition: function() { + var force = arguments[0] !== (void 0) ? arguments[0] : false; + if (!force && (!this.range.from || !this.editor.isVisible())) { + return; + } + var TD = this.hot.view.wt.wtTable.getCell(this.range.from); + var cellOffset = offset(TD); + var lastColWidth = this.hot.getColWidth(this.range.from.col); + var cellTopOffset = cellOffset.top; + var cellLeftOffset = cellOffset.left; + var verticalCompensation = 0; + var horizontalCompensation = 0; + if (this.hot.view.wt.wtViewport.hasVerticalScroll()) { + cellTopOffset = cellTopOffset - this.hot.view.wt.wtOverlays.topOverlay.getScrollPosition(); + verticalCompensation = 20; + } + if (this.hot.view.wt.wtViewport.hasHorizontalScroll()) { + cellLeftOffset = cellLeftOffset - this.hot.view.wt.wtOverlays.leftOverlay.getScrollPosition(); + horizontalCompensation = 20; + } + var x = cellLeftOffset + lastColWidth; + var y = cellTopOffset; + var rect = this.hot.view.wt.wtTable.holder.getBoundingClientRect(); + var holderPos = { + left: rect.left + getWindowScrollLeft() + horizontalCompensation, + right: rect.right + getWindowScrollLeft() - 15, + top: rect.top + getWindowScrollTop() + verticalCompensation, + bottom: rect.bottom + getWindowScrollTop() + }; + if (x <= holderPos.left || x > holderPos.right || y <= holderPos.top || y > holderPos.bottom) { + this.hide(); + } else { + this.editor.setPosition(x, y); + } + }, + onMouseDown: function(event) { + this.mouseDown = true; + if (!this.hot.view || !this.hot.view.wt) { + return; + } + if (!this.contextMenuEvent && !this.targetIsCommentTextArea(event) && !this.targetIsCellWithComment(event)) { + this.hide(); + } + this.contextMenuEvent = false; + }, + onMouseOver: function(event) { + if (this.mouseDown || this.editor.isFocused()) { + return; + } + if (this.targetIsCellWithComment(event)) { + var coordinates = this.hot.view.wt.wtTable.getCoords(event.target); + var range = {from: new WalkontableCellCoords(coordinates.row, coordinates.col)}; + this.setRange(range); + this.show(); + } else if (!this.targetIsCommentTextArea(event) && !this.editor.isFocused()) { + this.hide(); + } + }, + onMouseMove: function(event) { + var $__6 = this; + if (this.targetIsCommentTextArea(event)) { + this.mouseDown = true; + clearTimeout(this.timer); + this.timer = setTimeout((function() { + $__6.mouseDown = false; + }), 200); + } + }, + onMouseUp: function(event) { + this.mouseDown = false; + }, + onAfterRenderer: function(TD, cellProperties) { + if (cellProperties.comment) { + addClass(TD, cellProperties.commentedCellClassName); + } + }, + onEditorBlur: function(event) { + this.saveComment(); + }, + checkSelectionCommentsConsistency: function() { + var selected = this.hot.getSelectedRange(); + if (!selected) { + return false; + } + var hasComment = false; + var cell = selected.from; + if (this.hot.getCellMeta(cell.row, cell.col).comment) { + hasComment = true; + } + return hasComment; + }, + onContextMenuAddComment: function() { + var $__6 = this; + var coords = this.hot.getSelectedRange(); + this.contextMenuEvent = true; + this.setRange({from: coords.from}); + this.show(); + setTimeout((function() { + if ($__6.hot) { + $__6.hot.deselectCell(); + $__6.editor.focus(); + } + }), 10); + }, + onContextMenuRemoveComment: function(key, selection) { + this.contextMenuEvent = true; + this.removeCommentAtCell(selection.start.row, selection.start.col); + }, + addToContextMenu: function(defaultOptions) { + var $__6 = this; + defaultOptions.items.push(Handsontable.plugins.ContextMenu.SEPARATOR, { + key: 'commentsAddEdit', + name: (function() { + return $__6.checkSelectionCommentsConsistency() ? 'Edit Comment' : 'Add Comment'; + }), + callback: (function() { + return $__6.onContextMenuAddComment(); + }), + disabled: function() { + return this.getSelected() ? false : true; + } + }, { + key: 'commentsRemove', + name: function() { + return 'Delete Comment'; + }, + callback: (function(key, selection) { + return $__6.onContextMenuRemoveComment(key, selection); + }), + disabled: (function() { + return !$__6.checkSelectionCommentsConsistency(); + }) + }); + }, + destroy: function() { + if (this.editor) { + this.editor.destroy(); + } + $traceurRuntime.superGet(this, $Comments.prototype, "destroy").call(this); + } +}, {}, BasePlugin); +; +registerPlugin('comments', Comments); + +//# +},{"3rdparty/walkontable/src/cell/coords":5,"_base":58,"commentEditor":63,"eventManager":41,"helpers/dom/element":45,"plugins":57}],65:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + CommandExecutor: {get: function() { + return CommandExecutor; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_array__; +var arrayEach = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}).arrayEach; +var CommandExecutor = function CommandExecutor(hotInstance) { + this.hot = hotInstance; + this.commands = {}; + this.commonCallback = null; +}; +($traceurRuntime.createClass)(CommandExecutor, { + registerCommand: function(name, commandDescriptor) { + this.commands[name] = commandDescriptor; + }, + setCommonCallback: function(callback) { + this.commonCallback = callback; + }, + execute: function(commandName) { + for (var params = [], + $__3 = 1; $__3 < arguments.length; $__3++) + params[$__3 - 1] = arguments[$__3]; + var $__1 = this; + var commandSplit = commandName.split(':'); + commandName = commandSplit[0]; + var subCommandName = commandSplit.length === 2 ? commandSplit[1] : null; + var command = this.commands[commandName]; + if (!command) { + throw new Error(("Menu command '" + commandName + "' not exists.")); + } + if (subCommandName && command.submenu) { + command = findSubCommand(subCommandName, command.submenu.items); + } + if (command.disabled === true) { + return; + } + if (typeof command.disabled == 'function' && command.disabled.call(this.hot) === true) { + return; + } + if (command.hasOwnProperty('submenu')) { + return; + } + var callbacks = []; + if (typeof command.callback === 'function') { + callbacks.push(command.callback); + } + if (typeof this.commonCallback === 'function') { + callbacks.push(this.commonCallback); + } + params.unshift(commandSplit.join(':')); + arrayEach(callbacks, (function(callback) { + return callback.apply($__1.hot, params); + })); + } +}, {}); +function findSubCommand(subCommandName, subCommands) { + var command; + arrayEach(subCommands, (function(cmd) { + var cmds = cmd.key ? cmd.key.split(':') : null; + if (Array.isArray(cmds) && cmds[1] === subCommandName) { + command = cmd; + return false; + } + })); + return command; +} +; + +//# +},{"helpers/array":42}],66:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + ContextMenu: {get: function() { + return ContextMenu; + }}, + __esModule: {value: true} +}); +var $___46__46__47__95_base__, + $___46__46__47__46__46__47_helpers_47_array__, + $__commandExecutor__, + $___46__46__47__46__46__47_eventManager__, + $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $__itemsFactory__, + $__menu__, + $___46__46__47__46__46__47_helpers_47_object__, + $___46__46__47__46__46__47_plugins__, + $___46__46__47__46__46__47_helpers_47_dom_47_event__, + $__predefinedItems__; +var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default; +var arrayEach = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}).arrayEach; +var CommandExecutor = ($__commandExecutor__ = require("commandExecutor"), $__commandExecutor__ && $__commandExecutor__.__esModule && $__commandExecutor__ || {default: $__commandExecutor__}).CommandExecutor; +var EventManager = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).EventManager; +var hasClass = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}).hasClass; +var ItemsFactory = ($__itemsFactory__ = require("itemsFactory"), $__itemsFactory__ && $__itemsFactory__.__esModule && $__itemsFactory__ || {default: $__itemsFactory__}).ItemsFactory; +var Menu = ($__menu__ = require("menu"), $__menu__ && $__menu__.__esModule && $__menu__ || {default: $__menu__}).Menu; +var $__7 = ($___46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47_helpers_47_object__}), + objectEach = $__7.objectEach, + mixin = $__7.mixin; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var stopPropagation = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}).stopPropagation; +var $__10 = ($__predefinedItems__ = require("predefinedItems"), $__predefinedItems__ && $__predefinedItems__.__esModule && $__predefinedItems__ || {default: $__predefinedItems__}), + ROW_ABOVE = $__10.ROW_ABOVE, + ROW_BELOW = $__10.ROW_BELOW, + COLUMN_LEFT = $__10.COLUMN_LEFT, + COLUMN_RIGHT = $__10.COLUMN_RIGHT, + REMOVE_ROW = $__10.REMOVE_ROW, + REMOVE_COLUMN = $__10.REMOVE_COLUMN, + UNDO = $__10.UNDO, + REDO = $__10.REDO, + READ_ONLY = $__10.READ_ONLY, + ALIGNMENT = $__10.ALIGNMENT, + SEPARATOR = $__10.SEPARATOR, + predefinedItems = $__10.predefinedItems; +var ContextMenu = function ContextMenu(hotInstance) { + $traceurRuntime.superConstructor($ContextMenu).call(this, hotInstance); + this.eventManager = new EventManager(this); + this.commandExecutor = new CommandExecutor(this.hot); + this.itemsFactory = null; + this.menu = null; +}; +var $ContextMenu = ContextMenu; +($traceurRuntime.createClass)(ContextMenu, { + isEnabled: function() { + return this.hot.getSettings().contextMenu; + }, + enablePlugin: function() { + var $__11 = this; + if (this.enabled) { + return; + } + this.itemsFactory = new ItemsFactory(this.hot, $ContextMenu.DEFAULT_ITEMS); + var settings = this.hot.getSettings().contextMenu; + var predefinedItems = {items: this.itemsFactory.getVisibleItems(settings)}; + this.registerEvents(); + if (typeof settings.callback === 'function') { + this.commandExecutor.setCommonCallback(settings.callback); + } + $traceurRuntime.superGet(this, $ContextMenu.prototype, "enablePlugin").call(this); + this.callOnPluginsReady((function() { + $__11.hot.runHooks('afterContextMenuDefaultOptions', predefinedItems); + $__11.itemsFactory.setPredefinedItems(predefinedItems.items); + var menuItems = $__11.itemsFactory.getVisibleItems(settings); + $__11.menu = new Menu($__11.hot, { + className: 'htContextMenu', + keepInViewport: true + }); + $__11.menu.setMenuItems(menuItems); + $__11.menu.addLocalHook('afterOpen', (function() { + return $__11.onMenuAfterOpen(); + })); + $__11.menu.addLocalHook('afterClose', (function() { + return $__11.onMenuAfterClose(); + })); + $__11.menu.addLocalHook('executeCommand', (function() { + for (var params = [], + $__13 = 0; $__13 < arguments.length; $__13++) + params[$__13] = arguments[$__13]; + return $__11.executeCommand.apply($__11, params); + })); + arrayEach(menuItems, (function(command) { + return $__11.commandExecutor.registerCommand(command.key, command); + })); + })); + }, + disablePlugin: function() { + this.close(); + if (this.menu) { + this.menu.destroy(); + this.menu = null; + } + $traceurRuntime.superGet(this, $ContextMenu.prototype, "disablePlugin").call(this); + }, + registerEvents: function() { + var $__11 = this; + this.eventManager.addEventListener(this.hot.rootElement, 'contextmenu', (function(event) { + return $__11.onContextMenu(event); + })); + }, + open: function(event) { + if (!this.menu) { + return; + } + this.menu.open(); + this.menu.setPosition(event); + this.menu.hotMenu.isHotTableEnv = this.hot.isHotTableEnv; + Handsontable.eventManager.isHotTableEnv = this.hot.isHotTableEnv; + }, + close: function() { + if (!this.menu) { + return; + } + this.menu.close(); + }, + executeCommand: function() { + for (var params = [], + $__13 = 0; $__13 < arguments.length; $__13++) + params[$__13] = arguments[$__13]; + this.commandExecutor.execute.apply(this.commandExecutor, params); + }, + onContextMenu: function(event) { + var settings = this.hot.getSettings(); + var showRowHeaders = settings.rowHeaders; + var showColHeaders = settings.colHeaders; + function isValidElement(element) { + return element.nodeName === 'TD' || element.parentNode.nodeName === 'TD'; + } + var element = event.realTarget; + this.close(); + event.preventDefault(); + stopPropagation(event); + if (!(showRowHeaders || showColHeaders)) { + if (!isValidElement(element) && !(hasClass(element, 'current') && hasClass(element, 'wtBorder'))) { + return; + } + } else if (showRowHeaders && showColHeaders) { + var containsCornerHeader = element.parentNode.querySelectorAll('.cornerHeader').length > 0; + if (containsCornerHeader) { + return; + } + } + this.open(event); + }, + onMenuAfterOpen: function() { + this.hot.runHooks('afterContextMenuShow', this); + }, + onMenuAfterClose: function() { + this.hot.listen(); + this.hot.runHooks('afterContextMenuHide', this); + }, + destroy: function() { + this.close(); + if (this.menu) { + this.menu.destroy(); + } + $traceurRuntime.superGet(this, $ContextMenu.prototype, "destroy").call(this); + } +}, {get DEFAULT_ITEMS() { + return [ROW_ABOVE, ROW_BELOW, SEPARATOR, COLUMN_LEFT, COLUMN_RIGHT, SEPARATOR, REMOVE_ROW, REMOVE_COLUMN, SEPARATOR, UNDO, REDO, SEPARATOR, READ_ONLY, SEPARATOR, ALIGNMENT]; + }}, BasePlugin); +ContextMenu.SEPARATOR = {name: SEPARATOR}; +Handsontable.hooks.register('afterContextMenuDefaultOptions'); +Handsontable.hooks.register('afterContextMenuShow'); +Handsontable.hooks.register('afterContextMenuHide'); +Handsontable.hooks.register('afterContextMenuExecute'); +; +registerPlugin('contextMenu', ContextMenu); + +//# +},{"_base":58,"commandExecutor":65,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"itemsFactory":68,"menu":69,"plugins":57,"predefinedItems":70}],67:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + Cursor: {get: function() { + return Cursor; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_helpers_47_dom_47_event__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + getWindowScrollLeft = $__0.getWindowScrollLeft, + getWindowScrollTop = $__0.getWindowScrollTop; +var $__1 = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}), + pageX = $__1.pageX, + pageY = $__1.pageY; +var Cursor = function Cursor(object) { + var windowScrollTop = getWindowScrollTop(); + var windowScrollLeft = getWindowScrollLeft(); + var top, + topRelative; + var left, + leftRelative; + var scrollTop, + scrollLeft; + var cellHeight, + cellWidth; + this.type = this.getSourceType(object); + if (this.type === 'literal') { + top = parseInt(object.top, 10); + left = parseInt(object.left, 10); + cellHeight = object.height; + cellWidth = object.width; + } else if (this.type === 'event') { + top = parseInt(pageY(object), 10); + left = parseInt(pageX(object), 10); + cellHeight = object.target.clientHeight; + cellWidth = object.target.clientWidth; + } + topRelative = top - windowScrollTop; + leftRelative = left - windowScrollLeft; + scrollTop = windowScrollTop; + scrollLeft = windowScrollLeft; + this.top = top; + this.topRelative = topRelative; + this.left = left; + this.leftRelative = leftRelative; + this.scrollTop = scrollTop; + this.scrollLeft = scrollLeft; + this.cellHeight = cellHeight; + this.cellWidth = cellWidth; +}; +($traceurRuntime.createClass)(Cursor, { + getSourceType: function(object) { + var type = 'literal'; + if (object instanceof Event) { + type = 'event'; + } + return type; + }, + fitsAbove: function(element) { + return this.topRelative >= element.offsetHeight; + }, + fitsBelow: function(element) { + var viewportHeight = arguments[1] !== (void 0) ? arguments[1] : window.innerHeight; + return this.topRelative + element.offsetHeight <= viewportHeight; + }, + fitsOnRight: function(element) { + var viewportWidth = arguments[1] !== (void 0) ? arguments[1] : window.innerWidth; + return this.leftRelative + this.cellWidth + element.offsetWidth <= viewportWidth; + }, + fitsOnLeft: function(element) { + return this.leftRelative >= element.offsetWidth; + } +}, {}); +; +Handsontable.plugins.utils = Handsontable.plugins.utils || {}; +Handsontable.plugins.utils.Cursor = Cursor; + +//# +},{"helpers/dom/element":45,"helpers/dom/event":46}],68:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + ItemsFactory: {get: function() { + return ItemsFactory; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_object__, + $___46__46__47__46__46__47_helpers_47_array__, + $__predefinedItems__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47_helpers_47_object__}), + objectEach = $__0.objectEach, + isObject = $__0.isObject, + extend = $__0.extend; +var arrayEach = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}).arrayEach; +var $__2 = ($__predefinedItems__ = require("predefinedItems"), $__predefinedItems__ && $__predefinedItems__.__esModule && $__predefinedItems__ || {default: $__predefinedItems__}), + SEPARATOR = $__2.SEPARATOR, + ITEMS = $__2.ITEMS, + predefinedItems = $__2.predefinedItems; +var ItemsFactory = function ItemsFactory(hotInstance) { + var orderPattern = arguments[1] !== (void 0) ? arguments[1] : null; + this.hot = hotInstance; + this.predefinedItems = predefinedItems(); + this.defaultOrderPattern = orderPattern; +}; +($traceurRuntime.createClass)(ItemsFactory, { + setPredefinedItems: function(predefinedItems) { + var $__3 = this; + var items = {}; + this.defaultOrderPattern.length = 0; + objectEach(predefinedItems, (function(value, key) { + var menuItemKey = ''; + if (value.name === SEPARATOR) { + items[SEPARATOR] = value; + menuItemKey = SEPARATOR; + } else if (isNaN(parseInt(key, 10))) { + value.key = value.key === void 0 ? key : value.key; + items[key] = value; + menuItemKey = value.key; + } else { + items[value.key] = value; + menuItemKey = value.key; + } + $__3.defaultOrderPattern.push(menuItemKey); + })); + this.predefinedItems = items; + }, + getVisibleItems: function() { + var pattern = arguments[0] !== (void 0) ? arguments[0] : null; + var $__3 = this; + var visibleItems = {}; + objectEach(this.predefinedItems, (function(value, key) { + if (!value.hidden || value.hidden && !value.hidden.apply($__3.hot)) { + visibleItems[key] = value; + } + })); + return getItems(pattern, this.defaultOrderPattern, visibleItems); + }, + getItems: function() { + var pattern = arguments[0] !== (void 0) ? arguments[0] : null; + return getItems(pattern, this.defaultOrderPattern, this.predefinedItems); + } +}, {}); +function getItems() { + var pattern = arguments[0] !== (void 0) ? arguments[0] : null; + var defaultPattern = arguments[1] !== (void 0) ? arguments[1] : []; + var items = arguments[2] !== (void 0) ? arguments[2] : {}; + var result = []; + if (pattern && pattern.items) { + pattern = pattern.items; + } else if (!Array.isArray(pattern)) { + pattern = defaultPattern; + } + if (isObject(pattern)) { + objectEach(pattern, (function(value, key) { + var item = items[typeof value === 'string' ? value : key]; + if (!item) { + item = value; + } + if (isObject(value)) { + extend(item, value); + } else if (typeof item === 'string') { + item = {name: item}; + } + if (item.key === void 0) { + item.key = key; + } + result.push(item); + })); + } else { + arrayEach(pattern, (function(name, key) { + var item = items[name]; + if (!item && ITEMS.indexOf(name) >= 0) { + return; + } + if (!item) { + item = { + name: name, + key: key + '' + }; + } + if (isObject(name)) { + extend(item, name); + } + if (item.key === void 0) { + item.key = key; + } + result.push(item); + })); + } + if (result[0].name === SEPARATOR) { + result.shift(); + } + return result; +} +; + +//# +},{"helpers/array":42,"helpers/object":50,"predefinedItems":70}],69:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + Menu: {get: function() { + return Menu; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_helpers_47_array__, + $__cursor__, + $___46__46__47__46__46__47_eventManager__, + $___46__46__47__46__46__47_helpers_47_object__, + $__utils__, + $___46__46__47__46__46__47_helpers_47_unicode__, + $___46__46__47__46__46__47_mixins_47_localHooks__, + $__predefinedItems__, + $___46__46__47__46__46__47_helpers_47_dom_47_event__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + empty = $__0.empty, + fastInnerHTML = $__0.fastInnerHTML, + getComputedStyle = $__0.getComputedStyle, + getScrollbarWidth = $__0.getScrollbarWidth, + getWindowScrollLeft = $__0.getWindowScrollLeft, + getWindowScrollTop = $__0.getWindowScrollTop, + hasClass = $__0.hasClass, + isChildOf = $__0.isChildOf, + removeClass = $__0.removeClass; +var arrayEach = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}).arrayEach; +var Cursor = ($__cursor__ = require("cursor"), $__cursor__ && $__cursor__.__esModule && $__cursor__ || {default: $__cursor__}).Cursor; +var EventManager = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).EventManager; +var $__4 = ($___46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47_helpers_47_object__}), + extend = $__4.extend, + isObject = $__4.isObject, + objectEach = $__4.objectEach, + mixin = $__4.mixin; +var $__5 = ($__utils__ = require("utils"), $__utils__ && $__utils__.__esModule && $__utils__ || {default: $__utils__}), + isSeparator = $__5.isSeparator, + isDisabled = $__5.isDisabled, + isSelectionDisabled = $__5.isSelectionDisabled, + hasSubMenu = $__5.hasSubMenu, + normalizeSelection = $__5.normalizeSelection; +var KEY_CODES = ($___46__46__47__46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47__46__46__47_helpers_47_unicode__ && $___46__46__47__46__46__47_helpers_47_unicode__.__esModule && $___46__46__47__46__46__47_helpers_47_unicode__ || {default: $___46__46__47__46__46__47_helpers_47_unicode__}).KEY_CODES; +var localHooks = ($___46__46__47__46__46__47_mixins_47_localHooks__ = require("mixins/localHooks"), $___46__46__47__46__46__47_mixins_47_localHooks__ && $___46__46__47__46__46__47_mixins_47_localHooks__.__esModule && $___46__46__47__46__46__47_mixins_47_localHooks__ || {default: $___46__46__47__46__46__47_mixins_47_localHooks__}).localHooks; +var $__8 = ($__predefinedItems__ = require("predefinedItems"), $__predefinedItems__ && $__predefinedItems__.__esModule && $__predefinedItems__ || {default: $__predefinedItems__}), + SEPARATOR = $__8.SEPARATOR, + predefinedItems = $__8.predefinedItems; +var $__9 = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}), + stopPropagation = $__9.stopPropagation, + stopImmediatePropagation = $__9.stopImmediatePropagation, + pageX = $__9.pageX, + pageY = $__9.pageY; +var Menu = function Menu(hotInstance) { + var options = arguments[1] !== (void 0) ? arguments[1] : { + parent: null, + name: null, + className: '', + keepInViewport: true + }; + this.hot = hotInstance; + this.options = options; + this.eventManager = new EventManager(this); + this.container = this.createContainer(this.options.name); + this.hotMenu = null; + this.hotSubMenus = {}; + this.parentMenu = this.options.parent || null; + this.menuItems = null; + this.origOutsideClickDeselects = null; + this._afterScrollCallback = null; + this.registerEvents(); +}; +var $Menu = Menu; +($traceurRuntime.createClass)(Menu, { + registerEvents: function() { + var $__10 = this; + this.eventManager.addEventListener(document.documentElement, 'mousedown', (function(event) { + return $__10.onDocumentMouseDown(event); + })); + }, + setMenuItems: function(menuItems) { + this.menuItems = menuItems; + }, + isSubMenu: function() { + return this.parentMenu !== null; + }, + open: function() { + var $__10 = this; + this.container.removeAttribute('style'); + this.container.style.display = 'block'; + var settings = { + data: this.menuItems, + colHeaders: false, + colWidths: [200], + autoRowSize: false, + readOnly: true, + copyPaste: false, + columns: [{ + data: 'name', + renderer: (function(hot, TD, row, col, prop, value) { + return $__10.menuItemRenderer(hot, TD, row, col, prop, value); + }) + }], + renderAllRows: true, + fragmentSelection: 'cell', + beforeKeyDown: (function(event) { + return $__10.onBeforeKeyDown(event); + }), + afterOnCellMouseOver: (function(event, coords, TD) { + return $__10.openSubMenu(coords.row); + }) + }; + this.origOutsideClickDeselects = this.hot.getSettings().outsideClickDeselects; + this.hot.getSettings().outsideClickDeselects = false; + this.hotMenu = new Handsontable.Core(this.container, settings); + this.hotMenu.addHook('afterInit', (function() { + return $__10.onAfterInit(); + })); + this.hotMenu.init(); + this.hotMenu.listen(); + this.blockMainTableCallbacks(); + this.runLocalHooks('afterOpen'); + }, + close: function() { + var closeParent = arguments[0] !== (void 0) ? arguments[0] : false; + if (!this.isOpened()) { + return; + } + if (closeParent && this.parentMenu) { + this.parentMenu.close(); + } else { + this.closeAllSubMenus(); + this.container.style.display = 'none'; + this.releaseMainTableCallbacks(); + this.hotMenu.destroy(); + this.hotMenu = null; + this.hot.getSettings().outsideClickDeselects = this.origOutsideClickDeselects; + this.runLocalHooks('afterClose'); + } + }, + openSubMenu: function(row) { + var cell = this.hotMenu.getCell(row, 0); + this.closeAllSubMenus(); + if (!cell || !hasSubMenu(cell)) { + return false; + } + var dataItem = this.hotMenu.getSourceDataAtRow(row); + var subMenu = new $Menu(this.hot, { + parent: this, + name: dataItem.name, + className: this.options.className + }); + subMenu.setMenuItems(dataItem.submenu.items); + subMenu.open(); + subMenu.setPosition(cell.getBoundingClientRect()); + this.hotSubMenus[dataItem.key] = subMenu; + return subMenu; + }, + closeSubMenu: function(row) { + var dataItem = this.hotMenu.getSourceDataAtRow(row); + var menus = this.hotSubMenus[dataItem.key]; + if (menus) { + menus.destroy(); + delete this.hotSubMenus[dataItem.key]; + } + }, + closeAllSubMenus: function() { + var $__10 = this; + arrayEach(this.hotMenu.getData(), (function(value, row) { + return $__10.closeSubMenu(row); + })); + }, + isAllSubMenusClosed: function() { + return Object.keys(this.hotSubMenus).length === 0; + }, + destroy: function() { + this.clearLocalHooks(); + this.close(); + this.parentMenu = null; + this.eventManager.destroy(); + }, + isOpened: function() { + return this.hotMenu !== null; + }, + executeCommand: function(event) { + if (!this.isOpened() || !this.hotMenu.getSelected()) { + return; + } + var selectedItem = this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelected()[0]); + this.runLocalHooks('select', selectedItem, event); + if (selectedItem.isCommand === false) { + return; + } + var selRange = this.hot.getSelectedRange(); + var normalizedSelection = selRange ? normalizeSelection(selRange) : {}; + this.runLocalHooks('executeCommand', selectedItem.key, normalizedSelection, event); + if (this.isSubMenu()) { + this.parentMenu.runLocalHooks('executeCommand', selectedItem.key, normalizedSelection, event); + } + this.close(true); + }, + setPosition: function(coords) { + var cursor = new Cursor(coords); + if (this.options.keepInViewport) { + if (cursor.fitsBelow(this.container)) { + this.setPositionBelowCursor(cursor); + } else if (cursor.fitsAbove(this.container)) { + this.setPositionAboveCursor(cursor); + } else { + this.setPositionBelowCursor(cursor); + } + if (cursor.fitsOnRight(this.container)) { + this.setPositionOnRightOfCursor(cursor); + } else { + this.setPositionOnLeftOfCursor(cursor); + } + } else { + this.setPositionBelowCursor(cursor); + this.setPositionOnRightOfCursor(cursor); + } + }, + setPositionAboveCursor: function(cursor) { + var top = cursor.top - this.container.offsetHeight; + if (this.isSubMenu()) { + top = window.scrollY + cursor.top + cursor.cellHeight - this.container.offsetHeight + 3; + } + this.container.style.top = top + 'px'; + }, + setPositionBelowCursor: function(cursor) { + var top = cursor.top - 1; + if (this.isSubMenu()) { + top = cursor.top + window.scrollY - 1; + } + this.container.style.top = top + 'px'; + }, + setPositionOnRightOfCursor: function(cursor) { + var left; + if (this.isSubMenu()) { + left = window.scrollX + 1 + cursor.left + cursor.cellWidth; + } else { + left = 1 + cursor.left; + } + this.container.style.left = left + 'px'; + }, + setPositionOnLeftOfCursor: function(cursor) { + this.container.style.left = (cursor.left - this.container.offsetWidth + getScrollbarWidth() + 4) + 'px'; + }, + selectFirstCell: function() { + var cell = this.hotMenu.getCell(0, 0); + if (isSeparator(cell) || isDisabled(cell) || isSelectionDisabled(cell)) { + this.selectNextCell(0, 0); + } else { + this.hotMenu.selectCell(0, 0); + } + }, + selectLastCell: function() { + var lastRow = this.hotMenu.countRows() - 1; + var cell = this.hotMenu.getCell(lastRow, 0); + if (isSeparator(cell) || isDisabled(cell) || isSelectionDisabled(cell)) { + this.selectPrevCell(lastRow, 0); + } else { + this.hotMenu.selectCell(lastRow, 0); + } + }, + selectNextCell: function(row, col) { + var nextRow = row + 1; + var cell = nextRow < this.hotMenu.countRows() ? this.hotMenu.getCell(nextRow, col) : null; + if (!cell) { + return; + } + if (isSeparator(cell) || isDisabled(cell) || isSelectionDisabled(cell)) { + this.selectNextCell(nextRow, col); + } else { + this.hotMenu.selectCell(nextRow, col); + } + }, + selectPrevCell: function(row, col) { + var prevRow = row - 1; + var cell = prevRow >= 0 ? this.hotMenu.getCell(prevRow, col) : null; + if (!cell) { + return; + } + if (isSeparator(cell) || isDisabled(cell) || isSelectionDisabled(cell)) { + this.selectPrevCell(prevRow, col); + } else { + this.hotMenu.selectCell(prevRow, col); + } + }, + menuItemRenderer: function(hot, TD, row, col, prop, value) { + var $__10 = this; + var item = hot.getSourceDataAtRow(row); + var wrapper = document.createElement('div'); + var isSubMenu = (function(item) { + return item.hasOwnProperty('submenu'); + }); + var itemIsSeparator = (function(item) { + return new RegExp(SEPARATOR, 'i').test(item.name); + }); + var itemIsDisabled = (function(item) { + return item.disabled === true || (typeof item.disabled == 'function' && item.disabled.call($__10.hot) === true); + }); + var itemIsHidden = (function(item) { + return typeof item.hidden == 'function' && item.hidden.call($__10.hot) === true; + }); + var itemIsSelectionDisabled = (function(item) { + return item.disableSelection; + }); + var isHidden = itemIsHidden(item); + if (typeof value === 'function') { + value = value.call(this.hot); + } + empty(TD); + addClass(wrapper, 'htItemWrapper'); + TD.appendChild(wrapper); + if (itemIsSeparator(item)) { + addClass(TD, 'htSeparator'); + } else if (!isHidden && typeof item.renderer === 'function') { + addClass(TD, 'htCustomMenuRenderer'); + TD.appendChild(item.renderer(hot, wrapper, row, col, prop, value)); + } else { + fastInnerHTML(wrapper, value); + } + if (isHidden) { + if (TD.parentNode) { + addClass(TD.parentNode, 'htHidden'); + } + } else if (itemIsDisabled(item)) { + addClass(TD, 'htDisabled'); + this.eventManager.addEventListener(wrapper, 'mouseenter', (function() { + return hot.deselectCell(); + })); + } else if (itemIsSelectionDisabled(item)) { + addClass(TD, 'htSelectionDisabled'); + this.eventManager.addEventListener(wrapper, 'mouseenter', (function() { + return hot.deselectCell(); + })); + } else if (isSubMenu(item)) { + addClass(TD, 'htSubmenu'); + if (itemIsSelectionDisabled(item)) { + this.eventManager.addEventListener(wrapper, 'mouseenter', (function() { + return hot.deselectCell(); + })); + } else { + this.eventManager.addEventListener(wrapper, 'mouseenter', (function() { + return hot.selectCell(row, col, void 0, void 0, void 0, false); + })); + } + } else { + removeClass(TD, 'htSubmenu'); + removeClass(TD, 'htDisabled'); + if (itemIsSelectionDisabled(item)) { + this.eventManager.addEventListener(wrapper, 'mouseenter', (function() { + return hot.deselectCell(); + })); + } else { + this.eventManager.addEventListener(wrapper, 'mouseenter', (function() { + return hot.selectCell(row, col, void 0, void 0, void 0, false); + })); + } + } + }, + createContainer: function() { + var name = arguments[0] !== (void 0) ? arguments[0] : null; + if (name) { + name = name.replace(/ /g, '_'); + name = this.options.className + 'Sub_' + name; + } + var container; + if (name) { + container = document.querySelector('.' + this.options.className + '.' + name); + } else { + container = document.querySelector('.' + this.options.className); + } + if (!container) { + container = document.createElement('div'); + addClass(container, 'htMenu ' + this.options.className); + if (name) { + addClass(container, name); + } + document.getElementsByTagName('body')[0].appendChild(container); + } + return container; + }, + blockMainTableCallbacks: function() { + this._afterScrollCallback = function() {}; + this.hot.addHook('afterScrollVertically', this._afterScrollCallback); + this.hot.addHook('afterScrollHorizontally', this._afterScrollCallback); + }, + releaseMainTableCallbacks: function() { + if (this._afterScrollCallback) { + this.hot.removeHook('afterScrollVertically', this._afterScrollCallback); + this.hot.removeHook('afterScrollHorizontally', this._afterScrollCallback); + this._afterScrollCallback = null; + } + }, + onBeforeKeyDown: function(event) { + var selection = this.hotMenu.getSelected(); + var stopEvent = false; + switch (event.keyCode) { + case KEY_CODES.ESCAPE: + this.close(); + stopEvent = true; + break; + case KEY_CODES.ENTER: + if (selection) { + if (this.hotMenu.getSourceDataAtRow(selection[0]).submenu) { + stopEvent = true; + } else { + this.executeCommand(event); + this.close(true); + } + } + break; + case KEY_CODES.ARROW_DOWN: + if (selection) { + this.selectNextCell(selection[0], selection[1]); + } else { + this.selectFirstCell(); + } + stopEvent = true; + break; + case KEY_CODES.ARROW_UP: + if (selection) { + this.selectPrevCell(selection[0], selection[1]); + } else { + this.selectLastCell(); + } + stopEvent = true; + break; + case KEY_CODES.ARROW_RIGHT: + if (selection) { + var menu = this.openSubMenu(selection[0]); + if (menu) { + menu.selectFirstCell(); + } + } + stopEvent = true; + break; + case KEY_CODES.ARROW_LEFT: + if (selection && this.isSubMenu()) { + this.close(); + if (this.parentMenu) { + this.parentMenu.hotMenu.listen(); + } + stopEvent = true; + } + break; + } + if (stopEvent) { + event.preventDefault(); + stopImmediatePropagation(event); + } + }, + onAfterInit: function() { + var data = this.hotMenu.getSettings().data; + var hiderStyle = this.hotMenu.view.wt.wtTable.hider.style; + var holderStyle = this.hotMenu.view.wt.wtTable.holder.style; + var currentHiderWidth = parseInt(hiderStyle.width, 10); + var realHeight = 0; + arrayEach(data, (function(value) { + return realHeight += value.name === SEPARATOR ? 1 : 26; + })); + holderStyle.width = currentHiderWidth + 22 + 'px'; + holderStyle.height = realHeight + 4 + 'px'; + }, + onDocumentMouseDown: function(event) { + if (!this.isOpened()) { + return; + } + if (this.container && isChildOf(event.target, this.container)) { + this.executeCommand(event); + } + if ((this.isAllSubMenusClosed() || this.isSubMenu()) && (!isChildOf(event.target, '.htMenu') && isChildOf(event.target, document))) { + this.close(true); + } + } +}, {}); +mixin(Menu, localHooks); +; + +//# +},{"cursor":67,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,"mixins/localHooks":54,"predefinedItems":70,"utils":71}],70:[function(require,module,exports){ +"use strict"; +var $__4; +Object.defineProperties(exports, { + ROW_ABOVE: {get: function() { + return ROW_ABOVE; + }}, + ROW_BELOW: {get: function() { + return ROW_BELOW; + }}, + COLUMN_LEFT: {get: function() { + return COLUMN_LEFT; + }}, + COLUMN_RIGHT: {get: function() { + return COLUMN_RIGHT; + }}, + CLEAR_COLUMN: {get: function() { + return CLEAR_COLUMN; + }}, + REMOVE_ROW: {get: function() { + return REMOVE_ROW; + }}, + REMOVE_COLUMN: {get: function() { + return REMOVE_COLUMN; + }}, + UNDO: {get: function() { + return UNDO; + }}, + REDO: {get: function() { + return REDO; + }}, + READ_ONLY: {get: function() { + return READ_ONLY; + }}, + ALIGNMENT: {get: function() { + return ALIGNMENT; + }}, + SEPARATOR: {get: function() { + return SEPARATOR; + }}, + ITEMS: {get: function() { + return ITEMS; + }}, + predefinedItems: {get: function() { + return predefinedItems; + }}, + addItem: {get: function() { + return addItem; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_object__, + $___46__46__47__46__46__47_helpers_47_number__, + $__utils__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47_helpers_47_object__}), + objectEach = $__0.objectEach, + clone = $__0.clone; +var rangeEach = ($___46__46__47__46__46__47_helpers_47_number__ = require("helpers/number"), $___46__46__47__46__46__47_helpers_47_number__ && $___46__46__47__46__46__47_helpers_47_number__.__esModule && $___46__46__47__46__46__47_helpers_47_number__ || {default: $___46__46__47__46__46__47_helpers_47_number__}).rangeEach; +var $__2 = ($__utils__ = require("utils"), $__utils__ && $__utils__.__esModule && $__utils__ || {default: $__utils__}), + align = $__2.align, + getAlignmentClasses = $__2.getAlignmentClasses, + getValidSelection = $__2.getValidSelection, + checkSelectionConsistency = $__2.checkSelectionConsistency, + markLabelAsSelected = $__2.markLabelAsSelected; +var ROW_ABOVE = 'row_above'; +var ROW_BELOW = 'row_below'; +var COLUMN_LEFT = 'col_left'; +var COLUMN_RIGHT = 'col_right'; +var CLEAR_COLUMN = 'clear_column'; +var REMOVE_ROW = 'remove_row'; +var REMOVE_COLUMN = 'remove_col'; +var UNDO = 'undo'; +var REDO = 'redo'; +var READ_ONLY = 'make_read_only'; +var ALIGNMENT = 'alignment'; +var SEPARATOR = '---------'; +var ITEMS = [ROW_ABOVE, ROW_BELOW, COLUMN_LEFT, COLUMN_RIGHT, CLEAR_COLUMN, REMOVE_ROW, REMOVE_COLUMN, UNDO, REDO, READ_ONLY, ALIGNMENT, SEPARATOR]; +function predefinedItems() { + var items = {}; + objectEach(_predefinedItems, (function(value, key) { + return items[key] = clone(value); + })); + return items; +} +function addItem(key, item) { + if (ITEMS.indexOf(key) === -1) { + _predefinedItems[key] = item; + } +} +var _predefinedItems = ($__4 = {}, Object.defineProperty($__4, SEPARATOR, { + value: {name: SEPARATOR}, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__4, ROW_ABOVE, { + value: { + key: ROW_ABOVE, + name: 'Insert row above', + callback: function(key, selection) { + this.alter('insert_row', selection.start.row); + }, + disabled: function() { + var selected = getValidSelection(this); + if (!selected || this.countRows() >= this.getSettings().maxRows) { + return true; + } + var rowCount = this.countRows(); + var entireColumnSelection = [0, selected[1], rowCount - 1, selected[1]]; + return (entireColumnSelection.join(',') === selected.join(',')) && rowCount > 1; + }, + hidden: function() { + return !this.getSettings().allowInsertRow; + } + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__4, ROW_BELOW, { + value: { + key: ROW_BELOW, + name: 'Insert row below', + callback: function(key, selection) { + this.alter('insert_row', selection.end.row + 1); + }, + disabled: function() { + var selected = getValidSelection(this); + if (!selected || this.countRows() >= this.getSettings().maxRows) { + return true; + } + var rowCount = this.countRows(); + var entireColumnSelection = [0, selected[1], rowCount - 1, selected[1]]; + return (entireColumnSelection.join(',') === selected.join(',')) && rowCount > 1; + }, + hidden: function() { + return !this.getSettings().allowInsertRow; + } + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__4, COLUMN_LEFT, { + value: { + key: COLUMN_LEFT, + name: 'Insert column on the left', + callback: function(key, selection) { + this.alter('insert_col', selection.start.col); + }, + disabled: function() { + var selected = getValidSelection(this); + if (!selected) { + return true; + } + if (!this.isColumnModificationAllowed()) { + return true; + } + var entireRowSelection = [selected[0], 0, selected[0], this.countCols() - 1]; + var rowSelected = entireRowSelection.join(',') == selected.join(','); + return selected[1] < 0 || this.countCols() >= this.getSettings().maxCols || rowSelected; + }, + hidden: function() { + return !this.getSettings().allowInsertColumn; + } + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__4, COLUMN_RIGHT, { + value: { + key: COLUMN_RIGHT, + name: 'Insert column on the right', + callback: function(key, selection) { + this.alter('insert_col', selection.end.col + 1); + }, + disabled: function() { + var selected = getValidSelection(this); + if (!selected) { + return true; + } + if (!this.isColumnModificationAllowed()) { + return true; + } + var entireRowSelection = [selected[0], 0, selected[0], this.countCols() - 1]; + var rowSelected = entireRowSelection.join(',') == selected.join(','); + return selected[1] < 0 || this.countCols() >= this.getSettings().maxCols || rowSelected; + }, + hidden: function() { + return !this.getSettings().allowInsertColumn; + } + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__4, CLEAR_COLUMN, { + value: { + key: CLEAR_COLUMN, + name: 'Clear column', + callback: function(key, selection) { + var column = selection.start.col; + if (this.countRows()) { + this.populateFromArray(0, column, [[null]], Math.max(selection.start.row, selection.end.row), column); + } + }, + disabled: function() { + var selected = getValidSelection(this); + if (!selected) { + return true; + } + var entireRowSelection = [selected[0], 0, selected[0], this.countCols() - 1]; + var rowSelected = entireRowSelection.join(',') == selected.join(','); + return selected[1] < 0 || this.countCols() >= this.getSettings().maxCols || rowSelected; + } + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__4, REMOVE_ROW, { + value: { + key: REMOVE_ROW, + name: 'Remove row', + callback: function(key, selection) { + var amount = selection.end.row - selection.start.row + 1; + this.alter('remove_row', selection.start.row, amount); + }, + disabled: function() { + var selected = getValidSelection(this); + if (!selected) { + return true; + } + var entireColumnSelection = [0, selected[1], this.countRows() - 1, selected[1]]; + return entireColumnSelection.join(',') === selected.join(','); + }, + hidden: function() { + return !this.getSettings().allowRemoveRow; + } + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__4, REMOVE_COLUMN, { + value: { + key: REMOVE_COLUMN, + name: 'Remove column', + callback: function(key, selection) { + var amount = selection.end.col - selection.start.col + 1; + this.alter('remove_col', selection.start.col, amount); + }, + disabled: function() { + var selected = getValidSelection(this); + if (!selected) { + return true; + } + if (!this.isColumnModificationAllowed()) { + return true; + } + var entireRowSelection = [selected[0], 0, selected[0], this.countCols() - 1]; + var rowSelected = entireRowSelection.join(',') == selected.join(','); + return (selected[1] < 0 || rowSelected); + }, + hidden: function() { + return !this.getSettings().allowRemoveColumn; + } + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__4, UNDO, { + value: { + key: UNDO, + name: 'Undo', + callback: function() { + this.undo(); + }, + disabled: function() { + return this.undoRedo && !this.undoRedo.isUndoAvailable(); + } + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__4, REDO, { + value: { + key: REDO, + name: 'Redo', + callback: function() { + this.redo(); + }, + disabled: function() { + return this.undoRedo && !this.undoRedo.isRedoAvailable(); + } + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__4, READ_ONLY, { + value: { + key: READ_ONLY, + name: function() { + var $__3 = this; + var label = 'Read only'; + var atLeastOneReadOnly = checkSelectionConsistency(this.getSelectedRange(), (function(row, col) { + return $__3.getCellMeta(row, col).readOnly; + })); + if (atLeastOneReadOnly) { + label = markLabelAsSelected(label); + } + return label; + }, + callback: function() { + var $__3 = this; + var range = this.getSelectedRange(); + var atLeastOneReadOnly = checkSelectionConsistency(range, (function(row, col) { + return $__3.getCellMeta(row, col).readOnly; + })); + range.forAll((function(row, col) { + $__3.getCellMeta(row, col).readOnly = atLeastOneReadOnly ? false : true; + })); + this.render(); + }, + disabled: function() { + return this.getSelectedRange() ? false : true; + } + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__4, ALIGNMENT, { + value: { + key: ALIGNMENT, + name: 'Alignment', + disabled: function() { + return this.getSelectedRange() ? false : true; + }, + submenu: {items: [{ + key: (ALIGNMENT + ":left"), + name: function() { + var $__3 = this; + var label = 'Left'; + var hasClass = checkSelectionConsistency(this.getSelectedRange(), (function(row, col) { + var className = $__3.getCellMeta(row, col).className; + if (className && className.indexOf('htLeft') !== -1) { + return true; + } + })); + if (hasClass) { + label = markLabelAsSelected(label); + } + return label; + }, + callback: function() { + var $__3 = this; + var range = this.getSelectedRange(); + var stateBefore = getAlignmentClasses(range, (function(row, col) { + return $__3.getCellMeta(row, col).className; + })); + var type = 'horizontal'; + var alignment = 'htLeft'; + this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment); + align(range, type, alignment, (function(row, col) { + return $__3.getCellMeta(row, col); + })); + this.render(); + }, + disabled: false + }, { + key: (ALIGNMENT + ":center"), + name: function() { + var $__3 = this; + var label = 'Center'; + var hasClass = checkSelectionConsistency(this.getSelectedRange(), (function(row, col) { + var className = $__3.getCellMeta(row, col).className; + if (className && className.indexOf('htCenter') !== -1) { + return true; + } + })); + if (hasClass) { + label = markLabelAsSelected(label); + } + return label; + }, + callback: function() { + var $__3 = this; + var range = this.getSelectedRange(); + var stateBefore = getAlignmentClasses(range, (function(row, col) { + return $__3.getCellMeta(row, col).className; + })); + var type = 'horizontal'; + var alignment = 'htCenter'; + this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment); + align(range, type, alignment, (function(row, col) { + return $__3.getCellMeta(row, col); + })); + this.render(); + }, + disabled: false + }, { + key: (ALIGNMENT + ":right"), + name: function() { + var $__3 = this; + var label = 'Right'; + var hasClass = checkSelectionConsistency(this.getSelectedRange(), (function(row, col) { + var className = $__3.getCellMeta(row, col).className; + if (className && className.indexOf('htRight') !== -1) { + return true; + } + })); + if (hasClass) { + label = markLabelAsSelected(label); + } + return label; + }, + callback: function() { + var $__3 = this; + var range = this.getSelectedRange(); + var stateBefore = getAlignmentClasses(range, (function(row, col) { + return $__3.getCellMeta(row, col).className; + })); + var type = 'horizontal'; + var alignment = 'htRight'; + this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment); + align(range, type, alignment, (function(row, col) { + return $__3.getCellMeta(row, col); + })); + this.render(); + }, + disabled: false + }, { + key: (ALIGNMENT + ":justify"), + name: function() { + var $__3 = this; + var label = 'Justify'; + var hasClass = checkSelectionConsistency(this.getSelectedRange(), (function(row, col) { + var className = $__3.getCellMeta(row, col).className; + if (className && className.indexOf('htJustify') !== -1) { + return true; + } + })); + if (hasClass) { + label = markLabelAsSelected(label); + } + return label; + }, + callback: function() { + var $__3 = this; + var range = this.getSelectedRange(); + var stateBefore = getAlignmentClasses(range, (function(row, col) { + return $__3.getCellMeta(row, col).className; + })); + var type = 'horizontal'; + var alignment = 'htJustify'; + this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment); + align(range, type, alignment, (function(row, col) { + return $__3.getCellMeta(row, col); + })); + this.render(); + }, + disabled: false + }, {name: SEPARATOR}, { + key: (ALIGNMENT + ":top"), + name: function() { + var $__3 = this; + var label = 'Top'; + var hasClass = checkSelectionConsistency(this.getSelectedRange(), (function(row, col) { + var className = $__3.getCellMeta(row, col).className; + if (className && className.indexOf('htTop') !== -1) { + return true; + } + })); + if (hasClass) { + label = markLabelAsSelected(label); + } + return label; + }, + callback: function() { + var $__3 = this; + var range = this.getSelectedRange(); + var stateBefore = getAlignmentClasses(range, (function(row, col) { + return $__3.getCellMeta(row, col).className; + })); + var type = 'vertical'; + var alignment = 'htTop'; + this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment); + align(range, type, alignment, (function(row, col) { + return $__3.getCellMeta(row, col); + })); + this.render(); + }, + disabled: false + }, { + key: (ALIGNMENT + ":middle"), + name: function() { + var $__3 = this; + var label = 'Middle'; + var hasClass = checkSelectionConsistency(this.getSelectedRange(), (function(row, col) { + var className = $__3.getCellMeta(row, col).className; + if (className && className.indexOf('htMiddle') !== -1) { + return true; + } + })); + if (hasClass) { + label = markLabelAsSelected(label); + } + return label; + }, + callback: function() { + var $__3 = this; + var range = this.getSelectedRange(); + var stateBefore = getAlignmentClasses(range, (function(row, col) { + return $__3.getCellMeta(row, col).className; + })); + var type = 'vertical'; + var alignment = 'htMiddle'; + this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment); + align(range, type, alignment, (function(row, col) { + return $__3.getCellMeta(row, col); + })); + this.render(); + }, + disabled: false + }, { + key: (ALIGNMENT + ":bottom"), + name: function() { + var $__3 = this; + var label = 'Bottom'; + var hasClass = checkSelectionConsistency(this.getSelectedRange(), (function(row, col) { + var className = $__3.getCellMeta(row, col).className; + if (className && className.indexOf('htBottom') !== -1) { + return true; + } + })); + if (hasClass) { + label = markLabelAsSelected(label); + } + return label; + }, + callback: function() { + var $__3 = this; + var range = this.getSelectedRange(); + var stateBefore = getAlignmentClasses(range, (function(row, col) { + return $__3.getCellMeta(row, col).className; + })); + var type = 'vertical'; + var alignment = 'htBottom'; + this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment); + align(range, type, alignment, (function(row, col) { + return $__3.getCellMeta(row, col); + })); + this.render(); + }, + disabled: false + }]} + }, + configurable: true, + enumerable: true, + writable: true +}), $__4); + +//# +},{"helpers/number":49,"helpers/object":50,"utils":71}],71:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + normalizeSelection: {get: function() { + return normalizeSelection; + }}, + isSeparator: {get: function() { + return isSeparator; + }}, + hasSubMenu: {get: function() { + return hasSubMenu; + }}, + isDisabled: {get: function() { + return isDisabled; + }}, + isSelectionDisabled: {get: function() { + return isSelectionDisabled; + }}, + getValidSelection: {get: function() { + return getValidSelection; + }}, + prepareVerticalAlignClass: {get: function() { + return prepareVerticalAlignClass; + }}, + prepareHorizontalAlignClass: {get: function() { + return prepareHorizontalAlignClass; + }}, + getAlignmentClasses: {get: function() { + return getAlignmentClasses; + }}, + align: {get: function() { + return align; + }}, + checkSelectionConsistency: {get: function() { + return checkSelectionConsistency; + }}, + markLabelAsSelected: {get: function() { + return markLabelAsSelected; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_dom_47_element__; +var hasClass = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}).hasClass; +function normalizeSelection(selRange) { + return { + start: selRange.getTopLeftCorner(), + end: selRange.getBottomRightCorner() + }; +} +function isSeparator(cell) { + return hasClass(cell, 'htSeparator'); +} +function hasSubMenu(cell) { + return hasClass(cell, 'htSubmenu'); +} +function isDisabled(cell) { + return hasClass(cell, 'htDisabled'); +} +function isSelectionDisabled(cell) { + return hasClass(cell, 'htSelectionDisabled'); +} +function getValidSelection(hot) { + var selected = hot.getSelected(); + if (!selected) { + return null; + } + if (selected[0] < 0) { + return null; + } + return selected; +} +function prepareVerticalAlignClass(className, alignment) { + if (className.indexOf(alignment) != -1) { + return className; + } + className = className.replace('htTop', '').replace('htMiddle', '').replace('htBottom', '').replace(' ', ''); + className += ' ' + alignment; + return className; +} +function prepareHorizontalAlignClass(className, alignment) { + if (className.indexOf(alignment) != -1) { + return className; + } + className = className.replace('htLeft', '').replace('htCenter', '').replace('htRight', '').replace('htJustify', '').replace(' ', ''); + className += ' ' + alignment; + return className; +} +function getAlignmentClasses(range, callback) { + var classes = {}; + for (var row = range.from.row; row <= range.to.row; row++) { + for (var col = range.from.col; col <= range.to.col; col++) { + if (!classes[row]) { + classes[row] = []; + } + classes[row][col] = callback(row, col); + } + } + return classes; +} +function align(range, type, alignment, cellDescriptor) { + if (range.from.row == range.to.row && range.from.col == range.to.col) { + applyAlignClassName(range.from.row, range.from.col, type, alignment, cellDescriptor); + } else { + for (var row = range.from.row; row <= range.to.row; row++) { + for (var col = range.from.col; col <= range.to.col; col++) { + applyAlignClassName(row, col, type, alignment, cellDescriptor); + } + } + } +} +function applyAlignClassName(row, col, type, alignment, cellDescriptor) { + var cellMeta = cellDescriptor(row, col); + var className = alignment; + if (cellMeta.className) { + if (type === 'vertical') { + className = prepareVerticalAlignClass(cellMeta.className, alignment); + } else { + className = prepareHorizontalAlignClass(cellMeta.className, alignment); + } + } + cellMeta.className = className; +} +function checkSelectionConsistency(range, comparator) { + var result = false; + if (range) { + range.forAll(function(row, col) { + if (comparator(row, col)) { + result = true; + return false; + } + }); + } + return result; +} +function markLabelAsSelected(label) { + return '' + String.fromCharCode(10003) + '' + label; +} + +//# +},{"helpers/dom/element":45}],72:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + ContextMenuCopyPaste: {get: function() { + return ContextMenuCopyPaste; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_helpers_47_array__, + $___46__46__47__46__46__47_eventManager__, + $___46__46__47__46__46__47_plugins__, + $___46__46__47__95_base__, + $__zeroclipboard__; +var removeClass = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}).removeClass; +var arrayEach = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}).arrayEach; +var EventManager = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).EventManager; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default; +var ZeroClipboard = ($__zeroclipboard__ = require("zeroclipboard"), $__zeroclipboard__ && $__zeroclipboard__.__esModule && $__zeroclipboard__ || {default: $__zeroclipboard__}).default; +var ContextMenuCopyPaste = function ContextMenuCopyPaste(hotInstance) { + $traceurRuntime.superConstructor($ContextMenuCopyPaste).call(this, hotInstance); + this.eventManager = new EventManager(this); + this.swfPath = null; + this.outsideClickDeselectsCache = null; +}; +var $ContextMenuCopyPaste = ContextMenuCopyPaste; +($traceurRuntime.createClass)(ContextMenuCopyPaste, { + isEnabled: function() { + return this.hot.getSettings().contextMenuCopyPaste; + }, + enablePlugin: function() { + var $__6 = this; + if (this.enabled) { + return; + } + if (typeof this.hot.getSettings().contextMenuCopyPaste === 'object') { + this.swfPath = this.hot.getSettings().contextMenuCopyPaste.swfPath; + } + if (typeof ZeroClipboard === 'undefined') { + console.error('To be able to use the Copy/Paste feature from the context menu, you need to manually include ZeroClipboard.js file to your website.'); + } + try { + new ActiveXObject('ShockwaveFlash.ShockwaveFlash'); + } catch (exception) { + if (typeof navigator.mimeTypes['application/x-shockwave-flash'] == 'undefined') { + console.error('To be able to use the Copy/Paste feature from the context menu, your browser needs to have Flash Plugin installed.'); + } + } + if (this.swfPath) { + ZeroClipboard.config({swfPath: this.swfPath}); + } + this.hot.addHook('afterContextMenuShow', (function() { + return $__6.onAfterContextMenuShow(); + })); + this.hot.addHook('afterContextMenuDefaultOptions', (function(options) { + return $__6.onAfterContextMenuDefaultOptions(options); + })); + this.registerEvents(); + $traceurRuntime.superGet(this, $ContextMenuCopyPaste.prototype, "enablePlugin").call(this); + }, + disablePlugin: function() { + $traceurRuntime.superGet(this, $ContextMenuCopyPaste.prototype, "disablePlugin").call(this); + }, + registerEvents: function() { + var $__6 = this; + this.eventManager.addEventListener(document, 'mouseenter', (function() { + return $__6.removeCurrentClass(); + })); + this.eventManager.addEventListener(document, 'mouseleave', (function() { + return $__6.removeZeroClipboardClass(); + })); + }, + getCopyValue: function() { + this.hot.copyPaste.setCopyableText(); + return this.hot.copyPaste.copyPasteInstance.elTextarea.value; + }, + onAfterContextMenuDefaultOptions: function(defaultOptions) { + defaultOptions.items.unshift({ + key: 'copy', + name: 'Copy' + }, { + key: 'paste', + name: 'Paste', + callback: function() { + this.copyPaste.triggerPaste(); + } + }, Handsontable.plugins.ContextMenu.SEPARATOR); + }, + onAfterContextMenuShow: function() { + var $__6 = this; + var contextMenu = this.hot.getPlugin('contextMenu'); + var data = contextMenu.menu.hotMenu.getSourceData(); + arrayEach(data, (function(item, index) { + if (item.key === 'copy') { + var zeroClipboardInstance = new ZeroClipboard(contextMenu.menu.hotMenu.getCell(index, 0)); + zeroClipboardInstance.off(); + zeroClipboardInstance.on('copy', (function(event) { + var clipboard = event.clipboardData; + clipboard.setData('text/plain', $__6.getCopyValue()); + $__6.hot.getSettings().outsideClickDeselects = $__6.outsideClickDeselectsCache; + })); + return false; + } + })); + }, + removeCurrentClass: function() { + var contextMenu = this.hot.getPlugin('contextMenu'); + if (contextMenu.menu.isOpened()) { + var element = contextMenu.menu.hotMenu.rootElement.querySelector('td.current'); + if (element) { + removeClass(element, 'current'); + } + } + this.outsideClickDeselectsCache = this.hot.getSettings().outsideClickDeselects; + this.hot.getSettings().outsideClickDeselects = false; + }, + removeZeroClipboardClass: function() { + var contextMenu = this.hot.getPlugin('contextMenu'); + if (contextMenu.menu.isOpened()) { + var element = contextMenu.menu.hotMenu.rootElement.querySelector('td.zeroclipboard-is-hover'); + if (element) { + removeClass(element, 'zeroclipboard-is-hover'); + } + } + this.hot.getSettings().outsideClickDeselects = this.outsideClickDeselectsCache; + } +}, {}, BasePlugin); +; +registerPlugin('contextMenuCopyPaste', ContextMenuCopyPaste); + +//# +},{"_base":58,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"plugins":57,"zeroclipboard":"zeroclipboard"}],73:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + CopyPastePlugin: {get: function() { + return CopyPastePlugin; + }}, + __esModule: {value: true} +}); +var $__copyPaste__, + $__SheetClip__, + $___46__46__47__46__46__47_helpers_47_unicode__, + $___46__46__47__46__46__47_helpers_47_array__, + $___46__46__47__46__46__47_helpers_47_number__, + $___46__46__47__46__46__47_helpers_47_dom_47_event__, + $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_helpers_47_function__, + $___46__46__47__46__46__47_plugins__, + $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__, + $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__; +var copyPaste = ($__copyPaste__ = require("copyPaste"), $__copyPaste__ && $__copyPaste__.__esModule && $__copyPaste__ || {default: $__copyPaste__}).default; +var SheetClip = ($__SheetClip__ = require("SheetClip"), $__SheetClip__ && $__SheetClip__.__esModule && $__SheetClip__ || {default: $__SheetClip__}).default; +var $__2 = ($___46__46__47__46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47__46__46__47_helpers_47_unicode__ && $___46__46__47__46__46__47_helpers_47_unicode__.__esModule && $___46__46__47__46__46__47_helpers_47_unicode__ || {default: $___46__46__47__46__46__47_helpers_47_unicode__}), + KEY_CODES = $__2.KEY_CODES, + isCtrlKey = $__2.isCtrlKey; +var arrayEach = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}).arrayEach; +var rangeEach = ($___46__46__47__46__46__47_helpers_47_number__ = require("helpers/number"), $___46__46__47__46__46__47_helpers_47_number__ && $___46__46__47__46__46__47_helpers_47_number__.__esModule && $___46__46__47__46__46__47_helpers_47_number__ || {default: $___46__46__47__46__46__47_helpers_47_number__}).rangeEach; +var $__5 = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}), + stopImmediatePropagation = $__5.stopImmediatePropagation, + isImmediatePropagationStopped = $__5.isImmediatePropagationStopped; +var getSelectionText = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}).getSelectionText; +var proxy = ($___46__46__47__46__46__47_helpers_47_function__ = require("helpers/function"), $___46__46__47__46__46__47_helpers_47_function__ && $___46__46__47__46__46__47_helpers_47_function__.__esModule && $___46__46__47__46__46__47_helpers_47_function__ || {default: $___46__46__47__46__46__47_helpers_47_function__}).proxy; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var WalkontableCellCoords = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords; +var WalkontableCellRange = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ = require("3rdparty/walkontable/src/cell/range"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__}).WalkontableCellRange; +function CopyPastePlugin(instance) { + var _this = this; + this.copyPasteInstance = copyPaste(); + this.copyPasteInstance.onCut(onCut); + this.copyPasteInstance.onPaste(onPaste); + this.onPaste = onPaste; + instance.addHook('beforeKeyDown', onBeforeKeyDown); + function onCut() { + if (!instance.isListening()) { + return; + } + instance.selection.empty(); + } + function onPaste(str) { + var input, + inputArray, + selected, + coordsFrom, + coordsTo, + cellRange, + topLeftCorner, + bottomRightCorner, + areaStart, + areaEnd; + if (!instance.isListening() || !instance.selection.isSelected()) { + return; + } + input = str; + inputArray = SheetClip.parse(input); + selected = instance.getSelected(); + coordsFrom = new WalkontableCellCoords(selected[0], selected[1]); + coordsTo = new WalkontableCellCoords(selected[2], selected[3]); + cellRange = new WalkontableCellRange(coordsFrom, coordsFrom, coordsTo); + topLeftCorner = cellRange.getTopLeftCorner(); + bottomRightCorner = cellRange.getBottomRightCorner(); + areaStart = topLeftCorner; + areaEnd = new WalkontableCellCoords(Math.max(bottomRightCorner.row, inputArray.length - 1 + topLeftCorner.row), Math.max(bottomRightCorner.col, inputArray[0].length - 1 + topLeftCorner.col)); + var isSelRowAreaCoverInputValue = coordsTo.row - coordsFrom.row >= inputArray.length - 1; + var isSelColAreaCoverInputValue = coordsTo.col - coordsFrom.col >= inputArray[0].length - 1; + instance.addHookOnce('afterChange', (function(changes, source) { + var changesLength = changes ? changes.length : 0; + if (changesLength) { + var offset = { + row: 0, + col: 0 + }; + var highestColumnIndex = -1; + arrayEach(changes, (function(change, index) { + var nextChange = changesLength > index + 1 ? changes[index + 1] : null; + if (nextChange) { + if (!isSelRowAreaCoverInputValue) { + offset.row = offset.row + Math.max(nextChange[0] - change[0] - 1, 0); + } + if (!isSelColAreaCoverInputValue && change[1] > highestColumnIndex) { + highestColumnIndex = change[1]; + offset.col = offset.col + Math.max(nextChange[1] - change[1] - 1, 0); + } + } + })); + instance.selectCell(areaStart.row, areaStart.col, areaEnd.row + offset.row, areaEnd.col + offset.col); + } + })); + instance.populateFromArray(areaStart.row, areaStart.col, inputArray, areaEnd.row, areaEnd.col, 'paste', instance.getSettings().pasteMode); + } + function onBeforeKeyDown(event) { + if (!instance.getSelected()) { + return; + } + if (instance.getActiveEditor() && instance.getActiveEditor().isOpened()) { + return; + } + if (isImmediatePropagationStopped(event)) { + return; + } + if (isCtrlKey(event.keyCode)) { + if (instance.getSettings().fragmentSelection && getSelectionText()) { + return; + } + _this.setCopyableText(); + stopImmediatePropagation(event); + return; + } + var ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey; + if (event.keyCode == KEY_CODES.A && ctrlDown) { + instance._registerTimeout(setTimeout(proxy(_this.setCopyableText, _this), 0)); + } + } + this.destroy = function() { + if (this.copyPasteInstance) { + this.copyPasteInstance.removeCallback(onCut); + this.copyPasteInstance.removeCallback(onPaste); + this.copyPasteInstance.destroy(); + this.copyPasteInstance = null; + } + instance.removeHook('beforeKeyDown', onBeforeKeyDown); + }; + instance.addHook('afterDestroy', proxy(this.destroy, this)); + this.triggerPaste = proxy(this.copyPasteInstance.triggerPaste, this.copyPasteInstance); + this.triggerCut = proxy(this.copyPasteInstance.triggerCut, this.copyPasteInstance); + this.setCopyableText = function() { + var settings = instance.getSettings(); + var copyRowsLimit = settings.copyRowsLimit; + var copyColsLimit = settings.copyColsLimit; + var selRange = instance.getSelectedRange(); + var topLeft = selRange.getTopLeftCorner(); + var bottomRight = selRange.getBottomRightCorner(); + var startRow = topLeft.row; + var startCol = topLeft.col; + var endRow = bottomRight.row; + var endCol = bottomRight.col; + var finalEndRow = Math.min(endRow, startRow + copyRowsLimit - 1); + var finalEndCol = Math.min(endCol, startCol + copyColsLimit - 1); + var copyableRanges = []; + copyableRanges.push({ + startRow: startRow, + startCol: startCol, + endRow: finalEndRow, + endCol: finalEndCol + }); + copyableRanges = Handsontable.hooks.run(instance, 'modifyCopyableRange', copyableRanges); + var copyableData = this.getRangedCopyableData(copyableRanges); + instance.copyPaste.copyPasteInstance.copyable(copyableData); + if (endRow !== finalEndRow || endCol !== finalEndCol) { + Handsontable.hooks.run(instance, 'afterCopyLimit', endRow - startRow + 1, endCol - startCol + 1, copyRowsLimit, copyColsLimit); + } + }; + this.getRangedCopyableData = function(ranges) { + var dataSet = []; + var copyableRows = []; + var copyableColumns = []; + arrayEach(ranges, (function(range) { + rangeEach(range.startRow, range.endRow, (function(row) { + if (copyableRows.indexOf(row) === -1) { + copyableRows.push(row); + } + })); + rangeEach(range.startCol, range.endCol, (function(column) { + if (copyableColumns.indexOf(column) === -1) { + copyableColumns.push(column); + } + })); + })); + arrayEach(copyableRows, (function(row) { + var rowSet = []; + arrayEach(copyableColumns, (function(column) { + rowSet.push(instance.getCopyableData(row, column)); + })); + dataSet.push(rowSet); + })); + return SheetClip.stringify(dataSet); + }; +} +function init() { + var instance = this, + pluginEnabled = instance.getSettings().copyPaste !== false; + if (pluginEnabled && !instance.copyPaste) { + instance.copyPaste = new CopyPastePlugin(instance); + } else if (!pluginEnabled && instance.copyPaste) { + instance.copyPaste.destroy(); + instance.copyPaste = null; + } +} +Handsontable.hooks.add('afterInit', init); +Handsontable.hooks.add('afterUpdateSettings', init); +Handsontable.hooks.register('afterCopyLimit'); +Handsontable.hooks.register('modifyCopyableRange'); +; + +//# +},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"SheetClip":"SheetClip","copyPaste":"copyPaste","helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/function":47,"helpers/number":49,"helpers/unicode":53,"plugins":57}],74:[function(require,module,exports){ +"use strict"; +var $___46__46__47__46__46__47_plugins__, + $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__, + $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_selection__; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var WalkontableCellRange = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ = require("3rdparty/walkontable/src/cell/range"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__}).WalkontableCellRange; +var WalkontableSelection = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_selection__ = require("3rdparty/walkontable/src/selection"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_selection__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_selection__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_selection__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_selection__}).WalkontableSelection; +function CustomBorders() {} +var instance; +var checkEnable = function(customBorders) { + if (typeof customBorders === 'boolean') { + if (customBorders === true) { + return true; + } + } + if (typeof customBorders === 'object') { + if (customBorders.length > 0) { + return true; + } + } + return false; +}; +var init = function() { + if (checkEnable(this.getSettings().customBorders)) { + if (!this.customBorders) { + instance = this; + this.customBorders = new CustomBorders(); + } + } +}; +var getSettingIndex = function(className) { + for (var i = 0; i < instance.view.wt.selections.length; i++) { + if (instance.view.wt.selections[i].settings.className == className) { + return i; + } + } + return -1; +}; +var insertBorderIntoSettings = function(border) { + var coordinates = { + row: border.row, + col: border.col + }; + var selection = new WalkontableSelection(border, new WalkontableCellRange(coordinates, coordinates, coordinates)); + var index = getSettingIndex(border.className); + if (index >= 0) { + instance.view.wt.selections[index] = selection; + } else { + instance.view.wt.selections.push(selection); + } +}; +var prepareBorderFromCustomAdded = function(row, col, borderObj) { + var border = createEmptyBorders(row, col); + border = extendDefaultBorder(border, borderObj); + this.setCellMeta(row, col, 'borders', border); + insertBorderIntoSettings(border); +}; +var prepareBorderFromCustomAddedRange = function(rowObj) { + var range = rowObj.range; + for (var row = range.from.row; row <= range.to.row; row++) { + for (var col = range.from.col; col <= range.to.col; col++) { + var border = createEmptyBorders(row, col); + var add = 0; + if (row == range.from.row) { + add++; + if (rowObj.hasOwnProperty('top')) { + border.top = rowObj.top; + } + } + if (row == range.to.row) { + add++; + if (rowObj.hasOwnProperty('bottom')) { + border.bottom = rowObj.bottom; + } + } + if (col == range.from.col) { + add++; + if (rowObj.hasOwnProperty('left')) { + border.left = rowObj.left; + } + } + if (col == range.to.col) { + add++; + if (rowObj.hasOwnProperty('right')) { + border.right = rowObj.right; + } + } + if (add > 0) { + this.setCellMeta(row, col, 'borders', border); + insertBorderIntoSettings(border); + } + } + } +}; +var createClassName = function(row, col) { + return 'border_row' + row + 'col' + col; +}; +var createDefaultCustomBorder = function() { + return { + width: 1, + color: '#000' + }; +}; +var createSingleEmptyBorder = function() { + return {hide: true}; +}; +var createDefaultHtBorder = function() { + return { + width: 1, + color: '#000', + cornerVisible: false + }; +}; +var createEmptyBorders = function(row, col) { + return { + className: createClassName(row, col), + border: createDefaultHtBorder(), + row: row, + col: col, + top: createSingleEmptyBorder(), + right: createSingleEmptyBorder(), + bottom: createSingleEmptyBorder(), + left: createSingleEmptyBorder() + }; +}; +var extendDefaultBorder = function(defaultBorder, customBorder) { + if (customBorder.hasOwnProperty('border')) { + defaultBorder.border = customBorder.border; + } + if (customBorder.hasOwnProperty('top')) { + defaultBorder.top = customBorder.top; + } + if (customBorder.hasOwnProperty('right')) { + defaultBorder.right = customBorder.right; + } + if (customBorder.hasOwnProperty('bottom')) { + defaultBorder.bottom = customBorder.bottom; + } + if (customBorder.hasOwnProperty('left')) { + defaultBorder.left = customBorder.left; + } + return defaultBorder; +}; +var removeBordersFromDom = function(borderClassName) { + var borders = document.querySelectorAll('.' + borderClassName); + for (var i = 0; i < borders.length; i++) { + if (borders[i]) { + if (borders[i].nodeName != 'TD') { + var parent = borders[i].parentNode; + if (parent.parentNode) { + parent.parentNode.removeChild(parent); + } + } + } + } +}; +var removeAllBorders = function(row, col) { + var borderClassName = createClassName(row, col); + removeBordersFromDom(borderClassName); + this.removeCellMeta(row, col, 'borders'); +}; +var setBorder = function(row, col, place, remove) { + var bordersMeta = this.getCellMeta(row, col).borders; + if (!bordersMeta || bordersMeta.border == undefined) { + bordersMeta = createEmptyBorders(row, col); + } + if (remove) { + bordersMeta[place] = createSingleEmptyBorder(); + } else { + bordersMeta[place] = createDefaultCustomBorder(); + } + this.setCellMeta(row, col, 'borders', bordersMeta); + var borderClassName = createClassName(row, col); + removeBordersFromDom(borderClassName); + insertBorderIntoSettings(bordersMeta); + this.render(); +}; +var prepareBorder = function(range, place, remove) { + if (range.from.row == range.to.row && range.from.col == range.to.col) { + if (place == 'noBorders') { + removeAllBorders.call(this, range.from.row, range.from.col); + } else { + setBorder.call(this, range.from.row, range.from.col, place, remove); + } + } else { + switch (place) { + case 'noBorders': + for (var column = range.from.col; column <= range.to.col; column++) { + for (var row = range.from.row; row <= range.to.row; row++) { + removeAllBorders.call(this, row, column); + } + } + break; + case 'top': + for (var topCol = range.from.col; topCol <= range.to.col; topCol++) { + setBorder.call(this, range.from.row, topCol, place, remove); + } + break; + case 'right': + for (var rowRight = range.from.row; rowRight <= range.to.row; rowRight++) { + setBorder.call(this, rowRight, range.to.col, place); + } + break; + case 'bottom': + for (var bottomCol = range.from.col; bottomCol <= range.to.col; bottomCol++) { + setBorder.call(this, range.to.row, bottomCol, place); + } + break; + case 'left': + for (var rowLeft = range.from.row; rowLeft <= range.to.row; rowLeft++) { + setBorder.call(this, rowLeft, range.from.col, place); + } + break; + } + } +}; +var checkSelectionBorders = function(hot, direction) { + var atLeastOneHasBorder = false; + hot.getSelectedRange().forAll(function(r, c) { + var metaBorders = hot.getCellMeta(r, c).borders; + if (metaBorders) { + if (direction) { + if (!metaBorders[direction].hasOwnProperty('hide')) { + atLeastOneHasBorder = true; + return false; + } + } else { + atLeastOneHasBorder = true; + return false; + } + } + }); + return atLeastOneHasBorder; +}; +var markSelected = function(label) { + return '' + String.fromCharCode(10003) + '' + label; +}; +var addBordersOptionsToContextMenu = function(defaultOptions) { + if (!this.getSettings().customBorders) { + return; + } + defaultOptions.items.push(Handsontable.plugins.ContextMenu.SEPARATOR); + defaultOptions.items.push({ + key: 'borders', + name: 'Borders', + submenu: {items: [{ + key: 'borders:top', + name: function() { + var label = 'Top'; + var hasBorder = checkSelectionBorders(this, 'top'); + if (hasBorder) { + label = markSelected(label); + } + return label; + }, + callback: function() { + var hasBorder = checkSelectionBorders(this, 'top'); + prepareBorder.call(this, this.getSelectedRange(), 'top', hasBorder); + }, + disabled: false + }, { + key: 'borders:right', + name: function() { + var label = 'Right'; + var hasBorder = checkSelectionBorders(this, 'right'); + if (hasBorder) { + label = markSelected(label); + } + return label; + }, + callback: function() { + var hasBorder = checkSelectionBorders(this, 'right'); + prepareBorder.call(this, this.getSelectedRange(), 'right', hasBorder); + }, + disabled: false + }, { + key: 'borders:bottom', + name: function() { + var label = 'Bottom'; + var hasBorder = checkSelectionBorders(this, 'bottom'); + if (hasBorder) { + label = markSelected(label); + } + return label; + }, + callback: function() { + var hasBorder = checkSelectionBorders(this, 'bottom'); + prepareBorder.call(this, this.getSelectedRange(), 'bottom', hasBorder); + }, + disabled: false + }, { + key: 'borders:left', + name: function() { + var label = 'Left'; + var hasBorder = checkSelectionBorders(this, 'left'); + if (hasBorder) { + label = markSelected(label); + } + return label; + }, + callback: function() { + var hasBorder = checkSelectionBorders(this, 'left'); + prepareBorder.call(this, this.getSelectedRange(), 'left', hasBorder); + }, + disabled: false + }, { + key: 'borders:no_borders', + name: 'Remove border(s)', + callback: function() { + prepareBorder.call(this, this.getSelectedRange(), 'noBorders'); + }, + disabled: function() { + return !checkSelectionBorders(this); + } + }]} + }); +}; +Handsontable.hooks.add('beforeInit', init); +Handsontable.hooks.add('afterContextMenuDefaultOptions', addBordersOptionsToContextMenu); +Handsontable.hooks.add('afterInit', function() { + var customBorders = this.getSettings().customBorders; + if (customBorders) { + for (var i = 0; i < customBorders.length; i++) { + if (customBorders[i].range) { + prepareBorderFromCustomAddedRange.call(this, customBorders[i]); + } else { + prepareBorderFromCustomAdded.call(this, customBorders[i].row, customBorders[i].col, customBorders[i]); + } + } + this.render(); + this.view.wt.draw(true); + } +}); +Handsontable.CustomBorders = CustomBorders; + +//# +},{"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/selection":18,"plugins":57}],75:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + DragToScroll: {get: function() { + return DragToScroll; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_eventManager__, + $___46__46__47__46__46__47_plugins__; +var eventManagerObject = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).eventManager; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +; +Handsontable.plugins.DragToScroll = DragToScroll; +function DragToScroll() { + this.boundaries = null; + this.callback = null; +} +DragToScroll.prototype.setBoundaries = function(boundaries) { + this.boundaries = boundaries; +}; +DragToScroll.prototype.setCallback = function(callback) { + this.callback = callback; +}; +DragToScroll.prototype.check = function(x, y) { + var diffX = 0; + var diffY = 0; + if (y < this.boundaries.top) { + diffY = y - this.boundaries.top; + } else if (y > this.boundaries.bottom) { + diffY = y - this.boundaries.bottom; + } + if (x < this.boundaries.left) { + diffX = x - this.boundaries.left; + } else if (x > this.boundaries.right) { + diffX = x - this.boundaries.right; + } + this.callback(diffX, diffY); +}; +var dragToScroll; +var instance; +var setupListening = function(instance) { + instance.dragToScrollListening = false; + var scrollHandler = instance.view.wt.wtTable.holder; + dragToScroll = new DragToScroll(); + if (scrollHandler === window) { + return; + } else { + dragToScroll.setBoundaries(scrollHandler.getBoundingClientRect()); + } + dragToScroll.setCallback(function(scrollX, scrollY) { + if (scrollX < 0) { + scrollHandler.scrollLeft -= 50; + } else if (scrollX > 0) { + scrollHandler.scrollLeft += 50; + } + if (scrollY < 0) { + scrollHandler.scrollTop -= 20; + } else if (scrollY > 0) { + scrollHandler.scrollTop += 20; + } + }); + instance.dragToScrollListening = true; +}; +Handsontable.hooks.add('afterInit', function() { + var instance = this; + var eventManager = eventManagerObject(this); + eventManager.addEventListener(document, 'mouseup', function() { + instance.dragToScrollListening = false; + }); + eventManager.addEventListener(document, 'mousemove', function(event) { + if (instance.dragToScrollListening) { + dragToScroll.check(event.clientX, event.clientY); + } + }); +}); +Handsontable.hooks.add('afterDestroy', function() { + eventManagerObject(this).clear(); +}); +Handsontable.hooks.add('afterOnCellMouseDown', function() { + setupListening(this); +}); +Handsontable.hooks.add('afterOnCellCornerMouseDown', function() { + setupListening(this); +}); +Handsontable.plugins.DragToScroll = DragToScroll; + +//# +},{"eventManager":41,"plugins":57}],76:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + ManualColumnFreeze: {get: function() { + return ManualColumnFreeze; + }}, + __esModule: {value: true} +}); +var $___46__46__47__95_base__, + $___46__46__47__46__46__47_plugins__; +var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var ManualColumnFreeze = function ManualColumnFreeze(hotInstance) { + $traceurRuntime.superConstructor($ManualColumnFreeze).call(this, hotInstance); +}; +var $ManualColumnFreeze = ManualColumnFreeze; +($traceurRuntime.createClass)(ManualColumnFreeze, { + isEnabled: function() { + return !!this.hot.getSettings().manualColumnFreeze; + }, + enablePlugin: function() { + var $__2 = this; + if (this.enabled) { + return; + } + this.addHook('modifyCol', (function(col) { + return $__2.onModifyCol(col); + })); + this.addHook('afterContextMenuDefaultOptions', (function(defaultOptions) { + return $__2.addContextMenuEntry(defaultOptions); + })); + $traceurRuntime.superGet(this, $ManualColumnFreeze.prototype, "enablePlugin").call(this); + }, + disablePlugin: function() { + $traceurRuntime.superGet(this, $ManualColumnFreeze.prototype, "disablePlugin").call(this); + }, + init: function() { + $traceurRuntime.superGet(this, $ManualColumnFreeze.prototype, "init").call(this); + if (typeof this.hot.manualColumnPositionsPluginUsages === 'undefined') { + this.hot.manualColumnPositionsPluginUsages = ['manualColumnFreeze']; + } else { + this.hot.manualColumnPositionsPluginUsages.push('manualColumnFreeze'); + } + this.fixedColumnsCount = this.hot.getSettings().fixedColumnsLeft; + }, + onModifyCol: function(column) { + if (this.hot.manualColumnPositionsPluginUsages.length > 1) { + return column; + } + return this.getModifiedColumnIndex(column); + }, + getModifiedColumnIndex: function(column) { + return this.hot.manualColumnPositions[column]; + }, + addContextMenuEntry: function(defaultOptions) { + var _this = this; + defaultOptions.items.push(Handsontable.plugins.ContextMenu.SEPARATOR, { + key: 'freeze_column', + name: function() { + var selectedColumn = _this.hot.getSelected()[1]; + if (selectedColumn > _this.fixedColumnsCount - 1) { + return 'Freeze this column'; + } else { + return 'Unfreeze this column'; + } + }, + disabled: function() { + var selection = _this.hot.getSelected(); + return selection[1] !== selection[3]; + }, + callback: function() { + var selectedColumn = _this.hot.getSelected()[1]; + if (selectedColumn > _this.fixedColumnsCount - 1) { + _this.freezeColumn(selectedColumn); + } else { + _this.unfreezeColumn(selectedColumn); + } + } + }); + }, + freezeColumn: function(column) { + if (column <= this.fixedColumnsCount - 1) { + return; + } + var modifiedColumn = this.getModifiedColumnIndex(column) || column; + this.checkPositionData(modifiedColumn); + this.modifyColumnOrder(modifiedColumn, column, null, 'freeze'); + this.addFixedColumn(); + this.hot.view.wt.wtOverlays.leftOverlay.refresh(); + this.hot.view.wt.wtOverlays.adjustElementsSize(); + }, + unfreezeColumn: function(column) { + if (column > this.fixedColumnsCount - 1) { + return; + } + var returnCol = this.getBestColumnReturnPosition(column); + var modifiedColumn = this.getModifiedColumnIndex(column) || column; + this.checkPositionData(modifiedColumn); + this.modifyColumnOrder(modifiedColumn, column, returnCol, 'unfreeze'); + this.removeFixedColumn(); + this.hot.view.wt.wtOverlays.leftOverlay.refresh(); + this.hot.view.wt.wtOverlays.adjustElementsSize(); + }, + addFixedColumn: function() { + this.hot.updateSettings({fixedColumnsLeft: this.fixedColumnsCount + 1}); + this.fixedColumnsCount++; + }, + removeFixedColumn: function() { + this.hot.updateSettings({fixedColumnsLeft: this.fixedColumnsCount - 1}); + this.fixedColumnsCount--; + }, + checkPositionData: function(column) { + if (!this.hot.manualColumnPositions || this.hot.manualColumnPositions.length === 0) { + if (!this.hot.manualColumnPositions) { + this.hot.manualColumnPositions = []; + } + } + if (column) { + if (!this.hot.manualColumnPositions[column]) { + this.createPositionData(column + 1); + } + } else { + this.createPositionData(this.hot.countCols()); + } + }, + createPositionData: function(length) { + if (this.hot.manualColumnPositions.length < length) { + for (var i = this.hot.manualColumnPositions.length; i < length; i++) { + this.hot.manualColumnPositions[i] = i; + } + } + }, + modifyColumnOrder: function(column, actualColumn, returnColumn, action) { + if (returnColumn == null) { + returnColumn = column; + } + if (action === 'freeze') { + this.hot.manualColumnPositions.splice(this.fixedColumnsCount, 0, this.hot.manualColumnPositions.splice(actualColumn, 1)[0]); + } else if (action === 'unfreeze') { + this.hot.manualColumnPositions.splice(returnColumn, 0, this.hot.manualColumnPositions.splice(actualColumn, 1)[0]); + } + }, + getBestColumnReturnPosition: function(column) { + var i = this.fixedColumnsCount; + var j = this.getModifiedColumnIndex(i); + var initialCol = this.getModifiedColumnIndex(column); + while (j < initialCol) { + i++; + j = this.getModifiedColumnIndex(i); + } + return i - 1; + } +}, {}, BasePlugin); +; +registerPlugin('manualColumnFreeze', ManualColumnFreeze); + +//# +},{"_base":58,"plugins":57}],77:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + ManualColumnMove: {get: function() { + return ManualColumnMove; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_eventManager__, + $___46__46__47__46__46__47_helpers_47_dom_47_event__, + $___46__46__47__46__46__47_plugins__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + hasClass = $__0.hasClass, + removeClass = $__0.removeClass; +var eventManagerObject = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).eventManager; +var $__2 = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}), + pageX = $__2.pageX, + pageY = $__2.pageY; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +; +function ManualColumnMove() { + var startCol, + endCol, + startX, + startOffset, + currentCol, + instance, + currentTH, + handle = document.createElement('DIV'), + guide = document.createElement('DIV'), + eventManager = eventManagerObject(this); + handle.className = 'manualColumnMover'; + guide.className = 'manualColumnMoverGuide'; + var saveManualColumnPositions = function() { + var instance = this; + Handsontable.hooks.run(instance, 'persistentStateSave', 'manualColumnPositions', instance.manualColumnPositions); + }; + var loadManualColumnPositions = function() { + var instance = this; + var storedState = {}; + Handsontable.hooks.run(instance, 'persistentStateLoad', 'manualColumnPositions', storedState); + return storedState.value; + }; + function setupHandlePosition(TH) { + instance = this; + currentTH = TH; + var col = this.view.wt.wtTable.getCoords(TH).col; + if (col >= 0) { + currentCol = col; + var box = currentTH.getBoundingClientRect(); + startOffset = box.left; + handle.style.top = box.top + 'px'; + handle.style.left = startOffset + 'px'; + instance.rootElement.appendChild(handle); + } + } + function refreshHandlePosition(TH, delta) { + var box = TH.getBoundingClientRect(); + var handleWidth = 6; + if (delta > 0) { + handle.style.left = (box.left + box.width - handleWidth) + 'px'; + } else { + handle.style.left = box.left + 'px'; + } + } + function setupGuidePosition() { + var instance = this; + addClass(handle, 'active'); + addClass(guide, 'active'); + var box = currentTH.getBoundingClientRect(); + guide.style.width = box.width + 'px'; + guide.style.height = instance.view.maximumVisibleElementHeight(0) + 'px'; + guide.style.top = handle.style.top; + guide.style.left = startOffset + 'px'; + instance.rootElement.appendChild(guide); + } + function refreshGuidePosition(diff) { + guide.style.left = startOffset + diff + 'px'; + } + function hideHandleAndGuide() { + removeClass(handle, 'active'); + removeClass(guide, 'active'); + } + var checkColumnHeader = function(element) { + if (element.tagName != 'BODY') { + if (element.parentNode.tagName == 'THEAD') { + return true; + } else { + element = element.parentNode; + return checkColumnHeader(element); + } + } + return false; + }; + var getTHFromTargetElement = function(element) { + if (element.tagName != 'TABLE') { + if (element.tagName == 'TH') { + return element; + } else { + return getTHFromTargetElement(element.parentNode); + } + } + return null; + }; + var bindEvents = function() { + var instance = this; + var pressed; + eventManager.addEventListener(instance.rootElement, 'mouseover', function(e) { + if (checkColumnHeader(e.target)) { + var th = getTHFromTargetElement(e.target); + if (th) { + if (pressed) { + var col = instance.view.wt.wtTable.getCoords(th).col; + if (col >= 0) { + endCol = col; + refreshHandlePosition(e.target, endCol - startCol); + } + } else { + setupHandlePosition.call(instance, th); + } + } + } + }); + eventManager.addEventListener(instance.rootElement, 'mousedown', function(e) { + if (hasClass(e.target, 'manualColumnMover')) { + startX = pageX(e); + setupGuidePosition.call(instance); + pressed = instance; + startCol = currentCol; + endCol = currentCol; + } + }); + eventManager.addEventListener(window, 'mousemove', function(e) { + if (pressed) { + refreshGuidePosition(pageX(e) - startX); + } + }); + eventManager.addEventListener(window, 'mouseup', function(e) { + if (pressed) { + hideHandleAndGuide(); + pressed = false; + createPositionData(instance.manualColumnPositions, instance.countCols()); + instance.manualColumnPositions.splice(endCol, 0, instance.manualColumnPositions.splice(startCol, 1)[0]); + Handsontable.hooks.run(instance, 'beforeColumnMove', startCol, endCol); + instance.forceFullRender = true; + instance.view.render(); + saveManualColumnPositions.call(instance); + Handsontable.hooks.run(instance, 'afterColumnMove', startCol, endCol); + setupHandlePosition.call(instance, currentTH); + } + }); + instance.addHook('afterDestroy', unbindEvents); + }; + var unbindEvents = function() { + eventManager.clear(); + }; + var createPositionData = function(positionArr, len) { + if (positionArr.length < len) { + for (var i = positionArr.length; i < len; i++) { + positionArr[i] = i; + } + } + }; + this.beforeInit = function() { + this.manualColumnPositions = []; + }; + this.init = function(source) { + var instance = this; + var manualColMoveEnabled = !!(this.getSettings().manualColumnMove); + if (manualColMoveEnabled) { + var initialManualColumnPositions = this.getSettings().manualColumnMove; + var loadedManualColumnPositions = loadManualColumnPositions.call(instance); + if (typeof loadedManualColumnPositions != 'undefined') { + this.manualColumnPositions = loadedManualColumnPositions; + } else if (Array.isArray(initialManualColumnPositions)) { + this.manualColumnPositions = initialManualColumnPositions; + } else { + this.manualColumnPositions = []; + } + if (source === 'afterInit' || source === 'afterUpdateSettings' && eventManager.context.eventListeners.length === 0) { + if (typeof instance.manualColumnPositionsPluginUsages === 'undefined') { + instance.manualColumnPositionsPluginUsages = ['manualColumnMove']; + } else { + instance.manualColumnPositionsPluginUsages.push('manualColumnMove'); + } + bindEvents.call(this); + if (this.manualColumnPositions.length > 0) { + this.forceFullRender = true; + this.render(); + } + } + } else { + var pluginUsagesIndex = instance.manualColumnPositionsPluginUsages ? instance.manualColumnPositionsPluginUsages.indexOf('manualColumnMove') : -1; + if (pluginUsagesIndex > -1) { + unbindEvents.call(this); + this.manualColumnPositions = []; + instance.manualColumnPositionsPluginUsages[pluginUsagesIndex] = void 0; + } + } + }; + this.modifyCol = function(col) { + if (this.getSettings().manualColumnMove) { + if (typeof this.manualColumnPositions[col] === 'undefined') { + createPositionData(this.manualColumnPositions, col + 1); + } + return this.manualColumnPositions[col]; + } + return col; + }; + this.afterRemoveCol = function(index, amount) { + if (!this.getSettings().manualColumnMove) { + return; + } + var rmindx, + colpos = this.manualColumnPositions; + rmindx = colpos.splice(index, amount); + colpos = colpos.map(function(colpos) { + var i, + newpos = colpos; + for (i = 0; i < rmindx.length; i++) { + if (colpos > rmindx[i]) { + newpos--; + } + } + return newpos; + }); + this.manualColumnPositions = colpos; + }; + this.afterCreateCol = function(index, amount) { + if (!this.getSettings().manualColumnMove) { + return; + } + var colpos = this.manualColumnPositions; + if (!colpos.length) { + return; + } + var addindx = []; + for (var i = 0; i < amount; i++) { + addindx.push(index + i); + } + if (index >= colpos.length) { + colpos.concat(addindx); + } else { + colpos = colpos.map(function(colpos) { + return (colpos >= index) ? (colpos + amount) : colpos; + }); + colpos.splice.apply(colpos, [index, 0].concat(addindx)); + } + this.manualColumnPositions = colpos; + }; +} +var htManualColumnMove = new ManualColumnMove(); +Handsontable.hooks.add('beforeInit', htManualColumnMove.beforeInit); +Handsontable.hooks.add('afterInit', function() { + htManualColumnMove.init.call(this, 'afterInit'); +}); +Handsontable.hooks.add('afterUpdateSettings', function() { + htManualColumnMove.init.call(this, 'afterUpdateSettings'); +}); +Handsontable.hooks.add('modifyCol', htManualColumnMove.modifyCol); +Handsontable.hooks.add('afterRemoveCol', htManualColumnMove.afterRemoveCol); +Handsontable.hooks.add('afterCreateCol', htManualColumnMove.afterCreateCol); +Handsontable.hooks.register('beforeColumnMove'); +Handsontable.hooks.register('afterColumnMove'); + +//# +},{"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"plugins":57}],78:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + ManualColumnResize: {get: function() { + return ManualColumnResize; + }}, + __esModule: {value: true} +}); +var $___46__46__47__95_base_46_js__, + $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_eventManager__, + $___46__46__47__46__46__47_helpers_47_dom_47_event__, + $___46__46__47__46__46__47_plugins__; +var BasePlugin = ($___46__46__47__95_base_46_js__ = require("_base.js"), $___46__46__47__95_base_46_js__ && $___46__46__47__95_base_46_js__.__esModule && $___46__46__47__95_base_46_js__ || {default: $___46__46__47__95_base_46_js__}).default; +var $__1 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__1.addClass, + hasClass = $__1.hasClass, + removeClass = $__1.removeClass; +var eventManagerObject = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).eventManager; +var $__3 = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}), + pageX = $__3.pageX, + pageY = $__3.pageY; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var ManualColumnResize = function ManualColumnResize(hotInstance) { + $traceurRuntime.superConstructor($ManualColumnResize).call(this, hotInstance); + this.currentTH = null; + this.currentCol = null; + this.currentWidth = null; + this.newSize = null; + this.startY = null; + this.startWidth = null; + this.startOffset = null; + this.handle = document.createElement('DIV'); + this.guide = document.createElement('DIV'); + this.eventManager = eventManagerObject(this); + this.pressed = null; + this.dblclick = 0; + this.autoresizeTimeout = null; + this.manualColumnWidths = []; + addClass(this.handle, 'manualColumnResizer'); + addClass(this.guide, 'manualColumnResizerGuide'); +}; +var $ManualColumnResize = ManualColumnResize; +($traceurRuntime.createClass)(ManualColumnResize, { + isEnabled: function() { + return this.hot.getSettings().manualColumnResize; + }, + enablePlugin: function() { + var $__5 = this; + if (this.enabled) { + return; + } + this.manualColumnWidths = []; + var initialColumnWidth = this.hot.getSettings().manualColumnResize; + var loadedManualColumnWidths = this.loadManualColumnWidths(); + this.addHook('modifyColWidth', (function(width, col) { + return $__5.onModifyColWidth(width, col); + })); + if (typeof loadedManualColumnWidths != 'undefined') { + this.manualColumnWidths = loadedManualColumnWidths; + } else if (Array.isArray(initialColumnWidth)) { + this.manualColumnWidths = initialColumnWidth; + } else { + this.manualColumnWidths = []; + } + Handsontable.hooks.register('beforeColumnResize'); + Handsontable.hooks.register('afterColumnResize'); + this.bindEvents(); + $traceurRuntime.superGet(this, $ManualColumnResize.prototype, "enablePlugin").call(this); + }, + updatePlugin: function() { + var initialColumnWidth = this.hot.getSettings().manualColumnResize; + if (Array.isArray(initialColumnWidth)) { + this.manualColumnWidths = initialColumnWidth; + } else { + this.manualColumnWidths = []; + } + }, + disablePlugin: function() { + $traceurRuntime.superGet(this, $ManualColumnResize.prototype, "disablePlugin").call(this); + }, + saveManualColumnWidths: function() { + this.hot.runHooks('persistentStateSave', 'manualColumnWidths', this.manualColumnWidths); + }, + loadManualColumnWidths: function() { + var storedState = {}; + this.hot.runHooks('persistentStateLoad', 'manualColumnWidths', storedState); + return storedState.value; + }, + setupHandlePosition: function(TH) { + this.currentTH = TH; + var col = this.hot.view.wt.wtTable.getCoords(TH).col; + if (col >= 0) { + var box = this.currentTH.getBoundingClientRect(); + this.currentCol = col; + this.startOffset = box.left - 6; + this.startWidth = parseInt(box.width, 10); + this.handle.style.top = box.top + 'px'; + this.handle.style.left = this.startOffset + this.startWidth + 'px'; + this.hot.rootElement.appendChild(this.handle); + } + }, + refreshHandlePosition: function() { + this.handle.style.left = this.startOffset + this.currentWidth + 'px'; + }, + setupGuidePosition: function() { + addClass(this.handle, 'active'); + addClass(this.guide, 'active'); + this.guide.style.top = this.handle.style.top; + this.guide.style.left = this.handle.style.left; + this.guide.style.height = this.hot.view.maximumVisibleElementHeight(0) + 'px'; + this.hot.rootElement.appendChild(this.guide); + }, + refreshGuidePosition: function() { + this.guide.style.left = this.handle.style.left; + }, + hideHandleAndGuide: function() { + removeClass(this.handle, 'active'); + removeClass(this.guide, 'active'); + }, + checkIfColumnHeader: function(element) { + if (element.tagName != 'BODY') { + if (element.parentNode.tagName == 'THEAD') { + return true; + } else { + element = element.parentNode; + return this.checkIfColumnHeader(element); + } + } + return false; + }, + getTHFromTargetElement: function(element) { + if (element.tagName != 'TABLE') { + if (element.tagName == 'TH') { + return element; + } else { + return this.getTHFromTargetElement(element.parentNode); + } + } + return null; + }, + onMouseOver: function(event) { + if (this.checkIfColumnHeader(event.target)) { + var th = this.getTHFromTargetElement(event.target); + if (!th) { + return; + } + var colspan = th.getAttribute('colspan'); + if (th && (colspan === null || colspan === 1)) { + if (!this.pressed) { + this.setupHandlePosition(th); + } + } + } + }, + afterMouseDownTimeout: function() { + if (this.dblclick >= 2) { + var hookNewSize = this.hot.runHooks('beforeColumnResize', this.currentCol, this.newSize, true); + if (hookNewSize !== void 0) { + this.newSize = hookNewSize; + } + this.setManualSize(this.currentCol, this.newSize); + this.hot.forceFullRender = true; + this.hot.view.render(); + this.hot.view.wt.wtOverlays.adjustElementsSize(true); + this.hot.runHooks('afterColumnResize', this.currentCol, this.newSize, true); + } + this.dblclick = 0; + this.autoresizeTimeout = null; + }, + onMouseDown: function(event) { + var $__5 = this; + if (hasClass(event.target, 'manualColumnResizer')) { + this.setupGuidePosition(); + this.pressed = this.hot; + if (this.autoresizeTimeout === null) { + this.autoresizeTimeout = setTimeout((function() { + return $__5.afterMouseDownTimeout(); + }), 500); + this.hot._registerTimeout(this.autoresizeTimeout); + } + this.dblclick++; + this.startX = pageX(event); + this.newSize = this.startWidth; + } + }, + onMouseMove: function(event) { + if (this.pressed) { + this.currentWidth = this.startWidth + (pageX(event) - this.startX); + this.newSize = this.setManualSize(this.currentCol, this.currentWidth); + this.refreshHandlePosition(); + this.refreshGuidePosition(); + } + }, + onMouseUp: function(event) { + if (this.pressed) { + this.hideHandleAndGuide(); + this.pressed = false; + if (this.newSize != this.startWidth) { + this.hot.runHooks('beforeColumnResize', this.currentCol, this.newSize); + this.hot.forceFullRender = true; + this.hot.view.render(); + this.hot.view.wt.wtOverlays.adjustElementsSize(true); + this.saveManualColumnWidths(); + this.hot.runHooks('afterColumnResize', this.currentCol, this.newSize); + } + this.setupHandlePosition(this.currentTH); + } + }, + bindEvents: function() { + var $__5 = this; + this.eventManager.addEventListener(this.hot.rootElement, 'mouseover', (function(e) { + return $__5.onMouseOver(e); + })); + this.eventManager.addEventListener(this.hot.rootElement, 'mousedown', (function(e) { + return $__5.onMouseDown(e); + })); + this.eventManager.addEventListener(window, 'mousemove', (function(e) { + return $__5.onMouseMove(e); + })); + this.eventManager.addEventListener(window, 'mouseup', (function(e) { + return $__5.onMouseUp(e); + })); + }, + setManualSize: function(column, width) { + width = Math.max(width, 20); + column = this.hot.runHooks('modifyCol', column); + this.manualColumnWidths[column] = width; + return width; + }, + onModifyColWidth: function(width, column) { + if (this.enabled) { + column = this.hot.runHooks('modifyCol', column); + if (this.hot.getSettings().manualColumnResize && this.manualColumnWidths[column]) { + return this.manualColumnWidths[column]; + } + } + return width; + } +}, {}, BasePlugin); +; +registerPlugin('manualColumnResize', ManualColumnResize); + +//# +},{"_base.js":58,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"plugins":57}],79:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + ManualRowMove: {get: function() { + return ManualRowMove; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_eventManager__, + $___46__46__47__46__46__47_helpers_47_dom_47_event__, + $___46__46__47__46__46__47_plugins__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + hasClass = $__0.hasClass, + removeClass = $__0.removeClass; +var eventManagerObject = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).eventManager; +var $__2 = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}), + pageX = $__2.pageX, + pageY = $__2.pageY; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +; +function ManualRowMove() { + var startRow, + endRow, + startY, + startOffset, + currentRow, + currentTH, + handle = document.createElement('DIV'), + guide = document.createElement('DIV'), + eventManager = eventManagerObject(this); + handle.className = 'manualRowMover'; + guide.className = 'manualRowMoverGuide'; + var saveManualRowPositions = function() { + var instance = this; + Handsontable.hooks.run(instance, 'persistentStateSave', 'manualRowPositions', instance.manualRowPositions); + }; + var loadManualRowPositions = function() { + var instance = this, + storedState = {}; + Handsontable.hooks.run(instance, 'persistentStateLoad', 'manualRowPositions', storedState); + return storedState.value; + }; + function setupHandlePosition(TH) { + var instance = this; + currentTH = TH; + var row = this.view.wt.wtTable.getCoords(TH).row; + if (row >= 0) { + currentRow = row; + var box = currentTH.getBoundingClientRect(); + startOffset = box.top; + handle.style.top = startOffset + 'px'; + handle.style.left = box.left + 'px'; + instance.rootElement.appendChild(handle); + } + } + function refreshHandlePosition(TH, delta) { + var box = TH.getBoundingClientRect(); + var handleHeight = 6; + if (delta > 0) { + handle.style.top = (box.top + box.height - handleHeight) + 'px'; + } else { + handle.style.top = box.top + 'px'; + } + } + function setupGuidePosition() { + var instance = this; + addClass(handle, 'active'); + addClass(guide, 'active'); + var box = currentTH.getBoundingClientRect(); + guide.style.width = instance.view.maximumVisibleElementWidth(0) + 'px'; + guide.style.height = box.height + 'px'; + guide.style.top = startOffset + 'px'; + guide.style.left = handle.style.left; + instance.rootElement.appendChild(guide); + } + function refreshGuidePosition(diff) { + guide.style.top = startOffset + diff + 'px'; + } + function hideHandleAndGuide() { + removeClass(handle, 'active'); + removeClass(guide, 'active'); + } + var checkRowHeader = function(element) { + if (element.tagName != 'BODY') { + if (element.parentNode.tagName == 'TBODY') { + return true; + } else { + element = element.parentNode; + return checkRowHeader(element); + } + } + return false; + }; + var getTHFromTargetElement = function(element) { + if (element.tagName != 'TABLE') { + if (element.tagName == 'TH') { + return element; + } else { + return getTHFromTargetElement(element.parentNode); + } + } + return null; + }; + var bindEvents = function() { + var instance = this; + var pressed; + eventManager.addEventListener(instance.rootElement, 'mouseover', function(e) { + if (checkRowHeader(e.target)) { + var th = getTHFromTargetElement(e.target); + if (th) { + if (pressed) { + endRow = instance.view.wt.wtTable.getCoords(th).row; + refreshHandlePosition(th, endRow - startRow); + } else { + setupHandlePosition.call(instance, th); + } + } + } + }); + eventManager.addEventListener(instance.rootElement, 'mousedown', function(e) { + if (hasClass(e.target, 'manualRowMover')) { + startY = pageY(e); + setupGuidePosition.call(instance); + pressed = instance; + startRow = currentRow; + endRow = currentRow; + } + }); + eventManager.addEventListener(window, 'mousemove', function(e) { + if (pressed) { + refreshGuidePosition(pageY(e) - startY); + } + }); + eventManager.addEventListener(window, 'mouseup', function(e) { + if (pressed) { + hideHandleAndGuide(); + pressed = false; + createPositionData(instance.manualRowPositions, instance.countRows()); + instance.manualRowPositions.splice(endRow, 0, instance.manualRowPositions.splice(startRow, 1)[0]); + Handsontable.hooks.run(instance, 'beforeRowMove', startRow, endRow); + instance.forceFullRender = true; + instance.view.render(); + saveManualRowPositions.call(instance); + Handsontable.hooks.run(instance, 'afterRowMove', startRow, endRow); + setupHandlePosition.call(instance, currentTH); + } + }); + instance.addHook('afterDestroy', unbindEvents); + }; + var unbindEvents = function() { + eventManager.clear(); + }; + var createPositionData = function(positionArr, len) { + if (positionArr.length < len) { + for (var i = positionArr.length; i < len; i++) { + positionArr[i] = i; + } + } + }; + this.beforeInit = function() { + this.manualRowPositions = []; + }; + this.init = function(source) { + var instance = this; + var manualRowMoveEnabled = !!(instance.getSettings().manualRowMove); + if (manualRowMoveEnabled) { + var initialManualRowPositions = instance.getSettings().manualRowMove; + var loadedManualRowPostions = loadManualRowPositions.call(instance); + if (typeof instance.manualRowPositionsPluginUsages === 'undefined') { + instance.manualRowPositionsPluginUsages = ['manualColumnMove']; + } else { + instance.manualRowPositionsPluginUsages.push('manualColumnMove'); + } + if (typeof loadedManualRowPostions != 'undefined') { + this.manualRowPositions = loadedManualRowPostions; + } else if (Array.isArray(initialManualRowPositions)) { + this.manualRowPositions = initialManualRowPositions; + } else { + this.manualRowPositions = []; + } + if (source === 'afterInit' || source === 'afterUpdateSettings' && eventManager.context.eventListeners.length === 0) { + bindEvents.call(this); + if (this.manualRowPositions.length > 0) { + instance.forceFullRender = true; + instance.render(); + } + } + } else { + var pluginUsagesIndex = instance.manualRowPositionsPluginUsages ? instance.manualRowPositionsPluginUsages.indexOf('manualColumnMove') : -1; + if (pluginUsagesIndex > -1) { + unbindEvents.call(this); + instance.manualRowPositions = []; + instance.manualRowPositionsPluginUsages[pluginUsagesIndex] = void 0; + } + } + }; + this.modifyRow = function(row) { + var instance = this; + if (instance.getSettings().manualRowMove) { + if (typeof instance.manualRowPositions[row] === 'undefined') { + createPositionData(this.manualRowPositions, row + 1); + } + return instance.manualRowPositions[row]; + } + return row; + }; +} +var htManualRowMove = new ManualRowMove(); +Handsontable.hooks.add('beforeInit', htManualRowMove.beforeInit); +Handsontable.hooks.add('afterInit', function() { + htManualRowMove.init.call(this, 'afterInit'); +}); +Handsontable.hooks.add('afterUpdateSettings', function() { + htManualRowMove.init.call(this, 'afterUpdateSettings'); +}); +Handsontable.hooks.add('modifyRow', htManualRowMove.modifyRow); +Handsontable.hooks.register('beforeRowMove'); +Handsontable.hooks.register('afterRowMove'); + +//# +},{"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"plugins":57}],80:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + ManualRowResize: {get: function() { + return ManualRowResize; + }}, + __esModule: {value: true} +}); +var $___46__46__47__95_base_46_js__, + $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_eventManager__, + $___46__46__47__46__46__47_helpers_47_dom_47_event__, + $___46__46__47__46__46__47_plugins__; +var BasePlugin = ($___46__46__47__95_base_46_js__ = require("_base.js"), $___46__46__47__95_base_46_js__ && $___46__46__47__95_base_46_js__.__esModule && $___46__46__47__95_base_46_js__ || {default: $___46__46__47__95_base_46_js__}).default; +var $__1 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__1.addClass, + hasClass = $__1.hasClass, + removeClass = $__1.removeClass; +var eventManagerObject = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).eventManager; +var $__3 = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}), + pageX = $__3.pageX, + pageY = $__3.pageY; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var ManualRowResize = function ManualRowResize(hotInstance) { + $traceurRuntime.superConstructor($ManualRowResize).call(this, hotInstance); + this.currentTH = null; + this.currentRow = null; + this.currentHeight = null; + this.newSize = null; + this.startY = null; + this.startHeight = null; + this.startOffset = null; + this.handle = document.createElement('DIV'); + this.guide = document.createElement('DIV'); + this.eventManager = eventManagerObject(this); + this.pressed = null; + this.dblclick = 0; + this.autoresizeTimeout = null; + this.manualRowHeights = []; + addClass(this.handle, 'manualRowResizer'); + addClass(this.guide, 'manualRowResizerGuide'); +}; +var $ManualRowResize = ManualRowResize; +($traceurRuntime.createClass)(ManualRowResize, { + isEnabled: function() { + return this.hot.getSettings().manualRowResize; + }, + enablePlugin: function() { + var $__5 = this; + if (this.enabled) { + return; + } + this.manualRowHeights = []; + var initialRowHeights = this.hot.getSettings().manualRowResize; + var loadedManualRowHeights = this.loadManualRowHeights(); + if (typeof loadedManualRowHeights != 'undefined') { + this.manualRowHeights = loadedManualRowHeights; + } else if (Array.isArray(initialRowHeights)) { + this.manualRowHeights = initialRowHeights; + } else { + this.manualRowHeights = []; + } + this.addHook('modifyRowHeight', (function(height, row) { + return $__5.onModifyRowHeight(height, row); + })); + Handsontable.hooks.register('beforeRowResize'); + Handsontable.hooks.register('afterRowResize'); + this.bindEvents(); + $traceurRuntime.superGet(this, $ManualRowResize.prototype, "enablePlugin").call(this); + }, + updatePlugin: function() { + var initialRowHeights = this.hot.getSettings().manualRowResize; + if (Array.isArray(initialRowHeights)) { + this.manualRowHeights = initialRowHeights; + } else { + this.manualRowHeights = []; + } + }, + disablePlugin: function() { + $traceurRuntime.superGet(this, $ManualRowResize.prototype, "disablePlugin").call(this); + }, + saveManualRowHeights: function() { + this.hot.runHooks('persistentStateSave', 'manualRowHeights', this.manualRowHeights); + }, + loadManualRowHeights: function() { + var storedState = {}; + this.hot.runHooks('persistentStateLoad', 'manualRowHeights', storedState); + return storedState.value; + }, + setupHandlePosition: function(TH) { + this.currentTH = TH; + var row = this.hot.view.wt.wtTable.getCoords(TH).row; + if (row >= 0) { + var box = this.currentTH.getBoundingClientRect(); + this.currentRow = row; + this.startOffset = box.top - 6; + this.startHeight = parseInt(box.height, 10); + this.handle.style.left = box.left + 'px'; + this.handle.style.top = this.startOffset + this.startHeight + 'px'; + this.hot.rootElement.appendChild(this.handle); + } + }, + refreshHandlePosition: function() { + this.handle.style.top = this.startOffset + this.currentHeight + 'px'; + }, + setupGuidePosition: function() { + addClass(this.handle, 'active'); + addClass(this.guide, 'active'); + this.guide.style.top = this.handle.style.top; + this.guide.style.left = this.handle.style.left; + this.guide.style.width = this.hot.view.maximumVisibleElementWidth(0) + 'px'; + this.hot.rootElement.appendChild(this.guide); + }, + refreshGuidePosition: function() { + this.guide.style.top = this.handle.style.top; + }, + hideHandleAndGuide: function() { + removeClass(this.handle, 'active'); + removeClass(this.guide, 'active'); + }, + checkIfRowHeader: function(element) { + if (element.tagName != 'BODY') { + if (element.parentNode.tagName == 'TBODY') { + return true; + } else { + element = element.parentNode; + return this.checkIfRowHeader(element); + } + } + return false; + }, + getTHFromTargetElement: function(element) { + if (element.tagName != 'TABLE') { + if (element.tagName == 'TH') { + return element; + } else { + return this.getTHFromTargetElement(element.parentNode); + } + } + return null; + }, + onMouseOver: function(event) { + if (this.checkIfRowHeader(event.target)) { + var th = this.getTHFromTargetElement(event.target); + if (th) { + if (!this.pressed) { + this.setupHandlePosition(th); + } + } + } + }, + afterMouseDownTimeout: function() { + if (this.dblclick >= 2) { + var hookNewSize = this.hot.runHooks('beforeRowResize', this.currentRow, this.newSize, true); + if (hookNewSize !== void 0) { + this.newSize = hookNewSize; + } + this.setManualSize(this.currentRow, this.newSize); + this.hot.forceFullRender = true; + this.hot.view.render(); + this.hot.view.wt.wtOverlays.adjustElementsSize(true); + this.hot.runHooks('afterRowResize', this.currentRow, this.newSize, true); + } + this.dblclick = 0; + this.autoresizeTimeout = null; + }, + onMouseDown: function(event) { + var $__5 = this; + if (hasClass(event.target, 'manualRowResizer')) { + this.setupGuidePosition(); + this.pressed = this.hot; + if (this.autoresizeTimeout == null) { + this.autoresizeTimeout = setTimeout((function() { + return $__5.afterMouseDownTimeout(); + }), 500); + this.hot._registerTimeout(this.autoresizeTimeout); + } + this.dblclick++; + this.startY = pageY(event); + this.newSize = this.startHeight; + } + }, + onMouseMove: function(event) { + if (this.pressed) { + this.currentHeight = this.startHeight + (pageY(event) - this.startY); + this.newSize = this.setManualSize(this.currentRow, this.currentHeight); + this.refreshHandlePosition(); + this.refreshGuidePosition(); + } + }, + onMouseUp: function(event) { + if (this.pressed) { + this.hideHandleAndGuide(); + this.pressed = false; + if (this.newSize != this.startHeight) { + this.hot.runHooks('beforeRowResize', this.currentRow, this.newSize); + this.hot.forceFullRender = true; + this.hot.view.render(); + this.hot.view.wt.wtOverlays.adjustElementsSize(true); + this.saveManualRowHeights(); + this.hot.runHooks('afterRowResize', this.currentRow, this.newSize); + } + this.setupHandlePosition(this.currentTH); + } + }, + bindEvents: function() { + var $__5 = this; + this.eventManager.addEventListener(this.hot.rootElement, 'mouseover', (function(e) { + return $__5.onMouseOver(e); + })); + this.eventManager.addEventListener(this.hot.rootElement, 'mousedown', (function(e) { + return $__5.onMouseDown(e); + })); + this.eventManager.addEventListener(window, 'mousemove', (function(e) { + return $__5.onMouseMove(e); + })); + this.eventManager.addEventListener(window, 'mouseup', (function(e) { + return $__5.onMouseUp(e); + })); + }, + setManualSize: function(row, height) { + row = this.hot.runHooks('modifyRow', row); + this.manualRowHeights[row] = height; + return height; + }, + onModifyRowHeight: function(height, row) { + if (this.enabled) { + var autoRowSizePlugin = this.hot.getPlugin('autoRowSize'); + var autoRowHeightResult = autoRowSizePlugin ? autoRowSizePlugin.heights[row] : null; + row = this.hot.runHooks('modifyRow', row); + var manualRowHeight = this.manualRowHeights[row]; + if (manualRowHeight !== void 0 && (manualRowHeight === autoRowHeightResult || manualRowHeight > (height || 0))) { + return manualRowHeight; + } + } + return height; + } +}, {}, BasePlugin); +; +registerPlugin('manualRowResize', ManualRowResize); + +//# +},{"_base.js":58,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"plugins":57}],81:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + MergeCells: {get: function() { + return MergeCells; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_plugins__, + $___46__46__47__46__46__47_helpers_47_dom_47_event__, + $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__, + $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__, + $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_table__; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var stopImmediatePropagation = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}).stopImmediatePropagation; +var WalkontableCellCoords = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords; +var WalkontableCellRange = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ = require("3rdparty/walkontable/src/cell/range"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__}).WalkontableCellRange; +var WalkontableTable = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_table__ = require("3rdparty/walkontable/src/table"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_table__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_table__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_table__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_table__}).WalkontableTable; +; +function CellInfoCollection() { + var collection = []; + collection.getInfo = function(row, col) { + for (var i = 0, + ilen = this.length; i < ilen; i++) { + if (this[i].row <= row && this[i].row + this[i].rowspan - 1 >= row && this[i].col <= col && this[i].col + this[i].colspan - 1 >= col) { + return this[i]; + } + } + }; + collection.setInfo = function(info) { + for (var i = 0, + ilen = this.length; i < ilen; i++) { + if (this[i].row === info.row && this[i].col === info.col) { + this[i] = info; + return; + } + } + this.push(info); + }; + collection.removeInfo = function(row, col) { + for (var i = 0, + ilen = this.length; i < ilen; i++) { + if (this[i].row === row && this[i].col === col) { + this.splice(i, 1); + break; + } + } + }; + return collection; +} +function MergeCells(mergeCellsSetting) { + this.mergedCellInfoCollection = new CellInfoCollection(); + if (Array.isArray(mergeCellsSetting)) { + for (var i = 0, + ilen = mergeCellsSetting.length; i < ilen; i++) { + this.mergedCellInfoCollection.setInfo(mergeCellsSetting[i]); + } + } +} +MergeCells.prototype.canMergeRange = function(cellRange) { + return !cellRange.isSingle(); +}; +MergeCells.prototype.mergeRange = function(cellRange) { + if (!this.canMergeRange(cellRange)) { + return; + } + var topLeft = cellRange.getTopLeftCorner(); + var bottomRight = cellRange.getBottomRightCorner(); + var mergeParent = {}; + mergeParent.row = topLeft.row; + mergeParent.col = topLeft.col; + mergeParent.rowspan = bottomRight.row - topLeft.row + 1; + mergeParent.colspan = bottomRight.col - topLeft.col + 1; + this.mergedCellInfoCollection.setInfo(mergeParent); +}; +MergeCells.prototype.mergeOrUnmergeSelection = function(cellRange) { + var info = this.mergedCellInfoCollection.getInfo(cellRange.from.row, cellRange.from.col); + if (info) { + this.unmergeSelection(cellRange.from); + } else { + this.mergeSelection(cellRange); + } +}; +MergeCells.prototype.mergeSelection = function(cellRange) { + this.mergeRange(cellRange); +}; +MergeCells.prototype.unmergeSelection = function(cellRange) { + var info = this.mergedCellInfoCollection.getInfo(cellRange.row, cellRange.col); + this.mergedCellInfoCollection.removeInfo(info.row, info.col); +}; +MergeCells.prototype.applySpanProperties = function(TD, row, col) { + var info = this.mergedCellInfoCollection.getInfo(row, col); + if (info) { + if (info.row === row && info.col === col) { + TD.setAttribute('rowspan', info.rowspan); + TD.setAttribute('colspan', info.colspan); + } else { + TD.removeAttribute('rowspan'); + TD.removeAttribute('colspan'); + TD.style.display = 'none'; + } + } else { + TD.removeAttribute('rowspan'); + TD.removeAttribute('colspan'); + } +}; +MergeCells.prototype.modifyTransform = function(hook, currentSelectedRange, delta) { + var sameRowspan = function(merged, coords) { + if (coords.row >= merged.row && coords.row <= (merged.row + merged.rowspan - 1)) { + return true; + } + return false; + }, + sameColspan = function(merged, coords) { + if (coords.col >= merged.col && coords.col <= (merged.col + merged.colspan - 1)) { + return true; + } + return false; + }, + getNextPosition = function(newDelta) { + return new WalkontableCellCoords(currentSelectedRange.to.row + newDelta.row, currentSelectedRange.to.col + newDelta.col); + }; + var newDelta = { + row: delta.row, + col: delta.col + }; + if (hook == 'modifyTransformStart') { + if (!this.lastDesiredCoords) { + this.lastDesiredCoords = new WalkontableCellCoords(null, null); + } + var currentPosition = new WalkontableCellCoords(currentSelectedRange.highlight.row, currentSelectedRange.highlight.col), + mergedParent = this.mergedCellInfoCollection.getInfo(currentPosition.row, currentPosition.col), + currentRangeContainsMerge; + for (var i = 0, + mergesLength = this.mergedCellInfoCollection.length; i < mergesLength; i++) { + var range = this.mergedCellInfoCollection[i]; + range = new WalkontableCellCoords(range.row + range.rowspan - 1, range.col + range.colspan - 1); + if (currentSelectedRange.includes(range)) { + currentRangeContainsMerge = true; + break; + } + } + if (mergedParent) { + var mergeTopLeft = new WalkontableCellCoords(mergedParent.row, mergedParent.col), + mergeBottomRight = new WalkontableCellCoords(mergedParent.row + mergedParent.rowspan - 1, mergedParent.col + mergedParent.colspan - 1), + mergeRange = new WalkontableCellRange(mergeTopLeft, mergeTopLeft, mergeBottomRight); + if (!mergeRange.includes(this.lastDesiredCoords)) { + this.lastDesiredCoords = new WalkontableCellCoords(null, null); + } + newDelta.row = this.lastDesiredCoords.row ? this.lastDesiredCoords.row - currentPosition.row : newDelta.row; + newDelta.col = this.lastDesiredCoords.col ? this.lastDesiredCoords.col - currentPosition.col : newDelta.col; + if (delta.row > 0) { + newDelta.row = mergedParent.row + mergedParent.rowspan - 1 - currentPosition.row + delta.row; + } else if (delta.row < 0) { + newDelta.row = currentPosition.row - mergedParent.row + delta.row; + } + if (delta.col > 0) { + newDelta.col = mergedParent.col + mergedParent.colspan - 1 - currentPosition.col + delta.col; + } else if (delta.col < 0) { + newDelta.col = currentPosition.col - mergedParent.col + delta.col; + } + } + var nextPosition = new WalkontableCellCoords(currentSelectedRange.highlight.row + newDelta.row, currentSelectedRange.highlight.col + newDelta.col), + nextParentIsMerged = this.mergedCellInfoCollection.getInfo(nextPosition.row, nextPosition.col); + if (nextParentIsMerged) { + this.lastDesiredCoords = nextPosition; + newDelta = { + row: nextParentIsMerged.row - currentPosition.row, + col: nextParentIsMerged.col - currentPosition.col + }; + } + } else if (hook == 'modifyTransformEnd') { + for (var i = 0, + mergesLength = this.mergedCellInfoCollection.length; i < mergesLength; i++) { + var currentMerge = this.mergedCellInfoCollection[i], + mergeTopLeft = new WalkontableCellCoords(currentMerge.row, currentMerge.col), + mergeBottomRight = new WalkontableCellCoords(currentMerge.row + currentMerge.rowspan - 1, currentMerge.col + currentMerge.colspan - 1), + mergedRange = new WalkontableCellRange(mergeTopLeft, mergeTopLeft, mergeBottomRight), + sharedBorders = currentSelectedRange.getBordersSharedWith(mergedRange); + if (mergedRange.isEqual(currentSelectedRange)) { + currentSelectedRange.setDirection('NW-SE'); + } else if (sharedBorders.length > 0) { + var mergeHighlighted = (currentSelectedRange.highlight.isEqual(mergedRange.from)); + if (sharedBorders.indexOf('top') > -1) { + if (currentSelectedRange.to.isSouthEastOf(mergedRange.from) && mergeHighlighted) { + currentSelectedRange.setDirection('NW-SE'); + } else if (currentSelectedRange.to.isSouthWestOf(mergedRange.from) && mergeHighlighted) { + currentSelectedRange.setDirection('NE-SW'); + } + } else if (sharedBorders.indexOf('bottom') > -1) { + if (currentSelectedRange.to.isNorthEastOf(mergedRange.from) && mergeHighlighted) { + currentSelectedRange.setDirection('SW-NE'); + } else if (currentSelectedRange.to.isNorthWestOf(mergedRange.from) && mergeHighlighted) { + currentSelectedRange.setDirection('SE-NW'); + } + } + } + var nextPosition = getNextPosition(newDelta), + withinRowspan = sameRowspan(currentMerge, nextPosition), + withinColspan = sameColspan(currentMerge, nextPosition); + if (currentSelectedRange.includesRange(mergedRange) && (mergedRange.includes(nextPosition) || withinRowspan || withinColspan)) { + if (withinRowspan) { + if (newDelta.row < 0) { + newDelta.row -= currentMerge.rowspan - 1; + } else if (newDelta.row > 0) { + newDelta.row += currentMerge.rowspan - 1; + } + } + if (withinColspan) { + if (newDelta.col < 0) { + newDelta.col -= currentMerge.colspan - 1; + } else if (newDelta.col > 0) { + newDelta.col += currentMerge.colspan - 1; + } + } + } + } + } + if (newDelta.row !== 0) { + delta.row = newDelta.row; + } + if (newDelta.col !== 0) { + delta.col = newDelta.col; + } +}; +MergeCells.prototype.shiftCollection = function(direction, index, count) { + var shiftVector = [0, 0]; + switch (direction) { + case 'right': + shiftVector[0] += 1; + break; + case 'left': + shiftVector[0] -= 1; + break; + case 'down': + shiftVector[1] += 1; + break; + case 'up': + shiftVector[1] -= 1; + break; + } + for (var i = 0; i < this.mergedCellInfoCollection.length; i++) { + var currentMerge = this.mergedCellInfoCollection[i]; + if (direction === 'right' || direction === 'left') { + if (index <= currentMerge.col) { + currentMerge.col += shiftVector[0]; + } + } else { + if (index <= currentMerge.row) { + currentMerge.row += shiftVector[1]; + } + } + } +}; +var beforeInit = function() { + var instance = this; + var mergeCellsSetting = instance.getSettings().mergeCells; + if (mergeCellsSetting) { + if (!instance.mergeCells) { + instance.mergeCells = new MergeCells(mergeCellsSetting); + } + } +}; +var afterInit = function() { + var instance = this; + if (instance.mergeCells) { + instance.view.wt.wtTable.getCell = function(coords) { + if (instance.getSettings().mergeCells) { + var mergeParent = instance.mergeCells.mergedCellInfoCollection.getInfo(coords.row, coords.col); + if (mergeParent) { + coords = mergeParent; + } + } + return WalkontableTable.prototype.getCell.call(this, coords); + }; + } +}; +var afterUpdateSettings = function() { + var instance = this; + var mergeCellsSetting = instance.getSettings().mergeCells; + if (mergeCellsSetting) { + if (instance.mergeCells) { + instance.mergeCells.mergedCellInfoCollection = new CellInfoCollection(); + if (Array.isArray(mergeCellsSetting)) { + for (var i = 0, + ilen = mergeCellsSetting.length; i < ilen; i++) { + instance.mergeCells.mergedCellInfoCollection.setInfo(mergeCellsSetting[i]); + } + } + } else { + instance.mergeCells = new MergeCells(mergeCellsSetting); + } + } else { + if (instance.mergeCells) { + instance.mergeCells.mergedCellInfoCollection = new CellInfoCollection(); + } + } +}; +var onBeforeKeyDown = function(event) { + if (!this.mergeCells) { + return; + } + var ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey; + if (ctrlDown) { + if (event.keyCode === 77) { + this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()); + this.render(); + stopImmediatePropagation(event); + } + } +}; +var addMergeActionsToContextMenu = function(defaultOptions) { + if (!this.getSettings().mergeCells) { + return; + } + defaultOptions.items.push(Handsontable.plugins.ContextMenu.SEPARATOR); + defaultOptions.items.push({ + key: 'mergeCells', + name: function() { + var sel = this.getSelected(); + var info = this.mergeCells.mergedCellInfoCollection.getInfo(sel[0], sel[1]); + if (info) { + return 'Unmerge cells'; + } else { + return 'Merge cells'; + } + }, + callback: function() { + this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()); + this.render(); + }, + disabled: function() { + return false; + } + }); +}; +var afterRenderer = function(TD, row, col, prop, value, cellProperties) { + if (this.mergeCells) { + this.mergeCells.applySpanProperties(TD, row, col); + } +}; +var modifyTransformFactory = function(hook) { + return function(delta) { + var mergeCellsSetting = this.getSettings().mergeCells; + if (mergeCellsSetting) { + var currentSelectedRange = this.getSelectedRange(); + this.mergeCells.modifyTransform(hook, currentSelectedRange, delta); + if (hook === 'modifyTransformEnd') { + var totalRows = this.countRows(); + var totalCols = this.countCols(); + if (currentSelectedRange.from.row < 0) { + currentSelectedRange.from.row = 0; + } else if (currentSelectedRange.from.row > 0 && currentSelectedRange.from.row >= totalRows) { + currentSelectedRange.from.row = currentSelectedRange.from - 1; + } + if (currentSelectedRange.from.col < 0) { + currentSelectedRange.from.col = 0; + } else if (currentSelectedRange.from.col > 0 && currentSelectedRange.from.col >= totalCols) { + currentSelectedRange.from.col = totalCols - 1; + } + } + } + }; +}; +var beforeSetRangeEnd = function(coords) { + this.lastDesiredCoords = null; + var mergeCellsSetting = this.getSettings().mergeCells; + if (mergeCellsSetting) { + var selRange = this.getSelectedRange(); + selRange.highlight = new WalkontableCellCoords(selRange.highlight.row, selRange.highlight.col); + selRange.to = coords; + var rangeExpanded = false; + do { + rangeExpanded = false; + for (var i = 0, + ilen = this.mergeCells.mergedCellInfoCollection.length; i < ilen; i++) { + var cellInfo = this.mergeCells.mergedCellInfoCollection[i]; + var mergedCellTopLeft = new WalkontableCellCoords(cellInfo.row, cellInfo.col); + var mergedCellBottomRight = new WalkontableCellCoords(cellInfo.row + cellInfo.rowspan - 1, cellInfo.col + cellInfo.colspan - 1); + var mergedCellRange = new WalkontableCellRange(mergedCellTopLeft, mergedCellTopLeft, mergedCellBottomRight); + if (selRange.expandByRange(mergedCellRange)) { + coords.row = selRange.to.row; + coords.col = selRange.to.col; + rangeExpanded = true; + } + } + } while (rangeExpanded); + } +}; +var beforeDrawAreaBorders = function(corners, className) { + if (className && className == 'area') { + var mergeCellsSetting = this.getSettings().mergeCells; + if (mergeCellsSetting) { + var selRange = this.getSelectedRange(); + var startRange = new WalkontableCellRange(selRange.from, selRange.from, selRange.from); + var stopRange = new WalkontableCellRange(selRange.to, selRange.to, selRange.to); + for (var i = 0, + ilen = this.mergeCells.mergedCellInfoCollection.length; i < ilen; i++) { + var cellInfo = this.mergeCells.mergedCellInfoCollection[i]; + var mergedCellTopLeft = new WalkontableCellCoords(cellInfo.row, cellInfo.col); + var mergedCellBottomRight = new WalkontableCellCoords(cellInfo.row + cellInfo.rowspan - 1, cellInfo.col + cellInfo.colspan - 1); + var mergedCellRange = new WalkontableCellRange(mergedCellTopLeft, mergedCellTopLeft, mergedCellBottomRight); + if (startRange.expandByRange(mergedCellRange)) { + corners[0] = startRange.from.row; + corners[1] = startRange.from.col; + } + if (stopRange.expandByRange(mergedCellRange)) { + corners[2] = stopRange.from.row; + corners[3] = stopRange.from.col; + } + } + } + } +}; +var afterGetCellMeta = function(row, col, cellProperties) { + var mergeCellsSetting = this.getSettings().mergeCells; + if (mergeCellsSetting) { + var mergeParent = this.mergeCells.mergedCellInfoCollection.getInfo(row, col); + if (mergeParent && (mergeParent.row != row || mergeParent.col != col)) { + cellProperties.copyable = false; + } + } +}; +var afterViewportRowCalculatorOverride = function(calc) { + var mergeCellsSetting = this.getSettings().mergeCells; + if (mergeCellsSetting) { + var colCount = this.countCols(); + var mergeParent; + for (var c = 0; c < colCount; c++) { + mergeParent = this.mergeCells.mergedCellInfoCollection.getInfo(calc.startRow, c); + if (mergeParent) { + if (mergeParent.row < calc.startRow) { + calc.startRow = mergeParent.row; + return afterViewportRowCalculatorOverride.call(this, calc); + } + } + mergeParent = this.mergeCells.mergedCellInfoCollection.getInfo(calc.endRow, c); + if (mergeParent) { + var mergeEnd = mergeParent.row + mergeParent.rowspan - 1; + if (mergeEnd > calc.endRow) { + calc.endRow = mergeEnd; + return afterViewportRowCalculatorOverride.call(this, calc); + } + } + } + } +}; +var afterViewportColumnCalculatorOverride = function(calc) { + var mergeCellsSetting = this.getSettings().mergeCells; + if (mergeCellsSetting) { + var rowCount = this.countRows(); + var mergeParent; + for (var r = 0; r < rowCount; r++) { + mergeParent = this.mergeCells.mergedCellInfoCollection.getInfo(r, calc.startColumn); + if (mergeParent) { + if (mergeParent.col < calc.startColumn) { + calc.startColumn = mergeParent.col; + return afterViewportColumnCalculatorOverride.call(this, calc); + } + } + mergeParent = this.mergeCells.mergedCellInfoCollection.getInfo(r, calc.endColumn); + if (mergeParent) { + var mergeEnd = mergeParent.col + mergeParent.colspan - 1; + if (mergeEnd > calc.endColumn) { + calc.endColumn = mergeEnd; + return afterViewportColumnCalculatorOverride.call(this, calc); + } + } + } + } +}; +var isMultipleSelection = function(isMultiple) { + if (isMultiple && this.mergeCells) { + var mergedCells = this.mergeCells.mergedCellInfoCollection, + selectionRange = this.getSelectedRange(); + for (var group in mergedCells) { + if (selectionRange.highlight.row == mergedCells[group].row && selectionRange.highlight.col == mergedCells[group].col && selectionRange.to.row == mergedCells[group].row + mergedCells[group].rowspan - 1 && selectionRange.to.col == mergedCells[group].col + mergedCells[group].colspan - 1) { + return false; + } + } + } + return isMultiple; +}; +function afterAutofillApplyValues(select, drag) { + var mergeCellsSetting = this.getSettings().mergeCells; + if (!mergeCellsSetting || this.selection.isMultiple()) { + return; + } + var info = this.mergeCells.mergedCellInfoCollection.getInfo(select[0], select[1]); + if (info) { + select[0] = info.row; + select[1] = info.col; + select[2] = info.row + info.rowspan - 1; + select[3] = info.col + info.colspan - 1; + } +} +function onAfterCreateCol(col, count) { + if (this.mergeCells) { + this.mergeCells.shiftCollection('right', col, count); + } +} +function onAfterRemoveCol(col, count) { + if (this.mergeCells) { + this.mergeCells.shiftCollection('left', col, count); + } +} +function onAfterCreateRow(row, count) { + if (this.mergeCells) { + this.mergeCells.shiftCollection('down', row, count); + } +} +function onAfterRemoveRow(row, count) { + if (this.mergeCells) { + this.mergeCells.shiftCollection('up', row, count); + } +} +Handsontable.hooks.add('beforeInit', beforeInit); +Handsontable.hooks.add('afterInit', afterInit); +Handsontable.hooks.add('afterUpdateSettings', afterUpdateSettings); +Handsontable.hooks.add('beforeKeyDown', onBeforeKeyDown); +Handsontable.hooks.add('modifyTransformStart', modifyTransformFactory('modifyTransformStart')); +Handsontable.hooks.add('modifyTransformEnd', modifyTransformFactory('modifyTransformEnd')); +Handsontable.hooks.add('beforeSetRangeEnd', beforeSetRangeEnd); +Handsontable.hooks.add('beforeDrawBorders', beforeDrawAreaBorders); +Handsontable.hooks.add('afterIsMultipleSelection', isMultipleSelection); +Handsontable.hooks.add('afterRenderer', afterRenderer); +Handsontable.hooks.add('afterContextMenuDefaultOptions', addMergeActionsToContextMenu); +Handsontable.hooks.add('afterGetCellMeta', afterGetCellMeta); +Handsontable.hooks.add('afterViewportRowCalculatorOverride', afterViewportRowCalculatorOverride); +Handsontable.hooks.add('afterViewportColumnCalculatorOverride', afterViewportColumnCalculatorOverride); +Handsontable.hooks.add('afterAutofillApplyValues', afterAutofillApplyValues); +Handsontable.hooks.add('afterCreateCol', onAfterCreateCol); +Handsontable.hooks.add('afterRemoveCol', onAfterRemoveCol); +Handsontable.hooks.add('afterCreateRow', onAfterCreateRow); +Handsontable.hooks.add('afterRemoveRow', onAfterRemoveRow); +Handsontable.MergeCells = MergeCells; + +//# +},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/table":20,"helpers/dom/event":46,"plugins":57}],82:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + MultipleSelectionHandles: {get: function() { + return MultipleSelectionHandles; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__95_base__, + $___46__46__47__46__46__47_eventManager__, + $___46__46__47__46__46__47_plugins__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + getWindowScrollTop = $__0.getWindowScrollTop, + hasClass = $__0.hasClass, + getWindowScrollLeft = $__0.getWindowScrollLeft; +var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default; +var EventManager = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).EventManager; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var MultipleSelectionHandles = function MultipleSelectionHandles(hotInstance) { + $traceurRuntime.superConstructor($MultipleSelectionHandles).call(this, hotInstance); + this.dragged = []; + this.eventManager = null; + this.lastSetCell = null; +}; +var $MultipleSelectionHandles = MultipleSelectionHandles; +($traceurRuntime.createClass)(MultipleSelectionHandles, { + isEnabled: function() { + return Handsontable.mobileBrowser; + }, + enablePlugin: function() { + if (this.enabled) { + return; + } + if (!this.eventManager) { + this.eventManager = new EventManager(this); + } + this.registerListeners(); + $traceurRuntime.superGet(this, $MultipleSelectionHandles.prototype, "enablePlugin").call(this); + }, + registerListeners: function() { + var _this = this; + function removeFromDragged(query) { + if (_this.dragged.length === 1) { + _this.dragged.splice(0, _this.dragged.length); + return true; + } + var entryPosition = _this.dragged.indexOf(query); + if (entryPosition == -1) { + return false; + } else if (entryPosition === 0) { + _this.dragged = _this.dragged.slice(0, 1); + } else if (entryPosition == 1) { + _this.dragged = _this.dragged.slice(-1); + } + } + this.eventManager.addEventListener(this.hot.rootElement, 'touchstart', function(event) { + var selectedRange; + if (hasClass(event.target, 'topLeftSelectionHandle-HitArea')) { + selectedRange = _this.hot.getSelectedRange(); + _this.dragged.push('topLeft'); + _this.touchStartRange = { + width: selectedRange.getWidth(), + height: selectedRange.getHeight(), + direction: selectedRange.getDirection() + }; + event.preventDefault(); + return false; + } else if (hasClass(event.target, 'bottomRightSelectionHandle-HitArea')) { + selectedRange = _this.hot.getSelectedRange(); + _this.dragged.push('bottomRight'); + _this.touchStartRange = { + width: selectedRange.getWidth(), + height: selectedRange.getHeight(), + direction: selectedRange.getDirection() + }; + event.preventDefault(); + return false; + } + }); + this.eventManager.addEventListener(this.hot.rootElement, 'touchend', function(event) { + if (hasClass(event.target, 'topLeftSelectionHandle-HitArea')) { + removeFromDragged.call(_this, 'topLeft'); + _this.touchStartRange = void 0; + event.preventDefault(); + return false; + } else if (hasClass(event.target, 'bottomRightSelectionHandle-HitArea')) { + removeFromDragged.call(_this, 'bottomRight'); + _this.touchStartRange = void 0; + event.preventDefault(); + return false; + } + }); + this.eventManager.addEventListener(this.hot.rootElement, 'touchmove', function(event) { + var scrollTop = getWindowScrollTop(), + scrollLeft = getWindowScrollLeft(), + endTarget, + targetCoords, + selectedRange, + rangeWidth, + rangeHeight, + rangeDirection, + newRangeCoords; + if (_this.dragged.length === 0) { + return; + } + endTarget = document.elementFromPoint(event.touches[0].screenX - scrollLeft, event.touches[0].screenY - scrollTop); + if (!endTarget || endTarget === _this.lastSetCell) { + return; + } + if (endTarget.nodeName == 'TD' || endTarget.nodeName == 'TH') { + targetCoords = _this.hot.getCoords(endTarget); + if (targetCoords.col == -1) { + targetCoords.col = 0; + } + selectedRange = _this.hot.getSelectedRange(); + rangeWidth = selectedRange.getWidth(); + rangeHeight = selectedRange.getHeight(); + rangeDirection = selectedRange.getDirection(); + if (rangeWidth == 1 && rangeHeight == 1) { + _this.hot.selection.setRangeEnd(targetCoords); + } + newRangeCoords = _this.getCurrentRangeCoords(selectedRange, targetCoords, _this.touchStartRange.direction, rangeDirection, _this.dragged[0]); + if (newRangeCoords.start !== null) { + _this.hot.selection.setRangeStart(newRangeCoords.start); + } + _this.hot.selection.setRangeEnd(newRangeCoords.end); + _this.lastSetCell = endTarget; + } + event.preventDefault(); + }); + }, + getCurrentRangeCoords: function(selectedRange, currentTouch, touchStartDirection, currentDirection, draggedHandle) { + var topLeftCorner = selectedRange.getTopLeftCorner(), + bottomRightCorner = selectedRange.getBottomRightCorner(), + bottomLeftCorner = selectedRange.getBottomLeftCorner(), + topRightCorner = selectedRange.getTopRightCorner(); + var newCoords = { + start: null, + end: null + }; + switch (touchStartDirection) { + case 'NE-SW': + switch (currentDirection) { + case 'NE-SW': + case 'NW-SE': + if (draggedHandle == 'topLeft') { + newCoords = { + start: new WalkontableCellCoords(currentTouch.row, selectedRange.highlight.col), + end: new WalkontableCellCoords(bottomLeftCorner.row, currentTouch.col) + }; + } else { + newCoords = { + start: new WalkontableCellCoords(selectedRange.highlight.row, currentTouch.col), + end: new WalkontableCellCoords(currentTouch.row, topLeftCorner.col) + }; + } + break; + case 'SE-NW': + if (draggedHandle == 'bottomRight') { + newCoords = { + start: new WalkontableCellCoords(bottomRightCorner.row, currentTouch.col), + end: new WalkontableCellCoords(currentTouch.row, topLeftCorner.col) + }; + } + break; + } + break; + case 'NW-SE': + switch (currentDirection) { + case 'NE-SW': + if (draggedHandle == 'topLeft') { + newCoords = { + start: currentTouch, + end: bottomLeftCorner + }; + } else { + newCoords.end = currentTouch; + } + break; + case 'NW-SE': + if (draggedHandle == 'topLeft') { + newCoords = { + start: currentTouch, + end: bottomRightCorner + }; + } else { + newCoords.end = currentTouch; + } + break; + case 'SE-NW': + if (draggedHandle == 'topLeft') { + newCoords = { + start: currentTouch, + end: topLeftCorner + }; + } else { + newCoords.end = currentTouch; + } + break; + case 'SW-NE': + if (draggedHandle == 'topLeft') { + newCoords = { + start: currentTouch, + end: topRightCorner + }; + } else { + newCoords.end = currentTouch; + } + break; + } + break; + case 'SW-NE': + switch (currentDirection) { + case 'NW-SE': + if (draggedHandle == 'bottomRight') { + newCoords = { + start: new WalkontableCellCoords(currentTouch.row, topLeftCorner.col), + end: new WalkontableCellCoords(bottomLeftCorner.row, currentTouch.col) + }; + } else { + newCoords = { + start: new WalkontableCellCoords(topLeftCorner.row, currentTouch.col), + end: new WalkontableCellCoords(currentTouch.row, bottomRightCorner.col) + }; + } + break; + case 'SW-NE': + if (draggedHandle == 'topLeft') { + newCoords = { + start: new WalkontableCellCoords(selectedRange.highlight.row, currentTouch.col), + end: new WalkontableCellCoords(currentTouch.row, bottomRightCorner.col) + }; + } else { + newCoords = { + start: new WalkontableCellCoords(currentTouch.row, topLeftCorner.col), + end: new WalkontableCellCoords(topLeftCorner.row, currentTouch.col) + }; + } + break; + case 'SE-NW': + if (draggedHandle == 'bottomRight') { + newCoords = { + start: new WalkontableCellCoords(currentTouch.row, topRightCorner.col), + end: new WalkontableCellCoords(topLeftCorner.row, currentTouch.col) + }; + } else if (draggedHandle == 'topLeft') { + newCoords = { + start: bottomLeftCorner, + end: currentTouch + }; + } + break; + } + break; + case 'SE-NW': + switch (currentDirection) { + case 'NW-SE': + case 'NE-SW': + case 'SW-NE': + if (draggedHandle == 'topLeft') { + newCoords.end = currentTouch; + } + break; + case 'SE-NW': + if (draggedHandle == 'topLeft') { + newCoords.end = currentTouch; + } else { + newCoords = { + start: currentTouch, + end: topLeftCorner + }; + } + break; + } + break; + } + return newCoords; + }, + isDragged: function() { + return this.dragged.length > 0; + } +}, {}, BasePlugin); +; +registerPlugin('multipleSelectionHandles', MultipleSelectionHandles); + +//# +},{"_base":58,"eventManager":41,"helpers/dom/element":45,"plugins":57}],83:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + ObserveChanges: {get: function() { + return ObserveChanges; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_plugins__, + $__jsonpatch__; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var jsonpatch = ($__jsonpatch__ = require("jsonpatch"), $__jsonpatch__ && $__jsonpatch__.__esModule && $__jsonpatch__ || {default: $__jsonpatch__}).default; +; +function ObserveChanges() {} +Handsontable.hooks.add('afterLoadData', init); +Handsontable.hooks.add('afterUpdateSettings', init); +Handsontable.hooks.register('afterChangesObserved'); +function init() { + var instance = this; + var pluginEnabled = instance.getSettings().observeChanges; + if (pluginEnabled) { + if (instance.observer) { + destroy.call(instance); + } + createObserver.call(instance); + bindEvents.call(instance); + } else if (!pluginEnabled) { + destroy.call(instance); + } +} +function createObserver() { + var instance = this; + instance.observeChangesActive = true; + instance.pauseObservingChanges = function() { + instance.observeChangesActive = false; + }; + instance.resumeObservingChanges = function() { + instance.observeChangesActive = true; + }; + instance.observedData = instance.getSourceData(); + instance.observer = jsonpatch.observe(instance.observedData, function(patches) { + if (instance.observeChangesActive) { + runHookForOperation.call(instance, patches); + instance.render(); + } + instance.runHooks('afterChangesObserved'); + }); +} +function runHookForOperation(rawPatches) { + var instance = this; + var patches = cleanPatches(rawPatches); + for (var i = 0, + len = patches.length; i < len; i++) { + var patch = patches[i]; + var parsedPath = parsePath(patch.path); + switch (patch.op) { + case 'add': + if (isNaN(parsedPath.col)) { + instance.runHooks('afterCreateRow', parsedPath.row); + } else { + instance.runHooks('afterCreateCol', parsedPath.col); + } + break; + case 'remove': + if (isNaN(parsedPath.col)) { + instance.runHooks('afterRemoveRow', parsedPath.row, 1); + } else { + instance.runHooks('afterRemoveCol', parsedPath.col, 1); + } + break; + case 'replace': + instance.runHooks('afterChange', [parsedPath.row, parsedPath.col, null, patch.value], 'external'); + break; + } + } + function cleanPatches(rawPatches) { + var patches; + patches = removeLengthRelatedPatches(rawPatches); + patches = removeMultipleAddOrRemoveColPatches(patches); + return patches; + } + function removeMultipleAddOrRemoveColPatches(rawPatches) { + var newOrRemovedColumns = []; + return rawPatches.filter(function(patch) { + var parsedPath = parsePath(patch.path); + if (['add', 'remove'].indexOf(patch.op) != -1 && !isNaN(parsedPath.col)) { + if (newOrRemovedColumns.indexOf(parsedPath.col) != -1) { + return false; + } else { + newOrRemovedColumns.push(parsedPath.col); + } + } + return true; + }); + } + function removeLengthRelatedPatches(rawPatches) { + return rawPatches.filter(function(patch) { + return !/[/]length/ig.test(patch.path); + }); + } + function parsePath(path) { + var match = path.match(/^\/(\d+)\/?(.*)?$/); + return { + row: parseInt(match[1], 10), + col: /^\d*$/.test(match[2]) ? parseInt(match[2], 10) : match[2] + }; + } +} +function destroy() { + var instance = this; + if (instance.observer) { + destroyObserver.call(instance); + unbindEvents.call(instance); + } +} +function destroyObserver() { + var instance = this; + jsonpatch.unobserve(instance.observedData, instance.observer); + delete instance.observedData; + delete instance.observeChangesActive; + delete instance.pauseObservingChanges; + delete instance.resumeObservingChanges; +} +function bindEvents() { + var instance = this; + instance.addHook('afterDestroy', destroy); + instance.addHook('afterCreateRow', afterTableAlter); + instance.addHook('afterRemoveRow', afterTableAlter); + instance.addHook('afterCreateCol', afterTableAlter); + instance.addHook('afterRemoveCol', afterTableAlter); + instance.addHook('afterChange', function(changes, source) { + if (source != 'loadData') { + afterTableAlter.call(this); + } + }); +} +function unbindEvents() { + var instance = this; + instance.removeHook('afterDestroy', destroy); + instance.removeHook('afterCreateRow', afterTableAlter); + instance.removeHook('afterRemoveRow', afterTableAlter); + instance.removeHook('afterCreateCol', afterTableAlter); + instance.removeHook('afterRemoveCol', afterTableAlter); + instance.removeHook('afterChange', afterTableAlter); +} +function afterTableAlter() { + var instance = this; + instance.pauseObservingChanges(); + instance.addHookOnce('afterChangesObserved', function() { + instance.resumeObservingChanges(); + }); +} + +//# +},{"jsonpatch":"jsonpatch","plugins":57}],84:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + HandsontablePersistentState: {get: function() { + return HandsontablePersistentState; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_plugins__; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +; +function Storage(prefix) { + var savedKeys; + var saveSavedKeys = function() { + window.localStorage[prefix + '__' + 'persistentStateKeys'] = JSON.stringify(savedKeys); + }; + var loadSavedKeys = function() { + var keysJSON = window.localStorage[prefix + '__' + 'persistentStateKeys']; + var keys = typeof keysJSON == 'string' ? JSON.parse(keysJSON) : void 0; + savedKeys = keys ? keys : []; + }; + var clearSavedKeys = function() { + savedKeys = []; + saveSavedKeys(); + }; + loadSavedKeys(); + this.saveValue = function(key, value) { + window.localStorage[prefix + '_' + key] = JSON.stringify(value); + if (savedKeys.indexOf(key) == -1) { + savedKeys.push(key); + saveSavedKeys(); + } + }; + this.loadValue = function(key, defaultValue) { + key = typeof key === 'undefined' ? defaultValue : key; + var value = window.localStorage[prefix + '_' + key]; + return typeof value == 'undefined' ? void 0 : JSON.parse(value); + }; + this.reset = function(key) { + window.localStorage.removeItem(prefix + '_' + key); + }; + this.resetAll = function() { + for (var index = 0; index < savedKeys.length; index++) { + window.localStorage.removeItem(prefix + '_' + savedKeys[index]); + } + clearSavedKeys(); + }; +} +function HandsontablePersistentState() { + var plugin = this; + this.init = function() { + var instance = this, + pluginSettings = instance.getSettings().persistentState; + plugin.enabled = !!(pluginSettings); + if (!plugin.enabled) { + removeHooks.call(instance); + return; + } + if (!instance.storage) { + instance.storage = new Storage(instance.rootElement.id); + } + instance.resetState = plugin.resetValue; + addHooks.call(instance); + }; + this.saveValue = function(key, value) { + var instance = this; + instance.storage.saveValue(key, value); + }; + this.loadValue = function(key, saveTo) { + var instance = this; + saveTo.value = instance.storage.loadValue(key); + }; + this.resetValue = function(key) { + var instance = this; + if (typeof key === 'undefined') { + instance.storage.resetAll(); + } else { + instance.storage.reset(key); + } + }; + var hooks = { + persistentStateSave: plugin.saveValue, + persistentStateLoad: plugin.loadValue, + persistentStateReset: plugin.resetValue + }; + for (var hookName in hooks) { + if (hooks.hasOwnProperty(hookName)) { + Handsontable.hooks.register(hookName); + } + } + function addHooks() { + var instance = this; + for (var hookName in hooks) { + if (hooks.hasOwnProperty(hookName)) { + instance.addHook(hookName, hooks[hookName]); + } + } + } + function removeHooks() { + var instance = this; + for (var hookName in hooks) { + if (hooks.hasOwnProperty(hookName)) { + instance.removeHook(hookName, hooks[hookName]); + } + } + } +} +var htPersistentState = new HandsontablePersistentState(); +Handsontable.hooks.add('beforeInit', htPersistentState.init); +Handsontable.hooks.add('afterUpdateSettings', htPersistentState.init); + +//# +},{"plugins":57}],85:[function(require,module,exports){ +"use strict"; +var $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_renderers__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + removeClass = $__0.removeClass; +var $__1 = ($___46__46__47__46__46__47_renderers__ = require("renderers"), $___46__46__47__46__46__47_renderers__ && $___46__46__47__46__46__47_renderers__.__esModule && $___46__46__47__46__46__47_renderers__ || {default: $___46__46__47__46__46__47_renderers__}), + registerRenderer = $__1.registerRenderer, + getRenderer = $__1.getRenderer; +Handsontable.Search = function Search(instance) { + this.query = function(queryStr, callback, queryMethod) { + var rowCount = instance.countRows(); + var colCount = instance.countCols(); + var queryResult = []; + if (!callback) { + callback = Handsontable.Search.global.getDefaultCallback(); + } + if (!queryMethod) { + queryMethod = Handsontable.Search.global.getDefaultQueryMethod(); + } + for (var rowIndex = 0; rowIndex < rowCount; rowIndex++) { + for (var colIndex = 0; colIndex < colCount; colIndex++) { + var cellData = instance.getDataAtCell(rowIndex, colIndex); + var cellProperties = instance.getCellMeta(rowIndex, colIndex); + var cellCallback = cellProperties.search.callback || callback; + var cellQueryMethod = cellProperties.search.queryMethod || queryMethod; + var testResult = cellQueryMethod(queryStr, cellData); + if (testResult) { + var singleResult = { + row: rowIndex, + col: colIndex, + data: cellData + }; + queryResult.push(singleResult); + } + if (cellCallback) { + cellCallback(instance, rowIndex, colIndex, cellData, testResult); + } + } + } + return queryResult; + }; +}; +Handsontable.Search.DEFAULT_CALLBACK = function(instance, row, col, data, testResult) { + instance.getCellMeta(row, col).isSearchResult = testResult; +}; +Handsontable.Search.DEFAULT_QUERY_METHOD = function(query, value) { + if (typeof query == 'undefined' || query == null || !query.toLowerCase || query.length === 0) { + return false; + } + if (typeof value == 'undefined' || value == null) { + return false; + } + return value.toString().toLowerCase().indexOf(query.toLowerCase()) != -1; +}; +Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS = 'htSearchResult'; +Handsontable.Search.global = (function() { + var defaultCallback = Handsontable.Search.DEFAULT_CALLBACK; + var defaultQueryMethod = Handsontable.Search.DEFAULT_QUERY_METHOD; + var defaultSearchResultClass = Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS; + return { + getDefaultCallback: function() { + return defaultCallback; + }, + setDefaultCallback: function(newDefaultCallback) { + defaultCallback = newDefaultCallback; + }, + getDefaultQueryMethod: function() { + return defaultQueryMethod; + }, + setDefaultQueryMethod: function(newDefaultQueryMethod) { + defaultQueryMethod = newDefaultQueryMethod; + }, + getDefaultSearchResultClass: function() { + return defaultSearchResultClass; + }, + setDefaultSearchResultClass: function(newSearchResultClass) { + defaultSearchResultClass = newSearchResultClass; + } + }; +})(); +Handsontable.SearchCellDecorator = function(instance, TD, row, col, prop, value, cellProperties) { + var searchResultClass = (cellProperties.search !== null && typeof cellProperties.search == 'object' && cellProperties.search.searchResultClass) || Handsontable.Search.global.getDefaultSearchResultClass(); + if (cellProperties.isSearchResult) { + addClass(TD, searchResultClass); + } else { + removeClass(TD, searchResultClass); + } +}; +var originalBaseRenderer = getRenderer('base'); +registerRenderer('base', function(instance, TD, row, col, prop, value, cellProperties) { + originalBaseRenderer.apply(this, arguments); + Handsontable.SearchCellDecorator.apply(this, arguments); +}); +function init() { + var instance = this; + var pluginEnabled = !!instance.getSettings().search; + if (pluginEnabled) { + instance.search = new Handsontable.Search(instance); + } else { + delete instance.search; + } +} +Handsontable.hooks.add('afterInit', init); +Handsontable.hooks.add('afterUpdateSettings', init); + +//# +},{"helpers/dom/element":45,"renderers":88}],86:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + TouchScroll: {get: function() { + return TouchScroll; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__95_base__, + $___46__46__47__46__46__47_plugins__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + removeClass = $__0.removeClass; +var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var TouchScroll = function TouchScroll(hotInstance) { + var $__3 = this; + $traceurRuntime.superConstructor($TouchScroll).call(this, hotInstance); + this.hot.addHook('afterInit', (function() { + return $__3.afterInit(); + })); + this.hot.addHook('afterUpdateSettings', (function() { + return $__3.onAfterUpdateSettings(); + })); + this.scrollbars = []; + this.clones = []; +}; +var $TouchScroll = TouchScroll; +($traceurRuntime.createClass)(TouchScroll, { + afterInit: function() { + this.registerEvents(); + this.onAfterUpdateSettings(); + }, + onAfterUpdateSettings: function() { + var _this = this; + this.hot.addHookOnce('afterRender', function() { + var wtOverlays = _this.hot.view.wt.wtOverlays; + _this.scrollbars = []; + _this.scrollbars.push(wtOverlays.topOverlay); + if (wtOverlays.bottomOverlay.clone) { + _this.scrollbars.push(wtOverlays.bottomOverlay); + } + _this.scrollbars.push(wtOverlays.leftOverlay); + if (wtOverlays.topLeftCornerOverlay) { + _this.scrollbars.push(wtOverlays.topLeftCornerOverlay); + } + if (wtOverlays.bottomLeftCornerOverlay && wtOverlays.bottomLeftCornerOverlay.clone) { + _this.scrollbars.push(wtOverlays.bottomLeftCornerOverlay); + } + _this.clones = []; + if (wtOverlays.topOverlay.needFullRender) { + _this.clones.push(wtOverlays.topOverlay.clone.wtTable.holder.parentNode); + } + if (wtOverlays.bottomOverlay.needFullRender) { + _this.clones.push(wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode); + } + if (wtOverlays.leftOverlay.needFullRender) { + _this.clones.push(wtOverlays.leftOverlay.clone.wtTable.holder.parentNode); + } + if (wtOverlays.topLeftCornerOverlay) { + _this.clones.push(wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode); + } + if (wtOverlays.bottomLeftCornerOverlay && wtOverlays.bottomLeftCornerOverlay.clone) { + _this.clones.push(wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode); + } + }); + }, + registerEvents: function() { + var $__3 = this; + this.hot.addHook('beforeTouchScroll', (function() { + return $__3.onBeforeTouchScroll(); + })); + this.hot.addHook('afterMomentumScroll', (function() { + return $__3.onAfterMomentumScroll(); + })); + }, + onBeforeTouchScroll: function() { + Handsontable.freezeOverlays = true; + for (var i = 0, + cloneCount = this.clones.length; i < cloneCount; i++) { + addClass(this.clones[i], 'hide-tween'); + } + }, + onAfterMomentumScroll: function() { + Handsontable.freezeOverlays = false; + var _that = this; + for (var i = 0, + cloneCount = this.clones.length; i < cloneCount; i++) { + removeClass(this.clones[i], 'hide-tween'); + } + for (var i$__5 = 0, + cloneCount$__6 = this.clones.length; i$__5 < cloneCount$__6; i$__5++) { + addClass(this.clones[i$__5], 'show-tween'); + } + setTimeout(function() { + for (var i = 0, + cloneCount = _that.clones.length; i < cloneCount; i++) { + removeClass(_that.clones[i], 'show-tween'); + } + }, 400); + for (var i$__7 = 0, + cloneCount$__8 = this.scrollbars.length; i$__7 < cloneCount$__8; i$__7++) { + this.scrollbars[i$__7].refresh(); + this.scrollbars[i$__7].resetFixedPosition(); + } + this.hot.view.wt.wtOverlays.syncScrollWithMaster(); + } +}, {}, BasePlugin); +; +registerPlugin('touchScroll', TouchScroll); + +//# +},{"_base":58,"helpers/dom/element":45,"plugins":57}],87:[function(require,module,exports){ +"use strict"; +var $___46__46__47__46__46__47_helpers_47_object__, + $___46__46__47__46__46__47_helpers_47_dom_47_event__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47_helpers_47_object__}), + inherit = $__0.inherit, + deepClone = $__0.deepClone; +var stopImmediatePropagation = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}).stopImmediatePropagation; +Handsontable.UndoRedo = function(instance) { + var plugin = this; + this.instance = instance; + this.doneActions = []; + this.undoneActions = []; + this.ignoreNewActions = false; + instance.addHook('afterChange', function(changes, origin) { + if (changes) { + var action = new Handsontable.UndoRedo.ChangeAction(changes); + plugin.done(action); + } + }); + instance.addHook('afterCreateRow', function(index, amount, createdAutomatically) { + if (createdAutomatically) { + return; + } + var action = new Handsontable.UndoRedo.CreateRowAction(index, amount); + plugin.done(action); + }); + instance.addHook('beforeRemoveRow', function(index, amount) { + var originalData = plugin.instance.getSourceData(); + index = (originalData.length + index) % originalData.length; + var removedData = originalData.slice(index, index + amount); + var action = new Handsontable.UndoRedo.RemoveRowAction(index, removedData); + plugin.done(action); + }); + instance.addHook('afterCreateCol', function(index, amount, createdAutomatically) { + if (createdAutomatically) { + return; + } + var action = new Handsontable.UndoRedo.CreateColumnAction(index, amount); + plugin.done(action); + }); + instance.addHook('beforeRemoveCol', function(index, amount) { + var originalData = plugin.instance.getSourceData(); + index = (plugin.instance.countCols() + index) % plugin.instance.countCols(); + var removedData = []; + for (var i = 0, + len = originalData.length; i < len; i++) { + removedData[i] = originalData[i].slice(index, index + amount); + } + var headers; + if (Array.isArray(instance.getSettings().colHeaders)) { + headers = instance.getSettings().colHeaders.slice(index, index + removedData.length); + } + var action = new Handsontable.UndoRedo.RemoveColumnAction(index, removedData, headers); + plugin.done(action); + }); + instance.addHook('beforeCellAlignment', function(stateBefore, range, type, alignment) { + var action = new Handsontable.UndoRedo.CellAlignmentAction(stateBefore, range, type, alignment); + plugin.done(action); + }); +}; +Handsontable.UndoRedo.prototype.done = function(action) { + if (!this.ignoreNewActions) { + this.doneActions.push(action); + this.undoneActions.length = 0; + } +}; +Handsontable.UndoRedo.prototype.undo = function() { + if (this.isUndoAvailable()) { + var action = this.doneActions.pop(); + this.ignoreNewActions = true; + var that = this; + action.undo(this.instance, function() { + that.ignoreNewActions = false; + that.undoneActions.push(action); + }); + } +}; +Handsontable.UndoRedo.prototype.redo = function() { + if (this.isRedoAvailable()) { + var action = this.undoneActions.pop(); + this.ignoreNewActions = true; + var that = this; + action.redo(this.instance, function() { + that.ignoreNewActions = false; + that.doneActions.push(action); + }); + } +}; +Handsontable.UndoRedo.prototype.isUndoAvailable = function() { + return this.doneActions.length > 0; +}; +Handsontable.UndoRedo.prototype.isRedoAvailable = function() { + return this.undoneActions.length > 0; +}; +Handsontable.UndoRedo.prototype.clear = function() { + this.doneActions.length = 0; + this.undoneActions.length = 0; +}; +Handsontable.UndoRedo.Action = function() {}; +Handsontable.UndoRedo.Action.prototype.undo = function() {}; +Handsontable.UndoRedo.Action.prototype.redo = function() {}; +Handsontable.UndoRedo.ChangeAction = function(changes) { + this.changes = changes; +}; +inherit(Handsontable.UndoRedo.ChangeAction, Handsontable.UndoRedo.Action); +Handsontable.UndoRedo.ChangeAction.prototype.undo = function(instance, undoneCallback) { + var data = deepClone(this.changes), + emptyRowsAtTheEnd = instance.countEmptyRows(true), + emptyColsAtTheEnd = instance.countEmptyCols(true); + for (var i = 0, + len = data.length; i < len; i++) { + data[i].splice(3, 1); + } + instance.addHookOnce('afterChange', undoneCallback); + instance.setDataAtRowProp(data, null, null, 'undo'); + for (var i = 0, + len = data.length; i < len; i++) { + if (instance.getSettings().minSpareRows && data[i][0] + 1 + instance.getSettings().minSpareRows === instance.countRows() && emptyRowsAtTheEnd == instance.getSettings().minSpareRows) { + instance.alter('remove_row', parseInt(data[i][0] + 1, 10), instance.getSettings().minSpareRows); + instance.undoRedo.doneActions.pop(); + } + if (instance.getSettings().minSpareCols && data[i][1] + 1 + instance.getSettings().minSpareCols === instance.countCols() && emptyColsAtTheEnd == instance.getSettings().minSpareCols) { + instance.alter('remove_col', parseInt(data[i][1] + 1, 10), instance.getSettings().minSpareCols); + instance.undoRedo.doneActions.pop(); + } + } +}; +Handsontable.UndoRedo.ChangeAction.prototype.redo = function(instance, onFinishCallback) { + var data = deepClone(this.changes); + for (var i = 0, + len = data.length; i < len; i++) { + data[i].splice(2, 1); + } + instance.addHookOnce('afterChange', onFinishCallback); + instance.setDataAtRowProp(data, null, null, 'redo'); +}; +Handsontable.UndoRedo.CreateRowAction = function(index, amount) { + this.index = index; + this.amount = amount; +}; +inherit(Handsontable.UndoRedo.CreateRowAction, Handsontable.UndoRedo.Action); +Handsontable.UndoRedo.CreateRowAction.prototype.undo = function(instance, undoneCallback) { + var rowCount = instance.countRows(), + minSpareRows = instance.getSettings().minSpareRows; + if (this.index >= rowCount && this.index - minSpareRows < rowCount) { + this.index -= minSpareRows; + } + instance.addHookOnce('afterRemoveRow', undoneCallback); + instance.alter('remove_row', this.index, this.amount); +}; +Handsontable.UndoRedo.CreateRowAction.prototype.redo = function(instance, redoneCallback) { + instance.addHookOnce('afterCreateRow', redoneCallback); + instance.alter('insert_row', this.index + 1, this.amount); +}; +Handsontable.UndoRedo.RemoveRowAction = function(index, data) { + this.index = index; + this.data = data; +}; +inherit(Handsontable.UndoRedo.RemoveRowAction, Handsontable.UndoRedo.Action); +Handsontable.UndoRedo.RemoveRowAction.prototype.undo = function(instance, undoneCallback) { + var spliceArgs = [this.index, 0]; + Array.prototype.push.apply(spliceArgs, this.data); + Array.prototype.splice.apply(instance.getSourceData(), spliceArgs); + instance.addHookOnce('afterRender', undoneCallback); + instance.render(); +}; +Handsontable.UndoRedo.RemoveRowAction.prototype.redo = function(instance, redoneCallback) { + instance.addHookOnce('afterRemoveRow', redoneCallback); + instance.alter('remove_row', this.index, this.data.length); +}; +Handsontable.UndoRedo.CreateColumnAction = function(index, amount) { + this.index = index; + this.amount = amount; +}; +inherit(Handsontable.UndoRedo.CreateColumnAction, Handsontable.UndoRedo.Action); +Handsontable.UndoRedo.CreateColumnAction.prototype.undo = function(instance, undoneCallback) { + instance.addHookOnce('afterRemoveCol', undoneCallback); + instance.alter('remove_col', this.index, this.amount); +}; +Handsontable.UndoRedo.CreateColumnAction.prototype.redo = function(instance, redoneCallback) { + instance.addHookOnce('afterCreateCol', redoneCallback); + instance.alter('insert_col', this.index + 1, this.amount); +}; +Handsontable.UndoRedo.CellAlignmentAction = function(stateBefore, range, type, alignment) { + this.stateBefore = stateBefore; + this.range = range; + this.type = type; + this.alignment = alignment; +}; +Handsontable.UndoRedo.CellAlignmentAction.prototype.undo = function(instance, undoneCallback) { + if (!instance.getPlugin('contextMenu').isEnabled()) { + return; + } + for (var row = this.range.from.row; row <= this.range.to.row; row++) { + for (var col = this.range.from.col; col <= this.range.to.col; col++) { + instance.setCellMeta(row, col, 'className', this.stateBefore[row][col] || ' htLeft'); + } + } + instance.addHookOnce('afterRender', undoneCallback); + instance.render(); +}; +Handsontable.UndoRedo.CellAlignmentAction.prototype.redo = function(instance, undoneCallback) { + if (!instance.getPlugin('contextMenu').isEnabled()) { + return; + } + instance.selectCell(this.range.from.row, this.range.from.col, this.range.to.row, this.range.to.col); + instance.getPlugin('contextMenu').executeCommand('alignment:' + this.alignment.replace('ht', '').toLowerCase()); + instance.addHookOnce('afterRender', undoneCallback); + instance.render(); +}; +Handsontable.UndoRedo.RemoveColumnAction = function(index, data, headers) { + this.index = index; + this.data = data; + this.amount = this.data[0].length; + this.headers = headers; +}; +inherit(Handsontable.UndoRedo.RemoveColumnAction, Handsontable.UndoRedo.Action); +Handsontable.UndoRedo.RemoveColumnAction.prototype.undo = function(instance, undoneCallback) { + var row, + spliceArgs; + for (var i = 0, + len = instance.getSourceData().length; i < len; i++) { + row = instance.getSourceDataAtRow(i); + spliceArgs = [this.index, 0]; + Array.prototype.push.apply(spliceArgs, this.data[i]); + Array.prototype.splice.apply(row, spliceArgs); + } + if (typeof this.headers != 'undefined') { + spliceArgs = [this.index, 0]; + Array.prototype.push.apply(spliceArgs, this.headers); + Array.prototype.splice.apply(instance.getSettings().colHeaders, spliceArgs); + } + instance.addHookOnce('afterRender', undoneCallback); + instance.render(); +}; +Handsontable.UndoRedo.RemoveColumnAction.prototype.redo = function(instance, redoneCallback) { + instance.addHookOnce('afterRemoveCol', redoneCallback); + instance.alter('remove_col', this.index, this.amount); +}; +function init() { + var instance = this; + var pluginEnabled = typeof instance.getSettings().undo == 'undefined' || instance.getSettings().undo; + if (pluginEnabled) { + if (!instance.undoRedo) { + instance.undoRedo = new Handsontable.UndoRedo(instance); + exposeUndoRedoMethods(instance); + instance.addHook('beforeKeyDown', onBeforeKeyDown); + instance.addHook('afterChange', onAfterChange); + } + } else { + if (instance.undoRedo) { + delete instance.undoRedo; + removeExposedUndoRedoMethods(instance); + instance.removeHook('beforeKeyDown', onBeforeKeyDown); + instance.removeHook('afterChange', onAfterChange); + } + } +} +function onBeforeKeyDown(event) { + var instance = this; + var ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey; + if (ctrlDown) { + if (event.keyCode === 89 || (event.shiftKey && event.keyCode === 90)) { + instance.undoRedo.redo(); + stopImmediatePropagation(event); + } else if (event.keyCode === 90) { + instance.undoRedo.undo(); + stopImmediatePropagation(event); + } + } +} +function onAfterChange(changes, source) { + var instance = this; + if (source == 'loadData') { + return instance.undoRedo.clear(); + } +} +function exposeUndoRedoMethods(instance) { + instance.undo = function() { + return instance.undoRedo.undo(); + }; + instance.redo = function() { + return instance.undoRedo.redo(); + }; + instance.isUndoAvailable = function() { + return instance.undoRedo.isUndoAvailable(); + }; + instance.isRedoAvailable = function() { + return instance.undoRedo.isRedoAvailable(); + }; + instance.clearUndo = function() { + return instance.undoRedo.clear(); + }; +} +function removeExposedUndoRedoMethods(instance) { + delete instance.undo; + delete instance.redo; + delete instance.isUndoAvailable; + delete instance.isRedoAvailable; + delete instance.clearUndo; +} +Handsontable.hooks.add('afterInit', init); +Handsontable.hooks.add('afterUpdateSettings', init); + +//# +},{"helpers/dom/event":46,"helpers/object":50}],88:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + registerRenderer: {get: function() { + return registerRenderer; + }}, + getRenderer: {get: function() { + return getRenderer; + }}, + hasRenderer: {get: function() { + return hasRenderer; + }}, + __esModule: {value: true} +}); +var $__helpers_47_string__; +var toUpperCaseFirst = ($__helpers_47_string__ = require("helpers/string"), $__helpers_47_string__ && $__helpers_47_string__.__esModule && $__helpers_47_string__ || {default: $__helpers_47_string__}).toUpperCaseFirst; +var registeredRenderers = {}; +Handsontable.renderers = Handsontable.renderers || {}; +Handsontable.renderers.registerRenderer = registerRenderer; +Handsontable.renderers.getRenderer = getRenderer; +function registerRenderer(rendererName, rendererFunction) { + var registerName; + registeredRenderers[rendererName] = rendererFunction; + registerName = toUpperCaseFirst(rendererName) + 'Renderer'; + Handsontable.renderers[registerName] = rendererFunction; + Handsontable[registerName] = rendererFunction; +} +function getRenderer(rendererName) { + if (typeof rendererName == 'function') { + return rendererName; + } + if (typeof rendererName != 'string') { + throw Error('Only strings and functions can be passed as "renderer" parameter'); + } + if (!(rendererName in registeredRenderers)) { + throw Error('No editor registered under name "' + rendererName + '"'); + } + return registeredRenderers[rendererName]; +} +function hasRenderer(rendererName) { + return rendererName in registeredRenderers; +} +; + +//# +},{"helpers/string":52}],89:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + cellDecorator: {get: function() { + return cellDecorator; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_renderers__; +var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + removeClass = $__0.removeClass; +var registerRenderer = ($___46__46__47_renderers__ = require("renderers"), $___46__46__47_renderers__ && $___46__46__47_renderers__.__esModule && $___46__46__47_renderers__ || {default: $___46__46__47_renderers__}).registerRenderer; +; +registerRenderer('base', cellDecorator); +Handsontable.renderers.cellDecorator = cellDecorator; +function cellDecorator(instance, TD, row, col, prop, value, cellProperties) { + if (cellProperties.className) { + if (TD.className) { + TD.className = TD.className + ' ' + cellProperties.className; + } else { + TD.className = cellProperties.className; + } + } + if (cellProperties.readOnly) { + addClass(TD, cellProperties.readOnlyCellClassName); + } + if (cellProperties.valid === false && cellProperties.invalidCellClassName) { + addClass(TD, cellProperties.invalidCellClassName); + } else { + removeClass(TD, cellProperties.invalidCellClassName); + } + if (cellProperties.wordWrap === false && cellProperties.noWordWrapClassName) { + addClass(TD, cellProperties.noWordWrapClassName); + } + if (!value && cellProperties.placeholder) { + addClass(TD, cellProperties.placeholderCellClassName); + } +} + +//# +},{"helpers/dom/element":45,"renderers":88}],90:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + autocompleteRenderer: {get: function() { + return autocompleteRenderer; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_eventManager__, + $___46__46__47_renderers__, + $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__; +var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + hasClass = $__0.hasClass, + empty = $__0.empty; +var eventManagerObject = ($___46__46__47_eventManager__ = require("eventManager"), $___46__46__47_eventManager__ && $___46__46__47_eventManager__.__esModule && $___46__46__47_eventManager__ || {default: $___46__46__47_eventManager__}).eventManager; +var $__2 = ($___46__46__47_renderers__ = require("renderers"), $___46__46__47_renderers__ && $___46__46__47_renderers__.__esModule && $___46__46__47_renderers__ || {default: $___46__46__47_renderers__}), + getRenderer = $__2.getRenderer, + registerRenderer = $__2.registerRenderer; +var WalkontableCellCoords = ($___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords; +var clonableWRAPPER = document.createElement('DIV'); +clonableWRAPPER.className = 'htAutocompleteWrapper'; +var clonableARROW = document.createElement('DIV'); +clonableARROW.className = 'htAutocompleteArrow'; +clonableARROW.appendChild(document.createTextNode(String.fromCharCode(9660))); +var wrapTdContentWithWrapper = function(TD, WRAPPER) { + WRAPPER.innerHTML = TD.innerHTML; + empty(TD); + TD.appendChild(WRAPPER); +}; +function autocompleteRenderer(instance, TD, row, col, prop, value, cellProperties) { + var WRAPPER = clonableWRAPPER.cloneNode(true); + var ARROW = clonableARROW.cloneNode(true); + getRenderer('text')(instance, TD, row, col, prop, value, cellProperties); + TD.appendChild(ARROW); + addClass(TD, 'htAutocomplete'); + if (!TD.firstChild) { + TD.appendChild(document.createTextNode(String.fromCharCode(160))); + } + if (!instance.acArrowListener) { + var eventManager = eventManagerObject(instance); + instance.acArrowListener = function(event) { + if (hasClass(event.target, 'htAutocompleteArrow')) { + instance.view.wt.getSetting('onCellDblClick', null, new WalkontableCellCoords(row, col), TD); + } + }; + eventManager.addEventListener(instance.rootElement, 'mousedown', instance.acArrowListener); + instance.addHookOnce('afterDestroy', function() { + eventManager.destroy(); + }); + } +} +; +registerRenderer('autocomplete', autocompleteRenderer); + +//# +},{"3rdparty/walkontable/src/cell/coords":5,"eventManager":41,"helpers/dom/element":45,"renderers":88}],91:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + checkboxRenderer: {get: function() { + return checkboxRenderer; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_helpers_47_string__, + $___46__46__47_eventManager__, + $___46__46__47_renderers__, + $___46__46__47_helpers_47_unicode__, + $___46__46__47_helpers_47_dom_47_event__; +var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}), + empty = $__0.empty, + addClass = $__0.addClass, + hasClass = $__0.hasClass; +var equalsIgnoreCase = ($___46__46__47_helpers_47_string__ = require("helpers/string"), $___46__46__47_helpers_47_string__ && $___46__46__47_helpers_47_string__.__esModule && $___46__46__47_helpers_47_string__ || {default: $___46__46__47_helpers_47_string__}).equalsIgnoreCase; +var EventManager = ($___46__46__47_eventManager__ = require("eventManager"), $___46__46__47_eventManager__ && $___46__46__47_eventManager__.__esModule && $___46__46__47_eventManager__ || {default: $___46__46__47_eventManager__}).EventManager; +var $__3 = ($___46__46__47_renderers__ = require("renderers"), $___46__46__47_renderers__ && $___46__46__47_renderers__.__esModule && $___46__46__47_renderers__ || {default: $___46__46__47_renderers__}), + getRenderer = $__3.getRenderer, + registerRenderer = $__3.registerRenderer; +var KEY_CODES = ($___46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47_helpers_47_unicode__ && $___46__46__47_helpers_47_unicode__.__esModule && $___46__46__47_helpers_47_unicode__ || {default: $___46__46__47_helpers_47_unicode__}).KEY_CODES; +var $__5 = ($___46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47_helpers_47_dom_47_event__ && $___46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47_helpers_47_dom_47_event__}), + stopPropagation = $__5.stopPropagation, + stopImmediatePropagation = $__5.stopImmediatePropagation, + isImmediatePropagationStopped = $__5.isImmediatePropagationStopped; +var isListeningKeyDownEvent = new WeakMap(); +var BAD_VALUE_CLASS = 'htBadValue'; +function checkboxRenderer(instance, TD, row, col, prop, value, cellProperties) { + var eventManager = new EventManager(instance); + var input = createInput(); + var labelOptions = cellProperties.label; + var badValue = false; + if (typeof cellProperties.checkedTemplate === 'undefined') { + cellProperties.checkedTemplate = true; + } + if (typeof cellProperties.uncheckedTemplate === 'undefined') { + cellProperties.uncheckedTemplate = false; + } + empty(TD); + if (value === cellProperties.checkedTemplate || equalsIgnoreCase(value, cellProperties.checkedTemplate)) { + input.checked = true; + } else if (value === cellProperties.uncheckedTemplate || equalsIgnoreCase(value, cellProperties.uncheckedTemplate)) { + input.checked = false; + } else if (value === null) { + addClass(input, 'noValue'); + } else { + input.style.display = 'none'; + addClass(input, BAD_VALUE_CLASS); + badValue = true; + } + if (!badValue && labelOptions) { + var labelText = ''; + if (labelOptions.value) { + labelText = typeof labelOptions.value === 'function' ? labelOptions.value.call(this, row, col, prop, value) : labelOptions.value; + } else if (labelOptions.property) { + labelText = instance.getDataAtRowProp(row, labelOptions.property); + } + var label = createLabel(labelText); + if (labelOptions.position === 'before') { + label.appendChild(input); + } else { + label.insertBefore(input, label.firstChild); + } + input = label; + } + TD.appendChild(input); + if (badValue) { + TD.appendChild(document.createTextNode('#bad-value#')); + } + if (cellProperties.readOnly) { + eventManager.addEventListener(input, 'click', preventDefault); + } else { + eventManager.addEventListener(input, 'mousedown', stopPropagation); + eventManager.addEventListener(input, 'mouseup', stopPropagation); + eventManager.addEventListener(input, 'change', (function(event) { + instance.setDataAtRowProp(row, prop, event.target.checked ? cellProperties.checkedTemplate : cellProperties.uncheckedTemplate); + })); + } + if (!isListeningKeyDownEvent.has(instance)) { + isListeningKeyDownEvent.set(instance, true); + instance.addHook('beforeKeyDown', onBeforeKeyDown); + } + function onBeforeKeyDown(event) { + var allowedKeys = [KEY_CODES.SPACE, KEY_CODES.ENTER, KEY_CODES.DELETE, KEY_CODES.BACKSPACE]; + if (allowedKeys.indexOf(event.keyCode) !== -1 && !isImmediatePropagationStopped(event)) { + eachSelectedCheckboxCell(function() { + stopImmediatePropagation(event); + event.preventDefault(); + }); + } + if (event.keyCode == KEY_CODES.SPACE || event.keyCode == KEY_CODES.ENTER) { + toggleSelected(); + } + if (event.keyCode == KEY_CODES.DELETE || event.keyCode == KEY_CODES.BACKSPACE) { + toggleSelected(false); + } + } + function toggleSelected() { + var checked = arguments[0] !== (void 0) ? arguments[0] : null; + eachSelectedCheckboxCell(function(checkboxes) { + for (var i = 0, + len = checkboxes.length; i < len; i++) { + if (hasClass(checkboxes[i], BAD_VALUE_CLASS) && checked === null) { + return; + } + toggleCheckbox(checkboxes[i], checked); + } + }); + } + function toggleCheckbox(checkbox) { + var checked = arguments[1] !== (void 0) ? arguments[1] : null; + if (checked === null) { + checkbox.checked = !checkbox.checked; + } else { + checkbox.checked = checked; + } + eventManager.fireEvent(checkbox, 'change'); + } + function eachSelectedCheckboxCell(callback) { + var selRange = instance.getSelectedRange(); + var topLeft = selRange.getTopLeftCorner(); + var bottomRight = selRange.getBottomRightCorner(); + for (var row = topLeft.row; row <= bottomRight.row; row++) { + for (var col = topLeft.col; col <= bottomRight.col; col++) { + var cell = instance.getCell(row, col); + var cellProperties$__6 = instance.getCellMeta(row, col); + var checkboxes = cell.querySelectorAll('input[type=checkbox]'); + if (checkboxes.length > 0 && !cellProperties$__6.readOnly) { + callback(checkboxes); + } + } + } + } +} +; +registerRenderer('checkbox', checkboxRenderer); +function createInput() { + var input = document.createElement('input'); + input.className = 'htCheckboxRendererInput'; + input.type = 'checkbox'; + input.setAttribute('autocomplete', 'off'); + return input.cloneNode(false); +} +function createLabel(text) { + var label = document.createElement('label'); + label.className = 'htCheckboxRendererLabel'; + label.appendChild(document.createTextNode(text)); + return label.cloneNode(true); +} +function preventDefault(event) { + event.preventDefault(); +} + +//# +},{"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/string":52,"helpers/unicode":53,"renderers":88}],92:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + htmlRenderer: {get: function() { + return htmlRenderer; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_renderers__; +var fastInnerHTML = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}).fastInnerHTML; +var $__1 = ($___46__46__47_renderers__ = require("renderers"), $___46__46__47_renderers__ && $___46__46__47_renderers__.__esModule && $___46__46__47_renderers__ || {default: $___46__46__47_renderers__}), + getRenderer = $__1.getRenderer, + registerRenderer = $__1.registerRenderer; +function htmlRenderer(instance, TD, row, col, prop, value, cellProperties) { + getRenderer('base').apply(this, arguments); + fastInnerHTML(TD, value); +} +; +registerRenderer('html', htmlRenderer); + +//# +},{"helpers/dom/element":45,"renderers":88}],93:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + numericRenderer: {get: function() { + return numericRenderer; + }}, + __esModule: {value: true} +}); +var $__numeral__, + $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_renderers__, + $___46__46__47_helpers_47_number__; +var numeral = ($__numeral__ = require("numeral"), $__numeral__ && $__numeral__.__esModule && $__numeral__ || {default: $__numeral__}).default; +var addClass = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}).addClass; +var $__2 = ($___46__46__47_renderers__ = require("renderers"), $___46__46__47_renderers__ && $___46__46__47_renderers__.__esModule && $___46__46__47_renderers__ || {default: $___46__46__47_renderers__}), + getRenderer = $__2.getRenderer, + registerRenderer = $__2.registerRenderer; +var isNumeric = ($___46__46__47_helpers_47_number__ = require("helpers/number"), $___46__46__47_helpers_47_number__ && $___46__46__47_helpers_47_number__.__esModule && $___46__46__47_helpers_47_number__ || {default: $___46__46__47_helpers_47_number__}).isNumeric; +function numericRenderer(instance, TD, row, col, prop, value, cellProperties) { + if (isNumeric(value)) { + if (typeof cellProperties.language !== 'undefined') { + numeral.language(cellProperties.language); + } + value = numeral(value).format(cellProperties.format || '0'); + addClass(TD, 'htNumeric'); + } + getRenderer('text')(instance, TD, row, col, prop, value, cellProperties); +} +; +registerRenderer('numeric', numericRenderer); + +//# +},{"helpers/dom/element":45,"helpers/number":49,"numeral":"numeral","renderers":88}],94:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + passwordRenderer: {get: function() { + return passwordRenderer; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_renderers__; +var fastInnerHTML = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}).fastInnerHTML; +var $__1 = ($___46__46__47_renderers__ = require("renderers"), $___46__46__47_renderers__ && $___46__46__47_renderers__.__esModule && $___46__46__47_renderers__ || {default: $___46__46__47_renderers__}), + getRenderer = $__1.getRenderer, + registerRenderer = $__1.registerRenderer; +function passwordRenderer(instance, TD, row, col, prop, value, cellProperties) { + getRenderer('text').apply(this, arguments); + value = TD.innerHTML; + var hash; + var hashLength = cellProperties.hashLength || value.length; + var hashSymbol = cellProperties.hashSymbol || '*'; + for (hash = ''; hash.split(hashSymbol).length - 1 < hashLength; hash += hashSymbol) {} + fastInnerHTML(TD, hash); +} +; +registerRenderer('password', passwordRenderer); + +//# +},{"helpers/dom/element":45,"renderers":88}],95:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + textRenderer: {get: function() { + return textRenderer; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_helpers_47_mixed__, + $___46__46__47_renderers__; +var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}), + empty = $__0.empty, + fastInnerText = $__0.fastInnerText; +var stringify = ($___46__46__47_helpers_47_mixed__ = require("helpers/mixed"), $___46__46__47_helpers_47_mixed__ && $___46__46__47_helpers_47_mixed__.__esModule && $___46__46__47_helpers_47_mixed__ || {default: $___46__46__47_helpers_47_mixed__}).stringify; +var $__2 = ($___46__46__47_renderers__ = require("renderers"), $___46__46__47_renderers__ && $___46__46__47_renderers__.__esModule && $___46__46__47_renderers__ || {default: $___46__46__47_renderers__}), + getRenderer = $__2.getRenderer, + registerRenderer = $__2.registerRenderer; +function textRenderer(instance, TD, row, col, prop, value, cellProperties) { + getRenderer('base').apply(this, arguments); + if (!value && cellProperties.placeholder) { + value = cellProperties.placeholder; + } + var escaped = stringify(value); + if (!instance.getSettings().trimWhitespace) { + escaped = escaped.replace(/ /g, String.fromCharCode(160)); + } + if (cellProperties.rendererTemplate) { + empty(TD); + var TEMPLATE = document.createElement('TEMPLATE'); + TEMPLATE.setAttribute('bind', '{{}}'); + TEMPLATE.innerHTML = cellProperties.rendererTemplate; + HTMLTemplateElement.decorate(TEMPLATE); + TEMPLATE.model = instance.getSourceDataAtRow(row); + TD.appendChild(TEMPLATE); + } else { + fastInnerText(TD, escaped); + } +} +; +registerRenderer('text', textRenderer); + +//# +},{"helpers/dom/element":45,"helpers/mixed":48,"renderers":88}],96:[function(require,module,exports){ +"use strict"; +(function(global) { + 'use strict'; + if (global.$traceurRuntime) { + return; + } + var $Object = Object; + var $TypeError = TypeError; + var $create = $Object.create; + var $defineProperties = $Object.defineProperties; + var $defineProperty = $Object.defineProperty; + var $freeze = $Object.freeze; + var $getOwnPropertyDescriptor = $Object.getOwnPropertyDescriptor; + var $getOwnPropertyNames = $Object.getOwnPropertyNames; + var $keys = $Object.keys; + var $hasOwnProperty = $Object.prototype.hasOwnProperty; + var $preventExtensions = Object.preventExtensions; + var $seal = Object.seal; + var $isExtensible = Object.isExtensible; + function nonEnum(value) { + return { + configurable: true, + enumerable: false, + value: value, + writable: true + }; + } + var method = nonEnum; + var counter = 0; + function newUniqueString() { + return '__$' + Math.floor(Math.random() * 1e9) + '$' + ++counter + '$__'; + } + var symbolInternalProperty = newUniqueString(); + var symbolDescriptionProperty = newUniqueString(); + var symbolDataProperty = newUniqueString(); + var symbolValues = $create(null); + var privateNames = $create(null); + function isPrivateName(s) { + return privateNames[s]; + } + function createPrivateName() { + var s = newUniqueString(); + privateNames[s] = true; + return s; + } + function isShimSymbol(symbol) { + return typeof symbol === 'object' && symbol instanceof SymbolValue; + } + function typeOf(v) { + if (isShimSymbol(v)) + return 'symbol'; + return typeof v; + } + function Symbol(description) { + var value = new SymbolValue(description); + if (!(this instanceof Symbol)) + return value; + throw new TypeError('Symbol cannot be new\'ed'); + } + $defineProperty(Symbol.prototype, 'constructor', nonEnum(Symbol)); + $defineProperty(Symbol.prototype, 'toString', method(function() { + var symbolValue = this[symbolDataProperty]; + if (!getOption('symbols')) + return symbolValue[symbolInternalProperty]; + if (!symbolValue) + throw TypeError('Conversion from symbol to string'); + var desc = symbolValue[symbolDescriptionProperty]; + if (desc === undefined) + desc = ''; + return 'Symbol(' + desc + ')'; + })); + $defineProperty(Symbol.prototype, 'valueOf', method(function() { + var symbolValue = this[symbolDataProperty]; + if (!symbolValue) + throw TypeError('Conversion from symbol to string'); + if (!getOption('symbols')) + return symbolValue[symbolInternalProperty]; + return symbolValue; + })); + function SymbolValue(description) { + var key = newUniqueString(); + $defineProperty(this, symbolDataProperty, {value: this}); + $defineProperty(this, symbolInternalProperty, {value: key}); + $defineProperty(this, symbolDescriptionProperty, {value: description}); + freeze(this); + symbolValues[key] = this; + } + $defineProperty(SymbolValue.prototype, 'constructor', nonEnum(Symbol)); + $defineProperty(SymbolValue.prototype, 'toString', { + value: Symbol.prototype.toString, + enumerable: false + }); + $defineProperty(SymbolValue.prototype, 'valueOf', { + value: Symbol.prototype.valueOf, + enumerable: false + }); + var hashProperty = createPrivateName(); + var hashPropertyDescriptor = {value: undefined}; + var hashObjectProperties = { + hash: {value: undefined}, + self: {value: undefined} + }; + var hashCounter = 0; + function getOwnHashObject(object) { + var hashObject = object[hashProperty]; + if (hashObject && hashObject.self === object) + return hashObject; + if ($isExtensible(object)) { + hashObjectProperties.hash.value = hashCounter++; + hashObjectProperties.self.value = object; + hashPropertyDescriptor.value = $create(null, hashObjectProperties); + $defineProperty(object, hashProperty, hashPropertyDescriptor); + return hashPropertyDescriptor.value; + } + return undefined; + } + function freeze(object) { + getOwnHashObject(object); + return $freeze.apply(this, arguments); + } + function preventExtensions(object) { + getOwnHashObject(object); + return $preventExtensions.apply(this, arguments); + } + function seal(object) { + getOwnHashObject(object); + return $seal.apply(this, arguments); + } + freeze(SymbolValue.prototype); + function isSymbolString(s) { + return symbolValues[s] || privateNames[s]; + } + function toProperty(name) { + if (isShimSymbol(name)) + return name[symbolInternalProperty]; + return name; + } + function removeSymbolKeys(array) { + var rv = []; + for (var i = 0; i < array.length; i++) { + if (!isSymbolString(array[i])) { + rv.push(array[i]); + } + } + return rv; + } + function getOwnPropertyNames(object) { + return removeSymbolKeys($getOwnPropertyNames(object)); + } + function keys(object) { + return removeSymbolKeys($keys(object)); + } + function getOwnPropertySymbols(object) { + var rv = []; + var names = $getOwnPropertyNames(object); + for (var i = 0; i < names.length; i++) { + var symbol = symbolValues[names[i]]; + if (symbol) { + rv.push(symbol); + } + } + return rv; + } + function getOwnPropertyDescriptor(object, name) { + return $getOwnPropertyDescriptor(object, toProperty(name)); + } + function hasOwnProperty(name) { + return $hasOwnProperty.call(this, toProperty(name)); + } + function getOption(name) { + return global.traceur && global.traceur.options[name]; + } + function defineProperty(object, name, descriptor) { + if (isShimSymbol(name)) { + name = name[symbolInternalProperty]; + } + $defineProperty(object, name, descriptor); + return object; + } + function polyfillObject(Object) { + $defineProperty(Object, 'defineProperty', {value: defineProperty}); + $defineProperty(Object, 'getOwnPropertyNames', {value: getOwnPropertyNames}); + $defineProperty(Object, 'getOwnPropertyDescriptor', {value: getOwnPropertyDescriptor}); + $defineProperty(Object.prototype, 'hasOwnProperty', {value: hasOwnProperty}); + $defineProperty(Object, 'freeze', {value: freeze}); + $defineProperty(Object, 'preventExtensions', {value: preventExtensions}); + $defineProperty(Object, 'seal', {value: seal}); + $defineProperty(Object, 'keys', {value: keys}); + } + function exportStar(object) { + for (var i = 1; i < arguments.length; i++) { + var names = $getOwnPropertyNames(arguments[i]); + for (var j = 0; j < names.length; j++) { + var name = names[j]; + if (isSymbolString(name)) + continue; + (function(mod, name) { + $defineProperty(object, name, { + get: function() { + return mod[name]; + }, + enumerable: true + }); + })(arguments[i], names[j]); + } + } + return object; + } + function isObject(x) { + return x != null && (typeof x === 'object' || typeof x === 'function'); + } + function toObject(x) { + if (x == null) + throw $TypeError(); + return $Object(x); + } + function checkObjectCoercible(argument) { + if (argument == null) { + throw new TypeError('Value cannot be converted to an Object'); + } + return argument; + } + function polyfillSymbol(global, Symbol) { + if (!global.Symbol) { + global.Symbol = Symbol; + Object.getOwnPropertySymbols = getOwnPropertySymbols; + } + if (!global.Symbol.iterator) { + global.Symbol.iterator = Symbol('Symbol.iterator'); + } + } + function setupGlobals(global) { + polyfillSymbol(global, Symbol); + global.Reflect = global.Reflect || {}; + global.Reflect.global = global.Reflect.global || global; + polyfillObject(global.Object); + } + setupGlobals(global); + global.$traceurRuntime = { + checkObjectCoercible: checkObjectCoercible, + createPrivateName: createPrivateName, + defineProperties: $defineProperties, + defineProperty: $defineProperty, + exportStar: exportStar, + getOwnHashObject: getOwnHashObject, + getOwnPropertyDescriptor: $getOwnPropertyDescriptor, + getOwnPropertyNames: $getOwnPropertyNames, + isObject: isObject, + isPrivateName: isPrivateName, + isSymbolString: isSymbolString, + keys: $keys, + setupGlobals: setupGlobals, + toObject: toObject, + toProperty: toProperty, + typeof: typeOf + }; +})(window); +(function() { + 'use strict'; + var $toProperty = $traceurRuntime.toProperty; + function spread() { + var rv = [], + j = 0, + iterResult; + for (var i = 0; i < arguments.length; i++) { + var valueToSpread = $traceurRuntime.checkObjectCoercible(arguments[i]); + if (typeof valueToSpread[$toProperty(Symbol.iterator)] !== 'function') { + throw new TypeError('Cannot spread non-iterable object.'); + } + var iter = valueToSpread[$toProperty(Symbol.iterator)](); + while (!(iterResult = iter.next()).done) { + rv[j++] = iterResult.value; + } + } + return rv; + } + $traceurRuntime.spread = spread; +})(); +(function() { + 'use strict'; + var $Object = Object; + var $TypeError = TypeError; + var $create = $Object.create; + var $defineProperties = $traceurRuntime.defineProperties; + var $defineProperty = $traceurRuntime.defineProperty; + var $getOwnPropertyDescriptor = $traceurRuntime.getOwnPropertyDescriptor; + var $getPrototypeOf = Object.getPrototypeOf; + var $toProperty = $traceurRuntime.toProperty; + var $__0 = Object, + getOwnPropertyNames = $__0.getOwnPropertyNames, + getOwnPropertySymbols = $__0.getOwnPropertySymbols; + function superDescriptor(homeObject, name) { + var proto = $getPrototypeOf(homeObject); + do { + var result = $getOwnPropertyDescriptor(proto, name); + if (result) + return result; + proto = $getPrototypeOf(proto); + } while (proto); + return undefined; + } + function superConstructor(ctor) { + return ctor.__proto__; + } + function superCall(self, homeObject, name, args) { + return superGet(self, homeObject, name).apply(self, args); + } + function superGet(self, homeObject, name) { + var descriptor = superDescriptor(homeObject, name); + if (descriptor) { + if (!descriptor.get) + return descriptor.value; + return descriptor.get.call(self); + } + return undefined; + } + function superSet(self, homeObject, name, value) { + var descriptor = superDescriptor(homeObject, name); + if (descriptor && descriptor.set) { + descriptor.set.call(self, value); + return value; + } + throw $TypeError(("super has no setter '" + name + "'.")); + } + function getDescriptors(object) { + var descriptors = {}; + var names = getOwnPropertyNames(object); + for (var i = 0; i < names.length; i++) { + var name = names[i]; + descriptors[name] = $getOwnPropertyDescriptor(object, name); + } + var symbols = getOwnPropertySymbols(object); + for (var i = 0; i < symbols.length; i++) { + var symbol = symbols[i]; + descriptors[$toProperty(symbol)] = $getOwnPropertyDescriptor(object, $toProperty(symbol)); + } + return descriptors; + } + function createClass(ctor, object, staticObject, superClass) { + $defineProperty(object, 'constructor', { + value: ctor, + configurable: true, + enumerable: false, + writable: true + }); + if (arguments.length > 3) { + if (typeof superClass === 'function') + ctor.__proto__ = superClass; + ctor.prototype = $create(getProtoParent(superClass), getDescriptors(object)); + } else { + ctor.prototype = object; + } + $defineProperty(ctor, 'prototype', { + configurable: false, + writable: false + }); + return $defineProperties(ctor, getDescriptors(staticObject)); + } + function getProtoParent(superClass) { + if (typeof superClass === 'function') { + var prototype = superClass.prototype; + if ($Object(prototype) === prototype || prototype === null) + return superClass.prototype; + throw new $TypeError('super prototype must be an Object or null'); + } + if (superClass === null) + return null; + throw new $TypeError(("Super expression must either be null or a function, not " + typeof superClass + ".")); + } + function defaultSuperCall(self, homeObject, args) { + if ($getPrototypeOf(homeObject) !== null) + superCall(self, homeObject, 'constructor', args); + } + $traceurRuntime.createClass = createClass; + $traceurRuntime.defaultSuperCall = defaultSuperCall; + $traceurRuntime.superCall = superCall; + $traceurRuntime.superConstructor = superConstructor; + $traceurRuntime.superGet = superGet; + $traceurRuntime.superSet = superSet; +})(); + +//# +},{}],97:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + TableView: {get: function() { + return TableView; + }}, + __esModule: {value: true} +}); +var $__helpers_47_dom_47_element__, + $__eventManager__, + $__helpers_47_dom_47_event__, + $__3rdparty_47_walkontable_47_src_47_cell_47_coords__, + $__3rdparty_47_walkontable_47_src_47_selection__, + $__3rdparty_47_walkontable_47_src_47_core__; +var $__0 = ($__helpers_47_dom_47_element__ = require("helpers/dom/element"), $__helpers_47_dom_47_element__ && $__helpers_47_dom_47_element__.__esModule && $__helpers_47_dom_47_element__ || {default: $__helpers_47_dom_47_element__}), + addClass = $__0.addClass, + empty = $__0.empty, + fastInnerHTML = $__0.fastInnerHTML, + fastInnerText = $__0.fastInnerText, + getScrollbarWidth = $__0.getScrollbarWidth, + hasClass = $__0.hasClass, + isChildOf = $__0.isChildOf, + isInput = $__0.isInput, + isOutsideInput = $__0.isOutsideInput; +var eventManagerObject = ($__eventManager__ = require("eventManager"), $__eventManager__ && $__eventManager__.__esModule && $__eventManager__ || {default: $__eventManager__}).eventManager; +var $__2 = ($__helpers_47_dom_47_event__ = require("helpers/dom/event"), $__helpers_47_dom_47_event__ && $__helpers_47_dom_47_event__.__esModule && $__helpers_47_dom_47_event__ || {default: $__helpers_47_dom_47_event__}), + stopPropagation = $__2.stopPropagation, + isImmediatePropagationStopped = $__2.isImmediatePropagationStopped; +var WalkontableCellCoords = ($__3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $__3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $__3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $__3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $__3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords; +var WalkontableSelection = ($__3rdparty_47_walkontable_47_src_47_selection__ = require("3rdparty/walkontable/src/selection"), $__3rdparty_47_walkontable_47_src_47_selection__ && $__3rdparty_47_walkontable_47_src_47_selection__.__esModule && $__3rdparty_47_walkontable_47_src_47_selection__ || {default: $__3rdparty_47_walkontable_47_src_47_selection__}).WalkontableSelection; +var Walkontable = ($__3rdparty_47_walkontable_47_src_47_core__ = require("3rdparty/walkontable/src/core"), $__3rdparty_47_walkontable_47_src_47_core__ && $__3rdparty_47_walkontable_47_src_47_core__.__esModule && $__3rdparty_47_walkontable_47_src_47_core__ || {default: $__3rdparty_47_walkontable_47_src_47_core__}).Walkontable; +Handsontable.TableView = TableView; +function TableView(instance) { + var $__6 = this; + var that = this; + this.eventManager = eventManagerObject(instance); + this.instance = instance; + this.settings = instance.getSettings(); + this.selectionMouseDown = false; + var originalStyle = instance.rootElement.getAttribute('style'); + if (originalStyle) { + instance.rootElement.setAttribute('data-originalstyle', originalStyle); + } + addClass(instance.rootElement, 'handsontable'); + var table = document.createElement('TABLE'); + addClass(table, 'htCore'); + if (instance.getSettings().tableClassName) { + addClass(table, instance.getSettings().tableClassName); + } + this.THEAD = document.createElement('THEAD'); + table.appendChild(this.THEAD); + this.TBODY = document.createElement('TBODY'); + table.appendChild(this.TBODY); + instance.table = table; + instance.container.insertBefore(table, instance.container.firstChild); + this.eventManager.addEventListener(instance.rootElement, 'mousedown', function(event) { + this.selectionMouseDown = true; + if (!that.isTextSelectionAllowed(event.target)) { + clearTextSelection(); + event.preventDefault(); + window.focus(); + } + }); + this.eventManager.addEventListener(instance.rootElement, 'mouseup', function(event) { + this.selectionMouseDown = false; + }); + this.eventManager.addEventListener(instance.rootElement, 'mousemove', function(event) { + if (this.selectionMouseDown && !that.isTextSelectionAllowed(event.target)) { + clearTextSelection(); + event.preventDefault(); + } + }); + this.eventManager.addEventListener(document.documentElement, 'keyup', function(event) { + if (instance.selection.isInProgress() && !event.shiftKey) { + instance.selection.finish(); + } + }); + var isMouseDown; + this.isMouseDown = function() { + return isMouseDown; + }; + this.eventManager.addEventListener(document.documentElement, 'mouseup', function(event) { + if (instance.selection.isInProgress() && event.which === 1) { + instance.selection.finish(); + } + isMouseDown = false; + if (isOutsideInput(document.activeElement)) { + instance.unlisten(); + } + }); + this.eventManager.addEventListener(document.documentElement, 'mousedown', function(event) { + var next = event.target; + var eventX = event.x || event.clientX; + var eventY = event.y || event.clientY; + if (isMouseDown || !instance.rootElement) { + return; + } + if (next === instance.view.wt.wtTable.holder) { + var scrollbarWidth = getScrollbarWidth(); + if (document.elementFromPoint(eventX + scrollbarWidth, eventY) !== instance.view.wt.wtTable.holder || document.elementFromPoint(eventX, eventY + scrollbarWidth) !== instance.view.wt.wtTable.holder) { + return; + } + } else { + while (next !== document.documentElement) { + if (next === null) { + if (event.isTargetWebComponent) { + break; + } + return; + } + if (next === instance.rootElement) { + return; + } + next = next.parentNode; + } + } + if (that.settings.outsideClickDeselects) { + instance.deselectCell(); + } else { + instance.destroyEditor(); + } + }); + this.eventManager.addEventListener(table, 'selectstart', function(event) { + if (that.settings.fragmentSelection || isInput(event.target)) { + return; + } + event.preventDefault(); + }); + var clearTextSelection = function() { + if (window.getSelection) { + if (window.getSelection().empty) { + window.getSelection().empty(); + } else if (window.getSelection().removeAllRanges) { + window.getSelection().removeAllRanges(); + } + } else if (document.selection) { + document.selection.empty(); + } + }; + var selections = [new WalkontableSelection({ + className: 'current', + border: { + width: 2, + color: '#5292F7', + cornerVisible: function() { + return that.settings.fillHandle && !that.isCellEdited() && !instance.selection.isMultiple(); + }, + multipleSelectionHandlesVisible: function() { + return !that.isCellEdited() && !instance.selection.isMultiple(); + } + } + }), new WalkontableSelection({ + className: 'area', + border: { + width: 1, + color: '#89AFF9', + cornerVisible: function() { + return that.settings.fillHandle && !that.isCellEdited() && instance.selection.isMultiple(); + }, + multipleSelectionHandlesVisible: function() { + return !that.isCellEdited() && instance.selection.isMultiple(); + } + } + }), new WalkontableSelection({ + className: 'highlight', + highlightRowClassName: that.settings.currentRowClassName, + highlightColumnClassName: that.settings.currentColClassName + }), new WalkontableSelection({ + className: 'fill', + border: { + width: 1, + color: 'red' + } + })]; + selections.current = selections[0]; + selections.area = selections[1]; + selections.highlight = selections[2]; + selections.fill = selections[3]; + var walkontableConfig = { + debug: function() { + return that.settings.debug; + }, + externalRowCalculator: this.instance.getPlugin('autoRowSize') && this.instance.getPlugin('autoRowSize').isEnabled(), + table: table, + preventOverflow: (function() { + return $__6.settings.preventOverflow; + }), + stretchH: this.settings.stretchH, + data: instance.getDataAtCell, + totalRows: (function() { + return instance.countRows(); + }), + totalColumns: (function() { + return instance.countCols(); + }), + fixedColumnsLeft: function() { + return that.settings.fixedColumnsLeft; + }, + fixedRowsTop: function() { + return that.settings.fixedRowsTop; + }, + fixedRowsBottom: function() { + return that.settings.fixedRowsBottom; + }, + minSpareRows: function() { + return that.settings.minSpareRows; + }, + renderAllRows: that.settings.renderAllRows, + rowHeaders: function() { + var headerRenderers = []; + if (instance.hasRowHeaders()) { + headerRenderers.push(function(row, TH) { + that.appendRowHeader(row, TH); + }); + } + Handsontable.hooks.run(instance, 'afterGetRowHeaderRenderers', headerRenderers); + return headerRenderers; + }, + columnHeaders: function() { + var headerRenderers = []; + if (instance.hasColHeaders()) { + headerRenderers.push(function(column, TH) { + that.appendColHeader(column, TH); + }); + } + Handsontable.hooks.run(instance, 'afterGetColumnHeaderRenderers', headerRenderers); + return headerRenderers; + }, + columnWidth: instance.getColWidth, + rowHeight: instance.getRowHeight, + cellRenderer: function(row, col, TD) { + var prop = that.instance.colToProp(col), + cellProperties = that.instance.getCellMeta(row, col), + renderer = that.instance.getCellRenderer(cellProperties); + var value = that.instance.getDataAtRowProp(row, prop); + renderer(that.instance, TD, row, col, prop, value, cellProperties); + Handsontable.hooks.run(that.instance, 'afterRenderer', TD, row, col, prop, value, cellProperties); + }, + selections: selections, + hideBorderOnMouseDownOver: function() { + return that.settings.fragmentSelection; + }, + onCellMouseDown: function(event, coords, TD, wt) { + var colspanOffset; + var TR = TD.parentNode; + var THEAD = TR.parentNode; + var headerLevel; + var headerColspan; + instance.listen(); + that.activeWt = wt; + isMouseDown = true; + Handsontable.hooks.run(instance, 'beforeOnCellMouseDown', event, coords, TD); + instance.selection.setSelectedHeaders(false, false); + if (!isImmediatePropagationStopped(event)) { + if (event.button === 2 && instance.selection.inInSelection(coords)) { + var nothing = 1; + } else if (event.shiftKey) { + if (coords.row >= 0 && coords.col >= 0) { + instance.selection.setRangeEnd(coords); + } + } else { + if ((coords.row < 0 || coords.col < 0) && (coords.row >= 0 || coords.col >= 0)) { + if (coords.row < 0) { + headerLevel = THEAD.childNodes.length - Array.prototype.indexOf.call(THEAD.childNodes, TR) - 1; + headerColspan = instance.getHeaderColspan(coords.col, headerLevel); + instance.selection.setSelectedHeaders(false, true); + instance.selectCell(0, coords.col, instance.countRows() - 1, coords.col + Math.max(0, headerColspan - 1)); + } + if (coords.col < 0) { + instance.selection.setSelectedHeaders(true, false); + instance.selectCell(coords.row, 0, coords.row, instance.countCols() - 1); + } + } else { + coords.row = coords.row < 0 ? 0 : coords.row; + coords.col = coords.col < 0 ? 0 : coords.col; + instance.selection.setRangeStart(coords); + } + } + Handsontable.hooks.run(instance, 'afterOnCellMouseDown', event, coords, TD); + that.activeWt = that.wt; + } + }, + onCellMouseOver: function(event, coords, TD, wt) { + that.activeWt = wt; + if (coords.row >= 0 && coords.col >= 0) { + if (isMouseDown) { + instance.selection.setRangeEnd(coords); + } + } else { + if (isMouseDown) { + if (coords.row < 0) { + if (instance.selection.selectedHeader.cols) { + instance.selection.setRangeEnd(new WalkontableCellCoords(instance.countRows() - 1, coords.col)); + instance.selection.setSelectedHeaders(false, true); + } else { + instance.selection.setRangeEnd(new WalkontableCellCoords(coords.row, coords.col)); + } + } + if (coords.col < 0) { + if (instance.selection.selectedHeader.rows) { + instance.selection.setRangeEnd(new WalkontableCellCoords(coords.row, instance.countCols() - 1)); + instance.selection.setSelectedHeaders(true, false); + } else { + instance.selection.setRangeEnd(new WalkontableCellCoords(coords.row, coords.col)); + } + } + } + } + Handsontable.hooks.run(instance, 'afterOnCellMouseOver', event, coords, TD); + that.activeWt = that.wt; + }, + onCellCornerMouseDown: function(event) { + event.preventDefault(); + Handsontable.hooks.run(instance, 'afterOnCellCornerMouseDown', event); + }, + beforeDraw: function(force) { + that.beforeRender(force); + }, + onDraw: function(force) { + that.onDraw(force); + }, + onScrollVertically: function() { + instance.runHooks('afterScrollVertically'); + }, + onScrollHorizontally: function() { + instance.runHooks('afterScrollHorizontally'); + }, + onBeforeDrawBorders: function(corners, borderClassName) { + instance.runHooks('beforeDrawBorders', corners, borderClassName); + }, + onBeforeTouchScroll: function() { + instance.runHooks('beforeTouchScroll'); + }, + onAfterMomentumScroll: function() { + instance.runHooks('afterMomentumScroll'); + }, + viewportRowCalculatorOverride: function(calc) { + var rows = instance.countRows(); + var viewportOffset = that.settings.viewportRowRenderingOffset; + if (viewportOffset === 'auto' && that.settings.fixedRowsTop) { + viewportOffset = 10; + } + if (typeof viewportOffset === 'number') { + calc.startRow = Math.max(calc.startRow - viewportOffset, 0); + calc.endRow = Math.min(calc.endRow + viewportOffset, rows - 1); + } + if (viewportOffset === 'auto') { + var center = calc.startRow + calc.endRow - calc.startRow; + var offset = Math.ceil(center / rows * 12); + calc.startRow = Math.max(calc.startRow - offset, 0); + calc.endRow = Math.min(calc.endRow + offset, rows - 1); + } + instance.runHooks('afterViewportRowCalculatorOverride', calc); + }, + viewportColumnCalculatorOverride: function(calc) { + var cols = instance.countCols(); + var viewportOffset = that.settings.viewportColumnRenderingOffset; + if (viewportOffset === 'auto' && that.settings.fixedColumnsLeft) { + viewportOffset = 10; + } + if (typeof viewportOffset === 'number') { + calc.startColumn = Math.max(calc.startColumn - viewportOffset, 0); + calc.endColumn = Math.min(calc.endColumn + viewportOffset, cols - 1); + } + if (viewportOffset === 'auto') { + var center = calc.startColumn + calc.endColumn - calc.startColumn; + var offset = Math.ceil(center / cols * 12); + calc.startRow = Math.max(calc.startColumn - offset, 0); + calc.endColumn = Math.min(calc.endColumn + offset, cols - 1); + } + instance.runHooks('afterViewportColumnCalculatorOverride', calc); + } + }; + Handsontable.hooks.run(instance, 'beforeInitWalkontable', walkontableConfig); + this.wt = new Walkontable(walkontableConfig); + this.activeWt = this.wt; + this.eventManager.addEventListener(that.wt.wtTable.spreader, 'mousedown', function(event) { + if (event.target === that.wt.wtTable.spreader && event.which === 3) { + stopPropagation(event); + } + }); + this.eventManager.addEventListener(that.wt.wtTable.spreader, 'contextmenu', function(event) { + if (event.target === that.wt.wtTable.spreader && event.which === 3) { + stopPropagation(event); + } + }); + this.eventManager.addEventListener(document.documentElement, 'click', function() { + if (that.settings.observeDOMVisibility) { + if (that.wt.drawInterrupted) { + that.instance.forceFullRender = true; + that.render(); + } + } + }); +} +TableView.prototype.isTextSelectionAllowed = function(el) { + if (isInput(el)) { + return true; + } + var isChildOfTableBody = isChildOf(el, this.instance.view.wt.wtTable.spreader); + if (this.settings.fragmentSelection === true && isChildOfTableBody) { + return true; + } + if (this.settings.fragmentSelection === 'cell' && this.isSelectedOnlyCell() && isChildOfTableBody) { + return true; + } + return false; +}; +TableView.prototype.isSelectedOnlyCell = function() { + var $__7 = this.instance.getSelected() || [], + row = $__7[0], + col = $__7[1], + rowEnd = $__7[2], + colEnd = $__7[3]; + return row !== void 0 && row === rowEnd && col === colEnd; +}; +TableView.prototype.isCellEdited = function() { + var activeEditor = this.instance.getActiveEditor(); + return activeEditor && activeEditor.isOpened(); +}; +TableView.prototype.beforeRender = function(force) { + if (force) { + Handsontable.hooks.run(this.instance, 'beforeRender', this.instance.forceFullRender); + } +}; +TableView.prototype.onDraw = function(force) { + if (force) { + Handsontable.hooks.run(this.instance, 'afterRender', this.instance.forceFullRender); + } +}; +TableView.prototype.render = function() { + this.wt.draw(!this.instance.forceFullRender); + this.instance.forceFullRender = false; + this.instance.renderCall = false; +}; +TableView.prototype.getCellAtCoords = function(coords, topmost) { + var td = this.wt.getCell(coords, topmost); + if (td < 0) { + return null; + } else { + return td; + } +}; +TableView.prototype.scrollViewport = function(coords) { + this.wt.scrollViewport(coords); +}; +TableView.prototype.appendRowHeader = function(row, TH) { + if (TH.firstChild) { + var container = TH.firstChild; + if (!hasClass(container, 'relative')) { + empty(TH); + this.appendRowHeader(row, TH); + return; + } + this.updateCellHeader(container.querySelector('.rowHeader'), row, this.instance.getRowHeader); + } else { + var div = document.createElement('div'); + var span = document.createElement('span'); + div.className = 'relative'; + span.className = 'rowHeader'; + this.updateCellHeader(span, row, this.instance.getRowHeader); + div.appendChild(span); + TH.appendChild(div); + } + Handsontable.hooks.run(this.instance, 'afterGetRowHeader', row, TH); +}; +TableView.prototype.appendColHeader = function(col, TH) { + if (TH.firstChild) { + var container = TH.firstChild; + if (hasClass(container, 'relative')) { + this.updateCellHeader(container.querySelector('.colHeader'), col, this.instance.getColHeader); + } else { + empty(TH); + this.appendColHeader(col, TH); + } + } else { + var div = document.createElement('div'); + var span = document.createElement('span'); + div.className = 'relative'; + span.className = 'colHeader'; + this.updateCellHeader(span, col, this.instance.getColHeader); + div.appendChild(span); + TH.appendChild(div); + } + Handsontable.hooks.run(this.instance, 'afterGetColHeader', col, TH); +}; +TableView.prototype.updateCellHeader = function(element, index, content) { + if (index > -1) { + fastInnerHTML(element, content(index)); + } else { + fastInnerText(element, String.fromCharCode(160)); + addClass(element, 'cornerHeader'); + } +}; +TableView.prototype.maximumVisibleElementWidth = function(leftOffset) { + var workspaceWidth = this.wt.wtViewport.getWorkspaceWidth(); + var maxWidth = workspaceWidth - leftOffset; + return maxWidth > 0 ? maxWidth : 0; +}; +TableView.prototype.maximumVisibleElementHeight = function(topOffset) { + var workspaceHeight = this.wt.wtViewport.getWorkspaceHeight(); + var maxHeight = workspaceHeight - topOffset; + return maxHeight > 0 ? maxHeight : 0; +}; +TableView.prototype.mainViewIsActive = function() { + return this.wt === this.activeWt; +}; +TableView.prototype.destroy = function() { + this.wt.destroy(); + this.eventManager.destroy(); +}; +; + +//# +},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/core":7,"3rdparty/walkontable/src/selection":18,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46}],98:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + GhostTable: {get: function() { + return GhostTable; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_helpers_47_array__, + $___46__46__47_helpers_47_object__, + $___46__46__47_helpers_47_number__, + $___46__46__47_helpers_47_mixed__; +var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + outerHeight = $__0.outerHeight, + outerWidth = $__0.outerWidth; +var arrayEach = ($___46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47_helpers_47_array__ && $___46__46__47_helpers_47_array__.__esModule && $___46__46__47_helpers_47_array__ || {default: $___46__46__47_helpers_47_array__}).arrayEach; +var objectEach = ($___46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47_helpers_47_object__ && $___46__46__47_helpers_47_object__.__esModule && $___46__46__47_helpers_47_object__ || {default: $___46__46__47_helpers_47_object__}).objectEach; +var rangeEach = ($___46__46__47_helpers_47_number__ = require("helpers/number"), $___46__46__47_helpers_47_number__ && $___46__46__47_helpers_47_number__.__esModule && $___46__46__47_helpers_47_number__ || {default: $___46__46__47_helpers_47_number__}).rangeEach; +var stringify = ($___46__46__47_helpers_47_mixed__ = require("helpers/mixed"), $___46__46__47_helpers_47_mixed__ && $___46__46__47_helpers_47_mixed__.__esModule && $___46__46__47_helpers_47_mixed__ || {default: $___46__46__47_helpers_47_mixed__}).stringify; +var GhostTable = function GhostTable(hotInstance) { + this.hot = hotInstance; + this.container = null; + this.injected = false; + this.rows = []; + this.columns = []; + this.samples = null; +}; +($traceurRuntime.createClass)(GhostTable, { + addRow: function(row, samples) { + if (this.columns.length) { + throw new Error('Doesn\'t support multi-dimensional table'); + } + if (!this.rows.length) { + this.container = this.createContainer(this.hot.rootElement.className); + } + var rowObject = {row: row}; + this.rows.push(rowObject); + this.samples = samples; + this.table = this.createTable(this.hot.table.className); + this.table.colGroup.appendChild(this.createColGroupsCol()); + this.table.tr.appendChild(this.createRow(row)); + this.container.container.appendChild(this.table.fragment); + rowObject.table = this.table.table; + }, + addColumn: function(column, samples) { + if (this.rows.length) { + throw new Error('Doesn\'t support multi-dimensional table'); + } + if (!this.columns.length) { + this.container = this.createContainer(this.hot.rootElement.className); + } + var columnObject = {col: column}; + this.columns.push(columnObject); + this.samples = samples; + this.table = this.createTable(this.hot.table.className); + if (this.hot.getColHeader(column) !== null) { + this.hot.view.appendColHeader(column, this.table.th); + } + this.table.tBody.appendChild(this.createCol(column)); + this.container.container.appendChild(this.table.fragment); + columnObject.table = this.table.table; + }, + getHeights: function(callback) { + if (!this.injected) { + this.injectTable(); + } + arrayEach(this.rows, (function(row) { + callback(row.row, outerHeight(row.table) - 1); + })); + }, + getWidths: function(callback) { + if (!this.injected) { + this.injectTable(); + } + arrayEach(this.columns, (function(column) { + callback(column.col, outerWidth(column.table)); + })); + }, + createColGroupsCol: function() { + var $__5 = this; + var d = document; + var fragment = d.createDocumentFragment(); + fragment.appendChild(this.createColElement(-1)); + this.samples.forEach((function(sample) { + arrayEach(sample.strings, (function(string) { + fragment.appendChild($__5.createColElement(string.col)); + })); + })); + return fragment; + }, + createRow: function(row) { + var $__5 = this; + var d = document; + var fragment = d.createDocumentFragment(); + var th = d.createElement('th'); + if (this.hot.getRowHeader(row) !== null) { + this.hot.view.appendRowHeader(row, th); + } + fragment.appendChild(th); + this.samples.forEach((function(sample) { + arrayEach(sample.strings, (function(string) { + var column = string.col; + var cellProperties = $__5.hot.getCellMeta(row, column); + cellProperties.col = column; + cellProperties.row = row; + var renderer = $__5.hot.getCellRenderer(cellProperties); + var td = d.createElement('td'); + renderer($__5.hot, td, row, column, $__5.hot.colToProp(column), string.value, cellProperties); + fragment.appendChild(td); + })); + })); + return fragment; + }, + createCol: function(column) { + var $__5 = this; + var d = document; + var fragment = d.createDocumentFragment(); + this.samples.forEach((function(sample) { + arrayEach(sample.strings, (function(string) { + var row = string.row; + var cellProperties = $__5.hot.getCellMeta(row, column); + cellProperties.col = column; + cellProperties.row = row; + var renderer = $__5.hot.getCellRenderer(cellProperties); + var td = d.createElement('td'); + var tr = d.createElement('tr'); + renderer($__5.hot, td, row, column, $__5.hot.colToProp(row), string.value, cellProperties); + tr.appendChild(td); + fragment.appendChild(tr); + })); + })); + return fragment; + }, + clean: function() { + this.rows.length = 0; + this.columns.length = 0; + if (this.samples) { + this.samples.clear(); + } + this.samples = null; + this.removeTable(); + }, + injectTable: function() { + var parent = arguments[0] !== (void 0) ? arguments[0] : null; + if (!this.injected) { + (parent || this.hot.rootElement).appendChild(this.container.fragment); + this.injected = true; + } + }, + removeTable: function() { + if (this.injected && this.container.container.parentNode) { + this.container.container.parentNode.removeChild(this.container.container); + this.container = null; + this.injected = false; + } + }, + createColElement: function(column) { + var d = document; + var col = d.createElement('col'); + col.style.width = this.hot.view.wt.wtTable.getStretchedColumnWidth(column) + 'px'; + return col; + }, + createTable: function() { + var className = arguments[0] !== (void 0) ? arguments[0] : ''; + var d = document; + var fragment = d.createDocumentFragment(); + var table = d.createElement('table'); + var tHead = d.createElement('thead'); + var tBody = d.createElement('tbody'); + var colGroup = d.createElement('colgroup'); + var tr = d.createElement('tr'); + var th = d.createElement('th'); + if (this.isVertical()) { + table.appendChild(colGroup); + } + if (this.isHorizontal()) { + tr.appendChild(th); + tHead.appendChild(tr); + table.style.tableLayout = 'auto'; + table.style.width = 'auto'; + } + table.appendChild(tHead); + if (this.isVertical()) { + tBody.appendChild(tr); + } + table.appendChild(tBody); + addClass(table, className); + fragment.appendChild(table); + return { + fragment: fragment, + table: table, + tHead: tHead, + tBody: tBody, + colGroup: colGroup, + tr: tr, + th: th + }; + }, + createContainer: function() { + var className = arguments[0] !== (void 0) ? arguments[0] : ''; + var d = document; + var fragment = d.createDocumentFragment(); + var container = d.createElement('div'); + className = 'htGhostTable htAutoSize ' + className.trim(); + addClass(container, className); + fragment.appendChild(container); + return { + fragment: fragment, + container: container + }; + }, + isVertical: function() { + return this.rows.length && !this.columns.length ? true : false; + }, + isHorizontal: function() { + return this.columns.length && !this.rows.length ? true : false; + } +}, {}); +; +Handsontable.utils = Handsontable.utils || {}; +Handsontable.utils.GhostTable = GhostTable; + +//# +},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],99:[function(require,module,exports){ +"use strict"; +var $__7; +Object.defineProperties(exports, { + SamplesGenerator: {get: function() { + return SamplesGenerator; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_helpers_47_array__, + $___46__46__47_helpers_47_object__, + $___46__46__47_helpers_47_number__, + $___46__46__47_helpers_47_mixed__; +var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + outerHeight = $__0.outerHeight, + outerWidth = $__0.outerWidth; +var arrayEach = ($___46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47_helpers_47_array__ && $___46__46__47_helpers_47_array__.__esModule && $___46__46__47_helpers_47_array__ || {default: $___46__46__47_helpers_47_array__}).arrayEach; +var objectEach = ($___46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47_helpers_47_object__ && $___46__46__47_helpers_47_object__.__esModule && $___46__46__47_helpers_47_object__ || {default: $___46__46__47_helpers_47_object__}).objectEach; +var rangeEach = ($___46__46__47_helpers_47_number__ = require("helpers/number"), $___46__46__47_helpers_47_number__ && $___46__46__47_helpers_47_number__.__esModule && $___46__46__47_helpers_47_number__ || {default: $___46__46__47_helpers_47_number__}).rangeEach; +var stringify = ($___46__46__47_helpers_47_mixed__ = require("helpers/mixed"), $___46__46__47_helpers_47_mixed__ && $___46__46__47_helpers_47_mixed__.__esModule && $___46__46__47_helpers_47_mixed__ || {default: $___46__46__47_helpers_47_mixed__}).stringify; +var SamplesGenerator = function SamplesGenerator(dataFactory) { + this.samples = null; + this.dataFactory = dataFactory; + this.customSampleCount = null; +}; +var $SamplesGenerator = SamplesGenerator; +($traceurRuntime.createClass)(SamplesGenerator, ($__7 = {}, Object.defineProperty($__7, "getSampleCount", { + value: function() { + if (this.customSampleCount) { + return this.customSampleCount; + } + return $SamplesGenerator.SAMPLE_COUNT; + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__7, "generateRowSamples", { + value: function(rowRange, colRange) { + return this.generateSamples('row', colRange, rowRange); + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__7, "generateColumnSamples", { + value: function(colRange, rowRange) { + return this.generateSamples('col', rowRange, colRange); + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__7, "generateSamples", { + value: function(type, range, specifierRange) { + var $__5 = this; + var samples = new Map(); + if (typeof specifierRange === 'number') { + specifierRange = { + from: specifierRange, + to: specifierRange + }; + } + rangeEach(specifierRange.from, specifierRange.to, (function(index) { + var sample = $__5.generateSample(type, range, index); + samples.set(index, sample); + })); + return samples; + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__7, "generateSample", { + value: function(type, range, specifierValue) { + var $__5 = this; + var samples = new Map(); + var sampledValues = []; + rangeEach(range.from, range.to, (function(index) { + var $__7; + var value; + if (type === 'row') { + value = $__5.dataFactory(specifierValue, index); + } else if (type === 'col') { + value = $__5.dataFactory(index, specifierValue); + } else { + throw new Error('Unsupported sample type'); + } + if (!Array.isArray(value)) { + value = stringify(value); + } + var len = value.length; + if (!samples.has(len)) { + samples.set(len, { + needed: $__5.getSampleCount(), + strings: [] + }); + } + var sample = samples.get(len); + if (sample.needed) { + var duplicate = sampledValues.indexOf(value) > -1; + if (!duplicate) { + var computedKey = type === 'row' ? 'col' : 'row'; + sample.strings.push(($__7 = {}, Object.defineProperty($__7, "value", { + value: value, + configurable: true, + enumerable: true, + writable: true + }), Object.defineProperty($__7, computedKey, { + value: index, + configurable: true, + enumerable: true, + writable: true + }), $__7)); + sampledValues.push(value); + sample.needed--; + } + } + })); + return samples; + }, + configurable: true, + enumerable: true, + writable: true +}), $__7), {get SAMPLE_COUNT() { + return 3; + }}); +; +Handsontable.utils = Handsontable.utils || {}; +Handsontable.utils.SamplesGenerator = SamplesGenerator; + +//# +},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],100:[function(require,module,exports){ +"use strict"; +var $___46__46__47_helpers_47_mixed__; +var stringify = ($___46__46__47_helpers_47_mixed__ = require("helpers/mixed"), $___46__46__47_helpers_47_mixed__ && $___46__46__47_helpers_47_mixed__.__esModule && $___46__46__47_helpers_47_mixed__ || {default: $___46__46__47_helpers_47_mixed__}).stringify; +Handsontable.AutocompleteValidator = function(value, callback) { + if (this.strict && this.source) { + if (typeof this.source === 'function') { + this.source(value, process(value, callback)); + } else { + process(value, callback)(this.source); + } + } else { + callback(true); + } +}; +function process(value, callback) { + var originalVal = value; + var lowercaseVal = typeof originalVal === 'string' ? originalVal.toLowerCase() : null; + return function(source) { + var found = false; + for (var s = 0, + slen = source.length; s < slen; s++) { + if (originalVal === source[s]) { + found = true; + break; + } else if (lowercaseVal === stringify(source[s]).toLowerCase()) { + found = true; + break; + } + } + callback(found); + }; +} + +//# +},{"helpers/mixed":48}],101:[function(require,module,exports){ +"use strict"; +var $__moment__, + $___46__46__47_editors__; +var moment = ($__moment__ = require("moment"), $__moment__ && $__moment__.__esModule && $__moment__ || {default: $__moment__}).default; +var getEditor = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}).getEditor; +Handsontable.DateValidator = function(value, callback) { + var valid = true; + var dateEditor = getEditor('date', this.instance); + if (value === null) { + value = ''; + } + var isValidDate = moment(new Date(value)).isValid(); + var isValidFormat = moment(value, this.dateFormat || dateEditor.defaultDateFormat, true).isValid(); + if (!isValidDate) { + valid = false; + } + if (!isValidDate && isValidFormat) { + valid = true; + } + if (isValidDate && !isValidFormat) { + if (this.correctFormat === true) { + var correctedValue = correctFormat(value, this.dateFormat); + this.instance.setDataAtCell(this.row, this.col, correctedValue, 'dateValidator'); + valid = true; + } else { + valid = false; + } + } + callback(valid); +}; +var correctFormat = function correctFormat(value, dateFormat) { + var date = moment(new Date(value)); + var year = date.format('YYYY'); + var yearNow = moment().format('YYYY'); + if (year.substr(0, 2) !== yearNow.substr(0, 2)) { + if (!value.match(new RegExp(year))) { + date.year(year.replace(year.substr(0, 2), yearNow.substr(0, 2))); + } + } else if (year.length > 4) { + date.year((date.year() + '').substr(0, 4)); + } + return date.format(dateFormat); +}; + +//# +},{"editors":29,"moment":"moment"}],102:[function(require,module,exports){ +"use strict"; +Handsontable.NumericValidator = function(value, callback) { + if (value === null) { + value = ''; + } + callback(/^-?\d*(\.|\,)?\d*$/.test(value)); +}; + +//# +},{}],"SheetClip":[function(require,module,exports){ +"use strict"; +(function(global) { + "use strict"; + function countQuotes(str) { + return str.split('"').length - 1; + } + var SheetClip = { + parse: function(str) { + var r, + rLen, + rows, + arr = [], + a = 0, + c, + cLen, + multiline, + last; + rows = str.split('\n'); + if (rows.length > 1 && rows[rows.length - 1] === '') { + rows.pop(); + } + for (r = 0, rLen = rows.length; r < rLen; r += 1) { + rows[r] = rows[r].split('\t'); + for (c = 0, cLen = rows[r].length; c < cLen; c += 1) { + if (!arr[a]) { + arr[a] = []; + } + if (multiline && c === 0) { + last = arr[a].length - 1; + arr[a][last] = arr[a][last] + '\n' + rows[r][0]; + if (multiline && (countQuotes(rows[r][0]) & 1)) { + multiline = false; + arr[a][last] = arr[a][last].substring(0, arr[a][last].length - 1).replace(/""/g, '"'); + } + } else { + if (c === cLen - 1 && rows[r][c].indexOf('"') === 0 && (countQuotes(rows[r][c]) & 1)) { + arr[a].push(rows[r][c].substring(1).replace(/""/g, '"')); + multiline = true; + } else { + arr[a].push(rows[r][c].replace(/""/g, '"')); + multiline = false; + } + } + } + if (!multiline) { + a += 1; + } + } + return arr; + }, + stringify: function(arr) { + var r, + rLen, + c, + cLen, + str = '', + val; + for (r = 0, rLen = arr.length; r < rLen; r += 1) { + cLen = arr[r].length; + for (c = 0; c < cLen; c += 1) { + if (c > 0) { + str += '\t'; + } + val = arr[r][c]; + if (typeof val === 'string') { + if (val.indexOf('\n') > -1) { + str += '"' + val.replace(/"/g, '""') + '"'; + } else { + str += val; + } + } else if (val === null || val === void 0) { + str += ''; + } else { + str += val; + } + } + str += '\n'; + } + return str; + } + }; + if (typeof exports !== 'undefined') { + exports.parse = SheetClip.parse; + exports.stringify = SheetClip.stringify; + } else { + global.SheetClip = SheetClip; + } +}(window)); + +//# +},{}],"autoResize":[function(require,module,exports){ +"use strict"; +function autoResize() { + var defaults = { + minHeight: 200, + maxHeight: 300, + minWidth: 100, + maxWidth: 300 + }, + el, + body = document.body, + text = document.createTextNode(''), + span = document.createElement('SPAN'), + observe = function(element, event, handler) { + if (window.attachEvent) { + element.attachEvent('on' + event, handler); + } else { + element.addEventListener(event, handler, false); + } + }, + unObserve = function(element, event, handler) { + if (window.removeEventListener) { + element.removeEventListener(event, handler, false); + } else { + element.detachEvent('on' + event, handler); + } + }, + resize = function(newChar) { + var width, + scrollHeight; + if (!newChar) { + newChar = ""; + } else if (!/^[a-zA-Z \.,\\\/\|0-9]$/.test(newChar)) { + newChar = "."; + } + if (text.textContent !== void 0) { + text.textContent = el.value + newChar; + } else { + text.data = el.value + newChar; + } + span.style.fontSize = Handsontable.Dom.getComputedStyle(el).fontSize; + span.style.fontFamily = Handsontable.Dom.getComputedStyle(el).fontFamily; + span.style.whiteSpace = "pre"; + body.appendChild(span); + width = span.clientWidth + 2; + body.removeChild(span); + el.style.height = defaults.minHeight + 'px'; + if (defaults.minWidth > width) { + el.style.width = defaults.minWidth + 'px'; + } else if (width > defaults.maxWidth) { + el.style.width = defaults.maxWidth + 'px'; + } else { + el.style.width = width + 'px'; + } + scrollHeight = el.scrollHeight ? el.scrollHeight - 1 : 0; + if (defaults.minHeight > scrollHeight) { + el.style.height = defaults.minHeight + 'px'; + } else if (defaults.maxHeight < scrollHeight) { + el.style.height = defaults.maxHeight + 'px'; + el.style.overflowY = 'visible'; + } else { + el.style.height = scrollHeight + 'px'; + } + }, + delayedResize = function() { + window.setTimeout(resize, 0); + }, + extendDefaults = function(config) { + if (config && config.minHeight) { + if (config.minHeight == 'inherit') { + defaults.minHeight = el.clientHeight; + } else { + var minHeight = parseInt(config.minHeight); + if (!isNaN(minHeight)) { + defaults.minHeight = minHeight; + } + } + } + if (config && config.maxHeight) { + if (config.maxHeight == 'inherit') { + defaults.maxHeight = el.clientHeight; + } else { + var maxHeight = parseInt(config.maxHeight); + if (!isNaN(maxHeight)) { + defaults.maxHeight = maxHeight; + } + } + } + if (config && config.minWidth) { + if (config.minWidth == 'inherit') { + defaults.minWidth = el.clientWidth; + } else { + var minWidth = parseInt(config.minWidth); + if (!isNaN(minWidth)) { + defaults.minWidth = minWidth; + } + } + } + if (config && config.maxWidth) { + if (config.maxWidth == 'inherit') { + defaults.maxWidth = el.clientWidth; + } else { + var maxWidth = parseInt(config.maxWidth); + if (!isNaN(maxWidth)) { + defaults.maxWidth = maxWidth; + } + } + } + if (!span.firstChild) { + span.className = "autoResize"; + span.style.display = 'inline-block'; + span.appendChild(text); + } + }, + init = function(el_, config, doObserve) { + el = el_; + extendDefaults(config); + if (el.nodeName == 'TEXTAREA') { + el.style.resize = 'none'; + el.style.overflowY = ''; + el.style.height = defaults.minHeight + 'px'; + el.style.minWidth = defaults.minWidth + 'px'; + el.style.maxWidth = defaults.maxWidth + 'px'; + el.style.overflowY = 'hidden'; + } + if (doObserve) { + observe(el, 'change', resize); + observe(el, 'cut', delayedResize); + observe(el, 'paste', delayedResize); + observe(el, 'drop', delayedResize); + observe(el, 'keydown', delayedResize); + } + resize(); + }; + return { + init: function(el_, config, doObserve) { + init(el_, config, doObserve); + }, + unObserve: function() { + unObserve(el, 'change', resize); + unObserve(el, 'cut', delayedResize); + unObserve(el, 'paste', delayedResize); + unObserve(el, 'drop', delayedResize); + unObserve(el, 'keydown', delayedResize); + }, + resize: resize + }; +} +if (typeof exports !== 'undefined') { + module.exports = autoResize; +} + +//# +},{}],"copyPaste":[function(require,module,exports){ +"use strict"; +var instance; +function copyPaste() { + if (!instance) { + instance = new CopyPasteClass(); + } else if (instance.hasBeenDestroyed()) { + instance.init(); + } + instance.refCounter++; + return instance; +} +if (typeof exports !== 'undefined') { + module.exports = copyPaste; +} +function CopyPasteClass() { + this.refCounter = 0; + this.init(); +} +CopyPasteClass.prototype.init = function() { + var style, + parent; + this.copyCallbacks = []; + this.cutCallbacks = []; + this.pasteCallbacks = []; + parent = document.body; + if (document.getElementById('CopyPasteDiv')) { + this.elDiv = document.getElementById('CopyPasteDiv'); + this.elTextarea = this.elDiv.firstChild; + } else { + this.elDiv = document.createElement('div'); + this.elDiv.id = 'CopyPasteDiv'; + style = this.elDiv.style; + style.position = 'fixed'; + style.top = '-10000px'; + style.left = '-10000px'; + parent.appendChild(this.elDiv); + this.elTextarea = document.createElement('textarea'); + this.elTextarea.className = 'copyPaste'; + this.elTextarea.onpaste = function(event) { + var clipboardContents, + temp; + if ('WebkitAppearance' in document.documentElement.style) { + clipboardContents = event.clipboardData.getData("Text"); + if (navigator.userAgent.indexOf('Safari') !== -1 && navigator.userAgent.indexOf('Chrome') === -1) { + temp = clipboardContents.split('\n'); + if (temp[temp.length - 1] === '') { + temp.pop(); + } + clipboardContents = temp.join('\n'); + } + this.value = clipboardContents; + return false; + } + }; + style = this.elTextarea.style; + style.width = '10000px'; + style.height = '10000px'; + style.overflow = 'hidden'; + this.elDiv.appendChild(this.elTextarea); + if (typeof style.opacity !== 'undefined') { + style.opacity = 0; + } + } + this.onKeyDownRef = this.onKeyDown.bind(this); + document.documentElement.addEventListener('keydown', this.onKeyDownRef, false); +}; +CopyPasteClass.prototype.onKeyDown = function(event) { + var _this = this, + isCtrlDown = false; + function isActiveElementEditable() { + var element = document.activeElement; + if (element.shadowRoot && element.shadowRoot.activeElement) { + element = element.shadowRoot.activeElement; + } + return ['INPUT', 'SELECT', 'TEXTAREA'].indexOf(element.nodeName) > -1 || element.contentEditable === 'true'; + } + if (event.metaKey) { + isCtrlDown = true; + } else if (event.ctrlKey && navigator.userAgent.indexOf('Mac') === -1) { + isCtrlDown = true; + } + if (isCtrlDown) { + if (document.activeElement !== this.elTextarea && (this.getSelectionText() !== '' || isActiveElementEditable())) { + return; + } + this.selectNodeText(this.elTextarea); + setTimeout(function() { + if (document.activeElement !== _this.elTextarea) { + _this.selectNodeText(_this.elTextarea); + } + }, 0); + } + if (isCtrlDown && (event.keyCode === 67 || event.keyCode === 86 || event.keyCode === 88)) { + if (event.keyCode === 88) { + setTimeout(function() { + _this.triggerCut(event); + }, 0); + } else if (event.keyCode === 86) { + setTimeout(function() { + _this.triggerPaste(event); + }, 0); + } + } +}; +CopyPasteClass.prototype.selectNodeText = function(element) { + if (element) { + element.select(); + } +}; +CopyPasteClass.prototype.getSelectionText = function() { + var text = ''; + if (window.getSelection) { + text = window.getSelection().toString(); + } else if (document.selection && document.selection.type !== 'Control') { + text = document.selection.createRange().text; + } + return text; +}; +CopyPasteClass.prototype.copyable = function(string) { + if (typeof string !== 'string' && string.toString === void 0) { + throw new Error('copyable requires string parameter'); + } + this.elTextarea.value = string; + this.selectNodeText(this.elTextarea); +}; +CopyPasteClass.prototype.onCut = function(callback) { + this.cutCallbacks.push(callback); +}; +CopyPasteClass.prototype.onPaste = function(callback) { + this.pasteCallbacks.push(callback); +}; +CopyPasteClass.prototype.removeCallback = function(callback) { + var i, + len; + for (i = 0, len = this.copyCallbacks.length; i < len; i++) { + if (this.copyCallbacks[i] === callback) { + this.copyCallbacks.splice(i, 1); + return true; + } + } + for (i = 0, len = this.cutCallbacks.length; i < len; i++) { + if (this.cutCallbacks[i] === callback) { + this.cutCallbacks.splice(i, 1); + return true; + } + } + for (i = 0, len = this.pasteCallbacks.length; i < len; i++) { + if (this.pasteCallbacks[i] === callback) { + this.pasteCallbacks.splice(i, 1); + return true; + } + } + return false; +}; +CopyPasteClass.prototype.triggerCut = function(event) { + var _this = this; + if (_this.cutCallbacks) { + setTimeout(function() { + for (var i = 0, + len = _this.cutCallbacks.length; i < len; i++) { + _this.cutCallbacks[i](event); + } + }, 50); + } +}; +CopyPasteClass.prototype.triggerPaste = function(event, string) { + var _this = this; + if (_this.pasteCallbacks) { + setTimeout(function() { + var val = string || _this.elTextarea.value; + for (var i = 0, + len = _this.pasteCallbacks.length; i < len; i++) { + _this.pasteCallbacks[i](val, event); + } + }, 50); + } +}; +CopyPasteClass.prototype.destroy = function() { + if (!this.hasBeenDestroyed() && --this.refCounter === 0) { + if (this.elDiv && this.elDiv.parentNode) { + this.elDiv.parentNode.removeChild(this.elDiv); + this.elDiv = null; + this.elTextarea = null; + } + document.documentElement.removeEventListener('keydown', this.onKeyDownRef); + this.onKeyDownRef = null; + } +}; +CopyPasteClass.prototype.hasBeenDestroyed = function() { + return !this.refCounter; +}; + +//# +},{}],"es6collections":[function(require,module,exports){ +"use strict"; +(function(exports) { + 'use strict'; + var i; + var defineProperty = Object.defineProperty, + is = function(a, b) { + return isNaN(a) ? isNaN(b) : a === b; + }; + if (typeof WeakMap == 'undefined') { + exports.WeakMap = createCollection({ + 'delete': sharedDelete, + clear: sharedClear, + get: sharedGet, + has: mapHas, + set: sharedSet + }, true); + } + if (typeof Map == 'undefined') { + exports.Map = createCollection({ + 'delete': sharedDelete, + has: mapHas, + get: sharedGet, + set: sharedSet, + keys: sharedKeys, + values: sharedValues, + entries: mapEntries, + forEach: sharedForEach, + clear: sharedClear + }); + } + if (typeof Set == 'undefined') { + exports.Set = createCollection({ + has: setHas, + add: sharedAdd, + 'delete': sharedDelete, + clear: sharedClear, + keys: sharedValues, + values: sharedValues, + entries: setEntries, + forEach: sharedForEach + }); + } + if (typeof WeakSet == 'undefined') { + exports.WeakSet = createCollection({ + 'delete': sharedDelete, + add: sharedAdd, + clear: sharedClear, + has: setHas + }, true); + } + function createCollection(proto, objectOnly) { + function Collection(a) { + if (!this || this.constructor !== Collection) + return new Collection(a); + this._keys = []; + this._values = []; + this._itp = []; + this.objectOnly = objectOnly; + if (a) + init.call(this, a); + } + if (!objectOnly) { + defineProperty(proto, 'size', {get: sharedSize}); + } + proto.constructor = Collection; + Collection.prototype = proto; + return Collection; + } + function init(a) { + var i; + if (this.add) + a.forEach(this.add, this); + else + a.forEach(function(a) { + this.set(a[0], a[1]); + }, this); + } + function sharedDelete(key) { + if (this.has(key)) { + this._keys.splice(i, 1); + this._values.splice(i, 1); + this._itp.forEach(function(p) { + if (i < p[0]) + p[0]--; + }); + } + return -1 < i; + } + ; + function sharedGet(key) { + return this.has(key) ? this._values[i] : undefined; + } + function has(list, key) { + if (this.objectOnly && key !== Object(key)) + throw new TypeError("Invalid value used as weak collection key"); + if (key != key || key === 0) + for (i = list.length; i-- && !is(list[i], key); ) {} + else + i = list.indexOf(key); + return -1 < i; + } + function setHas(value) { + return has.call(this, this._values, value); + } + function mapHas(value) { + return has.call(this, this._keys, value); + } + function sharedSet(key, value) { + this.has(key) ? this._values[i] = value : this._values[this._keys.push(key) - 1] = value; + return this; + } + function sharedAdd(value) { + if (!this.has(value)) + this._values.push(value); + return this; + } + function sharedClear() { + this._values.length = 0; + } + function sharedKeys() { + return sharedIterator(this._itp, this._keys); + } + function sharedValues() { + return sharedIterator(this._itp, this._values); + } + function mapEntries() { + return sharedIterator(this._itp, this._keys, this._values); + } + function setEntries() { + return sharedIterator(this._itp, this._values, this._values); + } + function sharedIterator(itp, array, array2) { + var p = [0], + done = false; + itp.push(p); + return {next: function() { + var v, + k = p[0]; + if (!done && k < array.length) { + v = array2 ? [array[k], array2[k]] : array[k]; + p[0]++; + } else { + done = true; + itp.splice(itp.indexOf(p), 1); + } + return { + done: done, + value: v + }; + }}; + } + function sharedSize() { + return this._values.length; + } + function sharedForEach(callback, context) { + var it = this.entries(); + for (; ; ) { + var r = it.next(); + if (r.done) + break; + callback.call(context, r.value[1], r.value[0], this); + } + } +})(typeof exports != 'undefined' && typeof global != 'undefined' ? global : window); + +//# +},{}],"jsonpatch":[function(require,module,exports){ +"use strict"; +var jsonpatch; +(function(jsonpatch) { + var objOps = { + add: function(obj, key) { + obj[key] = this.value; + return true; + }, + remove: function(obj, key) { + delete obj[key]; + return true; + }, + replace: function(obj, key) { + obj[key] = this.value; + return true; + }, + move: function(obj, key, tree) { + var temp = { + op: "_get", + path: this.from + }; + apply(tree, [temp]); + apply(tree, [{ + op: "remove", + path: this.from + }]); + apply(tree, [{ + op: "add", + path: this.path, + value: temp.value + }]); + return true; + }, + copy: function(obj, key, tree) { + var temp = { + op: "_get", + path: this.from + }; + apply(tree, [temp]); + apply(tree, [{ + op: "add", + path: this.path, + value: temp.value + }]); + return true; + }, + test: function(obj, key) { + return (JSON.stringify(obj[key]) === JSON.stringify(this.value)); + }, + _get: function(obj, key) { + this.value = obj[key]; + } + }; + var arrOps = { + add: function(arr, i) { + arr.splice(i, 0, this.value); + return true; + }, + remove: function(arr, i) { + arr.splice(i, 1); + return true; + }, + replace: function(arr, i) { + arr[i] = this.value; + return true; + }, + move: objOps.move, + copy: objOps.copy, + test: objOps.test, + _get: objOps._get + }; + var observeOps = { + add: function(patches, path) { + var patch = { + op: "add", + path: path + escapePathComponent(this.name), + value: this.object[this.name] + }; + patches.push(patch); + }, + 'delete': function(patches, path) { + var patch = { + op: "remove", + path: path + escapePathComponent(this.name) + }; + patches.push(patch); + }, + update: function(patches, path) { + var patch = { + op: "replace", + path: path + escapePathComponent(this.name), + value: this.object[this.name] + }; + patches.push(patch); + } + }; + function escapePathComponent(str) { + if (str.indexOf('/') === -1 && str.indexOf('~') === -1) { + return str; + } + return str.replace(/~/g, '~0').replace(/\//g, '~1'); + } + function _getPathRecursive(root, obj) { + var found; + for (var key in root) { + if (root.hasOwnProperty(key)) { + if (root[key] === obj) { + return escapePathComponent(key) + '/'; + } else if (typeof root[key] === 'object') { + found = _getPathRecursive(root[key], obj); + if (found != '') { + return escapePathComponent(key) + '/' + found; + } + } + } + } + return ''; + } + function getPath(root, obj) { + if (root === obj) { + return '/'; + } + var path = _getPathRecursive(root, obj); + if (path === '') { + throw new Error("Object not found in root"); + } + return '/' + path; + } + var beforeDict = []; + jsonpatch.intervals; + var Mirror = (function() { + function Mirror(obj) { + this.observers = []; + this.obj = obj; + } + return Mirror; + })(); + var ObserverInfo = (function() { + function ObserverInfo(callback, observer) { + this.callback = callback; + this.observer = observer; + } + return ObserverInfo; + })(); + function getMirror(obj) { + for (var i = 0, + ilen = beforeDict.length; i < ilen; i++) { + if (beforeDict[i].obj === obj) { + return beforeDict[i]; + } + } + } + function removeMirror(obj) { + for (var i = 0, + ilen = beforeDict.length; i < ilen; i++) { + if (beforeDict[i] === obj) { + beforeDict.splice(i, 1); + } + } + } + function getObserverFromMirror(mirror, callback) { + for (var j = 0, + jlen = mirror.observers.length; j < jlen; j++) { + if (mirror.observers[j].callback === callback) { + return mirror.observers[j].observer; + } + } + } + function removeObserverFromMirror(mirror, observer) { + for (var j = 0, + jlen = mirror.observers.length; j < jlen; j++) { + if (mirror.observers[j].observer === observer) { + mirror.observers.splice(j, 1); + if (!mirror.observers.length) { + removeMirror(mirror); + } + return; + } + } + } + function unobserve(root, observer) { + generate(observer); + if (Object.observe) { + _unobserve(observer, root); + } else { + clearTimeout(observer.next); + } + var mirror = getMirror(root); + removeObserverFromMirror(mirror, observer); + } + jsonpatch.unobserve = unobserve; + function observe(obj, callback) { + var patches = []; + var root = obj; + var observer; + var mirror = getMirror(obj); + if (!mirror) { + mirror = new Mirror(obj); + beforeDict.push(mirror); + } else { + observer = getObserverFromMirror(mirror, callback); + } + if (observer) { + return observer; + } + if (Object.observe) { + observer = function(arr) { + _unobserve(observer, obj); + _observe(observer, obj); + var a = 0, + alen = arr.length; + while (a < alen) { + if (!(arr[a].name === 'length' && _isArray(arr[a].object)) && !(arr[a].name === '__Jasmine_been_here_before__')) { + var type = arr[a].type; + switch (type) { + case 'new': + type = 'add'; + break; + case 'deleted': + type = 'delete'; + break; + case 'updated': + type = 'update'; + break; + } + observeOps[type].call(arr[a], patches, getPath(root, arr[a].object)); + } + a++; + } + if (patches) { + if (callback) { + callback(patches); + } + } + observer.patches = patches; + patches = []; + }; + } else { + observer = {}; + mirror.value = JSON.parse(JSON.stringify(obj)); + if (callback) { + observer.callback = callback; + observer.next = null; + var intervals = this.intervals || [100, 1000, 10000, 60000]; + var currentInterval = 0; + var dirtyCheck = function() { + generate(observer); + }; + var fastCheck = function() { + clearTimeout(observer.next); + observer.next = setTimeout(function() { + dirtyCheck(); + currentInterval = 0; + observer.next = setTimeout(slowCheck, intervals[currentInterval++]); + }, 0); + }; + var slowCheck = function() { + dirtyCheck(); + if (currentInterval == intervals.length) { + currentInterval = intervals.length - 1; + } + observer.next = setTimeout(slowCheck, intervals[currentInterval++]); + }; + if (typeof window !== 'undefined') { + if (window.addEventListener) { + window.addEventListener('mousedown', fastCheck); + window.addEventListener('mouseup', fastCheck); + window.addEventListener('keydown', fastCheck); + } else { + window.attachEvent('onmousedown', fastCheck); + window.attachEvent('onmouseup', fastCheck); + window.attachEvent('onkeydown', fastCheck); + } + } + observer.next = setTimeout(slowCheck, intervals[currentInterval++]); + } + } + observer.patches = patches; + observer.object = obj; + mirror.observers.push(new ObserverInfo(callback, observer)); + return _observe(observer, obj); + } + jsonpatch.observe = observe; + function _observe(observer, obj) { + if (Object.observe) { + Object.observe(obj, observer); + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + var v = obj[key]; + if (v && typeof(v) === "object") { + _observe(observer, v); + } + } + } + } + return observer; + } + function _unobserve(observer, obj) { + if (Object.observe) { + Object.unobserve(obj, observer); + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + var v = obj[key]; + if (v && typeof(v) === "object") { + _unobserve(observer, v); + } + } + } + } + return observer; + } + function generate(observer) { + if (Object.observe) { + Object.deliverChangeRecords(observer); + } else { + var mirror; + for (var i = 0, + ilen = beforeDict.length; i < ilen; i++) { + if (beforeDict[i].obj === observer.object) { + mirror = beforeDict[i]; + break; + } + } + if (mirror) { + _generate(mirror.value, observer.object, observer.patches, ""); + } + } + var temp = observer.patches; + if (temp.length > 0) { + observer.patches = []; + if (observer.callback) { + observer.callback(temp); + } + } + return temp; + } + jsonpatch.generate = generate; + var _objectKeys; + if (Object.keys) { + _objectKeys = Object.keys; + } else { + _objectKeys = function(obj) { + var keys = []; + for (var o in obj) { + if (obj.hasOwnProperty(o)) { + keys.push(o); + } + } + return keys; + }; + } + function _generate(mirror, obj, patches, path) { + var newKeys = _objectKeys(obj); + var oldKeys = _objectKeys(mirror); + var changed = false; + var deleted = false; + for (var t = oldKeys.length - 1; t >= 0; t--) { + var key = oldKeys[t]; + var oldVal = mirror[key]; + if (obj.hasOwnProperty(key)) { + var newVal = obj[key]; + if (oldVal instanceof Object) { + _generate(oldVal, newVal, patches, path + "/" + escapePathComponent(key)); + } else { + if (oldVal != newVal) { + changed = true; + patches.push({ + op: "replace", + path: path + "/" + escapePathComponent(key), + value: newVal + }); + mirror[key] = newVal; + } + } + } else { + patches.push({ + op: "remove", + path: path + "/" + escapePathComponent(key) + }); + delete mirror[key]; + deleted = true; + } + } + if (!deleted && newKeys.length == oldKeys.length) { + return; + } + for (var t = 0; t < newKeys.length; t++) { + var key = newKeys[t]; + if (!mirror.hasOwnProperty(key)) { + patches.push({ + op: "add", + path: path + "/" + escapePathComponent(key), + value: obj[key] + }); + mirror[key] = JSON.parse(JSON.stringify(obj[key])); + } + } + } + var _isArray; + if (Array.isArray) { + _isArray = Array.isArray; + } else { + _isArray = function(obj) { + return obj.push && typeof obj.length === 'number'; + }; + } + function apply(tree, patches) { + var result = false, + p = 0, + plen = patches.length, + patch; + while (p < plen) { + patch = patches[p]; + var keys = patch.path.split('/'); + var obj = tree; + var t = 1; + var len = keys.length; + while (true) { + if (_isArray(obj)) { + var index = parseInt(keys[t], 10); + t++; + if (t >= len) { + result = arrOps[patch.op].call(patch, obj, index, tree); + break; + } + obj = obj[index]; + } else { + var key = keys[t]; + if (key.indexOf('~') != -1) { + key = key.replace(/~1/g, '/').replace(/~0/g, '~'); + } + t++; + if (t >= len) { + result = objOps[patch.op].call(patch, obj, key, tree); + break; + } + obj = obj[key]; + } + } + p++; + } + return result; + } + jsonpatch.apply = apply; +})(jsonpatch || (jsonpatch = {})); +if (typeof exports !== "undefined") { + exports.apply = jsonpatch.apply; + exports.observe = jsonpatch.observe; + exports.unobserve = jsonpatch.unobserve; + exports.generate = jsonpatch.generate; +} + +//# +},{}],"moment":[function(require,module,exports){ +//! moment.js +//! version : 2.10.6 +//! authors : Tim Wood, Iskren Chernev, Moment.js contributors +//! license : MIT +//! momentjs.com + +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + global.moment = factory() +}(this, function () { 'use strict'; + + var hookCallback; + + function utils_hooks__hooks () { + return hookCallback.apply(null, arguments); + } + + // This is done to register the method called with moment() + // without creating circular dependencies. + function setHookCallback (callback) { + hookCallback = callback; + } + + function isArray(input) { + return Object.prototype.toString.call(input) === '[object Array]'; + } + + function isDate(input) { + return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]'; + } + + function map(arr, fn) { + var res = [], i; + for (i = 0; i < arr.length; ++i) { + res.push(fn(arr[i], i)); + } + return res; + } + + function hasOwnProp(a, b) { + return Object.prototype.hasOwnProperty.call(a, b); + } + + function extend(a, b) { + for (var i in b) { + if (hasOwnProp(b, i)) { + a[i] = b[i]; + } + } + + if (hasOwnProp(b, 'toString')) { + a.toString = b.toString; + } + + if (hasOwnProp(b, 'valueOf')) { + a.valueOf = b.valueOf; + } + + return a; + } + + function create_utc__createUTC (input, format, locale, strict) { + return createLocalOrUTC(input, format, locale, strict, true).utc(); + } + + function defaultParsingFlags() { + // We need to deep clone this object. + return { + empty : false, + unusedTokens : [], + unusedInput : [], + overflow : -2, + charsLeftOver : 0, + nullInput : false, + invalidMonth : null, + invalidFormat : false, + userInvalidated : false, + iso : false + }; + } + + function getParsingFlags(m) { + if (m._pf == null) { + m._pf = defaultParsingFlags(); + } + return m._pf; + } + + function valid__isValid(m) { + if (m._isValid == null) { + var flags = getParsingFlags(m); + m._isValid = !isNaN(m._d.getTime()) && + flags.overflow < 0 && + !flags.empty && + !flags.invalidMonth && + !flags.invalidWeekday && + !flags.nullInput && + !flags.invalidFormat && + !flags.userInvalidated; + + if (m._strict) { + m._isValid = m._isValid && + flags.charsLeftOver === 0 && + flags.unusedTokens.length === 0 && + flags.bigHour === undefined; + } + } + return m._isValid; + } + + function valid__createInvalid (flags) { + var m = create_utc__createUTC(NaN); + if (flags != null) { + extend(getParsingFlags(m), flags); + } + else { + getParsingFlags(m).userInvalidated = true; + } + + return m; + } + + var momentProperties = utils_hooks__hooks.momentProperties = []; + + function copyConfig(to, from) { + var i, prop, val; + + if (typeof from._isAMomentObject !== 'undefined') { + to._isAMomentObject = from._isAMomentObject; + } + if (typeof from._i !== 'undefined') { + to._i = from._i; + } + if (typeof from._f !== 'undefined') { + to._f = from._f; + } + if (typeof from._l !== 'undefined') { + to._l = from._l; + } + if (typeof from._strict !== 'undefined') { + to._strict = from._strict; + } + if (typeof from._tzm !== 'undefined') { + to._tzm = from._tzm; + } + if (typeof from._isUTC !== 'undefined') { + to._isUTC = from._isUTC; + } + if (typeof from._offset !== 'undefined') { + to._offset = from._offset; + } + if (typeof from._pf !== 'undefined') { + to._pf = getParsingFlags(from); + } + if (typeof from._locale !== 'undefined') { + to._locale = from._locale; + } + + if (momentProperties.length > 0) { + for (i in momentProperties) { + prop = momentProperties[i]; + val = from[prop]; + if (typeof val !== 'undefined') { + to[prop] = val; + } + } + } + + return to; + } + + var updateInProgress = false; + + // Moment prototype object + function Moment(config) { + copyConfig(this, config); + this._d = new Date(config._d != null ? config._d.getTime() : NaN); + // Prevent infinite loop in case updateOffset creates new moment + // objects. + if (updateInProgress === false) { + updateInProgress = true; + utils_hooks__hooks.updateOffset(this); + updateInProgress = false; + } + } + + function isMoment (obj) { + return obj instanceof Moment || (obj != null && obj._isAMomentObject != null); + } + + function absFloor (number) { + if (number < 0) { + return Math.ceil(number); + } else { + return Math.floor(number); + } + } + + function toInt(argumentForCoercion) { + var coercedNumber = +argumentForCoercion, + value = 0; + + if (coercedNumber !== 0 && isFinite(coercedNumber)) { + value = absFloor(coercedNumber); + } + + return value; + } + + function compareArrays(array1, array2, dontConvert) { + var len = Math.min(array1.length, array2.length), + lengthDiff = Math.abs(array1.length - array2.length), + diffs = 0, + i; + for (i = 0; i < len; i++) { + if ((dontConvert && array1[i] !== array2[i]) || + (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) { + diffs++; + } + } + return diffs + lengthDiff; + } + + function Locale() { + } + + var locales = {}; + var globalLocale; + + function normalizeLocale(key) { + return key ? key.toLowerCase().replace('_', '-') : key; + } + + // pick the locale from the array + // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each + // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root + function chooseLocale(names) { + var i = 0, j, next, locale, split; + + while (i < names.length) { + split = normalizeLocale(names[i]).split('-'); + j = split.length; + next = normalizeLocale(names[i + 1]); + next = next ? next.split('-') : null; + while (j > 0) { + locale = loadLocale(split.slice(0, j).join('-')); + if (locale) { + return locale; + } + if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) { + //the next array item is better than a shallower substring of this one + break; + } + j--; + } + i++; + } + return null; + } + + function loadLocale(name) { + var oldLocale = null; + // TODO: Find a better way to register and load all the locales in Node + if (!locales[name] && typeof module !== 'undefined' && + module && module.exports) { + try { + oldLocale = globalLocale._abbr; + require('./locale/' + name); + // because defineLocale currently also sets the global locale, we + // want to undo that for lazy loaded locales + locale_locales__getSetGlobalLocale(oldLocale); + } catch (e) { } + } + return locales[name]; + } + + // This function will load locale and then set the global locale. If + // no arguments are passed in, it will simply return the current global + // locale key. + function locale_locales__getSetGlobalLocale (key, values) { + var data; + if (key) { + if (typeof values === 'undefined') { + data = locale_locales__getLocale(key); + } + else { + data = defineLocale(key, values); + } + + if (data) { + // moment.duration._locale = moment._locale = data; + globalLocale = data; + } + } + + return globalLocale._abbr; + } + + function defineLocale (name, values) { + if (values !== null) { + values.abbr = name; + locales[name] = locales[name] || new Locale(); + locales[name].set(values); + + // backwards compat for now: also set the locale + locale_locales__getSetGlobalLocale(name); + + return locales[name]; + } else { + // useful for testing + delete locales[name]; + return null; + } + } + + // returns locale data + function locale_locales__getLocale (key) { + var locale; + + if (key && key._locale && key._locale._abbr) { + key = key._locale._abbr; + } + + if (!key) { + return globalLocale; + } + + if (!isArray(key)) { + //short-circuit everything else + locale = loadLocale(key); + if (locale) { + return locale; + } + key = [key]; + } + + return chooseLocale(key); + } + + var aliases = {}; + + function addUnitAlias (unit, shorthand) { + var lowerCase = unit.toLowerCase(); + aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit; + } + + function normalizeUnits(units) { + return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined; + } + + function normalizeObjectUnits(inputObject) { + var normalizedInput = {}, + normalizedProp, + prop; + + for (prop in inputObject) { + if (hasOwnProp(inputObject, prop)) { + normalizedProp = normalizeUnits(prop); + if (normalizedProp) { + normalizedInput[normalizedProp] = inputObject[prop]; + } + } + } + + return normalizedInput; + } + + function makeGetSet (unit, keepTime) { + return function (value) { + if (value != null) { + get_set__set(this, unit, value); + utils_hooks__hooks.updateOffset(this, keepTime); + return this; + } else { + return get_set__get(this, unit); + } + }; + } + + function get_set__get (mom, unit) { + return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit](); + } + + function get_set__set (mom, unit, value) { + return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); + } + + // MOMENTS + + function getSet (units, value) { + var unit; + if (typeof units === 'object') { + for (unit in units) { + this.set(unit, units[unit]); + } + } else { + units = normalizeUnits(units); + if (typeof this[units] === 'function') { + return this[units](value); + } + } + return this; + } + + function zeroFill(number, targetLength, forceSign) { + var absNumber = '' + Math.abs(number), + zerosToFill = targetLength - absNumber.length, + sign = number >= 0; + return (sign ? (forceSign ? '+' : '') : '-') + + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; + } + + var formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; + + var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g; + + var formatFunctions = {}; + + var formatTokenFunctions = {}; + + // token: 'M' + // padded: ['MM', 2] + // ordinal: 'Mo' + // callback: function () { this.month() + 1 } + function addFormatToken (token, padded, ordinal, callback) { + var func = callback; + if (typeof callback === 'string') { + func = function () { + return this[callback](); + }; + } + if (token) { + formatTokenFunctions[token] = func; + } + if (padded) { + formatTokenFunctions[padded[0]] = function () { + return zeroFill(func.apply(this, arguments), padded[1], padded[2]); + }; + } + if (ordinal) { + formatTokenFunctions[ordinal] = function () { + return this.localeData().ordinal(func.apply(this, arguments), token); + }; + } + } + + function removeFormattingTokens(input) { + if (input.match(/\[[\s\S]/)) { + return input.replace(/^\[|\]$/g, ''); + } + return input.replace(/\\/g, ''); + } + + function makeFormatFunction(format) { + var array = format.match(formattingTokens), i, length; + + for (i = 0, length = array.length; i < length; i++) { + if (formatTokenFunctions[array[i]]) { + array[i] = formatTokenFunctions[array[i]]; + } else { + array[i] = removeFormattingTokens(array[i]); + } + } + + return function (mom) { + var output = ''; + for (i = 0; i < length; i++) { + output += array[i] instanceof Function ? array[i].call(mom, format) : array[i]; + } + return output; + }; + } + + // format date using native date object + function formatMoment(m, format) { + if (!m.isValid()) { + return m.localeData().invalidDate(); + } + + format = expandFormat(format, m.localeData()); + formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format); + + return formatFunctions[format](m); + } + + function expandFormat(format, locale) { + var i = 5; + + function replaceLongDateFormatTokens(input) { + return locale.longDateFormat(input) || input; + } + + localFormattingTokens.lastIndex = 0; + while (i >= 0 && localFormattingTokens.test(format)) { + format = format.replace(localFormattingTokens, replaceLongDateFormatTokens); + localFormattingTokens.lastIndex = 0; + i -= 1; + } + + return format; + } + + var match1 = /\d/; // 0 - 9 + var match2 = /\d\d/; // 00 - 99 + var match3 = /\d{3}/; // 000 - 999 + var match4 = /\d{4}/; // 0000 - 9999 + var match6 = /[+-]?\d{6}/; // -999999 - 999999 + var match1to2 = /\d\d?/; // 0 - 99 + var match1to3 = /\d{1,3}/; // 0 - 999 + var match1to4 = /\d{1,4}/; // 0 - 9999 + var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999 + + var matchUnsigned = /\d+/; // 0 - inf + var matchSigned = /[+-]?\d+/; // -inf - inf + + var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z + + var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123 + + // any word (or two) characters or numbers including two/three word month in arabic. + var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i; + + var regexes = {}; + + function isFunction (sth) { + // https://github.com/moment/moment/issues/2325 + return typeof sth === 'function' && + Object.prototype.toString.call(sth) === '[object Function]'; + } + + + function addRegexToken (token, regex, strictRegex) { + regexes[token] = isFunction(regex) ? regex : function (isStrict) { + return (isStrict && strictRegex) ? strictRegex : regex; + }; + } + + function getParseRegexForToken (token, config) { + if (!hasOwnProp(regexes, token)) { + return new RegExp(unescapeFormat(token)); + } + + return regexes[token](config._strict, config._locale); + } + + // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript + function unescapeFormat(s) { + return s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { + return p1 || p2 || p3 || p4; + }).replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); + } + + var tokens = {}; + + function addParseToken (token, callback) { + var i, func = callback; + if (typeof token === 'string') { + token = [token]; + } + if (typeof callback === 'number') { + func = function (input, array) { + array[callback] = toInt(input); + }; + } + for (i = 0; i < token.length; i++) { + tokens[token[i]] = func; + } + } + + function addWeekParseToken (token, callback) { + addParseToken(token, function (input, array, config, token) { + config._w = config._w || {}; + callback(input, config._w, config, token); + }); + } + + function addTimeToArrayFromToken(token, input, config) { + if (input != null && hasOwnProp(tokens, token)) { + tokens[token](input, config._a, config, token); + } + } + + var YEAR = 0; + var MONTH = 1; + var DATE = 2; + var HOUR = 3; + var MINUTE = 4; + var SECOND = 5; + var MILLISECOND = 6; + + function daysInMonth(year, month) { + return new Date(Date.UTC(year, month + 1, 0)).getUTCDate(); + } + + // FORMATTING + + addFormatToken('M', ['MM', 2], 'Mo', function () { + return this.month() + 1; + }); + + addFormatToken('MMM', 0, 0, function (format) { + return this.localeData().monthsShort(this, format); + }); + + addFormatToken('MMMM', 0, 0, function (format) { + return this.localeData().months(this, format); + }); + + // ALIASES + + addUnitAlias('month', 'M'); + + // PARSING + + addRegexToken('M', match1to2); + addRegexToken('MM', match1to2, match2); + addRegexToken('MMM', matchWord); + addRegexToken('MMMM', matchWord); + + addParseToken(['M', 'MM'], function (input, array) { + array[MONTH] = toInt(input) - 1; + }); + + addParseToken(['MMM', 'MMMM'], function (input, array, config, token) { + var month = config._locale.monthsParse(input, token, config._strict); + // if we didn't find a month name, mark the date as invalid. + if (month != null) { + array[MONTH] = month; + } else { + getParsingFlags(config).invalidMonth = input; + } + }); + + // LOCALES + + var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'); + function localeMonths (m) { + return this._months[m.month()]; + } + + var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'); + function localeMonthsShort (m) { + return this._monthsShort[m.month()]; + } + + function localeMonthsParse (monthName, format, strict) { + var i, mom, regex; + + if (!this._monthsParse) { + this._monthsParse = []; + this._longMonthsParse = []; + this._shortMonthsParse = []; + } + + for (i = 0; i < 12; i++) { + // make the regex if we don't have it already + mom = create_utc__createUTC([2000, i]); + if (strict && !this._longMonthsParse[i]) { + this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i'); + this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i'); + } + if (!strict && !this._monthsParse[i]) { + regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); + this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); + } + // test the regex + if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) { + return i; + } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) { + return i; + } else if (!strict && this._monthsParse[i].test(monthName)) { + return i; + } + } + } + + // MOMENTS + + function setMonth (mom, value) { + var dayOfMonth; + + // TODO: Move this out of here! + if (typeof value === 'string') { + value = mom.localeData().monthsParse(value); + // TODO: Another silent failure? + if (typeof value !== 'number') { + return mom; + } + } + + dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value)); + mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth); + return mom; + } + + function getSetMonth (value) { + if (value != null) { + setMonth(this, value); + utils_hooks__hooks.updateOffset(this, true); + return this; + } else { + return get_set__get(this, 'Month'); + } + } + + function getDaysInMonth () { + return daysInMonth(this.year(), this.month()); + } + + function checkOverflow (m) { + var overflow; + var a = m._a; + + if (a && getParsingFlags(m).overflow === -2) { + overflow = + a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : + a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : + a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR : + a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : + a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : + a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : + -1; + + if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { + overflow = DATE; + } + + getParsingFlags(m).overflow = overflow; + } + + return m; + } + + function warn(msg) { + if (utils_hooks__hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) { + console.warn('Deprecation warning: ' + msg); + } + } + + function deprecate(msg, fn) { + var firstTime = true; + + return extend(function () { + if (firstTime) { + warn(msg + '\n' + (new Error()).stack); + firstTime = false; + } + return fn.apply(this, arguments); + }, fn); + } + + var deprecations = {}; + + function deprecateSimple(name, msg) { + if (!deprecations[name]) { + warn(msg); + deprecations[name] = true; + } + } + + utils_hooks__hooks.suppressDeprecationWarnings = false; + + var from_string__isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/; + + var isoDates = [ + ['YYYYYY-MM-DD', /[+-]\d{6}-\d{2}-\d{2}/], + ['YYYY-MM-DD', /\d{4}-\d{2}-\d{2}/], + ['GGGG-[W]WW-E', /\d{4}-W\d{2}-\d/], + ['GGGG-[W]WW', /\d{4}-W\d{2}/], + ['YYYY-DDD', /\d{4}-\d{3}/] + ]; + + // iso time formats and regexes + var isoTimes = [ + ['HH:mm:ss.SSSS', /(T| )\d\d:\d\d:\d\d\.\d+/], + ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/], + ['HH:mm', /(T| )\d\d:\d\d/], + ['HH', /(T| )\d\d/] + ]; + + var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i; + + // date from iso format + function configFromISO(config) { + var i, l, + string = config._i, + match = from_string__isoRegex.exec(string); + + if (match) { + getParsingFlags(config).iso = true; + for (i = 0, l = isoDates.length; i < l; i++) { + if (isoDates[i][1].exec(string)) { + config._f = isoDates[i][0]; + break; + } + } + for (i = 0, l = isoTimes.length; i < l; i++) { + if (isoTimes[i][1].exec(string)) { + // match[6] should be 'T' or space + config._f += (match[6] || ' ') + isoTimes[i][0]; + break; + } + } + if (string.match(matchOffset)) { + config._f += 'Z'; + } + configFromStringAndFormat(config); + } else { + config._isValid = false; + } + } + + // date from iso format or fallback + function configFromString(config) { + var matched = aspNetJsonRegex.exec(config._i); + + if (matched !== null) { + config._d = new Date(+matched[1]); + return; + } + + configFromISO(config); + if (config._isValid === false) { + delete config._isValid; + utils_hooks__hooks.createFromInputFallback(config); + } + } + + utils_hooks__hooks.createFromInputFallback = deprecate( + 'moment construction falls back to js Date. This is ' + + 'discouraged and will be removed in upcoming major ' + + 'release. Please refer to ' + + 'https://github.com/moment/moment/issues/1407 for more info.', + function (config) { + config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); + } + ); + + function createDate (y, m, d, h, M, s, ms) { + //can't just apply() to create a date: + //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply + var date = new Date(y, m, d, h, M, s, ms); + + //the date constructor doesn't accept years < 1970 + if (y < 1970) { + date.setFullYear(y); + } + return date; + } + + function createUTCDate (y) { + var date = new Date(Date.UTC.apply(null, arguments)); + if (y < 1970) { + date.setUTCFullYear(y); + } + return date; + } + + addFormatToken(0, ['YY', 2], 0, function () { + return this.year() % 100; + }); + + addFormatToken(0, ['YYYY', 4], 0, 'year'); + addFormatToken(0, ['YYYYY', 5], 0, 'year'); + addFormatToken(0, ['YYYYYY', 6, true], 0, 'year'); + + // ALIASES + + addUnitAlias('year', 'y'); + + // PARSING + + addRegexToken('Y', matchSigned); + addRegexToken('YY', match1to2, match2); + addRegexToken('YYYY', match1to4, match4); + addRegexToken('YYYYY', match1to6, match6); + addRegexToken('YYYYYY', match1to6, match6); + + addParseToken(['YYYYY', 'YYYYYY'], YEAR); + addParseToken('YYYY', function (input, array) { + array[YEAR] = input.length === 2 ? utils_hooks__hooks.parseTwoDigitYear(input) : toInt(input); + }); + addParseToken('YY', function (input, array) { + array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input); + }); + + // HELPERS + + function daysInYear(year) { + return isLeapYear(year) ? 366 : 365; + } + + function isLeapYear(year) { + return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; + } + + // HOOKS + + utils_hooks__hooks.parseTwoDigitYear = function (input) { + return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); + }; + + // MOMENTS + + var getSetYear = makeGetSet('FullYear', false); + + function getIsLeapYear () { + return isLeapYear(this.year()); + } + + addFormatToken('w', ['ww', 2], 'wo', 'week'); + addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); + + // ALIASES + + addUnitAlias('week', 'w'); + addUnitAlias('isoWeek', 'W'); + + // PARSING + + addRegexToken('w', match1to2); + addRegexToken('ww', match1to2, match2); + addRegexToken('W', match1to2); + addRegexToken('WW', match1to2, match2); + + addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { + week[token.substr(0, 1)] = toInt(input); + }); + + // HELPERS + + // firstDayOfWeek 0 = sun, 6 = sat + // the day of the week that starts the week + // (usually sunday or monday) + // firstDayOfWeekOfYear 0 = sun, 6 = sat + // the first week is the week that contains the first + // of this day of the week + // (eg. ISO weeks use thursday (4)) + function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) { + var end = firstDayOfWeekOfYear - firstDayOfWeek, + daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(), + adjustedMoment; + + + if (daysToDayOfWeek > end) { + daysToDayOfWeek -= 7; + } + + if (daysToDayOfWeek < end - 7) { + daysToDayOfWeek += 7; + } + + adjustedMoment = local__createLocal(mom).add(daysToDayOfWeek, 'd'); + return { + week: Math.ceil(adjustedMoment.dayOfYear() / 7), + year: adjustedMoment.year() + }; + } + + // LOCALES + + function localeWeek (mom) { + return weekOfYear(mom, this._week.dow, this._week.doy).week; + } + + var defaultLocaleWeek = { + dow : 0, // Sunday is the first day of the week. + doy : 6 // The week that contains Jan 1st is the first week of the year. + }; + + function localeFirstDayOfWeek () { + return this._week.dow; + } + + function localeFirstDayOfYear () { + return this._week.doy; + } + + // MOMENTS + + function getSetWeek (input) { + var week = this.localeData().week(this); + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + function getSetISOWeek (input) { + var week = weekOfYear(this, 1, 4).week; + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); + + // ALIASES + + addUnitAlias('dayOfYear', 'DDD'); + + // PARSING + + addRegexToken('DDD', match1to3); + addRegexToken('DDDD', match3); + addParseToken(['DDD', 'DDDD'], function (input, array, config) { + config._dayOfYear = toInt(input); + }); + + // HELPERS + + //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday + function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) { + var week1Jan = 6 + firstDayOfWeek - firstDayOfWeekOfYear, janX = createUTCDate(year, 0, 1 + week1Jan), d = janX.getUTCDay(), dayOfYear; + if (d < firstDayOfWeek) { + d += 7; + } + + weekday = weekday != null ? 1 * weekday : firstDayOfWeek; + + dayOfYear = 1 + week1Jan + 7 * (week - 1) - d + weekday; + + return { + year: dayOfYear > 0 ? year : year - 1, + dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear + }; + } + + // MOMENTS + + function getSetDayOfYear (input) { + var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; + return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); + } + + // Pick the first defined of two or three arguments. + function defaults(a, b, c) { + if (a != null) { + return a; + } + if (b != null) { + return b; + } + return c; + } + + function currentDateArray(config) { + var now = new Date(); + if (config._useUTC) { + return [now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()]; + } + return [now.getFullYear(), now.getMonth(), now.getDate()]; + } + + // convert an array to a date. + // the array should mirror the parameters below + // note: all values past the year are optional and will default to the lowest possible value. + // [year, month, day , hour, minute, second, millisecond] + function configFromArray (config) { + var i, date, input = [], currentDate, yearToUse; + + if (config._d) { + return; + } + + currentDate = currentDateArray(config); + + //compute day of the year from weeks and weekdays + if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { + dayOfYearFromWeekInfo(config); + } + + //if the day of the year is set, figure out what it is + if (config._dayOfYear) { + yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); + + if (config._dayOfYear > daysInYear(yearToUse)) { + getParsingFlags(config)._overflowDayOfYear = true; + } + + date = createUTCDate(yearToUse, 0, config._dayOfYear); + config._a[MONTH] = date.getUTCMonth(); + config._a[DATE] = date.getUTCDate(); + } + + // Default to current date. + // * if no year, month, day of month are given, default to today + // * if day of month is given, default month and year + // * if month is given, default only year + // * if year is given, don't default anything + for (i = 0; i < 3 && config._a[i] == null; ++i) { + config._a[i] = input[i] = currentDate[i]; + } + + // Zero out whatever was not defaulted, including time + for (; i < 7; i++) { + config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i]; + } + + // Check for 24:00:00.000 + if (config._a[HOUR] === 24 && + config._a[MINUTE] === 0 && + config._a[SECOND] === 0 && + config._a[MILLISECOND] === 0) { + config._nextDay = true; + config._a[HOUR] = 0; + } + + config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input); + // Apply timezone offset from input. The actual utcOffset can be changed + // with parseZone. + if (config._tzm != null) { + config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); + } + + if (config._nextDay) { + config._a[HOUR] = 24; + } + } + + function dayOfYearFromWeekInfo(config) { + var w, weekYear, week, weekday, dow, doy, temp; + + w = config._w; + if (w.GG != null || w.W != null || w.E != null) { + dow = 1; + doy = 4; + + // TODO: We need to take the current isoWeekYear, but that depends on + // how we interpret now (local, utc, fixed offset). So create + // a now version of current config (take local/utc/offset flags, and + // create now). + weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year); + week = defaults(w.W, 1); + weekday = defaults(w.E, 1); + } else { + dow = config._locale._week.dow; + doy = config._locale._week.doy; + + weekYear = defaults(w.gg, config._a[YEAR], weekOfYear(local__createLocal(), dow, doy).year); + week = defaults(w.w, 1); + + if (w.d != null) { + // weekday -- low day numbers are considered next week + weekday = w.d; + if (weekday < dow) { + ++week; + } + } else if (w.e != null) { + // local weekday -- counting starts from begining of week + weekday = w.e + dow; + } else { + // default to begining of week + weekday = dow; + } + } + temp = dayOfYearFromWeeks(weekYear, week, weekday, doy, dow); + + config._a[YEAR] = temp.year; + config._dayOfYear = temp.dayOfYear; + } + + utils_hooks__hooks.ISO_8601 = function () {}; + + // date from string and format string + function configFromStringAndFormat(config) { + // TODO: Move this to another part of the creation flow to prevent circular deps + if (config._f === utils_hooks__hooks.ISO_8601) { + configFromISO(config); + return; + } + + config._a = []; + getParsingFlags(config).empty = true; + + // This array is used to make a Date, either with `new Date` or `Date.UTC` + var string = '' + config._i, + i, parsedInput, tokens, token, skipped, + stringLength = string.length, + totalParsedInputLength = 0; + + tokens = expandFormat(config._f, config._locale).match(formattingTokens) || []; + + for (i = 0; i < tokens.length; i++) { + token = tokens[i]; + parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; + if (parsedInput) { + skipped = string.substr(0, string.indexOf(parsedInput)); + if (skipped.length > 0) { + getParsingFlags(config).unusedInput.push(skipped); + } + string = string.slice(string.indexOf(parsedInput) + parsedInput.length); + totalParsedInputLength += parsedInput.length; + } + // don't parse if it's not a known token + if (formatTokenFunctions[token]) { + if (parsedInput) { + getParsingFlags(config).empty = false; + } + else { + getParsingFlags(config).unusedTokens.push(token); + } + addTimeToArrayFromToken(token, parsedInput, config); + } + else if (config._strict && !parsedInput) { + getParsingFlags(config).unusedTokens.push(token); + } + } + + // add remaining unparsed input length to the string + getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength; + if (string.length > 0) { + getParsingFlags(config).unusedInput.push(string); + } + + // clear _12h flag if hour is <= 12 + if (getParsingFlags(config).bigHour === true && + config._a[HOUR] <= 12 && + config._a[HOUR] > 0) { + getParsingFlags(config).bigHour = undefined; + } + // handle meridiem + config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem); + + configFromArray(config); + checkOverflow(config); + } + + + function meridiemFixWrap (locale, hour, meridiem) { + var isPm; + + if (meridiem == null) { + // nothing to do + return hour; + } + if (locale.meridiemHour != null) { + return locale.meridiemHour(hour, meridiem); + } else if (locale.isPM != null) { + // Fallback + isPm = locale.isPM(meridiem); + if (isPm && hour < 12) { + hour += 12; + } + if (!isPm && hour === 12) { + hour = 0; + } + return hour; + } else { + // this is not supposed to happen + return hour; + } + } + + function configFromStringAndArray(config) { + var tempConfig, + bestMoment, + + scoreToBeat, + i, + currentScore; + + if (config._f.length === 0) { + getParsingFlags(config).invalidFormat = true; + config._d = new Date(NaN); + return; + } + + for (i = 0; i < config._f.length; i++) { + currentScore = 0; + tempConfig = copyConfig({}, config); + if (config._useUTC != null) { + tempConfig._useUTC = config._useUTC; + } + tempConfig._f = config._f[i]; + configFromStringAndFormat(tempConfig); + + if (!valid__isValid(tempConfig)) { + continue; + } + + // if there is any input that was not parsed add a penalty for that format + currentScore += getParsingFlags(tempConfig).charsLeftOver; + + //or tokens + currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; + + getParsingFlags(tempConfig).score = currentScore; + + if (scoreToBeat == null || currentScore < scoreToBeat) { + scoreToBeat = currentScore; + bestMoment = tempConfig; + } + } + + extend(config, bestMoment || tempConfig); + } + + function configFromObject(config) { + if (config._d) { + return; + } + + var i = normalizeObjectUnits(config._i); + config._a = [i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond]; + + configFromArray(config); + } + + function createFromConfig (config) { + var res = new Moment(checkOverflow(prepareConfig(config))); + if (res._nextDay) { + // Adding is smart enough around DST + res.add(1, 'd'); + res._nextDay = undefined; + } + + return res; + } + + function prepareConfig (config) { + var input = config._i, + format = config._f; + + config._locale = config._locale || locale_locales__getLocale(config._l); + + if (input === null || (format === undefined && input === '')) { + return valid__createInvalid({nullInput: true}); + } + + if (typeof input === 'string') { + config._i = input = config._locale.preparse(input); + } + + if (isMoment(input)) { + return new Moment(checkOverflow(input)); + } else if (isArray(format)) { + configFromStringAndArray(config); + } else if (format) { + configFromStringAndFormat(config); + } else if (isDate(input)) { + config._d = input; + } else { + configFromInput(config); + } + + return config; + } + + function configFromInput(config) { + var input = config._i; + if (input === undefined) { + config._d = new Date(); + } else if (isDate(input)) { + config._d = new Date(+input); + } else if (typeof input === 'string') { + configFromString(config); + } else if (isArray(input)) { + config._a = map(input.slice(0), function (obj) { + return parseInt(obj, 10); + }); + configFromArray(config); + } else if (typeof(input) === 'object') { + configFromObject(config); + } else if (typeof(input) === 'number') { + // from milliseconds + config._d = new Date(input); + } else { + utils_hooks__hooks.createFromInputFallback(config); + } + } + + function createLocalOrUTC (input, format, locale, strict, isUTC) { + var c = {}; + + if (typeof(locale) === 'boolean') { + strict = locale; + locale = undefined; + } + // object construction must be done this way. + // https://github.com/moment/moment/issues/1423 + c._isAMomentObject = true; + c._useUTC = c._isUTC = isUTC; + c._l = locale; + c._i = input; + c._f = format; + c._strict = strict; + + return createFromConfig(c); + } + + function local__createLocal (input, format, locale, strict) { + return createLocalOrUTC(input, format, locale, strict, false); + } + + var prototypeMin = deprecate( + 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', + function () { + var other = local__createLocal.apply(null, arguments); + return other < this ? this : other; + } + ); + + var prototypeMax = deprecate( + 'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', + function () { + var other = local__createLocal.apply(null, arguments); + return other > this ? this : other; + } + ); + + // Pick a moment m from moments so that m[fn](other) is true for all + // other. This relies on the function fn to be transitive. + // + // moments should either be an array of moment objects or an array, whose + // first element is an array of moment objects. + function pickBy(fn, moments) { + var res, i; + if (moments.length === 1 && isArray(moments[0])) { + moments = moments[0]; + } + if (!moments.length) { + return local__createLocal(); + } + res = moments[0]; + for (i = 1; i < moments.length; ++i) { + if (!moments[i].isValid() || moments[i][fn](res)) { + res = moments[i]; + } + } + return res; + } + + // TODO: Use [].sort instead? + function min () { + var args = [].slice.call(arguments, 0); + + return pickBy('isBefore', args); + } + + function max () { + var args = [].slice.call(arguments, 0); + + return pickBy('isAfter', args); + } + + function Duration (duration) { + var normalizedInput = normalizeObjectUnits(duration), + years = normalizedInput.year || 0, + quarters = normalizedInput.quarter || 0, + months = normalizedInput.month || 0, + weeks = normalizedInput.week || 0, + days = normalizedInput.day || 0, + hours = normalizedInput.hour || 0, + minutes = normalizedInput.minute || 0, + seconds = normalizedInput.second || 0, + milliseconds = normalizedInput.millisecond || 0; + + // representation for dateAddRemove + this._milliseconds = +milliseconds + + seconds * 1e3 + // 1000 + minutes * 6e4 + // 1000 * 60 + hours * 36e5; // 1000 * 60 * 60 + // Because of dateAddRemove treats 24 hours as different from a + // day when working around DST, we need to store them separately + this._days = +days + + weeks * 7; + // It is impossible translate months into days without knowing + // which months you are are talking about, so we have to store + // it separately. + this._months = +months + + quarters * 3 + + years * 12; + + this._data = {}; + + this._locale = locale_locales__getLocale(); + + this._bubble(); + } + + function isDuration (obj) { + return obj instanceof Duration; + } + + function offset (token, separator) { + addFormatToken(token, 0, 0, function () { + var offset = this.utcOffset(); + var sign = '+'; + if (offset < 0) { + offset = -offset; + sign = '-'; + } + return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2); + }); + } + + offset('Z', ':'); + offset('ZZ', ''); + + // PARSING + + addRegexToken('Z', matchOffset); + addRegexToken('ZZ', matchOffset); + addParseToken(['Z', 'ZZ'], function (input, array, config) { + config._useUTC = true; + config._tzm = offsetFromString(input); + }); + + // HELPERS + + // timezone chunker + // '+10:00' > ['10', '00'] + // '-1530' > ['-15', '30'] + var chunkOffset = /([\+\-]|\d\d)/gi; + + function offsetFromString(string) { + var matches = ((string || '').match(matchOffset) || []); + var chunk = matches[matches.length - 1] || []; + var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; + var minutes = +(parts[1] * 60) + toInt(parts[2]); + + return parts[0] === '+' ? minutes : -minutes; + } + + // Return a moment from input, that is local/utc/zone equivalent to model. + function cloneWithOffset(input, model) { + var res, diff; + if (model._isUTC) { + res = model.clone(); + diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res); + // Use low-level api, because this fn is low-level api. + res._d.setTime(+res._d + diff); + utils_hooks__hooks.updateOffset(res, false); + return res; + } else { + return local__createLocal(input).local(); + } + } + + function getDateOffset (m) { + // On Firefox.24 Date#getTimezoneOffset returns a floating point. + // https://github.com/moment/moment/pull/1871 + return -Math.round(m._d.getTimezoneOffset() / 15) * 15; + } + + // HOOKS + + // This function will be called whenever a moment is mutated. + // It is intended to keep the offset in sync with the timezone. + utils_hooks__hooks.updateOffset = function () {}; + + // MOMENTS + + // keepLocalTime = true means only change the timezone, without + // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--> + // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset + // +0200, so we adjust the time as needed, to be valid. + // + // Keeping the time actually adds/subtracts (one hour) + // from the actual represented time. That is why we call updateOffset + // a second time. In case it wants us to change the offset again + // _changeInProgress == true case, then we have to adjust, because + // there is no such time in the given timezone. + function getSetOffset (input, keepLocalTime) { + var offset = this._offset || 0, + localAdjust; + if (input != null) { + if (typeof input === 'string') { + input = offsetFromString(input); + } + if (Math.abs(input) < 16) { + input = input * 60; + } + if (!this._isUTC && keepLocalTime) { + localAdjust = getDateOffset(this); + } + this._offset = input; + this._isUTC = true; + if (localAdjust != null) { + this.add(localAdjust, 'm'); + } + if (offset !== input) { + if (!keepLocalTime || this._changeInProgress) { + add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false); + } else if (!this._changeInProgress) { + this._changeInProgress = true; + utils_hooks__hooks.updateOffset(this, true); + this._changeInProgress = null; + } + } + return this; + } else { + return this._isUTC ? offset : getDateOffset(this); + } + } + + function getSetZone (input, keepLocalTime) { + if (input != null) { + if (typeof input !== 'string') { + input = -input; + } + + this.utcOffset(input, keepLocalTime); + + return this; + } else { + return -this.utcOffset(); + } + } + + function setOffsetToUTC (keepLocalTime) { + return this.utcOffset(0, keepLocalTime); + } + + function setOffsetToLocal (keepLocalTime) { + if (this._isUTC) { + this.utcOffset(0, keepLocalTime); + this._isUTC = false; + + if (keepLocalTime) { + this.subtract(getDateOffset(this), 'm'); + } + } + return this; + } + + function setOffsetToParsedOffset () { + if (this._tzm) { + this.utcOffset(this._tzm); + } else if (typeof this._i === 'string') { + this.utcOffset(offsetFromString(this._i)); + } + return this; + } + + function hasAlignedHourOffset (input) { + input = input ? local__createLocal(input).utcOffset() : 0; + + return (this.utcOffset() - input) % 60 === 0; + } + + function isDaylightSavingTime () { + return ( + this.utcOffset() > this.clone().month(0).utcOffset() || + this.utcOffset() > this.clone().month(5).utcOffset() + ); + } + + function isDaylightSavingTimeShifted () { + if (typeof this._isDSTShifted !== 'undefined') { + return this._isDSTShifted; + } + + var c = {}; + + copyConfig(c, this); + c = prepareConfig(c); + + if (c._a) { + var other = c._isUTC ? create_utc__createUTC(c._a) : local__createLocal(c._a); + this._isDSTShifted = this.isValid() && + compareArrays(c._a, other.toArray()) > 0; + } else { + this._isDSTShifted = false; + } + + return this._isDSTShifted; + } + + function isLocal () { + return !this._isUTC; + } + + function isUtcOffset () { + return this._isUTC; + } + + function isUtc () { + return this._isUTC && this._offset === 0; + } + + var aspNetRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/; + + // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html + // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere + var create__isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/; + + function create__createDuration (input, key) { + var duration = input, + // matching against regexp is expensive, do it on demand + match = null, + sign, + ret, + diffRes; + + if (isDuration(input)) { + duration = { + ms : input._milliseconds, + d : input._days, + M : input._months + }; + } else if (typeof input === 'number') { + duration = {}; + if (key) { + duration[key] = input; + } else { + duration.milliseconds = input; + } + } else if (!!(match = aspNetRegex.exec(input))) { + sign = (match[1] === '-') ? -1 : 1; + duration = { + y : 0, + d : toInt(match[DATE]) * sign, + h : toInt(match[HOUR]) * sign, + m : toInt(match[MINUTE]) * sign, + s : toInt(match[SECOND]) * sign, + ms : toInt(match[MILLISECOND]) * sign + }; + } else if (!!(match = create__isoRegex.exec(input))) { + sign = (match[1] === '-') ? -1 : 1; + duration = { + y : parseIso(match[2], sign), + M : parseIso(match[3], sign), + d : parseIso(match[4], sign), + h : parseIso(match[5], sign), + m : parseIso(match[6], sign), + s : parseIso(match[7], sign), + w : parseIso(match[8], sign) + }; + } else if (duration == null) {// checks for null or undefined + duration = {}; + } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) { + diffRes = momentsDifference(local__createLocal(duration.from), local__createLocal(duration.to)); + + duration = {}; + duration.ms = diffRes.milliseconds; + duration.M = diffRes.months; + } + + ret = new Duration(duration); + + if (isDuration(input) && hasOwnProp(input, '_locale')) { + ret._locale = input._locale; + } + + return ret; + } + + create__createDuration.fn = Duration.prototype; + + function parseIso (inp, sign) { + // We'd normally use ~~inp for this, but unfortunately it also + // converts floats to ints. + // inp may be undefined, so careful calling replace on it. + var res = inp && parseFloat(inp.replace(',', '.')); + // apply sign while we're at it + return (isNaN(res) ? 0 : res) * sign; + } + + function positiveMomentsDifference(base, other) { + var res = {milliseconds: 0, months: 0}; + + res.months = other.month() - base.month() + + (other.year() - base.year()) * 12; + if (base.clone().add(res.months, 'M').isAfter(other)) { + --res.months; + } + + res.milliseconds = +other - +(base.clone().add(res.months, 'M')); + + return res; + } + + function momentsDifference(base, other) { + var res; + other = cloneWithOffset(other, base); + if (base.isBefore(other)) { + res = positiveMomentsDifference(base, other); + } else { + res = positiveMomentsDifference(other, base); + res.milliseconds = -res.milliseconds; + res.months = -res.months; + } + + return res; + } + + function createAdder(direction, name) { + return function (val, period) { + var dur, tmp; + //invert the arguments, but complain about it + if (period !== null && !isNaN(+period)) { + deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period).'); + tmp = val; val = period; period = tmp; + } + + val = typeof val === 'string' ? +val : val; + dur = create__createDuration(val, period); + add_subtract__addSubtract(this, dur, direction); + return this; + }; + } + + function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) { + var milliseconds = duration._milliseconds, + days = duration._days, + months = duration._months; + updateOffset = updateOffset == null ? true : updateOffset; + + if (milliseconds) { + mom._d.setTime(+mom._d + milliseconds * isAdding); + } + if (days) { + get_set__set(mom, 'Date', get_set__get(mom, 'Date') + days * isAdding); + } + if (months) { + setMonth(mom, get_set__get(mom, 'Month') + months * isAdding); + } + if (updateOffset) { + utils_hooks__hooks.updateOffset(mom, days || months); + } + } + + var add_subtract__add = createAdder(1, 'add'); + var add_subtract__subtract = createAdder(-1, 'subtract'); + + function moment_calendar__calendar (time, formats) { + // We want to compare the start of today, vs this. + // Getting start-of-today depends on whether we're local/utc/offset or not. + var now = time || local__createLocal(), + sod = cloneWithOffset(now, this).startOf('day'), + diff = this.diff(sod, 'days', true), + format = diff < -6 ? 'sameElse' : + diff < -1 ? 'lastWeek' : + diff < 0 ? 'lastDay' : + diff < 1 ? 'sameDay' : + diff < 2 ? 'nextDay' : + diff < 7 ? 'nextWeek' : 'sameElse'; + return this.format(formats && formats[format] || this.localeData().calendar(format, this, local__createLocal(now))); + } + + function clone () { + return new Moment(this); + } + + function isAfter (input, units) { + var inputMs; + units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); + if (units === 'millisecond') { + input = isMoment(input) ? input : local__createLocal(input); + return +this > +input; + } else { + inputMs = isMoment(input) ? +input : +local__createLocal(input); + return inputMs < +this.clone().startOf(units); + } + } + + function isBefore (input, units) { + var inputMs; + units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); + if (units === 'millisecond') { + input = isMoment(input) ? input : local__createLocal(input); + return +this < +input; + } else { + inputMs = isMoment(input) ? +input : +local__createLocal(input); + return +this.clone().endOf(units) < inputMs; + } + } + + function isBetween (from, to, units) { + return this.isAfter(from, units) && this.isBefore(to, units); + } + + function isSame (input, units) { + var inputMs; + units = normalizeUnits(units || 'millisecond'); + if (units === 'millisecond') { + input = isMoment(input) ? input : local__createLocal(input); + return +this === +input; + } else { + inputMs = +local__createLocal(input); + return +(this.clone().startOf(units)) <= inputMs && inputMs <= +(this.clone().endOf(units)); + } + } + + function diff (input, units, asFloat) { + var that = cloneWithOffset(input, this), + zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4, + delta, output; + + units = normalizeUnits(units); + + if (units === 'year' || units === 'month' || units === 'quarter') { + output = monthDiff(this, that); + if (units === 'quarter') { + output = output / 3; + } else if (units === 'year') { + output = output / 12; + } + } else { + delta = this - that; + output = units === 'second' ? delta / 1e3 : // 1000 + units === 'minute' ? delta / 6e4 : // 1000 * 60 + units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60 + units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst + units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst + delta; + } + return asFloat ? output : absFloor(output); + } + + function monthDiff (a, b) { + // difference in months + var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()), + // b is in (anchor - 1 month, anchor + 1 month) + anchor = a.clone().add(wholeMonthDiff, 'months'), + anchor2, adjust; + + if (b - anchor < 0) { + anchor2 = a.clone().add(wholeMonthDiff - 1, 'months'); + // linear across the month + adjust = (b - anchor) / (anchor - anchor2); + } else { + anchor2 = a.clone().add(wholeMonthDiff + 1, 'months'); + // linear across the month + adjust = (b - anchor) / (anchor2 - anchor); + } + + return -(wholeMonthDiff + adjust); + } + + utils_hooks__hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; + + function toString () { + return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); + } + + function moment_format__toISOString () { + var m = this.clone().utc(); + if (0 < m.year() && m.year() <= 9999) { + if ('function' === typeof Date.prototype.toISOString) { + // native implementation is ~50x faster, use it when we can + return this.toDate().toISOString(); + } else { + return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); + } + } else { + return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); + } + } + + function format (inputString) { + var output = formatMoment(this, inputString || utils_hooks__hooks.defaultFormat); + return this.localeData().postformat(output); + } + + function from (time, withoutSuffix) { + if (!this.isValid()) { + return this.localeData().invalidDate(); + } + return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); + } + + function fromNow (withoutSuffix) { + return this.from(local__createLocal(), withoutSuffix); + } + + function to (time, withoutSuffix) { + if (!this.isValid()) { + return this.localeData().invalidDate(); + } + return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); + } + + function toNow (withoutSuffix) { + return this.to(local__createLocal(), withoutSuffix); + } + + function locale (key) { + var newLocaleData; + + if (key === undefined) { + return this._locale._abbr; + } else { + newLocaleData = locale_locales__getLocale(key); + if (newLocaleData != null) { + this._locale = newLocaleData; + } + return this; + } + } + + var lang = deprecate( + 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', + function (key) { + if (key === undefined) { + return this.localeData(); + } else { + return this.locale(key); + } + } + ); + + function localeData () { + return this._locale; + } + + function startOf (units) { + units = normalizeUnits(units); + // the following switch intentionally omits break keywords + // to utilize falling through the cases. + switch (units) { + case 'year': + this.month(0); + /* falls through */ + case 'quarter': + case 'month': + this.date(1); + /* falls through */ + case 'week': + case 'isoWeek': + case 'day': + this.hours(0); + /* falls through */ + case 'hour': + this.minutes(0); + /* falls through */ + case 'minute': + this.seconds(0); + /* falls through */ + case 'second': + this.milliseconds(0); + } + + // weeks are a special case + if (units === 'week') { + this.weekday(0); + } + if (units === 'isoWeek') { + this.isoWeekday(1); + } + + // quarters are also special + if (units === 'quarter') { + this.month(Math.floor(this.month() / 3) * 3); + } + + return this; + } + + function endOf (units) { + units = normalizeUnits(units); + if (units === undefined || units === 'millisecond') { + return this; + } + return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms'); + } + + function to_type__valueOf () { + return +this._d - ((this._offset || 0) * 60000); + } + + function unix () { + return Math.floor(+this / 1000); + } + + function toDate () { + return this._offset ? new Date(+this) : this._d; + } + + function toArray () { + var m = this; + return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()]; + } + + function toObject () { + var m = this; + return { + years: m.year(), + months: m.month(), + date: m.date(), + hours: m.hours(), + minutes: m.minutes(), + seconds: m.seconds(), + milliseconds: m.milliseconds() + }; + } + + function moment_valid__isValid () { + return valid__isValid(this); + } + + function parsingFlags () { + return extend({}, getParsingFlags(this)); + } + + function invalidAt () { + return getParsingFlags(this).overflow; + } + + addFormatToken(0, ['gg', 2], 0, function () { + return this.weekYear() % 100; + }); + + addFormatToken(0, ['GG', 2], 0, function () { + return this.isoWeekYear() % 100; + }); + + function addWeekYearFormatToken (token, getter) { + addFormatToken(0, [token, token.length], 0, getter); + } + + addWeekYearFormatToken('gggg', 'weekYear'); + addWeekYearFormatToken('ggggg', 'weekYear'); + addWeekYearFormatToken('GGGG', 'isoWeekYear'); + addWeekYearFormatToken('GGGGG', 'isoWeekYear'); + + // ALIASES + + addUnitAlias('weekYear', 'gg'); + addUnitAlias('isoWeekYear', 'GG'); + + // PARSING + + addRegexToken('G', matchSigned); + addRegexToken('g', matchSigned); + addRegexToken('GG', match1to2, match2); + addRegexToken('gg', match1to2, match2); + addRegexToken('GGGG', match1to4, match4); + addRegexToken('gggg', match1to4, match4); + addRegexToken('GGGGG', match1to6, match6); + addRegexToken('ggggg', match1to6, match6); + + addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) { + week[token.substr(0, 2)] = toInt(input); + }); + + addWeekParseToken(['gg', 'GG'], function (input, week, config, token) { + week[token] = utils_hooks__hooks.parseTwoDigitYear(input); + }); + + // HELPERS + + function weeksInYear(year, dow, doy) { + return weekOfYear(local__createLocal([year, 11, 31 + dow - doy]), dow, doy).week; + } + + // MOMENTS + + function getSetWeekYear (input) { + var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year; + return input == null ? year : this.add((input - year), 'y'); + } + + function getSetISOWeekYear (input) { + var year = weekOfYear(this, 1, 4).year; + return input == null ? year : this.add((input - year), 'y'); + } + + function getISOWeeksInYear () { + return weeksInYear(this.year(), 1, 4); + } + + function getWeeksInYear () { + var weekInfo = this.localeData()._week; + return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); + } + + addFormatToken('Q', 0, 0, 'quarter'); + + // ALIASES + + addUnitAlias('quarter', 'Q'); + + // PARSING + + addRegexToken('Q', match1); + addParseToken('Q', function (input, array) { + array[MONTH] = (toInt(input) - 1) * 3; + }); + + // MOMENTS + + function getSetQuarter (input) { + return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); + } + + addFormatToken('D', ['DD', 2], 'Do', 'date'); + + // ALIASES + + addUnitAlias('date', 'D'); + + // PARSING + + addRegexToken('D', match1to2); + addRegexToken('DD', match1to2, match2); + addRegexToken('Do', function (isStrict, locale) { + return isStrict ? locale._ordinalParse : locale._ordinalParseLenient; + }); + + addParseToken(['D', 'DD'], DATE); + addParseToken('Do', function (input, array) { + array[DATE] = toInt(input.match(match1to2)[0], 10); + }); + + // MOMENTS + + var getSetDayOfMonth = makeGetSet('Date', true); + + addFormatToken('d', 0, 'do', 'day'); + + addFormatToken('dd', 0, 0, function (format) { + return this.localeData().weekdaysMin(this, format); + }); + + addFormatToken('ddd', 0, 0, function (format) { + return this.localeData().weekdaysShort(this, format); + }); + + addFormatToken('dddd', 0, 0, function (format) { + return this.localeData().weekdays(this, format); + }); + + addFormatToken('e', 0, 0, 'weekday'); + addFormatToken('E', 0, 0, 'isoWeekday'); + + // ALIASES + + addUnitAlias('day', 'd'); + addUnitAlias('weekday', 'e'); + addUnitAlias('isoWeekday', 'E'); + + // PARSING + + addRegexToken('d', match1to2); + addRegexToken('e', match1to2); + addRegexToken('E', match1to2); + addRegexToken('dd', matchWord); + addRegexToken('ddd', matchWord); + addRegexToken('dddd', matchWord); + + addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config) { + var weekday = config._locale.weekdaysParse(input); + // if we didn't get a weekday name, mark the date as invalid + if (weekday != null) { + week.d = weekday; + } else { + getParsingFlags(config).invalidWeekday = input; + } + }); + + addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) { + week[token] = toInt(input); + }); + + // HELPERS + + function parseWeekday(input, locale) { + if (typeof input !== 'string') { + return input; + } + + if (!isNaN(input)) { + return parseInt(input, 10); + } + + input = locale.weekdaysParse(input); + if (typeof input === 'number') { + return input; + } + + return null; + } + + // LOCALES + + var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'); + function localeWeekdays (m) { + return this._weekdays[m.day()]; + } + + var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'); + function localeWeekdaysShort (m) { + return this._weekdaysShort[m.day()]; + } + + var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'); + function localeWeekdaysMin (m) { + return this._weekdaysMin[m.day()]; + } + + function localeWeekdaysParse (weekdayName) { + var i, mom, regex; + + this._weekdaysParse = this._weekdaysParse || []; + + for (i = 0; i < 7; i++) { + // make the regex if we don't have it already + if (!this._weekdaysParse[i]) { + mom = local__createLocal([2000, 1]).day(i); + regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); + this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); + } + // test the regex + if (this._weekdaysParse[i].test(weekdayName)) { + return i; + } + } + } + + // MOMENTS + + function getSetDayOfWeek (input) { + var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); + if (input != null) { + input = parseWeekday(input, this.localeData()); + return this.add(input - day, 'd'); + } else { + return day; + } + } + + function getSetLocaleDayOfWeek (input) { + var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; + return input == null ? weekday : this.add(input - weekday, 'd'); + } + + function getSetISODayOfWeek (input) { + // behaves the same as moment#day except + // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) + // as a setter, sunday should belong to the previous week. + return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7); + } + + addFormatToken('H', ['HH', 2], 0, 'hour'); + addFormatToken('h', ['hh', 2], 0, function () { + return this.hours() % 12 || 12; + }); + + function meridiem (token, lowercase) { + addFormatToken(token, 0, 0, function () { + return this.localeData().meridiem(this.hours(), this.minutes(), lowercase); + }); + } + + meridiem('a', true); + meridiem('A', false); + + // ALIASES + + addUnitAlias('hour', 'h'); + + // PARSING + + function matchMeridiem (isStrict, locale) { + return locale._meridiemParse; + } + + addRegexToken('a', matchMeridiem); + addRegexToken('A', matchMeridiem); + addRegexToken('H', match1to2); + addRegexToken('h', match1to2); + addRegexToken('HH', match1to2, match2); + addRegexToken('hh', match1to2, match2); + + addParseToken(['H', 'HH'], HOUR); + addParseToken(['a', 'A'], function (input, array, config) { + config._isPm = config._locale.isPM(input); + config._meridiem = input; + }); + addParseToken(['h', 'hh'], function (input, array, config) { + array[HOUR] = toInt(input); + getParsingFlags(config).bigHour = true; + }); + + // LOCALES + + function localeIsPM (input) { + // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays + // Using charAt should be more compatible. + return ((input + '').toLowerCase().charAt(0) === 'p'); + } + + var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i; + function localeMeridiem (hours, minutes, isLower) { + if (hours > 11) { + return isLower ? 'pm' : 'PM'; + } else { + return isLower ? 'am' : 'AM'; + } + } + + + // MOMENTS + + // Setting the hour should keep the time, because the user explicitly + // specified which hour he wants. So trying to maintain the same hour (in + // a new timezone) makes sense. Adding/subtracting hours does not follow + // this rule. + var getSetHour = makeGetSet('Hours', true); + + addFormatToken('m', ['mm', 2], 0, 'minute'); + + // ALIASES + + addUnitAlias('minute', 'm'); + + // PARSING + + addRegexToken('m', match1to2); + addRegexToken('mm', match1to2, match2); + addParseToken(['m', 'mm'], MINUTE); + + // MOMENTS + + var getSetMinute = makeGetSet('Minutes', false); + + addFormatToken('s', ['ss', 2], 0, 'second'); + + // ALIASES + + addUnitAlias('second', 's'); + + // PARSING + + addRegexToken('s', match1to2); + addRegexToken('ss', match1to2, match2); + addParseToken(['s', 'ss'], SECOND); + + // MOMENTS + + var getSetSecond = makeGetSet('Seconds', false); + + addFormatToken('S', 0, 0, function () { + return ~~(this.millisecond() / 100); + }); + + addFormatToken(0, ['SS', 2], 0, function () { + return ~~(this.millisecond() / 10); + }); + + addFormatToken(0, ['SSS', 3], 0, 'millisecond'); + addFormatToken(0, ['SSSS', 4], 0, function () { + return this.millisecond() * 10; + }); + addFormatToken(0, ['SSSSS', 5], 0, function () { + return this.millisecond() * 100; + }); + addFormatToken(0, ['SSSSSS', 6], 0, function () { + return this.millisecond() * 1000; + }); + addFormatToken(0, ['SSSSSSS', 7], 0, function () { + return this.millisecond() * 10000; + }); + addFormatToken(0, ['SSSSSSSS', 8], 0, function () { + return this.millisecond() * 100000; + }); + addFormatToken(0, ['SSSSSSSSS', 9], 0, function () { + return this.millisecond() * 1000000; + }); + + + // ALIASES + + addUnitAlias('millisecond', 'ms'); + + // PARSING + + addRegexToken('S', match1to3, match1); + addRegexToken('SS', match1to3, match2); + addRegexToken('SSS', match1to3, match3); + + var token; + for (token = 'SSSS'; token.length <= 9; token += 'S') { + addRegexToken(token, matchUnsigned); + } + + function parseMs(input, array) { + array[MILLISECOND] = toInt(('0.' + input) * 1000); + } + + for (token = 'S'; token.length <= 9; token += 'S') { + addParseToken(token, parseMs); + } + // MOMENTS + + var getSetMillisecond = makeGetSet('Milliseconds', false); + + addFormatToken('z', 0, 0, 'zoneAbbr'); + addFormatToken('zz', 0, 0, 'zoneName'); + + // MOMENTS + + function getZoneAbbr () { + return this._isUTC ? 'UTC' : ''; + } + + function getZoneName () { + return this._isUTC ? 'Coordinated Universal Time' : ''; + } + + var momentPrototype__proto = Moment.prototype; + + momentPrototype__proto.add = add_subtract__add; + momentPrototype__proto.calendar = moment_calendar__calendar; + momentPrototype__proto.clone = clone; + momentPrototype__proto.diff = diff; + momentPrototype__proto.endOf = endOf; + momentPrototype__proto.format = format; + momentPrototype__proto.from = from; + momentPrototype__proto.fromNow = fromNow; + momentPrototype__proto.to = to; + momentPrototype__proto.toNow = toNow; + momentPrototype__proto.get = getSet; + momentPrototype__proto.invalidAt = invalidAt; + momentPrototype__proto.isAfter = isAfter; + momentPrototype__proto.isBefore = isBefore; + momentPrototype__proto.isBetween = isBetween; + momentPrototype__proto.isSame = isSame; + momentPrototype__proto.isValid = moment_valid__isValid; + momentPrototype__proto.lang = lang; + momentPrototype__proto.locale = locale; + momentPrototype__proto.localeData = localeData; + momentPrototype__proto.max = prototypeMax; + momentPrototype__proto.min = prototypeMin; + momentPrototype__proto.parsingFlags = parsingFlags; + momentPrototype__proto.set = getSet; + momentPrototype__proto.startOf = startOf; + momentPrototype__proto.subtract = add_subtract__subtract; + momentPrototype__proto.toArray = toArray; + momentPrototype__proto.toObject = toObject; + momentPrototype__proto.toDate = toDate; + momentPrototype__proto.toISOString = moment_format__toISOString; + momentPrototype__proto.toJSON = moment_format__toISOString; + momentPrototype__proto.toString = toString; + momentPrototype__proto.unix = unix; + momentPrototype__proto.valueOf = to_type__valueOf; + + // Year + momentPrototype__proto.year = getSetYear; + momentPrototype__proto.isLeapYear = getIsLeapYear; + + // Week Year + momentPrototype__proto.weekYear = getSetWeekYear; + momentPrototype__proto.isoWeekYear = getSetISOWeekYear; + + // Quarter + momentPrototype__proto.quarter = momentPrototype__proto.quarters = getSetQuarter; + + // Month + momentPrototype__proto.month = getSetMonth; + momentPrototype__proto.daysInMonth = getDaysInMonth; + + // Week + momentPrototype__proto.week = momentPrototype__proto.weeks = getSetWeek; + momentPrototype__proto.isoWeek = momentPrototype__proto.isoWeeks = getSetISOWeek; + momentPrototype__proto.weeksInYear = getWeeksInYear; + momentPrototype__proto.isoWeeksInYear = getISOWeeksInYear; + + // Day + momentPrototype__proto.date = getSetDayOfMonth; + momentPrototype__proto.day = momentPrototype__proto.days = getSetDayOfWeek; + momentPrototype__proto.weekday = getSetLocaleDayOfWeek; + momentPrototype__proto.isoWeekday = getSetISODayOfWeek; + momentPrototype__proto.dayOfYear = getSetDayOfYear; + + // Hour + momentPrototype__proto.hour = momentPrototype__proto.hours = getSetHour; + + // Minute + momentPrototype__proto.minute = momentPrototype__proto.minutes = getSetMinute; + + // Second + momentPrototype__proto.second = momentPrototype__proto.seconds = getSetSecond; + + // Millisecond + momentPrototype__proto.millisecond = momentPrototype__proto.milliseconds = getSetMillisecond; + + // Offset + momentPrototype__proto.utcOffset = getSetOffset; + momentPrototype__proto.utc = setOffsetToUTC; + momentPrototype__proto.local = setOffsetToLocal; + momentPrototype__proto.parseZone = setOffsetToParsedOffset; + momentPrototype__proto.hasAlignedHourOffset = hasAlignedHourOffset; + momentPrototype__proto.isDST = isDaylightSavingTime; + momentPrototype__proto.isDSTShifted = isDaylightSavingTimeShifted; + momentPrototype__proto.isLocal = isLocal; + momentPrototype__proto.isUtcOffset = isUtcOffset; + momentPrototype__proto.isUtc = isUtc; + momentPrototype__proto.isUTC = isUtc; + + // Timezone + momentPrototype__proto.zoneAbbr = getZoneAbbr; + momentPrototype__proto.zoneName = getZoneName; + + // Deprecations + momentPrototype__proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth); + momentPrototype__proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth); + momentPrototype__proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear); + momentPrototype__proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779', getSetZone); + + var momentPrototype = momentPrototype__proto; + + function moment__createUnix (input) { + return local__createLocal(input * 1000); + } + + function moment__createInZone () { + return local__createLocal.apply(null, arguments).parseZone(); + } + + var defaultCalendar = { + sameDay : '[Today at] LT', + nextDay : '[Tomorrow at] LT', + nextWeek : 'dddd [at] LT', + lastDay : '[Yesterday at] LT', + lastWeek : '[Last] dddd [at] LT', + sameElse : 'L' + }; + + function locale_calendar__calendar (key, mom, now) { + var output = this._calendar[key]; + return typeof output === 'function' ? output.call(mom, now) : output; + } + + var defaultLongDateFormat = { + LTS : 'h:mm:ss A', + LT : 'h:mm A', + L : 'MM/DD/YYYY', + LL : 'MMMM D, YYYY', + LLL : 'MMMM D, YYYY h:mm A', + LLLL : 'dddd, MMMM D, YYYY h:mm A' + }; + + function longDateFormat (key) { + var format = this._longDateFormat[key], + formatUpper = this._longDateFormat[key.toUpperCase()]; + + if (format || !formatUpper) { + return format; + } + + this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) { + return val.slice(1); + }); + + return this._longDateFormat[key]; + } + + var defaultInvalidDate = 'Invalid date'; + + function invalidDate () { + return this._invalidDate; + } + + var defaultOrdinal = '%d'; + var defaultOrdinalParse = /\d{1,2}/; + + function ordinal (number) { + return this._ordinal.replace('%d', number); + } + + function preParsePostFormat (string) { + return string; + } + + var defaultRelativeTime = { + future : 'in %s', + past : '%s ago', + s : 'a few seconds', + m : 'a minute', + mm : '%d minutes', + h : 'an hour', + hh : '%d hours', + d : 'a day', + dd : '%d days', + M : 'a month', + MM : '%d months', + y : 'a year', + yy : '%d years' + }; + + function relative__relativeTime (number, withoutSuffix, string, isFuture) { + var output = this._relativeTime[string]; + return (typeof output === 'function') ? + output(number, withoutSuffix, string, isFuture) : + output.replace(/%d/i, number); + } + + function pastFuture (diff, output) { + var format = this._relativeTime[diff > 0 ? 'future' : 'past']; + return typeof format === 'function' ? format(output) : format.replace(/%s/i, output); + } + + function locale_set__set (config) { + var prop, i; + for (i in config) { + prop = config[i]; + if (typeof prop === 'function') { + this[i] = prop; + } else { + this['_' + i] = prop; + } + } + // Lenient ordinal parsing accepts just a number in addition to + // number + (possibly) stuff coming from _ordinalParseLenient. + this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source); + } + + var prototype__proto = Locale.prototype; + + prototype__proto._calendar = defaultCalendar; + prototype__proto.calendar = locale_calendar__calendar; + prototype__proto._longDateFormat = defaultLongDateFormat; + prototype__proto.longDateFormat = longDateFormat; + prototype__proto._invalidDate = defaultInvalidDate; + prototype__proto.invalidDate = invalidDate; + prototype__proto._ordinal = defaultOrdinal; + prototype__proto.ordinal = ordinal; + prototype__proto._ordinalParse = defaultOrdinalParse; + prototype__proto.preparse = preParsePostFormat; + prototype__proto.postformat = preParsePostFormat; + prototype__proto._relativeTime = defaultRelativeTime; + prototype__proto.relativeTime = relative__relativeTime; + prototype__proto.pastFuture = pastFuture; + prototype__proto.set = locale_set__set; + + // Month + prototype__proto.months = localeMonths; + prototype__proto._months = defaultLocaleMonths; + prototype__proto.monthsShort = localeMonthsShort; + prototype__proto._monthsShort = defaultLocaleMonthsShort; + prototype__proto.monthsParse = localeMonthsParse; + + // Week + prototype__proto.week = localeWeek; + prototype__proto._week = defaultLocaleWeek; + prototype__proto.firstDayOfYear = localeFirstDayOfYear; + prototype__proto.firstDayOfWeek = localeFirstDayOfWeek; + + // Day of Week + prototype__proto.weekdays = localeWeekdays; + prototype__proto._weekdays = defaultLocaleWeekdays; + prototype__proto.weekdaysMin = localeWeekdaysMin; + prototype__proto._weekdaysMin = defaultLocaleWeekdaysMin; + prototype__proto.weekdaysShort = localeWeekdaysShort; + prototype__proto._weekdaysShort = defaultLocaleWeekdaysShort; + prototype__proto.weekdaysParse = localeWeekdaysParse; + + // Hours + prototype__proto.isPM = localeIsPM; + prototype__proto._meridiemParse = defaultLocaleMeridiemParse; + prototype__proto.meridiem = localeMeridiem; + + function lists__get (format, index, field, setter) { + var locale = locale_locales__getLocale(); + var utc = create_utc__createUTC().set(setter, index); + return locale[field](utc, format); + } + + function list (format, index, field, count, setter) { + if (typeof format === 'number') { + index = format; + format = undefined; + } + + format = format || ''; + + if (index != null) { + return lists__get(format, index, field, setter); + } + + var i; + var out = []; + for (i = 0; i < count; i++) { + out[i] = lists__get(format, i, field, setter); + } + return out; + } + + function lists__listMonths (format, index) { + return list(format, index, 'months', 12, 'month'); + } + + function lists__listMonthsShort (format, index) { + return list(format, index, 'monthsShort', 12, 'month'); + } + + function lists__listWeekdays (format, index) { + return list(format, index, 'weekdays', 7, 'day'); + } + + function lists__listWeekdaysShort (format, index) { + return list(format, index, 'weekdaysShort', 7, 'day'); + } + + function lists__listWeekdaysMin (format, index) { + return list(format, index, 'weekdaysMin', 7, 'day'); + } + + locale_locales__getSetGlobalLocale('en', { + ordinalParse: /\d{1,2}(th|st|nd|rd)/, + ordinal : function (number) { + var b = number % 10, + output = (toInt(number % 100 / 10) === 1) ? 'th' : + (b === 1) ? 'st' : + (b === 2) ? 'nd' : + (b === 3) ? 'rd' : 'th'; + return number + output; + } + }); + + // Side effect imports + utils_hooks__hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', locale_locales__getSetGlobalLocale); + utils_hooks__hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', locale_locales__getLocale); + + var mathAbs = Math.abs; + + function duration_abs__abs () { + var data = this._data; + + this._milliseconds = mathAbs(this._milliseconds); + this._days = mathAbs(this._days); + this._months = mathAbs(this._months); + + data.milliseconds = mathAbs(data.milliseconds); + data.seconds = mathAbs(data.seconds); + data.minutes = mathAbs(data.minutes); + data.hours = mathAbs(data.hours); + data.months = mathAbs(data.months); + data.years = mathAbs(data.years); + + return this; + } + + function duration_add_subtract__addSubtract (duration, input, value, direction) { + var other = create__createDuration(input, value); + + duration._milliseconds += direction * other._milliseconds; + duration._days += direction * other._days; + duration._months += direction * other._months; + + return duration._bubble(); + } + + // supports only 2.0-style add(1, 's') or add(duration) + function duration_add_subtract__add (input, value) { + return duration_add_subtract__addSubtract(this, input, value, 1); + } + + // supports only 2.0-style subtract(1, 's') or subtract(duration) + function duration_add_subtract__subtract (input, value) { + return duration_add_subtract__addSubtract(this, input, value, -1); + } + + function absCeil (number) { + if (number < 0) { + return Math.floor(number); + } else { + return Math.ceil(number); + } + } + + function bubble () { + var milliseconds = this._milliseconds; + var days = this._days; + var months = this._months; + var data = this._data; + var seconds, minutes, hours, years, monthsFromDays; + + // if we have a mix of positive and negative values, bubble down first + // check: https://github.com/moment/moment/issues/2166 + if (!((milliseconds >= 0 && days >= 0 && months >= 0) || + (milliseconds <= 0 && days <= 0 && months <= 0))) { + milliseconds += absCeil(monthsToDays(months) + days) * 864e5; + days = 0; + months = 0; + } + + // The following code bubbles up values, see the tests for + // examples of what that means. + data.milliseconds = milliseconds % 1000; + + seconds = absFloor(milliseconds / 1000); + data.seconds = seconds % 60; + + minutes = absFloor(seconds / 60); + data.minutes = minutes % 60; + + hours = absFloor(minutes / 60); + data.hours = hours % 24; + + days += absFloor(hours / 24); + + // convert days to months + monthsFromDays = absFloor(daysToMonths(days)); + months += monthsFromDays; + days -= absCeil(monthsToDays(monthsFromDays)); + + // 12 months -> 1 year + years = absFloor(months / 12); + months %= 12; + + data.days = days; + data.months = months; + data.years = years; + + return this; + } + + function daysToMonths (days) { + // 400 years have 146097 days (taking into account leap year rules) + // 400 years have 12 months === 4800 + return days * 4800 / 146097; + } + + function monthsToDays (months) { + // the reverse of daysToMonths + return months * 146097 / 4800; + } + + function as (units) { + var days; + var months; + var milliseconds = this._milliseconds; + + units = normalizeUnits(units); + + if (units === 'month' || units === 'year') { + days = this._days + milliseconds / 864e5; + months = this._months + daysToMonths(days); + return units === 'month' ? months : months / 12; + } else { + // handle milliseconds separately because of floating point math errors (issue #1867) + days = this._days + Math.round(monthsToDays(this._months)); + switch (units) { + case 'week' : return days / 7 + milliseconds / 6048e5; + case 'day' : return days + milliseconds / 864e5; + case 'hour' : return days * 24 + milliseconds / 36e5; + case 'minute' : return days * 1440 + milliseconds / 6e4; + case 'second' : return days * 86400 + milliseconds / 1000; + // Math.floor prevents floating point math errors here + case 'millisecond': return Math.floor(days * 864e5) + milliseconds; + default: throw new Error('Unknown unit ' + units); + } + } + } + + // TODO: Use this.as('ms')? + function duration_as__valueOf () { + return ( + this._milliseconds + + this._days * 864e5 + + (this._months % 12) * 2592e6 + + toInt(this._months / 12) * 31536e6 + ); + } + + function makeAs (alias) { + return function () { + return this.as(alias); + }; + } + + var asMilliseconds = makeAs('ms'); + var asSeconds = makeAs('s'); + var asMinutes = makeAs('m'); + var asHours = makeAs('h'); + var asDays = makeAs('d'); + var asWeeks = makeAs('w'); + var asMonths = makeAs('M'); + var asYears = makeAs('y'); + + function duration_get__get (units) { + units = normalizeUnits(units); + return this[units + 's'](); + } + + function makeGetter(name) { + return function () { + return this._data[name]; + }; + } + + var milliseconds = makeGetter('milliseconds'); + var seconds = makeGetter('seconds'); + var minutes = makeGetter('minutes'); + var hours = makeGetter('hours'); + var days = makeGetter('days'); + var months = makeGetter('months'); + var years = makeGetter('years'); + + function weeks () { + return absFloor(this.days() / 7); + } + + var round = Math.round; + var thresholds = { + s: 45, // seconds to minute + m: 45, // minutes to hour + h: 22, // hours to day + d: 26, // days to month + M: 11 // months to year + }; + + // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize + function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { + return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); + } + + function duration_humanize__relativeTime (posNegDuration, withoutSuffix, locale) { + var duration = create__createDuration(posNegDuration).abs(); + var seconds = round(duration.as('s')); + var minutes = round(duration.as('m')); + var hours = round(duration.as('h')); + var days = round(duration.as('d')); + var months = round(duration.as('M')); + var years = round(duration.as('y')); + + var a = seconds < thresholds.s && ['s', seconds] || + minutes === 1 && ['m'] || + minutes < thresholds.m && ['mm', minutes] || + hours === 1 && ['h'] || + hours < thresholds.h && ['hh', hours] || + days === 1 && ['d'] || + days < thresholds.d && ['dd', days] || + months === 1 && ['M'] || + months < thresholds.M && ['MM', months] || + years === 1 && ['y'] || ['yy', years]; + + a[2] = withoutSuffix; + a[3] = +posNegDuration > 0; + a[4] = locale; + return substituteTimeAgo.apply(null, a); + } + + // This function allows you to set a threshold for relative time strings + function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) { + if (thresholds[threshold] === undefined) { + return false; + } + if (limit === undefined) { + return thresholds[threshold]; + } + thresholds[threshold] = limit; + return true; + } + + function humanize (withSuffix) { + var locale = this.localeData(); + var output = duration_humanize__relativeTime(this, !withSuffix, locale); + + if (withSuffix) { + output = locale.pastFuture(+this, output); + } + + return locale.postformat(output); + } + + var iso_string__abs = Math.abs; + + function iso_string__toISOString() { + // for ISO strings we do not use the normal bubbling rules: + // * milliseconds bubble up until they become hours + // * days do not bubble at all + // * months bubble up until they become years + // This is because there is no context-free conversion between hours and days + // (think of clock changes) + // and also not between days and months (28-31 days per month) + var seconds = iso_string__abs(this._milliseconds) / 1000; + var days = iso_string__abs(this._days); + var months = iso_string__abs(this._months); + var minutes, hours, years; + + // 3600 seconds -> 60 minutes -> 1 hour + minutes = absFloor(seconds / 60); + hours = absFloor(minutes / 60); + seconds %= 60; + minutes %= 60; + + // 12 months -> 1 year + years = absFloor(months / 12); + months %= 12; + + + // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js + var Y = years; + var M = months; + var D = days; + var h = hours; + var m = minutes; + var s = seconds; + var total = this.asSeconds(); + + if (!total) { + // this is the same as C#'s (Noda) and python (isodate)... + // but not other JS (goog.date) + return 'P0D'; + } + + return (total < 0 ? '-' : '') + + 'P' + + (Y ? Y + 'Y' : '') + + (M ? M + 'M' : '') + + (D ? D + 'D' : '') + + ((h || m || s) ? 'T' : '') + + (h ? h + 'H' : '') + + (m ? m + 'M' : '') + + (s ? s + 'S' : ''); + } + + var duration_prototype__proto = Duration.prototype; + + duration_prototype__proto.abs = duration_abs__abs; + duration_prototype__proto.add = duration_add_subtract__add; + duration_prototype__proto.subtract = duration_add_subtract__subtract; + duration_prototype__proto.as = as; + duration_prototype__proto.asMilliseconds = asMilliseconds; + duration_prototype__proto.asSeconds = asSeconds; + duration_prototype__proto.asMinutes = asMinutes; + duration_prototype__proto.asHours = asHours; + duration_prototype__proto.asDays = asDays; + duration_prototype__proto.asWeeks = asWeeks; + duration_prototype__proto.asMonths = asMonths; + duration_prototype__proto.asYears = asYears; + duration_prototype__proto.valueOf = duration_as__valueOf; + duration_prototype__proto._bubble = bubble; + duration_prototype__proto.get = duration_get__get; + duration_prototype__proto.milliseconds = milliseconds; + duration_prototype__proto.seconds = seconds; + duration_prototype__proto.minutes = minutes; + duration_prototype__proto.hours = hours; + duration_prototype__proto.days = days; + duration_prototype__proto.weeks = weeks; + duration_prototype__proto.months = months; + duration_prototype__proto.years = years; + duration_prototype__proto.humanize = humanize; + duration_prototype__proto.toISOString = iso_string__toISOString; + duration_prototype__proto.toString = iso_string__toISOString; + duration_prototype__proto.toJSON = iso_string__toISOString; + duration_prototype__proto.locale = locale; + duration_prototype__proto.localeData = localeData; + + // Deprecations + duration_prototype__proto.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', iso_string__toISOString); + duration_prototype__proto.lang = lang; + + // Side effect imports + + addFormatToken('X', 0, 0, 'unix'); + addFormatToken('x', 0, 0, 'valueOf'); + + // PARSING + + addRegexToken('x', matchSigned); + addRegexToken('X', matchTimestamp); + addParseToken('X', function (input, array, config) { + config._d = new Date(parseFloat(input, 10) * 1000); + }); + addParseToken('x', function (input, array, config) { + config._d = new Date(toInt(input)); + }); + + // Side effect imports + + + utils_hooks__hooks.version = '2.10.6'; + + setHookCallback(local__createLocal); + + utils_hooks__hooks.fn = momentPrototype; + utils_hooks__hooks.min = min; + utils_hooks__hooks.max = max; + utils_hooks__hooks.utc = create_utc__createUTC; + utils_hooks__hooks.unix = moment__createUnix; + utils_hooks__hooks.months = lists__listMonths; + utils_hooks__hooks.isDate = isDate; + utils_hooks__hooks.locale = locale_locales__getSetGlobalLocale; + utils_hooks__hooks.invalid = valid__createInvalid; + utils_hooks__hooks.duration = create__createDuration; + utils_hooks__hooks.isMoment = isMoment; + utils_hooks__hooks.weekdays = lists__listWeekdays; + utils_hooks__hooks.parseZone = moment__createInZone; + utils_hooks__hooks.localeData = locale_locales__getLocale; + utils_hooks__hooks.isDuration = isDuration; + utils_hooks__hooks.monthsShort = lists__listMonthsShort; + utils_hooks__hooks.weekdaysMin = lists__listWeekdaysMin; + utils_hooks__hooks.defineLocale = defineLocale; + utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort; + utils_hooks__hooks.normalizeUnits = normalizeUnits; + utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold; + + var _moment = utils_hooks__hooks; + + return _moment; + +})); +},{}],"numeral":[function(require,module,exports){ +"use strict"; +(function() { + var numeral, + VERSION = '1.5.3', + languages = {}, + currentLanguage = 'en', + zeroFormat = null, + defaultFormat = '0,0', + hasModule = (typeof module !== 'undefined' && module.exports); + function Numeral(number) { + this._value = number; + } + function toFixed(value, precision, roundingFunction, optionals) { + var power = Math.pow(10, precision), + optionalsRegExp, + output; + output = (roundingFunction(value * power) / power).toFixed(precision); + if (optionals) { + optionalsRegExp = new RegExp('0{1,' + optionals + '}$'); + output = output.replace(optionalsRegExp, ''); + } + return output; + } + function formatNumeral(n, format, roundingFunction) { + var output; + if (format.indexOf('$') > -1) { + output = formatCurrency(n, format, roundingFunction); + } else if (format.indexOf('%') > -1) { + output = formatPercentage(n, format, roundingFunction); + } else if (format.indexOf(':') > -1) { + output = formatTime(n, format); + } else { + output = formatNumber(n._value, format, roundingFunction); + } + return output; + } + function unformatNumeral(n, string) { + var stringOriginal = string, + thousandRegExp, + millionRegExp, + billionRegExp, + trillionRegExp, + suffixes = ['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], + bytesMultiplier = false, + power; + if (string.indexOf(':') > -1) { + n._value = unformatTime(string); + } else { + if (string === zeroFormat) { + n._value = 0; + } else { + if (languages[currentLanguage].delimiters.decimal !== '.') { + string = string.replace(/\./g, '').replace(languages[currentLanguage].delimiters.decimal, '.'); + } + thousandRegExp = new RegExp('[^a-zA-Z]' + languages[currentLanguage].abbreviations.thousand + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$'); + millionRegExp = new RegExp('[^a-zA-Z]' + languages[currentLanguage].abbreviations.million + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$'); + billionRegExp = new RegExp('[^a-zA-Z]' + languages[currentLanguage].abbreviations.billion + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$'); + trillionRegExp = new RegExp('[^a-zA-Z]' + languages[currentLanguage].abbreviations.trillion + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$'); + for (power = 0; power <= suffixes.length; power++) { + bytesMultiplier = (string.indexOf(suffixes[power]) > -1) ? Math.pow(1024, power + 1) : false; + if (bytesMultiplier) { + break; + } + } + n._value = ((bytesMultiplier) ? bytesMultiplier : 1) * ((stringOriginal.match(thousandRegExp)) ? Math.pow(10, 3) : 1) * ((stringOriginal.match(millionRegExp)) ? Math.pow(10, 6) : 1) * ((stringOriginal.match(billionRegExp)) ? Math.pow(10, 9) : 1) * ((stringOriginal.match(trillionRegExp)) ? Math.pow(10, 12) : 1) * ((string.indexOf('%') > -1) ? 0.01 : 1) * (((string.split('-').length + Math.min(string.split('(').length - 1, string.split(')').length - 1)) % 2) ? 1 : -1) * Number(string.replace(/[^0-9\.]+/g, '')); + n._value = (bytesMultiplier) ? Math.ceil(n._value) : n._value; + } + } + return n._value; + } + function formatCurrency(n, format, roundingFunction) { + var symbolIndex = format.indexOf('$'), + openParenIndex = format.indexOf('('), + minusSignIndex = format.indexOf('-'), + space = '', + spliceIndex, + output; + if (format.indexOf(' $') > -1) { + space = ' '; + format = format.replace(' $', ''); + } else if (format.indexOf('$ ') > -1) { + space = ' '; + format = format.replace('$ ', ''); + } else { + format = format.replace('$', ''); + } + output = formatNumber(n._value, format, roundingFunction); + if (symbolIndex <= 1) { + if (output.indexOf('(') > -1 || output.indexOf('-') > -1) { + output = output.split(''); + spliceIndex = 1; + if (symbolIndex < openParenIndex || symbolIndex < minusSignIndex) { + spliceIndex = 0; + } + output.splice(spliceIndex, 0, languages[currentLanguage].currency.symbol + space); + output = output.join(''); + } else { + output = languages[currentLanguage].currency.symbol + space + output; + } + } else { + if (output.indexOf(')') > -1) { + output = output.split(''); + output.splice(-1, 0, space + languages[currentLanguage].currency.symbol); + output = output.join(''); + } else { + output = output + space + languages[currentLanguage].currency.symbol; + } + } + return output; + } + function formatPercentage(n, format, roundingFunction) { + var space = '', + output, + value = n._value * 100; + if (format.indexOf(' %') > -1) { + space = ' '; + format = format.replace(' %', ''); + } else { + format = format.replace('%', ''); + } + output = formatNumber(value, format, roundingFunction); + if (output.indexOf(')') > -1) { + output = output.split(''); + output.splice(-1, 0, space + '%'); + output = output.join(''); + } else { + output = output + space + '%'; + } + return output; + } + function formatTime(n) { + var hours = Math.floor(n._value / 60 / 60), + minutes = Math.floor((n._value - (hours * 60 * 60)) / 60), + seconds = Math.round(n._value - (hours * 60 * 60) - (minutes * 60)); + return hours + ':' + ((minutes < 10) ? '0' + minutes : minutes) + ':' + ((seconds < 10) ? '0' + seconds : seconds); + } + function unformatTime(string) { + var timeArray = string.split(':'), + seconds = 0; + if (timeArray.length === 3) { + seconds = seconds + (Number(timeArray[0]) * 60 * 60); + seconds = seconds + (Number(timeArray[1]) * 60); + seconds = seconds + Number(timeArray[2]); + } else if (timeArray.length === 2) { + seconds = seconds + (Number(timeArray[0]) * 60); + seconds = seconds + Number(timeArray[1]); + } + return Number(seconds); + } + function formatNumber(value, format, roundingFunction) { + var negP = false, + signed = false, + optDec = false, + abbr = '', + abbrK = false, + abbrM = false, + abbrB = false, + abbrT = false, + abbrForce = false, + bytes = '', + ord = '', + abs = Math.abs(value), + suffixes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], + min, + max, + power, + w, + precision, + thousands, + d = '', + neg = false; + if (value === 0 && zeroFormat !== null) { + return zeroFormat; + } else { + if (format.indexOf('(') > -1) { + negP = true; + format = format.slice(1, -1); + } else if (format.indexOf('+') > -1) { + signed = true; + format = format.replace(/\+/g, ''); + } + if (format.indexOf('a') > -1) { + abbrK = format.indexOf('aK') >= 0; + abbrM = format.indexOf('aM') >= 0; + abbrB = format.indexOf('aB') >= 0; + abbrT = format.indexOf('aT') >= 0; + abbrForce = abbrK || abbrM || abbrB || abbrT; + if (format.indexOf(' a') > -1) { + abbr = ' '; + format = format.replace(' a', ''); + } else { + format = format.replace('a', ''); + } + if (abs >= Math.pow(10, 12) && !abbrForce || abbrT) { + abbr = abbr + languages[currentLanguage].abbreviations.trillion; + value = value / Math.pow(10, 12); + } else if (abs < Math.pow(10, 12) && abs >= Math.pow(10, 9) && !abbrForce || abbrB) { + abbr = abbr + languages[currentLanguage].abbreviations.billion; + value = value / Math.pow(10, 9); + } else if (abs < Math.pow(10, 9) && abs >= Math.pow(10, 6) && !abbrForce || abbrM) { + abbr = abbr + languages[currentLanguage].abbreviations.million; + value = value / Math.pow(10, 6); + } else if (abs < Math.pow(10, 6) && abs >= Math.pow(10, 3) && !abbrForce || abbrK) { + abbr = abbr + languages[currentLanguage].abbreviations.thousand; + value = value / Math.pow(10, 3); + } + } + if (format.indexOf('b') > -1) { + if (format.indexOf(' b') > -1) { + bytes = ' '; + format = format.replace(' b', ''); + } else { + format = format.replace('b', ''); + } + for (power = 0; power <= suffixes.length; power++) { + min = Math.pow(1024, power); + max = Math.pow(1024, power + 1); + if (value >= min && value < max) { + bytes = bytes + suffixes[power]; + if (min > 0) { + value = value / min; + } + break; + } + } + } + if (format.indexOf('o') > -1) { + if (format.indexOf(' o') > -1) { + ord = ' '; + format = format.replace(' o', ''); + } else { + format = format.replace('o', ''); + } + ord = ord + languages[currentLanguage].ordinal(value); + } + if (format.indexOf('[.]') > -1) { + optDec = true; + format = format.replace('[.]', '.'); + } + w = value.toString().split('.')[0]; + precision = format.split('.')[1]; + thousands = format.indexOf(','); + if (precision) { + if (precision.indexOf('[') > -1) { + precision = precision.replace(']', ''); + precision = precision.split('['); + d = toFixed(value, (precision[0].length + precision[1].length), roundingFunction, precision[1].length); + } else { + d = toFixed(value, precision.length, roundingFunction); + } + w = d.split('.')[0]; + if (d.split('.')[1].length) { + d = languages[currentLanguage].delimiters.decimal + d.split('.')[1]; + } else { + d = ''; + } + if (optDec && Number(d.slice(1)) === 0) { + d = ''; + } + } else { + w = toFixed(value, null, roundingFunction); + } + if (w.indexOf('-') > -1) { + w = w.slice(1); + neg = true; + } + if (thousands > -1) { + w = w.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1' + languages[currentLanguage].delimiters.thousands); + } + if (format.indexOf('.') === 0) { + w = ''; + } + return ((negP && neg) ? '(' : '') + ((!negP && neg) ? '-' : '') + ((!neg && signed) ? '+' : '') + w + d + ((ord) ? ord : '') + ((abbr) ? abbr : '') + ((bytes) ? bytes : '') + ((negP && neg) ? ')' : ''); + } + } + numeral = function(input) { + if (numeral.isNumeral(input)) { + input = input.value(); + } else if (input === 0 || typeof input === 'undefined') { + input = 0; + } else if (!Number(input)) { + input = numeral.fn.unformat(input); + } + return new Numeral(Number(input)); + }; + numeral.version = VERSION; + numeral.isNumeral = function(obj) { + return obj instanceof Numeral; + }; + numeral.language = function(key, values) { + if (!key) { + return currentLanguage; + } + if (key && !values) { + if (!languages[key]) { + throw new Error('Unknown language : ' + key); + } + currentLanguage = key; + } + if (values || !languages[key]) { + loadLanguage(key, values); + } + return numeral; + }; + numeral.languageData = function(key) { + if (!key) { + return languages[currentLanguage]; + } + if (!languages[key]) { + throw new Error('Unknown language : ' + key); + } + return languages[key]; + }; + numeral.language('en', { + delimiters: { + thousands: ',', + decimal: '.' + }, + abbreviations: { + thousand: 'k', + million: 'm', + billion: 'b', + trillion: 't' + }, + ordinal: function(number) { + var b = number % 10; + return (~~(number % 100 / 10) === 1) ? 'th' : (b === 1) ? 'st' : (b === 2) ? 'nd' : (b === 3) ? 'rd' : 'th'; + }, + currency: {symbol: '$'} + }); + numeral.zeroFormat = function(format) { + zeroFormat = typeof(format) === 'string' ? format : null; + }; + numeral.defaultFormat = function(format) { + defaultFormat = typeof(format) === 'string' ? format : '0.0'; + }; + numeral.validate = function(val, culture) { + var _decimalSep, + _thousandSep, + _currSymbol, + _valArray, + _abbrObj, + _thousandRegEx, + languageData, + temp; + if (typeof val !== 'string') { + val += ''; + if (console.warn) { + console.warn('Numeral.js: Value is not string. It has been co-erced to: ', val); + } + } + val = val.trim(); + if (val === '') { + return false; + } + val = val.replace(/^[+-]?/, ''); + try { + languageData = numeral.languageData(culture); + } catch (e) { + languageData = numeral.languageData(numeral.language()); + } + _currSymbol = languageData.currency.symbol; + _abbrObj = languageData.abbreviations; + _decimalSep = languageData.delimiters.decimal; + if (languageData.delimiters.thousands === '.') { + _thousandSep = '\\.'; + } else { + _thousandSep = languageData.delimiters.thousands; + } + temp = val.match(/^[^\d\.\,]+/); + if (temp !== null) { + val = val.substr(1); + if (temp[0] !== _currSymbol) { + return false; + } + } + temp = val.match(/[^\d]+$/); + if (temp !== null) { + val = val.slice(0, -1); + if (temp[0] !== _abbrObj.thousand && temp[0] !== _abbrObj.million && temp[0] !== _abbrObj.billion && temp[0] !== _abbrObj.trillion) { + return false; + } + } + if (!!val.match(/^\d+$/)) { + return true; + } + _thousandRegEx = new RegExp(_thousandSep + '{2}'); + if (!val.match(/[^\d.,]/g)) { + _valArray = val.split(_decimalSep); + if (_valArray.length > 2) { + return false; + } else { + if (_valArray.length < 2) { + return (!!_valArray[0].match(/^\d+.*\d$/) && !_valArray[0].match(_thousandRegEx)); + } else { + if (_valArray[0] === '') { + return (!_valArray[0].match(_thousandRegEx) && !!_valArray[1].match(/^\d+$/)); + } else if (_valArray[0].length === 1) { + return (!!_valArray[0].match(/^\d+$/) && !_valArray[0].match(_thousandRegEx) && !!_valArray[1].match(/^\d+$/)); + } else { + return (!!_valArray[0].match(/^\d+.*\d$/) && !_valArray[0].match(_thousandRegEx) && !!_valArray[1].match(/^\d+$/)); + } + } + } + } + return false; + }; + function loadLanguage(key, values) { + languages[key] = values; + } + if ('function' !== typeof Array.prototype.reduce) { + Array.prototype.reduce = function(callback, opt_initialValue) { + 'use strict'; + if (null === this || 'undefined' === typeof this) { + throw new TypeError('Array.prototype.reduce called on null or undefined'); + } + if ('function' !== typeof callback) { + throw new TypeError(callback + ' is not a function'); + } + var index, + value, + length = this.length >>> 0, + isValueSet = false; + if (1 < arguments.length) { + value = opt_initialValue; + isValueSet = true; + } + for (index = 0; length > index; ++index) { + if (this.hasOwnProperty(index)) { + if (isValueSet) { + value = callback(value, this[index], index, this); + } else { + value = this[index]; + isValueSet = true; + } + } + } + if (!isValueSet) { + throw new TypeError('Reduce of empty array with no initial value'); + } + return value; + }; + } + function multiplier(x) { + var parts = x.toString().split('.'); + if (parts.length < 2) { + return 1; + } + return Math.pow(10, parts[1].length); + } + function correctionFactor() { + var args = Array.prototype.slice.call(arguments); + return args.reduce(function(prev, next) { + var mp = multiplier(prev), + mn = multiplier(next); + return mp > mn ? mp : mn; + }, -Infinity); + } + numeral.fn = Numeral.prototype = { + clone: function() { + return numeral(this); + }, + format: function(inputString, roundingFunction) { + return formatNumeral(this, inputString ? inputString : defaultFormat, (roundingFunction !== undefined) ? roundingFunction : Math.round); + }, + unformat: function(inputString) { + if (Object.prototype.toString.call(inputString) === '[object Number]') { + return inputString; + } + return unformatNumeral(this, inputString ? inputString : defaultFormat); + }, + value: function() { + return this._value; + }, + valueOf: function() { + return this._value; + }, + set: function(value) { + this._value = Number(value); + return this; + }, + add: function(value) { + var corrFactor = correctionFactor.call(null, this._value, value); + function cback(accum, curr, currI, O) { + return accum + corrFactor * curr; + } + this._value = [this._value, value].reduce(cback, 0) / corrFactor; + return this; + }, + subtract: function(value) { + var corrFactor = correctionFactor.call(null, this._value, value); + function cback(accum, curr, currI, O) { + return accum - corrFactor * curr; + } + this._value = [value].reduce(cback, this._value * corrFactor) / corrFactor; + return this; + }, + multiply: function(value) { + function cback(accum, curr, currI, O) { + var corrFactor = correctionFactor(accum, curr); + return (accum * corrFactor) * (curr * corrFactor) / (corrFactor * corrFactor); + } + this._value = [this._value, value].reduce(cback, 1); + return this; + }, + divide: function(value) { + function cback(accum, curr, currI, O) { + var corrFactor = correctionFactor(accum, curr); + return (accum * corrFactor) / (curr * corrFactor); + } + this._value = [this._value, value].reduce(cback); + return this; + }, + difference: function(value) { + return Math.abs(numeral(this._value).subtract(value).value()); + } + }; + if (hasModule) { + module.exports = numeral; + } + if (typeof ender === 'undefined') { + this['numeral'] = numeral; + } + if (typeof define === 'function' && define.amd) { + define([], function() { + return numeral; + }); + } +}).call(window); + +//# +},{}],"pikaday":[function(require,module,exports){ +/*! + * Pikaday + * + * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday + */ + +(function (root, factory) +{ + 'use strict'; + + var moment; + if (typeof exports === 'object') { + // CommonJS module + // Load moment.js as an optional dependency + try { moment = require('moment'); } catch (e) {} + module.exports = factory(moment); + } else if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(function (req) + { + // Load moment.js as an optional dependency + var id = 'moment'; + try { moment = req(id); } catch (e) {} + return factory(moment); + }); + } else { + root.Pikaday = factory(root.moment); + } +}(this, function (moment) +{ + 'use strict'; + + /** + * feature detection and helper functions + */ + var hasMoment = typeof moment === 'function', + + hasEventListeners = !!window.addEventListener, + + document = window.document, + + sto = window.setTimeout, + + addEvent = function(el, e, callback, capture) + { + if (hasEventListeners) { + el.addEventListener(e, callback, !!capture); + } else { + el.attachEvent('on' + e, callback); + } + }, + + removeEvent = function(el, e, callback, capture) + { + if (hasEventListeners) { + el.removeEventListener(e, callback, !!capture); + } else { + el.detachEvent('on' + e, callback); + } + }, + + fireEvent = function(el, eventName, data) + { + var ev; + + if (document.createEvent) { + ev = document.createEvent('HTMLEvents'); + ev.initEvent(eventName, true, false); + ev = extend(ev, data); + el.dispatchEvent(ev); + } else if (document.createEventObject) { + ev = document.createEventObject(); + ev = extend(ev, data); + el.fireEvent('on' + eventName, ev); + } + }, + + trim = function(str) + { + return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g,''); + }, + + hasClass = function(el, cn) + { + return (' ' + el.className + ' ').indexOf(' ' + cn + ' ') !== -1; + }, + + addClass = function(el, cn) + { + if (!hasClass(el, cn)) { + el.className = (el.className === '') ? cn : el.className + ' ' + cn; + } + }, + + removeClass = function(el, cn) + { + el.className = trim((' ' + el.className + ' ').replace(' ' + cn + ' ', ' ')); + }, + + isArray = function(obj) + { + return (/Array/).test(Object.prototype.toString.call(obj)); + }, + + isDate = function(obj) + { + return (/Date/).test(Object.prototype.toString.call(obj)) && !isNaN(obj.getTime()); + }, + + isWeekend = function(date) + { + var day = date.getDay(); + return day === 0 || day === 6; + }, + + isLeapYear = function(year) + { + // solution by Matti Virkkunen: http://stackoverflow.com/a/4881951 + return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0; + }, + + getDaysInMonth = function(year, month) + { + return [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]; + }, + + setToStartOfDay = function(date) + { + if (isDate(date)) date.setHours(0,0,0,0); + }, + + compareDates = function(a,b) + { + // weak date comparison (use setToStartOfDay(date) to ensure correct result) + return a.getTime() === b.getTime(); + }, + + extend = function(to, from, overwrite) + { + var prop, hasProp; + for (prop in from) { + hasProp = to[prop] !== undefined; + if (hasProp && typeof from[prop] === 'object' && from[prop] !== null && from[prop].nodeName === undefined) { + if (isDate(from[prop])) { + if (overwrite) { + to[prop] = new Date(from[prop].getTime()); + } + } + else if (isArray(from[prop])) { + if (overwrite) { + to[prop] = from[prop].slice(0); + } + } else { + to[prop] = extend({}, from[prop], overwrite); + } + } else if (overwrite || !hasProp) { + to[prop] = from[prop]; + } + } + return to; + }, + + adjustCalendar = function(calendar) { + if (calendar.month < 0) { + calendar.year -= Math.ceil(Math.abs(calendar.month)/12); + calendar.month += 12; + } + if (calendar.month > 11) { + calendar.year += Math.floor(Math.abs(calendar.month)/12); + calendar.month -= 12; + } + return calendar; + }, + + /** + * defaults and localisation + */ + defaults = { + + // bind the picker to a form field + field: null, + + // automatically show/hide the picker on `field` focus (default `true` if `field` is set) + bound: undefined, + + // position of the datepicker, relative to the field (default to bottom & left) + // ('bottom' & 'left' keywords are not used, 'top' & 'right' are modifier on the bottom/left position) + position: 'bottom left', + + // automatically fit in the viewport even if it means repositioning from the position option + reposition: true, + + // the default output format for `.toString()` and `field` value + format: 'YYYY-MM-DD', + + // the initial date to view when first opened + defaultDate: null, + + // make the `defaultDate` the initial selected value + setDefaultDate: false, + + // first day of week (0: Sunday, 1: Monday etc) + firstDay: 0, + + // the minimum/earliest date that can be selected + minDate: null, + // the maximum/latest date that can be selected + maxDate: null, + + // number of years either side, or array of upper/lower range + yearRange: 10, + + // show week numbers at head of row + showWeekNumber: false, + + // used internally (don't config outside) + minYear: 0, + maxYear: 9999, + minMonth: undefined, + maxMonth: undefined, + + startRange: null, + endRange: null, + + isRTL: false, + + // Additional text to append to the year in the calendar title + yearSuffix: '', + + // Render the month after year in the calendar title + showMonthAfterYear: false, + + // how many months are visible + numberOfMonths: 1, + + // when numberOfMonths is used, this will help you to choose where the main calendar will be (default `left`, can be set to `right`) + // only used for the first display or when a selected date is not visible + mainCalendar: 'left', + + // Specify a DOM element to render the calendar in + container: undefined, + + // internationalization + i18n: { + previousMonth : 'Previous Month', + nextMonth : 'Next Month', + months : ['January','February','March','April','May','June','July','August','September','October','November','December'], + weekdays : ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'], + weekdaysShort : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'] + }, + + // Theme Classname + theme: null, + + // callback function + onSelect: null, + onOpen: null, + onClose: null, + onDraw: null + }, + + + /** + * templating functions to abstract HTML rendering + */ + renderDayName = function(opts, day, abbr) + { + day += opts.firstDay; + while (day >= 7) { + day -= 7; + } + return abbr ? opts.i18n.weekdaysShort[day] : opts.i18n.weekdays[day]; + }, + + renderDay = function(opts) + { + if (opts.isEmpty) { + return ''; + } + var arr = []; + if (opts.isDisabled) { + arr.push('is-disabled'); + } + if (opts.isToday) { + arr.push('is-today'); + } + if (opts.isSelected) { + arr.push('is-selected'); + } + if (opts.isInRange) { + arr.push('is-inrange'); + } + if (opts.isStartRange) { + arr.push('is-startrange'); + } + if (opts.isEndRange) { + arr.push('is-endrange'); + } + return '' + + '' + + ''; + }, + + renderWeek = function (d, m, y) { + // Lifted from http://javascript.about.com/library/blweekyear.htm, lightly modified. + var onejan = new Date(y, 0, 1), + weekNum = Math.ceil((((new Date(y, m, d) - onejan) / 86400000) + onejan.getDay()+1)/7); + return '' + weekNum + ''; + }, + + renderRow = function(days, isRTL) + { + return '' + (isRTL ? days.reverse() : days).join('') + ''; + }, + + renderBody = function(rows) + { + return '' + rows.join('') + ''; + }, + + renderHead = function(opts) + { + var i, arr = []; + if (opts.showWeekNumber) { + arr.push(''); + } + for (i = 0; i < 7; i++) { + arr.push('' + renderDayName(opts, i, true) + ''); + } + return '' + (opts.isRTL ? arr.reverse() : arr).join('') + ''; + }, + + renderTitle = function(instance, c, year, month, refYear) + { + var i, j, arr, + opts = instance._o, + isMinYear = year === opts.minYear, + isMaxYear = year === opts.maxYear, + html = '
', + monthHtml, + yearHtml, + prev = true, + next = true; + + for (arr = [], i = 0; i < 12; i++) { + arr.push(''); + } + monthHtml = '
' + opts.i18n.months[month] + '
'; + + if (isArray(opts.yearRange)) { + i = opts.yearRange[0]; + j = opts.yearRange[1] + 1; + } else { + i = year - opts.yearRange; + j = 1 + year + opts.yearRange; + } + + for (arr = []; i < j && i <= opts.maxYear; i++) { + if (i >= opts.minYear) { + arr.push(''); + } + } + yearHtml = '
' + year + opts.yearSuffix + '
'; + + if (opts.showMonthAfterYear) { + html += yearHtml + monthHtml; + } else { + html += monthHtml + yearHtml; + } + + if (isMinYear && (month === 0 || opts.minMonth >= month)) { + prev = false; + } + + if (isMaxYear && (month === 11 || opts.maxMonth <= month)) { + next = false; + } + + if (c === 0) { + html += ''; + } + if (c === (instance._o.numberOfMonths - 1) ) { + html += ''; + } + + return html += '
'; + }, + + renderTable = function(opts, data) + { + return '' + renderHead(opts) + renderBody(data) + '
'; + }, + + + /** + * Pikaday constructor + */ + Pikaday = function(options) + { + var self = this, + opts = self.config(options); + + self._onMouseDown = function(e) + { + if (!self._v) { + return; + } + e = e || window.event; + var target = e.target || e.srcElement; + if (!target) { + return; + } + + if (!hasClass(target, 'is-disabled')) { + if (hasClass(target, 'pika-button') && !hasClass(target, 'is-empty')) { + self.setDate(new Date(target.getAttribute('data-pika-year'), target.getAttribute('data-pika-month'), target.getAttribute('data-pika-day'))); + if (opts.bound) { + sto(function() { + self.hide(); + if (opts.field) { + opts.field.blur(); + } + }, 100); + } + } + else if (hasClass(target, 'pika-prev')) { + self.prevMonth(); + } + else if (hasClass(target, 'pika-next')) { + self.nextMonth(); + } + } + if (!hasClass(target, 'pika-select')) { + // if this is touch event prevent mouse events emulation + if (e.preventDefault) { + e.preventDefault(); + } else { + e.returnValue = false; + return false; + } + } else { + self._c = true; + } + }; + + self._onChange = function(e) + { + e = e || window.event; + var target = e.target || e.srcElement; + if (!target) { + return; + } + if (hasClass(target, 'pika-select-month')) { + self.gotoMonth(target.value); + } + else if (hasClass(target, 'pika-select-year')) { + self.gotoYear(target.value); + } + }; + + self._onInputChange = function(e) + { + var date; + + if (e.firedBy === self) { + return; + } + if (hasMoment) { + date = moment(opts.field.value, opts.format); + date = (date && date.isValid()) ? date.toDate() : null; + } + else { + date = new Date(Date.parse(opts.field.value)); + } + if (isDate(date)) { + self.setDate(date); + } + if (!self._v) { + self.show(); + } + }; + + self._onInputFocus = function() + { + self.show(); + }; + + self._onInputClick = function() + { + self.show(); + }; + + self._onInputBlur = function() + { + // IE allows pika div to gain focus; catch blur the input field + var pEl = document.activeElement; + do { + if (hasClass(pEl, 'pika-single')) { + return; + } + } + while ((pEl = pEl.parentNode)); + + if (!self._c) { + self._b = sto(function() { + self.hide(); + }, 50); + } + self._c = false; + }; + + self._onClick = function(e) + { + e = e || window.event; + var target = e.target || e.srcElement, + pEl = target; + if (!target) { + return; + } + if (!hasEventListeners && hasClass(target, 'pika-select')) { + if (!target.onchange) { + target.setAttribute('onchange', 'return;'); + addEvent(target, 'change', self._onChange); + } + } + do { + if (hasClass(pEl, 'pika-single') || pEl === opts.trigger) { + return; + } + } + while ((pEl = pEl.parentNode)); + if (self._v && target !== opts.trigger && pEl !== opts.trigger) { + self.hide(); + } + }; + + self.el = document.createElement('div'); + self.el.className = 'pika-single' + (opts.isRTL ? ' is-rtl' : '') + (opts.theme ? ' ' + opts.theme : ''); + + addEvent(self.el, 'mousedown', self._onMouseDown, true); + addEvent(self.el, 'touchend', self._onMouseDown, true); + addEvent(self.el, 'change', self._onChange); + + if (opts.field) { + if (opts.container) { + opts.container.appendChild(self.el); + } else if (opts.bound) { + document.body.appendChild(self.el); + } else { + opts.field.parentNode.insertBefore(self.el, opts.field.nextSibling); + } + addEvent(opts.field, 'change', self._onInputChange); + + if (!opts.defaultDate) { + if (hasMoment && opts.field.value) { + opts.defaultDate = moment(opts.field.value, opts.format).toDate(); + } else { + opts.defaultDate = new Date(Date.parse(opts.field.value)); + } + opts.setDefaultDate = true; + } + } + + var defDate = opts.defaultDate; + + if (isDate(defDate)) { + if (opts.setDefaultDate) { + self.setDate(defDate, true); + } else { + self.gotoDate(defDate); + } + } else { + self.gotoDate(new Date()); + } + + if (opts.bound) { + this.hide(); + self.el.className += ' is-bound'; + addEvent(opts.trigger, 'click', self._onInputClick); + addEvent(opts.trigger, 'focus', self._onInputFocus); + addEvent(opts.trigger, 'blur', self._onInputBlur); + } else { + this.show(); + } + }; + + + /** + * public Pikaday API + */ + Pikaday.prototype = { + + + /** + * configure functionality + */ + config: function(options) + { + if (!this._o) { + this._o = extend({}, defaults, true); + } + + var opts = extend(this._o, options, true); + + opts.isRTL = !!opts.isRTL; + + opts.field = (opts.field && opts.field.nodeName) ? opts.field : null; + + opts.theme = (typeof opts.theme) === 'string' && opts.theme ? opts.theme : null; + + opts.bound = !!(opts.bound !== undefined ? opts.field && opts.bound : opts.field); + + opts.trigger = (opts.trigger && opts.trigger.nodeName) ? opts.trigger : opts.field; + + opts.disableWeekends = !!opts.disableWeekends; + + opts.disableDayFn = (typeof opts.disableDayFn) === 'function' ? opts.disableDayFn : null; + + var nom = parseInt(opts.numberOfMonths, 10) || 1; + opts.numberOfMonths = nom > 4 ? 4 : nom; + + if (!isDate(opts.minDate)) { + opts.minDate = false; + } + if (!isDate(opts.maxDate)) { + opts.maxDate = false; + } + if ((opts.minDate && opts.maxDate) && opts.maxDate < opts.minDate) { + opts.maxDate = opts.minDate = false; + } + if (opts.minDate) { + this.setMinDate(opts.minDate); + } + if (opts.maxDate) { + this.setMaxDate(opts.maxDate); + } + + if (isArray(opts.yearRange)) { + var fallback = new Date().getFullYear() - 10; + opts.yearRange[0] = parseInt(opts.yearRange[0], 10) || fallback; + opts.yearRange[1] = parseInt(opts.yearRange[1], 10) || fallback; + } else { + opts.yearRange = Math.abs(parseInt(opts.yearRange, 10)) || defaults.yearRange; + if (opts.yearRange > 100) { + opts.yearRange = 100; + } + } + + return opts; + }, + + /** + * return a formatted string of the current selection (using Moment.js if available) + */ + toString: function(format) + { + return !isDate(this._d) ? '' : hasMoment ? moment(this._d).format(format || this._o.format) : this._d.toDateString(); + }, + + /** + * return a Moment.js object of the current selection (if available) + */ + getMoment: function() + { + return hasMoment ? moment(this._d) : null; + }, + + /** + * set the current selection from a Moment.js object (if available) + */ + setMoment: function(date, preventOnSelect) + { + if (hasMoment && moment.isMoment(date)) { + this.setDate(date.toDate(), preventOnSelect); + } + }, + + /** + * return a Date object of the current selection + */ + getDate: function() + { + return isDate(this._d) ? new Date(this._d.getTime()) : null; + }, + + /** + * set the current selection + */ + setDate: function(date, preventOnSelect) + { + if (!date) { + this._d = null; + + if (this._o.field) { + this._o.field.value = ''; + fireEvent(this._o.field, 'change', { firedBy: this }); + } + + return this.draw(); + } + if (typeof date === 'string') { + date = new Date(Date.parse(date)); + } + if (!isDate(date)) { + return; + } + + var min = this._o.minDate, + max = this._o.maxDate; + + if (isDate(min) && date < min) { + date = min; + } else if (isDate(max) && date > max) { + date = max; + } + + this._d = new Date(date.getTime()); + setToStartOfDay(this._d); + this.gotoDate(this._d); + + if (this._o.field) { + this._o.field.value = this.toString(); + fireEvent(this._o.field, 'change', { firedBy: this }); + } + if (!preventOnSelect && typeof this._o.onSelect === 'function') { + this._o.onSelect.call(this, this.getDate()); + } + }, + + /** + * change view to a specific date + */ + gotoDate: function(date) + { + var newCalendar = true; + + if (!isDate(date)) { + return; + } + + if (this.calendars) { + var firstVisibleDate = new Date(this.calendars[0].year, this.calendars[0].month, 1), + lastVisibleDate = new Date(this.calendars[this.calendars.length-1].year, this.calendars[this.calendars.length-1].month, 1), + visibleDate = date.getTime(); + // get the end of the month + lastVisibleDate.setMonth(lastVisibleDate.getMonth()+1); + lastVisibleDate.setDate(lastVisibleDate.getDate()-1); + newCalendar = (visibleDate < firstVisibleDate.getTime() || lastVisibleDate.getTime() < visibleDate); + } + + if (newCalendar) { + this.calendars = [{ + month: date.getMonth(), + year: date.getFullYear() + }]; + if (this._o.mainCalendar === 'right') { + this.calendars[0].month += 1 - this._o.numberOfMonths; + } + } + + this.adjustCalendars(); + }, + + adjustCalendars: function() { + this.calendars[0] = adjustCalendar(this.calendars[0]); + for (var c = 1; c < this._o.numberOfMonths; c++) { + this.calendars[c] = adjustCalendar({ + month: this.calendars[0].month + c, + year: this.calendars[0].year + }); + } + this.draw(); + }, + + gotoToday: function() + { + this.gotoDate(new Date()); + }, + + /** + * change view to a specific month (zero-index, e.g. 0: January) + */ + gotoMonth: function(month) + { + if (!isNaN(month)) { + this.calendars[0].month = parseInt(month, 10); + this.adjustCalendars(); + } + }, + + nextMonth: function() + { + this.calendars[0].month++; + this.adjustCalendars(); + }, + + prevMonth: function() + { + this.calendars[0].month--; + this.adjustCalendars(); + }, + + /** + * change view to a specific full year (e.g. "2012") + */ + gotoYear: function(year) + { + if (!isNaN(year)) { + this.calendars[0].year = parseInt(year, 10); + this.adjustCalendars(); + } + }, + + /** + * change the minDate + */ + setMinDate: function(value) + { + setToStartOfDay(value); + this._o.minDate = value; + this._o.minYear = value.getFullYear(); + this._o.minMonth = value.getMonth(); + this.draw(); + }, + + /** + * change the maxDate + */ + setMaxDate: function(value) + { + setToStartOfDay(value); + this._o.maxDate = value; + this._o.maxYear = value.getFullYear(); + this._o.maxMonth = value.getMonth(); + this.draw(); + }, + + setStartRange: function(value) + { + this._o.startRange = value; + }, + + setEndRange: function(value) + { + this._o.endRange = value; + }, + + /** + * refresh the HTML + */ + draw: function(force) + { + if (!this._v && !force) { + return; + } + var opts = this._o, + minYear = opts.minYear, + maxYear = opts.maxYear, + minMonth = opts.minMonth, + maxMonth = opts.maxMonth, + html = ''; + + if (this._y <= minYear) { + this._y = minYear; + if (!isNaN(minMonth) && this._m < minMonth) { + this._m = minMonth; + } + } + if (this._y >= maxYear) { + this._y = maxYear; + if (!isNaN(maxMonth) && this._m > maxMonth) { + this._m = maxMonth; + } + } + + for (var c = 0; c < opts.numberOfMonths; c++) { + html += '
' + renderTitle(this, c, this.calendars[c].year, this.calendars[c].month, this.calendars[0].year) + this.render(this.calendars[c].year, this.calendars[c].month) + '
'; + } + + this.el.innerHTML = html; + + if (opts.bound) { + if(opts.field.type !== 'hidden') { + sto(function() { + opts.trigger.focus(); + }, 1); + } + } + + if (typeof this._o.onDraw === 'function') { + var self = this; + sto(function() { + self._o.onDraw.call(self); + }, 0); + } + }, + + adjustPosition: function() + { + var field, pEl, width, height, viewportWidth, viewportHeight, scrollTop, left, top, clientRect; + + if (this._o.container) return; + + this.el.style.position = 'absolute'; + + field = this._o.trigger; + pEl = field; + width = this.el.offsetWidth; + height = this.el.offsetHeight; + viewportWidth = window.innerWidth || document.documentElement.clientWidth; + viewportHeight = window.innerHeight || document.documentElement.clientHeight; + scrollTop = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop; + + if (typeof field.getBoundingClientRect === 'function') { + clientRect = field.getBoundingClientRect(); + left = clientRect.left + window.pageXOffset; + top = clientRect.bottom + window.pageYOffset; + } else { + left = pEl.offsetLeft; + top = pEl.offsetTop + pEl.offsetHeight; + while((pEl = pEl.offsetParent)) { + left += pEl.offsetLeft; + top += pEl.offsetTop; + } + } + + // default position is bottom & left + if ((this._o.reposition && left + width > viewportWidth) || + ( + this._o.position.indexOf('right') > -1 && + left - width + field.offsetWidth > 0 + ) + ) { + left = left - width + field.offsetWidth; + } + if ((this._o.reposition && top + height > viewportHeight + scrollTop) || + ( + this._o.position.indexOf('top') > -1 && + top - height - field.offsetHeight > 0 + ) + ) { + top = top - height - field.offsetHeight; + } + + this.el.style.left = left + 'px'; + this.el.style.top = top + 'px'; + }, + + /** + * render HTML for a particular month + */ + render: function(year, month) + { + var opts = this._o, + now = new Date(), + days = getDaysInMonth(year, month), + before = new Date(year, month, 1).getDay(), + data = [], + row = []; + setToStartOfDay(now); + if (opts.firstDay > 0) { + before -= opts.firstDay; + if (before < 0) { + before += 7; + } + } + var cells = days + before, + after = cells; + while(after > 7) { + after -= 7; + } + cells += 7 - after; + for (var i = 0, r = 0; i < cells; i++) + { + var day = new Date(year, month, 1 + (i - before)), + isSelected = isDate(this._d) ? compareDates(day, this._d) : false, + isToday = compareDates(day, now), + isEmpty = i < before || i >= (days + before), + isStartRange = opts.startRange && compareDates(opts.startRange, day), + isEndRange = opts.endRange && compareDates(opts.endRange, day), + isInRange = opts.startRange && opts.endRange && opts.startRange < day && day < opts.endRange, + isDisabled = (opts.minDate && day < opts.minDate) || + (opts.maxDate && day > opts.maxDate) || + (opts.disableWeekends && isWeekend(day)) || + (opts.disableDayFn && opts.disableDayFn(day)), + dayConfig = { + day: 1 + (i - before), + month: month, + year: year, + isSelected: isSelected, + isToday: isToday, + isDisabled: isDisabled, + isEmpty: isEmpty, + isStartRange: isStartRange, + isEndRange: isEndRange, + isInRange: isInRange + }; + + row.push(renderDay(dayConfig)); + + if (++r === 7) { + if (opts.showWeekNumber) { + row.unshift(renderWeek(i - before, month, year)); + } + data.push(renderRow(row, opts.isRTL)); + row = []; + r = 0; + } + } + return renderTable(opts, data); + }, + + isVisible: function() + { + return this._v; + }, + + show: function() + { + if (!this._v) { + removeClass(this.el, 'is-hidden'); + this._v = true; + this.draw(); + if (this._o.bound) { + addEvent(document, 'click', this._onClick); + this.adjustPosition(); + } + if (typeof this._o.onOpen === 'function') { + this._o.onOpen.call(this); + } + } + }, + + hide: function() + { + var v = this._v; + if (v !== false) { + if (this._o.bound) { + removeEvent(document, 'click', this._onClick); + } + this.el.style.position = 'static'; // reset + this.el.style.left = 'auto'; + this.el.style.top = 'auto'; + addClass(this.el, 'is-hidden'); + this._v = false; + if (v !== undefined && typeof this._o.onClose === 'function') { + this._o.onClose.call(this); + } + } + }, + + /** + * GAME OVER + */ + destroy: function() + { + this.hide(); + removeEvent(this.el, 'mousedown', this._onMouseDown, true); + removeEvent(this.el, 'touchend', this._onMouseDown, true); + removeEvent(this.el, 'change', this._onChange); + if (this._o.field) { + removeEvent(this._o.field, 'change', this._onInputChange); + if (this._o.bound) { + removeEvent(this._o.trigger, 'click', this._onInputClick); + removeEvent(this._o.trigger, 'focus', this._onInputFocus); + removeEvent(this._o.trigger, 'blur', this._onInputBlur); + } + } + if (this.el.parentNode) { + this.el.parentNode.removeChild(this.el); + } + } + + }; + + return Pikaday; + +})); + +},{"moment":"moment"}],"zeroclipboard":[function(require,module,exports){ +/*! + * ZeroClipboard + * The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface. + * Copyright (c) 2009-2014 Jon Rohan, James M. Greene + * Licensed MIT + * http://zeroclipboard.org/ + * v2.2.0 + */ +(function(window, undefined) { + "use strict"; + /** + * Store references to critically important global functions that may be + * overridden on certain web pages. + */ + var _window = window, _document = _window.document, _navigator = _window.navigator, _setTimeout = _window.setTimeout, _clearTimeout = _window.clearTimeout, _setInterval = _window.setInterval, _clearInterval = _window.clearInterval, _getComputedStyle = _window.getComputedStyle, _encodeURIComponent = _window.encodeURIComponent, _ActiveXObject = _window.ActiveXObject, _Error = _window.Error, _parseInt = _window.Number.parseInt || _window.parseInt, _parseFloat = _window.Number.parseFloat || _window.parseFloat, _isNaN = _window.Number.isNaN || _window.isNaN, _now = _window.Date.now, _keys = _window.Object.keys, _defineProperty = _window.Object.defineProperty, _hasOwn = _window.Object.prototype.hasOwnProperty, _slice = _window.Array.prototype.slice, _unwrap = function() { + var unwrapper = function(el) { + return el; + }; + if (typeof _window.wrap === "function" && typeof _window.unwrap === "function") { + try { + var div = _document.createElement("div"); + var unwrappedDiv = _window.unwrap(div); + if (div.nodeType === 1 && unwrappedDiv && unwrappedDiv.nodeType === 1) { + unwrapper = _window.unwrap; + } + } catch (e) {} + } + return unwrapper; + }(); + /** + * Convert an `arguments` object into an Array. + * + * @returns The arguments as an Array + * @private + */ + var _args = function(argumentsObj) { + return _slice.call(argumentsObj, 0); + }; + /** + * Shallow-copy the owned, enumerable properties of one object over to another, similar to jQuery's `$.extend`. + * + * @returns The target object, augmented + * @private + */ + var _extend = function() { + var i, len, arg, prop, src, copy, args = _args(arguments), target = args[0] || {}; + for (i = 1, len = args.length; i < len; i++) { + if ((arg = args[i]) != null) { + for (prop in arg) { + if (_hasOwn.call(arg, prop)) { + src = target[prop]; + copy = arg[prop]; + if (target !== copy && copy !== undefined) { + target[prop] = copy; + } + } + } + } + } + return target; + }; + /** + * Return a deep copy of the source object or array. + * + * @returns Object or Array + * @private + */ + var _deepCopy = function(source) { + var copy, i, len, prop; + if (typeof source !== "object" || source == null || typeof source.nodeType === "number") { + copy = source; + } else if (typeof source.length === "number") { + copy = []; + for (i = 0, len = source.length; i < len; i++) { + if (_hasOwn.call(source, i)) { + copy[i] = _deepCopy(source[i]); + } + } + } else { + copy = {}; + for (prop in source) { + if (_hasOwn.call(source, prop)) { + copy[prop] = _deepCopy(source[prop]); + } + } + } + return copy; + }; + /** + * Makes a shallow copy of `obj` (like `_extend`) but filters its properties based on a list of `keys` to keep. + * The inverse of `_omit`, mostly. The big difference is that these properties do NOT need to be enumerable to + * be kept. + * + * @returns A new filtered object. + * @private + */ + var _pick = function(obj, keys) { + var newObj = {}; + for (var i = 0, len = keys.length; i < len; i++) { + if (keys[i] in obj) { + newObj[keys[i]] = obj[keys[i]]; + } + } + return newObj; + }; + /** + * Makes a shallow copy of `obj` (like `_extend`) but filters its properties based on a list of `keys` to omit. + * The inverse of `_pick`. + * + * @returns A new filtered object. + * @private + */ + var _omit = function(obj, keys) { + var newObj = {}; + for (var prop in obj) { + if (keys.indexOf(prop) === -1) { + newObj[prop] = obj[prop]; + } + } + return newObj; + }; + /** + * Remove all owned, enumerable properties from an object. + * + * @returns The original object without its owned, enumerable properties. + * @private + */ + var _deleteOwnProperties = function(obj) { + if (obj) { + for (var prop in obj) { + if (_hasOwn.call(obj, prop)) { + delete obj[prop]; + } + } + } + return obj; + }; + /** + * Determine if an element is contained within another element. + * + * @returns Boolean + * @private + */ + var _containedBy = function(el, ancestorEl) { + if (el && el.nodeType === 1 && el.ownerDocument && ancestorEl && (ancestorEl.nodeType === 1 && ancestorEl.ownerDocument && ancestorEl.ownerDocument === el.ownerDocument || ancestorEl.nodeType === 9 && !ancestorEl.ownerDocument && ancestorEl === el.ownerDocument)) { + do { + if (el === ancestorEl) { + return true; + } + el = el.parentNode; + } while (el); + } + return false; + }; + /** + * Get the URL path's parent directory. + * + * @returns String or `undefined` + * @private + */ + var _getDirPathOfUrl = function(url) { + var dir; + if (typeof url === "string" && url) { + dir = url.split("#")[0].split("?")[0]; + dir = url.slice(0, url.lastIndexOf("/") + 1); + } + return dir; + }; + /** + * Get the current script's URL by throwing an `Error` and analyzing it. + * + * @returns String or `undefined` + * @private + */ + var _getCurrentScriptUrlFromErrorStack = function(stack) { + var url, matches; + if (typeof stack === "string" && stack) { + matches = stack.match(/^(?:|[^:@]*@|.+\)@(?=http[s]?|file)|.+?\s+(?: at |@)(?:[^:\(]+ )*[\(]?)((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/); + if (matches && matches[1]) { + url = matches[1]; + } else { + matches = stack.match(/\)@((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/); + if (matches && matches[1]) { + url = matches[1]; + } + } + } + return url; + }; + /** + * Get the current script's URL by throwing an `Error` and analyzing it. + * + * @returns String or `undefined` + * @private + */ + var _getCurrentScriptUrlFromError = function() { + var url, err; + try { + throw new _Error(); + } catch (e) { + err = e; + } + if (err) { + url = err.sourceURL || err.fileName || _getCurrentScriptUrlFromErrorStack(err.stack); + } + return url; + }; + /** + * Get the current script's URL. + * + * @returns String or `undefined` + * @private + */ + var _getCurrentScriptUrl = function() { + var jsPath, scripts, i; + if (_document.currentScript && (jsPath = _document.currentScript.src)) { + return jsPath; + } + scripts = _document.getElementsByTagName("script"); + if (scripts.length === 1) { + return scripts[0].src || undefined; + } + if ("readyState" in scripts[0]) { + for (i = scripts.length; i--; ) { + if (scripts[i].readyState === "interactive" && (jsPath = scripts[i].src)) { + return jsPath; + } + } + } + if (_document.readyState === "loading" && (jsPath = scripts[scripts.length - 1].src)) { + return jsPath; + } + if (jsPath = _getCurrentScriptUrlFromError()) { + return jsPath; + } + return undefined; + }; + /** + * Get the unanimous parent directory of ALL script tags. + * If any script tags are either (a) inline or (b) from differing parent + * directories, this method must return `undefined`. + * + * @returns String or `undefined` + * @private + */ + var _getUnanimousScriptParentDir = function() { + var i, jsDir, jsPath, scripts = _document.getElementsByTagName("script"); + for (i = scripts.length; i--; ) { + if (!(jsPath = scripts[i].src)) { + jsDir = null; + break; + } + jsPath = _getDirPathOfUrl(jsPath); + if (jsDir == null) { + jsDir = jsPath; + } else if (jsDir !== jsPath) { + jsDir = null; + break; + } + } + return jsDir || undefined; + }; + /** + * Get the presumed location of the "ZeroClipboard.swf" file, based on the location + * of the executing JavaScript file (e.g. "ZeroClipboard.js", etc.). + * + * @returns String + * @private + */ + var _getDefaultSwfPath = function() { + var jsDir = _getDirPathOfUrl(_getCurrentScriptUrl()) || _getUnanimousScriptParentDir() || ""; + return jsDir + "ZeroClipboard.swf"; + }; + /** + * Keep track of if the page is framed (in an `iframe`). This can never change. + * @private + */ + var _pageIsFramed = function() { + return window.opener == null && (!!window.top && window != window.top || !!window.parent && window != window.parent); + }(); + /** + * Keep track of the state of the Flash object. + * @private + */ + var _flashState = { + bridge: null, + version: "0.0.0", + pluginType: "unknown", + disabled: null, + outdated: null, + sandboxed: null, + unavailable: null, + degraded: null, + deactivated: null, + overdue: null, + ready: null + }; + /** + * The minimum Flash Player version required to use ZeroClipboard completely. + * @readonly + * @private + */ + var _minimumFlashVersion = "11.0.0"; + /** + * The ZeroClipboard library version number, as reported by Flash, at the time the SWF was compiled. + */ + var _zcSwfVersion; + /** + * Keep track of all event listener registrations. + * @private + */ + var _handlers = {}; + /** + * Keep track of the currently activated element. + * @private + */ + var _currentElement; + /** + * Keep track of the element that was activated when a `copy` process started. + * @private + */ + var _copyTarget; + /** + * Keep track of data for the pending clipboard transaction. + * @private + */ + var _clipData = {}; + /** + * Keep track of data formats for the pending clipboard transaction. + * @private + */ + var _clipDataFormatMap = null; + /** + * Keep track of the Flash availability check timeout. + * @private + */ + var _flashCheckTimeout = 0; + /** + * Keep track of SWF network errors interval polling. + * @private + */ + var _swfFallbackCheckInterval = 0; + /** + * The `message` store for events + * @private + */ + var _eventMessages = { + ready: "Flash communication is established", + error: { + "flash-disabled": "Flash is disabled or not installed. May also be attempting to run Flash in a sandboxed iframe, which is impossible.", + "flash-outdated": "Flash is too outdated to support ZeroClipboard", + "flash-sandboxed": "Attempting to run Flash in a sandboxed iframe, which is impossible", + "flash-unavailable": "Flash is unable to communicate bidirectionally with JavaScript", + "flash-degraded": "Flash is unable to preserve data fidelity when communicating with JavaScript", + "flash-deactivated": "Flash is too outdated for your browser and/or is configured as click-to-activate.\nThis may also mean that the ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity.\nMay also be attempting to run Flash in a sandboxed iframe, which is impossible.", + "flash-overdue": "Flash communication was established but NOT within the acceptable time limit", + "version-mismatch": "ZeroClipboard JS version number does not match ZeroClipboard SWF version number", + "clipboard-error": "At least one error was thrown while ZeroClipboard was attempting to inject your data into the clipboard", + "config-mismatch": "ZeroClipboard configuration does not match Flash's reality", + "swf-not-found": "The ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity" + } + }; + /** + * The `name`s of `error` events that can only occur is Flash has at least + * been able to load the SWF successfully. + * @private + */ + var _errorsThatOnlyOccurAfterFlashLoads = [ "flash-unavailable", "flash-degraded", "flash-overdue", "version-mismatch", "config-mismatch", "clipboard-error" ]; + /** + * The `name`s of `error` events that should likely result in the `_flashState` + * variable's property values being updated. + * @private + */ + var _flashStateErrorNames = [ "flash-disabled", "flash-outdated", "flash-sandboxed", "flash-unavailable", "flash-degraded", "flash-deactivated", "flash-overdue" ]; + /** + * A RegExp to match the `name` property of `error` events related to Flash. + * @private + */ + var _flashStateErrorNameMatchingRegex = new RegExp("^flash-(" + _flashStateErrorNames.map(function(errorName) { + return errorName.replace(/^flash-/, ""); + }).join("|") + ")$"); + /** + * A RegExp to match the `name` property of `error` events related to Flash, + * which is enabled. + * @private + */ + var _flashStateEnabledErrorNameMatchingRegex = new RegExp("^flash-(" + _flashStateErrorNames.slice(1).map(function(errorName) { + return errorName.replace(/^flash-/, ""); + }).join("|") + ")$"); + /** + * ZeroClipboard configuration defaults for the Core module. + * @private + */ + var _globalConfig = { + swfPath: _getDefaultSwfPath(), + trustedDomains: window.location.host ? [ window.location.host ] : [], + cacheBust: true, + forceEnhancedClipboard: false, + flashLoadTimeout: 3e4, + autoActivate: true, + bubbleEvents: true, + containerId: "global-zeroclipboard-html-bridge", + containerClass: "global-zeroclipboard-container", + swfObjectId: "global-zeroclipboard-flash-bridge", + hoverClass: "zeroclipboard-is-hover", + activeClass: "zeroclipboard-is-active", + forceHandCursor: false, + title: null, + zIndex: 999999999 + }; + /** + * The underlying implementation of `ZeroClipboard.config`. + * @private + */ + var _config = function(options) { + if (typeof options === "object" && options !== null) { + for (var prop in options) { + if (_hasOwn.call(options, prop)) { + if (/^(?:forceHandCursor|title|zIndex|bubbleEvents)$/.test(prop)) { + _globalConfig[prop] = options[prop]; + } else if (_flashState.bridge == null) { + if (prop === "containerId" || prop === "swfObjectId") { + if (_isValidHtml4Id(options[prop])) { + _globalConfig[prop] = options[prop]; + } else { + throw new Error("The specified `" + prop + "` value is not valid as an HTML4 Element ID"); + } + } else { + _globalConfig[prop] = options[prop]; + } + } + } + } + } + if (typeof options === "string" && options) { + if (_hasOwn.call(_globalConfig, options)) { + return _globalConfig[options]; + } + return; + } + return _deepCopy(_globalConfig); + }; + /** + * The underlying implementation of `ZeroClipboard.state`. + * @private + */ + var _state = function() { + _detectSandbox(); + return { + browser: _pick(_navigator, [ "userAgent", "platform", "appName" ]), + flash: _omit(_flashState, [ "bridge" ]), + zeroclipboard: { + version: ZeroClipboard.version, + config: ZeroClipboard.config() + } + }; + }; + /** + * The underlying implementation of `ZeroClipboard.isFlashUnusable`. + * @private + */ + var _isFlashUnusable = function() { + return !!(_flashState.disabled || _flashState.outdated || _flashState.sandboxed || _flashState.unavailable || _flashState.degraded || _flashState.deactivated); + }; + /** + * The underlying implementation of `ZeroClipboard.on`. + * @private + */ + var _on = function(eventType, listener) { + var i, len, events, added = {}; + if (typeof eventType === "string" && eventType) { + events = eventType.toLowerCase().split(/\s+/); + } else if (typeof eventType === "object" && eventType && typeof listener === "undefined") { + for (i in eventType) { + if (_hasOwn.call(eventType, i) && typeof i === "string" && i && typeof eventType[i] === "function") { + ZeroClipboard.on(i, eventType[i]); + } + } + } + if (events && events.length) { + for (i = 0, len = events.length; i < len; i++) { + eventType = events[i].replace(/^on/, ""); + added[eventType] = true; + if (!_handlers[eventType]) { + _handlers[eventType] = []; + } + _handlers[eventType].push(listener); + } + if (added.ready && _flashState.ready) { + ZeroClipboard.emit({ + type: "ready" + }); + } + if (added.error) { + for (i = 0, len = _flashStateErrorNames.length; i < len; i++) { + if (_flashState[_flashStateErrorNames[i].replace(/^flash-/, "")] === true) { + ZeroClipboard.emit({ + type: "error", + name: _flashStateErrorNames[i] + }); + break; + } + } + if (_zcSwfVersion !== undefined && ZeroClipboard.version !== _zcSwfVersion) { + ZeroClipboard.emit({ + type: "error", + name: "version-mismatch", + jsVersion: ZeroClipboard.version, + swfVersion: _zcSwfVersion + }); + } + } + } + return ZeroClipboard; + }; + /** + * The underlying implementation of `ZeroClipboard.off`. + * @private + */ + var _off = function(eventType, listener) { + var i, len, foundIndex, events, perEventHandlers; + if (arguments.length === 0) { + events = _keys(_handlers); + } else if (typeof eventType === "string" && eventType) { + events = eventType.split(/\s+/); + } else if (typeof eventType === "object" && eventType && typeof listener === "undefined") { + for (i in eventType) { + if (_hasOwn.call(eventType, i) && typeof i === "string" && i && typeof eventType[i] === "function") { + ZeroClipboard.off(i, eventType[i]); + } + } + } + if (events && events.length) { + for (i = 0, len = events.length; i < len; i++) { + eventType = events[i].toLowerCase().replace(/^on/, ""); + perEventHandlers = _handlers[eventType]; + if (perEventHandlers && perEventHandlers.length) { + if (listener) { + foundIndex = perEventHandlers.indexOf(listener); + while (foundIndex !== -1) { + perEventHandlers.splice(foundIndex, 1); + foundIndex = perEventHandlers.indexOf(listener, foundIndex); + } + } else { + perEventHandlers.length = 0; + } + } + } + } + return ZeroClipboard; + }; + /** + * The underlying implementation of `ZeroClipboard.handlers`. + * @private + */ + var _listeners = function(eventType) { + var copy; + if (typeof eventType === "string" && eventType) { + copy = _deepCopy(_handlers[eventType]) || null; + } else { + copy = _deepCopy(_handlers); + } + return copy; + }; + /** + * The underlying implementation of `ZeroClipboard.emit`. + * @private + */ + var _emit = function(event) { + var eventCopy, returnVal, tmp; + event = _createEvent(event); + if (!event) { + return; + } + if (_preprocessEvent(event)) { + return; + } + if (event.type === "ready" && _flashState.overdue === true) { + return ZeroClipboard.emit({ + type: "error", + name: "flash-overdue" + }); + } + eventCopy = _extend({}, event); + _dispatchCallbacks.call(this, eventCopy); + if (event.type === "copy") { + tmp = _mapClipDataToFlash(_clipData); + returnVal = tmp.data; + _clipDataFormatMap = tmp.formatMap; + } + return returnVal; + }; + /** + * The underlying implementation of `ZeroClipboard.create`. + * @private + */ + var _create = function() { + var previousState = _flashState.sandboxed; + _detectSandbox(); + if (typeof _flashState.ready !== "boolean") { + _flashState.ready = false; + } + if (_flashState.sandboxed !== previousState && _flashState.sandboxed === true) { + _flashState.ready = false; + ZeroClipboard.emit({ + type: "error", + name: "flash-sandboxed" + }); + } else if (!ZeroClipboard.isFlashUnusable() && _flashState.bridge === null) { + var maxWait = _globalConfig.flashLoadTimeout; + if (typeof maxWait === "number" && maxWait >= 0) { + _flashCheckTimeout = _setTimeout(function() { + if (typeof _flashState.deactivated !== "boolean") { + _flashState.deactivated = true; + } + if (_flashState.deactivated === true) { + ZeroClipboard.emit({ + type: "error", + name: "flash-deactivated" + }); + } + }, maxWait); + } + _flashState.overdue = false; + _embedSwf(); + } + }; + /** + * The underlying implementation of `ZeroClipboard.destroy`. + * @private + */ + var _destroy = function() { + ZeroClipboard.clearData(); + ZeroClipboard.blur(); + ZeroClipboard.emit("destroy"); + _unembedSwf(); + ZeroClipboard.off(); + }; + /** + * The underlying implementation of `ZeroClipboard.setData`. + * @private + */ + var _setData = function(format, data) { + var dataObj; + if (typeof format === "object" && format && typeof data === "undefined") { + dataObj = format; + ZeroClipboard.clearData(); + } else if (typeof format === "string" && format) { + dataObj = {}; + dataObj[format] = data; + } else { + return; + } + for (var dataFormat in dataObj) { + if (typeof dataFormat === "string" && dataFormat && _hasOwn.call(dataObj, dataFormat) && typeof dataObj[dataFormat] === "string" && dataObj[dataFormat]) { + _clipData[dataFormat] = dataObj[dataFormat]; + } + } + }; + /** + * The underlying implementation of `ZeroClipboard.clearData`. + * @private + */ + var _clearData = function(format) { + if (typeof format === "undefined") { + _deleteOwnProperties(_clipData); + _clipDataFormatMap = null; + } else if (typeof format === "string" && _hasOwn.call(_clipData, format)) { + delete _clipData[format]; + } + }; + /** + * The underlying implementation of `ZeroClipboard.getData`. + * @private + */ + var _getData = function(format) { + if (typeof format === "undefined") { + return _deepCopy(_clipData); + } else if (typeof format === "string" && _hasOwn.call(_clipData, format)) { + return _clipData[format]; + } + }; + /** + * The underlying implementation of `ZeroClipboard.focus`/`ZeroClipboard.activate`. + * @private + */ + var _focus = function(element) { + if (!(element && element.nodeType === 1)) { + return; + } + if (_currentElement) { + _removeClass(_currentElement, _globalConfig.activeClass); + if (_currentElement !== element) { + _removeClass(_currentElement, _globalConfig.hoverClass); + } + } + _currentElement = element; + _addClass(element, _globalConfig.hoverClass); + var newTitle = element.getAttribute("title") || _globalConfig.title; + if (typeof newTitle === "string" && newTitle) { + var htmlBridge = _getHtmlBridge(_flashState.bridge); + if (htmlBridge) { + htmlBridge.setAttribute("title", newTitle); + } + } + var useHandCursor = _globalConfig.forceHandCursor === true || _getStyle(element, "cursor") === "pointer"; + _setHandCursor(useHandCursor); + _reposition(); + }; + /** + * The underlying implementation of `ZeroClipboard.blur`/`ZeroClipboard.deactivate`. + * @private + */ + var _blur = function() { + var htmlBridge = _getHtmlBridge(_flashState.bridge); + if (htmlBridge) { + htmlBridge.removeAttribute("title"); + htmlBridge.style.left = "0px"; + htmlBridge.style.top = "-9999px"; + htmlBridge.style.width = "1px"; + htmlBridge.style.height = "1px"; + } + if (_currentElement) { + _removeClass(_currentElement, _globalConfig.hoverClass); + _removeClass(_currentElement, _globalConfig.activeClass); + _currentElement = null; + } + }; + /** + * The underlying implementation of `ZeroClipboard.activeElement`. + * @private + */ + var _activeElement = function() { + return _currentElement || null; + }; + /** + * Check if a value is a valid HTML4 `ID` or `Name` token. + * @private + */ + var _isValidHtml4Id = function(id) { + return typeof id === "string" && id && /^[A-Za-z][A-Za-z0-9_:\-\.]*$/.test(id); + }; + /** + * Create or update an `event` object, based on the `eventType`. + * @private + */ + var _createEvent = function(event) { + var eventType; + if (typeof event === "string" && event) { + eventType = event; + event = {}; + } else if (typeof event === "object" && event && typeof event.type === "string" && event.type) { + eventType = event.type; + } + if (!eventType) { + return; + } + eventType = eventType.toLowerCase(); + if (!event.target && (/^(copy|aftercopy|_click)$/.test(eventType) || eventType === "error" && event.name === "clipboard-error")) { + event.target = _copyTarget; + } + _extend(event, { + type: eventType, + target: event.target || _currentElement || null, + relatedTarget: event.relatedTarget || null, + currentTarget: _flashState && _flashState.bridge || null, + timeStamp: event.timeStamp || _now() || null + }); + var msg = _eventMessages[event.type]; + if (event.type === "error" && event.name && msg) { + msg = msg[event.name]; + } + if (msg) { + event.message = msg; + } + if (event.type === "ready") { + _extend(event, { + target: null, + version: _flashState.version + }); + } + if (event.type === "error") { + if (_flashStateErrorNameMatchingRegex.test(event.name)) { + _extend(event, { + target: null, + minimumVersion: _minimumFlashVersion + }); + } + if (_flashStateEnabledErrorNameMatchingRegex.test(event.name)) { + _extend(event, { + version: _flashState.version + }); + } + } + if (event.type === "copy") { + event.clipboardData = { + setData: ZeroClipboard.setData, + clearData: ZeroClipboard.clearData + }; + } + if (event.type === "aftercopy") { + event = _mapClipResultsFromFlash(event, _clipDataFormatMap); + } + if (event.target && !event.relatedTarget) { + event.relatedTarget = _getRelatedTarget(event.target); + } + return _addMouseData(event); + }; + /** + * Get a relatedTarget from the target's `data-clipboard-target` attribute + * @private + */ + var _getRelatedTarget = function(targetEl) { + var relatedTargetId = targetEl && targetEl.getAttribute && targetEl.getAttribute("data-clipboard-target"); + return relatedTargetId ? _document.getElementById(relatedTargetId) : null; + }; + /** + * Add element and position data to `MouseEvent` instances + * @private + */ + var _addMouseData = function(event) { + if (event && /^_(?:click|mouse(?:over|out|down|up|move))$/.test(event.type)) { + var srcElement = event.target; + var fromElement = event.type === "_mouseover" && event.relatedTarget ? event.relatedTarget : undefined; + var toElement = event.type === "_mouseout" && event.relatedTarget ? event.relatedTarget : undefined; + var pos = _getElementPosition(srcElement); + var screenLeft = _window.screenLeft || _window.screenX || 0; + var screenTop = _window.screenTop || _window.screenY || 0; + var scrollLeft = _document.body.scrollLeft + _document.documentElement.scrollLeft; + var scrollTop = _document.body.scrollTop + _document.documentElement.scrollTop; + var pageX = pos.left + (typeof event._stageX === "number" ? event._stageX : 0); + var pageY = pos.top + (typeof event._stageY === "number" ? event._stageY : 0); + var clientX = pageX - scrollLeft; + var clientY = pageY - scrollTop; + var screenX = screenLeft + clientX; + var screenY = screenTop + clientY; + var moveX = typeof event.movementX === "number" ? event.movementX : 0; + var moveY = typeof event.movementY === "number" ? event.movementY : 0; + delete event._stageX; + delete event._stageY; + _extend(event, { + srcElement: srcElement, + fromElement: fromElement, + toElement: toElement, + screenX: screenX, + screenY: screenY, + pageX: pageX, + pageY: pageY, + clientX: clientX, + clientY: clientY, + x: clientX, + y: clientY, + movementX: moveX, + movementY: moveY, + offsetX: 0, + offsetY: 0, + layerX: 0, + layerY: 0 + }); + } + return event; + }; + /** + * Determine if an event's registered handlers should be execute synchronously or asynchronously. + * + * @returns {boolean} + * @private + */ + var _shouldPerformAsync = function(event) { + var eventType = event && typeof event.type === "string" && event.type || ""; + return !/^(?:(?:before)?copy|destroy)$/.test(eventType); + }; + /** + * Control if a callback should be executed asynchronously or not. + * + * @returns `undefined` + * @private + */ + var _dispatchCallback = function(func, context, args, async) { + if (async) { + _setTimeout(function() { + func.apply(context, args); + }, 0); + } else { + func.apply(context, args); + } + }; + /** + * Handle the actual dispatching of events to client instances. + * + * @returns `undefined` + * @private + */ + var _dispatchCallbacks = function(event) { + if (!(typeof event === "object" && event && event.type)) { + return; + } + var async = _shouldPerformAsync(event); + var wildcardTypeHandlers = _handlers["*"] || []; + var specificTypeHandlers = _handlers[event.type] || []; + var handlers = wildcardTypeHandlers.concat(specificTypeHandlers); + if (handlers && handlers.length) { + var i, len, func, context, eventCopy, originalContext = this; + for (i = 0, len = handlers.length; i < len; i++) { + func = handlers[i]; + context = originalContext; + if (typeof func === "string" && typeof _window[func] === "function") { + func = _window[func]; + } + if (typeof func === "object" && func && typeof func.handleEvent === "function") { + context = func; + func = func.handleEvent; + } + if (typeof func === "function") { + eventCopy = _extend({}, event); + _dispatchCallback(func, context, [ eventCopy ], async); + } + } + } + return this; + }; + /** + * Check an `error` event's `name` property to see if Flash has + * already loaded, which rules out possible `iframe` sandboxing. + * @private + */ + var _getSandboxStatusFromErrorEvent = function(event) { + var isSandboxed = null; + if (_pageIsFramed === false || event && event.type === "error" && event.name && _errorsThatOnlyOccurAfterFlashLoads.indexOf(event.name) !== -1) { + isSandboxed = false; + } + return isSandboxed; + }; + /** + * Preprocess any special behaviors, reactions, or state changes after receiving this event. + * Executes only once per event emitted, NOT once per client. + * @private + */ + var _preprocessEvent = function(event) { + var element = event.target || _currentElement || null; + var sourceIsSwf = event._source === "swf"; + delete event._source; + switch (event.type) { + case "error": + var isSandboxed = event.name === "flash-sandboxed" || _getSandboxStatusFromErrorEvent(event); + if (typeof isSandboxed === "boolean") { + _flashState.sandboxed = isSandboxed; + } + if (_flashStateErrorNames.indexOf(event.name) !== -1) { + _extend(_flashState, { + disabled: event.name === "flash-disabled", + outdated: event.name === "flash-outdated", + unavailable: event.name === "flash-unavailable", + degraded: event.name === "flash-degraded", + deactivated: event.name === "flash-deactivated", + overdue: event.name === "flash-overdue", + ready: false + }); + } else if (event.name === "version-mismatch") { + _zcSwfVersion = event.swfVersion; + _extend(_flashState, { + disabled: false, + outdated: false, + unavailable: false, + degraded: false, + deactivated: false, + overdue: false, + ready: false + }); + } + _clearTimeoutsAndPolling(); + break; + + case "ready": + _zcSwfVersion = event.swfVersion; + var wasDeactivated = _flashState.deactivated === true; + _extend(_flashState, { + disabled: false, + outdated: false, + sandboxed: false, + unavailable: false, + degraded: false, + deactivated: false, + overdue: wasDeactivated, + ready: !wasDeactivated + }); + _clearTimeoutsAndPolling(); + break; + + case "beforecopy": + _copyTarget = element; + break; + + case "copy": + var textContent, htmlContent, targetEl = event.relatedTarget; + if (!(_clipData["text/html"] || _clipData["text/plain"]) && targetEl && (htmlContent = targetEl.value || targetEl.outerHTML || targetEl.innerHTML) && (textContent = targetEl.value || targetEl.textContent || targetEl.innerText)) { + event.clipboardData.clearData(); + event.clipboardData.setData("text/plain", textContent); + if (htmlContent !== textContent) { + event.clipboardData.setData("text/html", htmlContent); + } + } else if (!_clipData["text/plain"] && event.target && (textContent = event.target.getAttribute("data-clipboard-text"))) { + event.clipboardData.clearData(); + event.clipboardData.setData("text/plain", textContent); + } + break; + + case "aftercopy": + _queueEmitClipboardErrors(event); + ZeroClipboard.clearData(); + if (element && element !== _safeActiveElement() && element.focus) { + element.focus(); + } + break; + + case "_mouseover": + ZeroClipboard.focus(element); + if (_globalConfig.bubbleEvents === true && sourceIsSwf) { + if (element && element !== event.relatedTarget && !_containedBy(event.relatedTarget, element)) { + _fireMouseEvent(_extend({}, event, { + type: "mouseenter", + bubbles: false, + cancelable: false + })); + } + _fireMouseEvent(_extend({}, event, { + type: "mouseover" + })); + } + break; + + case "_mouseout": + ZeroClipboard.blur(); + if (_globalConfig.bubbleEvents === true && sourceIsSwf) { + if (element && element !== event.relatedTarget && !_containedBy(event.relatedTarget, element)) { + _fireMouseEvent(_extend({}, event, { + type: "mouseleave", + bubbles: false, + cancelable: false + })); + } + _fireMouseEvent(_extend({}, event, { + type: "mouseout" + })); + } + break; + + case "_mousedown": + _addClass(element, _globalConfig.activeClass); + if (_globalConfig.bubbleEvents === true && sourceIsSwf) { + _fireMouseEvent(_extend({}, event, { + type: event.type.slice(1) + })); + } + break; + + case "_mouseup": + _removeClass(element, _globalConfig.activeClass); + if (_globalConfig.bubbleEvents === true && sourceIsSwf) { + _fireMouseEvent(_extend({}, event, { + type: event.type.slice(1) + })); + } + break; + + case "_click": + _copyTarget = null; + if (_globalConfig.bubbleEvents === true && sourceIsSwf) { + _fireMouseEvent(_extend({}, event, { + type: event.type.slice(1) + })); + } + break; + + case "_mousemove": + if (_globalConfig.bubbleEvents === true && sourceIsSwf) { + _fireMouseEvent(_extend({}, event, { + type: event.type.slice(1) + })); + } + break; + } + if (/^_(?:click|mouse(?:over|out|down|up|move))$/.test(event.type)) { + return true; + } + }; + /** + * Check an "aftercopy" event for clipboard errors and emit a corresponding "error" event. + * @private + */ + var _queueEmitClipboardErrors = function(aftercopyEvent) { + if (aftercopyEvent.errors && aftercopyEvent.errors.length > 0) { + var errorEvent = _deepCopy(aftercopyEvent); + _extend(errorEvent, { + type: "error", + name: "clipboard-error" + }); + delete errorEvent.success; + _setTimeout(function() { + ZeroClipboard.emit(errorEvent); + }, 0); + } + }; + /** + * Dispatch a synthetic MouseEvent. + * + * @returns `undefined` + * @private + */ + var _fireMouseEvent = function(event) { + if (!(event && typeof event.type === "string" && event)) { + return; + } + var e, target = event.target || null, doc = target && target.ownerDocument || _document, defaults = { + view: doc.defaultView || _window, + canBubble: true, + cancelable: true, + detail: event.type === "click" ? 1 : 0, + button: typeof event.which === "number" ? event.which - 1 : typeof event.button === "number" ? event.button : doc.createEvent ? 0 : 1 + }, args = _extend(defaults, event); + if (!target) { + return; + } + if (doc.createEvent && target.dispatchEvent) { + args = [ args.type, args.canBubble, args.cancelable, args.view, args.detail, args.screenX, args.screenY, args.clientX, args.clientY, args.ctrlKey, args.altKey, args.shiftKey, args.metaKey, args.button, args.relatedTarget ]; + e = doc.createEvent("MouseEvents"); + if (e.initMouseEvent) { + e.initMouseEvent.apply(e, args); + e._source = "js"; + target.dispatchEvent(e); + } + } + }; + /** + * Continuously poll the DOM until either: + * (a) the fallback content becomes visible, or + * (b) we receive an event from SWF (handled elsewhere) + * + * IMPORTANT: + * This is NOT a necessary check but it can result in significantly faster + * detection of bad `swfPath` configuration and/or network/server issues [in + * supported browsers] than waiting for the entire `flashLoadTimeout` duration + * to elapse before detecting that the SWF cannot be loaded. The detection + * duration can be anywhere from 10-30 times faster [in supported browsers] by + * using this approach. + * + * @returns `undefined` + * @private + */ + var _watchForSwfFallbackContent = function() { + var maxWait = _globalConfig.flashLoadTimeout; + if (typeof maxWait === "number" && maxWait >= 0) { + var pollWait = Math.min(1e3, maxWait / 10); + var fallbackContentId = _globalConfig.swfObjectId + "_fallbackContent"; + _swfFallbackCheckInterval = _setInterval(function() { + var el = _document.getElementById(fallbackContentId); + if (_isElementVisible(el)) { + _clearTimeoutsAndPolling(); + _flashState.deactivated = null; + ZeroClipboard.emit({ + type: "error", + name: "swf-not-found" + }); + } + }, pollWait); + } + }; + /** + * Create the HTML bridge element to embed the Flash object into. + * @private + */ + var _createHtmlBridge = function() { + var container = _document.createElement("div"); + container.id = _globalConfig.containerId; + container.className = _globalConfig.containerClass; + container.style.position = "absolute"; + container.style.left = "0px"; + container.style.top = "-9999px"; + container.style.width = "1px"; + container.style.height = "1px"; + container.style.zIndex = "" + _getSafeZIndex(_globalConfig.zIndex); + return container; + }; + /** + * Get the HTML element container that wraps the Flash bridge object/element. + * @private + */ + var _getHtmlBridge = function(flashBridge) { + var htmlBridge = flashBridge && flashBridge.parentNode; + while (htmlBridge && htmlBridge.nodeName === "OBJECT" && htmlBridge.parentNode) { + htmlBridge = htmlBridge.parentNode; + } + return htmlBridge || null; + }; + /** + * Create the SWF object. + * + * @returns The SWF object reference. + * @private + */ + var _embedSwf = function() { + var len, flashBridge = _flashState.bridge, container = _getHtmlBridge(flashBridge); + if (!flashBridge) { + var allowScriptAccess = _determineScriptAccess(_window.location.host, _globalConfig); + var allowNetworking = allowScriptAccess === "never" ? "none" : "all"; + var flashvars = _vars(_extend({ + jsVersion: ZeroClipboard.version + }, _globalConfig)); + var swfUrl = _globalConfig.swfPath + _cacheBust(_globalConfig.swfPath, _globalConfig); + container = _createHtmlBridge(); + var divToBeReplaced = _document.createElement("div"); + container.appendChild(divToBeReplaced); + _document.body.appendChild(container); + var tmpDiv = _document.createElement("div"); + var usingActiveX = _flashState.pluginType === "activex"; + tmpDiv.innerHTML = '" + (usingActiveX ? '' : "") + '' + '' + '' + '' + '' + '
 
' + "
"; + flashBridge = tmpDiv.firstChild; + tmpDiv = null; + _unwrap(flashBridge).ZeroClipboard = ZeroClipboard; + container.replaceChild(flashBridge, divToBeReplaced); + _watchForSwfFallbackContent(); + } + if (!flashBridge) { + flashBridge = _document[_globalConfig.swfObjectId]; + if (flashBridge && (len = flashBridge.length)) { + flashBridge = flashBridge[len - 1]; + } + if (!flashBridge && container) { + flashBridge = container.firstChild; + } + } + _flashState.bridge = flashBridge || null; + return flashBridge; + }; + /** + * Destroy the SWF object. + * @private + */ + var _unembedSwf = function() { + var flashBridge = _flashState.bridge; + if (flashBridge) { + var htmlBridge = _getHtmlBridge(flashBridge); + if (htmlBridge) { + if (_flashState.pluginType === "activex" && "readyState" in flashBridge) { + flashBridge.style.display = "none"; + (function removeSwfFromIE() { + if (flashBridge.readyState === 4) { + for (var prop in flashBridge) { + if (typeof flashBridge[prop] === "function") { + flashBridge[prop] = null; + } + } + if (flashBridge.parentNode) { + flashBridge.parentNode.removeChild(flashBridge); + } + if (htmlBridge.parentNode) { + htmlBridge.parentNode.removeChild(htmlBridge); + } + } else { + _setTimeout(removeSwfFromIE, 10); + } + })(); + } else { + if (flashBridge.parentNode) { + flashBridge.parentNode.removeChild(flashBridge); + } + if (htmlBridge.parentNode) { + htmlBridge.parentNode.removeChild(htmlBridge); + } + } + } + _clearTimeoutsAndPolling(); + _flashState.ready = null; + _flashState.bridge = null; + _flashState.deactivated = null; + _zcSwfVersion = undefined; + } + }; + /** + * Map the data format names of the "clipData" to Flash-friendly names. + * + * @returns A new transformed object. + * @private + */ + var _mapClipDataToFlash = function(clipData) { + var newClipData = {}, formatMap = {}; + if (!(typeof clipData === "object" && clipData)) { + return; + } + for (var dataFormat in clipData) { + if (dataFormat && _hasOwn.call(clipData, dataFormat) && typeof clipData[dataFormat] === "string" && clipData[dataFormat]) { + switch (dataFormat.toLowerCase()) { + case "text/plain": + case "text": + case "air:text": + case "flash:text": + newClipData.text = clipData[dataFormat]; + formatMap.text = dataFormat; + break; + + case "text/html": + case "html": + case "air:html": + case "flash:html": + newClipData.html = clipData[dataFormat]; + formatMap.html = dataFormat; + break; + + case "application/rtf": + case "text/rtf": + case "rtf": + case "richtext": + case "air:rtf": + case "flash:rtf": + newClipData.rtf = clipData[dataFormat]; + formatMap.rtf = dataFormat; + break; + + default: + break; + } + } + } + return { + data: newClipData, + formatMap: formatMap + }; + }; + /** + * Map the data format names from Flash-friendly names back to their original "clipData" names (via a format mapping). + * + * @returns A new transformed object. + * @private + */ + var _mapClipResultsFromFlash = function(clipResults, formatMap) { + if (!(typeof clipResults === "object" && clipResults && typeof formatMap === "object" && formatMap)) { + return clipResults; + } + var newResults = {}; + for (var prop in clipResults) { + if (_hasOwn.call(clipResults, prop)) { + if (prop === "errors") { + newResults[prop] = clipResults[prop] ? clipResults[prop].slice() : []; + for (var i = 0, len = newResults[prop].length; i < len; i++) { + newResults[prop][i].format = formatMap[newResults[prop][i].format]; + } + } else if (prop !== "success" && prop !== "data") { + newResults[prop] = clipResults[prop]; + } else { + newResults[prop] = {}; + var tmpHash = clipResults[prop]; + for (var dataFormat in tmpHash) { + if (dataFormat && _hasOwn.call(tmpHash, dataFormat) && _hasOwn.call(formatMap, dataFormat)) { + newResults[prop][formatMap[dataFormat]] = tmpHash[dataFormat]; + } + } + } + } + } + return newResults; + }; + /** + * Will look at a path, and will create a "?noCache={time}" or "&noCache={time}" + * query param string to return. Does NOT append that string to the original path. + * This is useful because ExternalInterface often breaks when a Flash SWF is cached. + * + * @returns The `noCache` query param with necessary "?"/"&" prefix. + * @private + */ + var _cacheBust = function(path, options) { + var cacheBust = options == null || options && options.cacheBust === true; + if (cacheBust) { + return (path.indexOf("?") === -1 ? "?" : "&") + "noCache=" + _now(); + } else { + return ""; + } + }; + /** + * Creates a query string for the FlashVars param. + * Does NOT include the cache-busting query param. + * + * @returns FlashVars query string + * @private + */ + var _vars = function(options) { + var i, len, domain, domains, str = "", trustedOriginsExpanded = []; + if (options.trustedDomains) { + if (typeof options.trustedDomains === "string") { + domains = [ options.trustedDomains ]; + } else if (typeof options.trustedDomains === "object" && "length" in options.trustedDomains) { + domains = options.trustedDomains; + } + } + if (domains && domains.length) { + for (i = 0, len = domains.length; i < len; i++) { + if (_hasOwn.call(domains, i) && domains[i] && typeof domains[i] === "string") { + domain = _extractDomain(domains[i]); + if (!domain) { + continue; + } + if (domain === "*") { + trustedOriginsExpanded.length = 0; + trustedOriginsExpanded.push(domain); + break; + } + trustedOriginsExpanded.push.apply(trustedOriginsExpanded, [ domain, "//" + domain, _window.location.protocol + "//" + domain ]); + } + } + } + if (trustedOriginsExpanded.length) { + str += "trustedOrigins=" + _encodeURIComponent(trustedOriginsExpanded.join(",")); + } + if (options.forceEnhancedClipboard === true) { + str += (str ? "&" : "") + "forceEnhancedClipboard=true"; + } + if (typeof options.swfObjectId === "string" && options.swfObjectId) { + str += (str ? "&" : "") + "swfObjectId=" + _encodeURIComponent(options.swfObjectId); + } + if (typeof options.jsVersion === "string" && options.jsVersion) { + str += (str ? "&" : "") + "jsVersion=" + _encodeURIComponent(options.jsVersion); + } + return str; + }; + /** + * Extract the domain (e.g. "github.com") from an origin (e.g. "https://github.com") or + * URL (e.g. "https://github.com/zeroclipboard/zeroclipboard/"). + * + * @returns the domain + * @private + */ + var _extractDomain = function(originOrUrl) { + if (originOrUrl == null || originOrUrl === "") { + return null; + } + originOrUrl = originOrUrl.replace(/^\s+|\s+$/g, ""); + if (originOrUrl === "") { + return null; + } + var protocolIndex = originOrUrl.indexOf("//"); + originOrUrl = protocolIndex === -1 ? originOrUrl : originOrUrl.slice(protocolIndex + 2); + var pathIndex = originOrUrl.indexOf("/"); + originOrUrl = pathIndex === -1 ? originOrUrl : protocolIndex === -1 || pathIndex === 0 ? null : originOrUrl.slice(0, pathIndex); + if (originOrUrl && originOrUrl.slice(-4).toLowerCase() === ".swf") { + return null; + } + return originOrUrl || null; + }; + /** + * Set `allowScriptAccess` based on `trustedDomains` and `window.location.host` vs. `swfPath`. + * + * @returns The appropriate script access level. + * @private + */ + var _determineScriptAccess = function() { + var _extractAllDomains = function(origins) { + var i, len, tmp, resultsArray = []; + if (typeof origins === "string") { + origins = [ origins ]; + } + if (!(typeof origins === "object" && origins && typeof origins.length === "number")) { + return resultsArray; + } + for (i = 0, len = origins.length; i < len; i++) { + if (_hasOwn.call(origins, i) && (tmp = _extractDomain(origins[i]))) { + if (tmp === "*") { + resultsArray.length = 0; + resultsArray.push("*"); + break; + } + if (resultsArray.indexOf(tmp) === -1) { + resultsArray.push(tmp); + } + } + } + return resultsArray; + }; + return function(currentDomain, configOptions) { + var swfDomain = _extractDomain(configOptions.swfPath); + if (swfDomain === null) { + swfDomain = currentDomain; + } + var trustedDomains = _extractAllDomains(configOptions.trustedDomains); + var len = trustedDomains.length; + if (len > 0) { + if (len === 1 && trustedDomains[0] === "*") { + return "always"; + } + if (trustedDomains.indexOf(currentDomain) !== -1) { + if (len === 1 && currentDomain === swfDomain) { + return "sameDomain"; + } + return "always"; + } + } + return "never"; + }; + }(); + /** + * Get the currently active/focused DOM element. + * + * @returns the currently active/focused element, or `null` + * @private + */ + var _safeActiveElement = function() { + try { + return _document.activeElement; + } catch (err) { + return null; + } + }; + /** + * Add a class to an element, if it doesn't already have it. + * + * @returns The element, with its new class added. + * @private + */ + var _addClass = function(element, value) { + var c, cl, className, classNames = []; + if (typeof value === "string" && value) { + classNames = value.split(/\s+/); + } + if (element && element.nodeType === 1 && classNames.length > 0) { + if (element.classList) { + for (c = 0, cl = classNames.length; c < cl; c++) { + element.classList.add(classNames[c]); + } + } else if (element.hasOwnProperty("className")) { + className = " " + element.className + " "; + for (c = 0, cl = classNames.length; c < cl; c++) { + if (className.indexOf(" " + classNames[c] + " ") === -1) { + className += classNames[c] + " "; + } + } + element.className = className.replace(/^\s+|\s+$/g, ""); + } + } + return element; + }; + /** + * Remove a class from an element, if it has it. + * + * @returns The element, with its class removed. + * @private + */ + var _removeClass = function(element, value) { + var c, cl, className, classNames = []; + if (typeof value === "string" && value) { + classNames = value.split(/\s+/); + } + if (element && element.nodeType === 1 && classNames.length > 0) { + if (element.classList && element.classList.length > 0) { + for (c = 0, cl = classNames.length; c < cl; c++) { + element.classList.remove(classNames[c]); + } + } else if (element.className) { + className = (" " + element.className + " ").replace(/[\r\n\t]/g, " "); + for (c = 0, cl = classNames.length; c < cl; c++) { + className = className.replace(" " + classNames[c] + " ", " "); + } + element.className = className.replace(/^\s+|\s+$/g, ""); + } + } + return element; + }; + /** + * Attempt to interpret the element's CSS styling. If `prop` is `"cursor"`, + * then we assume that it should be a hand ("pointer") cursor if the element + * is an anchor element ("a" tag). + * + * @returns The computed style property. + * @private + */ + var _getStyle = function(el, prop) { + var value = _getComputedStyle(el, null).getPropertyValue(prop); + if (prop === "cursor") { + if (!value || value === "auto") { + if (el.nodeName === "A") { + return "pointer"; + } + } + } + return value; + }; + /** + * Get the absolutely positioned coordinates of a DOM element. + * + * @returns Object containing the element's position, width, and height. + * @private + */ + var _getElementPosition = function(el) { + var pos = { + left: 0, + top: 0, + width: 0, + height: 0 + }; + if (el.getBoundingClientRect) { + var elRect = el.getBoundingClientRect(); + var pageXOffset = _window.pageXOffset; + var pageYOffset = _window.pageYOffset; + var leftBorderWidth = _document.documentElement.clientLeft || 0; + var topBorderWidth = _document.documentElement.clientTop || 0; + var leftBodyOffset = 0; + var topBodyOffset = 0; + if (_getStyle(_document.body, "position") === "relative") { + var bodyRect = _document.body.getBoundingClientRect(); + var htmlRect = _document.documentElement.getBoundingClientRect(); + leftBodyOffset = bodyRect.left - htmlRect.left || 0; + topBodyOffset = bodyRect.top - htmlRect.top || 0; + } + pos.left = elRect.left + pageXOffset - leftBorderWidth - leftBodyOffset; + pos.top = elRect.top + pageYOffset - topBorderWidth - topBodyOffset; + pos.width = "width" in elRect ? elRect.width : elRect.right - elRect.left; + pos.height = "height" in elRect ? elRect.height : elRect.bottom - elRect.top; + } + return pos; + }; + /** + * Determine is an element is visible somewhere within the document (page). + * + * @returns Boolean + * @private + */ + var _isElementVisible = function(el) { + if (!el) { + return false; + } + var styles = _getComputedStyle(el, null); + var hasCssHeight = _parseFloat(styles.height) > 0; + var hasCssWidth = _parseFloat(styles.width) > 0; + var hasCssTop = _parseFloat(styles.top) >= 0; + var hasCssLeft = _parseFloat(styles.left) >= 0; + var cssKnows = hasCssHeight && hasCssWidth && hasCssTop && hasCssLeft; + var rect = cssKnows ? null : _getElementPosition(el); + var isVisible = styles.display !== "none" && styles.visibility !== "collapse" && (cssKnows || !!rect && (hasCssHeight || rect.height > 0) && (hasCssWidth || rect.width > 0) && (hasCssTop || rect.top >= 0) && (hasCssLeft || rect.left >= 0)); + return isVisible; + }; + /** + * Clear all existing timeouts and interval polling delegates. + * + * @returns `undefined` + * @private + */ + var _clearTimeoutsAndPolling = function() { + _clearTimeout(_flashCheckTimeout); + _flashCheckTimeout = 0; + _clearInterval(_swfFallbackCheckInterval); + _swfFallbackCheckInterval = 0; + }; + /** + * Reposition the Flash object to cover the currently activated element. + * + * @returns `undefined` + * @private + */ + var _reposition = function() { + var htmlBridge; + if (_currentElement && (htmlBridge = _getHtmlBridge(_flashState.bridge))) { + var pos = _getElementPosition(_currentElement); + _extend(htmlBridge.style, { + width: pos.width + "px", + height: pos.height + "px", + top: pos.top + "px", + left: pos.left + "px", + zIndex: "" + _getSafeZIndex(_globalConfig.zIndex) + }); + } + }; + /** + * Sends a signal to the Flash object to display the hand cursor if `true`. + * + * @returns `undefined` + * @private + */ + var _setHandCursor = function(enabled) { + if (_flashState.ready === true) { + if (_flashState.bridge && typeof _flashState.bridge.setHandCursor === "function") { + _flashState.bridge.setHandCursor(enabled); + } else { + _flashState.ready = false; + } + } + }; + /** + * Get a safe value for `zIndex` + * + * @returns an integer, or "auto" + * @private + */ + var _getSafeZIndex = function(val) { + if (/^(?:auto|inherit)$/.test(val)) { + return val; + } + var zIndex; + if (typeof val === "number" && !_isNaN(val)) { + zIndex = val; + } else if (typeof val === "string") { + zIndex = _getSafeZIndex(_parseInt(val, 10)); + } + return typeof zIndex === "number" ? zIndex : "auto"; + }; + /** + * Attempt to detect if ZeroClipboard is executing inside of a sandboxed iframe. + * If it is, Flash Player cannot be used, so ZeroClipboard is dead in the water. + * + * @see {@link http://lists.w3.org/Archives/Public/public-whatwg-archive/2014Dec/0002.html} + * @see {@link https://github.com/zeroclipboard/zeroclipboard/issues/511} + * @see {@link http://zeroclipboard.org/test-iframes.html} + * + * @returns `true` (is sandboxed), `false` (is not sandboxed), or `null` (uncertain) + * @private + */ + var _detectSandbox = function(doNotReassessFlashSupport) { + var effectiveScriptOrigin, frame, frameError, previousState = _flashState.sandboxed, isSandboxed = null; + doNotReassessFlashSupport = doNotReassessFlashSupport === true; + if (_pageIsFramed === false) { + isSandboxed = false; + } else { + try { + frame = window.frameElement || null; + } catch (e) { + frameError = { + name: e.name, + message: e.message + }; + } + if (frame && frame.nodeType === 1 && frame.nodeName === "IFRAME") { + try { + isSandboxed = frame.hasAttribute("sandbox"); + } catch (e) { + isSandboxed = null; + } + } else { + try { + effectiveScriptOrigin = document.domain || null; + } catch (e) { + effectiveScriptOrigin = null; + } + if (effectiveScriptOrigin === null || frameError && frameError.name === "SecurityError" && /(^|[\s\(\[@])sandbox(es|ed|ing|[\s\.,!\)\]@]|$)/.test(frameError.message.toLowerCase())) { + isSandboxed = true; + } + } + } + _flashState.sandboxed = isSandboxed; + if (previousState !== isSandboxed && !doNotReassessFlashSupport) { + _detectFlashSupport(_ActiveXObject); + } + return isSandboxed; + }; + /** + * Detect the Flash Player status, version, and plugin type. + * + * @see {@link https://code.google.com/p/doctype-mirror/wiki/ArticleDetectFlash#The_code} + * @see {@link http://stackoverflow.com/questions/12866060/detecting-pepper-ppapi-flash-with-javascript} + * + * @returns `undefined` + * @private + */ + var _detectFlashSupport = function(ActiveXObject) { + var plugin, ax, mimeType, hasFlash = false, isActiveX = false, isPPAPI = false, flashVersion = ""; + /** + * Derived from Apple's suggested sniffer. + * @param {String} desc e.g. "Shockwave Flash 7.0 r61" + * @returns {String} "7.0.61" + * @private + */ + function parseFlashVersion(desc) { + var matches = desc.match(/[\d]+/g); + matches.length = 3; + return matches.join("."); + } + function isPepperFlash(flashPlayerFileName) { + return !!flashPlayerFileName && (flashPlayerFileName = flashPlayerFileName.toLowerCase()) && (/^(pepflashplayer\.dll|libpepflashplayer\.so|pepperflashplayer\.plugin)$/.test(flashPlayerFileName) || flashPlayerFileName.slice(-13) === "chrome.plugin"); + } + function inspectPlugin(plugin) { + if (plugin) { + hasFlash = true; + if (plugin.version) { + flashVersion = parseFlashVersion(plugin.version); + } + if (!flashVersion && plugin.description) { + flashVersion = parseFlashVersion(plugin.description); + } + if (plugin.filename) { + isPPAPI = isPepperFlash(plugin.filename); + } + } + } + if (_navigator.plugins && _navigator.plugins.length) { + plugin = _navigator.plugins["Shockwave Flash"]; + inspectPlugin(plugin); + if (_navigator.plugins["Shockwave Flash 2.0"]) { + hasFlash = true; + flashVersion = "2.0.0.11"; + } + } else if (_navigator.mimeTypes && _navigator.mimeTypes.length) { + mimeType = _navigator.mimeTypes["application/x-shockwave-flash"]; + plugin = mimeType && mimeType.enabledPlugin; + inspectPlugin(plugin); + } else if (typeof ActiveXObject !== "undefined") { + isActiveX = true; + try { + ax = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); + hasFlash = true; + flashVersion = parseFlashVersion(ax.GetVariable("$version")); + } catch (e1) { + try { + ax = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); + hasFlash = true; + flashVersion = "6.0.21"; + } catch (e2) { + try { + ax = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); + hasFlash = true; + flashVersion = parseFlashVersion(ax.GetVariable("$version")); + } catch (e3) { + isActiveX = false; + } + } + } + } + _flashState.disabled = hasFlash !== true; + _flashState.outdated = flashVersion && _parseFloat(flashVersion) < _parseFloat(_minimumFlashVersion); + _flashState.version = flashVersion || "0.0.0"; + _flashState.pluginType = isPPAPI ? "pepper" : isActiveX ? "activex" : hasFlash ? "netscape" : "unknown"; + }; + /** + * Invoke the Flash detection algorithms immediately upon inclusion so we're not waiting later. + */ + _detectFlashSupport(_ActiveXObject); + /** + * Always assess the `sandboxed` state of the page at important Flash-related moments. + */ + _detectSandbox(true); + /** + * A shell constructor for `ZeroClipboard` client instances. + * + * @constructor + */ + var ZeroClipboard = function() { + if (!(this instanceof ZeroClipboard)) { + return new ZeroClipboard(); + } + if (typeof ZeroClipboard._createClient === "function") { + ZeroClipboard._createClient.apply(this, _args(arguments)); + } + }; + /** + * The ZeroClipboard library's version number. + * + * @static + * @readonly + * @property {string} + */ + _defineProperty(ZeroClipboard, "version", { + value: "2.2.0", + writable: false, + configurable: true, + enumerable: true + }); + /** + * Update or get a copy of the ZeroClipboard global configuration. + * Returns a copy of the current/updated configuration. + * + * @returns Object + * @static + */ + ZeroClipboard.config = function() { + return _config.apply(this, _args(arguments)); + }; + /** + * Diagnostic method that describes the state of the browser, Flash Player, and ZeroClipboard. + * + * @returns Object + * @static + */ + ZeroClipboard.state = function() { + return _state.apply(this, _args(arguments)); + }; + /** + * Check if Flash is unusable for any reason: disabled, outdated, deactivated, etc. + * + * @returns Boolean + * @static + */ + ZeroClipboard.isFlashUnusable = function() { + return _isFlashUnusable.apply(this, _args(arguments)); + }; + /** + * Register an event listener. + * + * @returns `ZeroClipboard` + * @static + */ + ZeroClipboard.on = function() { + return _on.apply(this, _args(arguments)); + }; + /** + * Unregister an event listener. + * If no `listener` function/object is provided, it will unregister all listeners for the provided `eventType`. + * If no `eventType` is provided, it will unregister all listeners for every event type. + * + * @returns `ZeroClipboard` + * @static + */ + ZeroClipboard.off = function() { + return _off.apply(this, _args(arguments)); + }; + /** + * Retrieve event listeners for an `eventType`. + * If no `eventType` is provided, it will retrieve all listeners for every event type. + * + * @returns array of listeners for the `eventType`; if no `eventType`, then a map/hash object of listeners for all event types; or `null` + */ + ZeroClipboard.handlers = function() { + return _listeners.apply(this, _args(arguments)); + }; + /** + * Event emission receiver from the Flash object, forwarding to any registered JavaScript event listeners. + * + * @returns For the "copy" event, returns the Flash-friendly "clipData" object; otherwise `undefined`. + * @static + */ + ZeroClipboard.emit = function() { + return _emit.apply(this, _args(arguments)); + }; + /** + * Create and embed the Flash object. + * + * @returns The Flash object + * @static + */ + ZeroClipboard.create = function() { + return _create.apply(this, _args(arguments)); + }; + /** + * Self-destruct and clean up everything, including the embedded Flash object. + * + * @returns `undefined` + * @static + */ + ZeroClipboard.destroy = function() { + return _destroy.apply(this, _args(arguments)); + }; + /** + * Set the pending data for clipboard injection. + * + * @returns `undefined` + * @static + */ + ZeroClipboard.setData = function() { + return _setData.apply(this, _args(arguments)); + }; + /** + * Clear the pending data for clipboard injection. + * If no `format` is provided, all pending data formats will be cleared. + * + * @returns `undefined` + * @static + */ + ZeroClipboard.clearData = function() { + return _clearData.apply(this, _args(arguments)); + }; + /** + * Get a copy of the pending data for clipboard injection. + * If no `format` is provided, a copy of ALL pending data formats will be returned. + * + * @returns `String` or `Object` + * @static + */ + ZeroClipboard.getData = function() { + return _getData.apply(this, _args(arguments)); + }; + /** + * Sets the current HTML object that the Flash object should overlay. This will put the global + * Flash object on top of the current element; depending on the setup, this may also set the + * pending clipboard text data as well as the Flash object's wrapping element's title attribute + * based on the underlying HTML element and ZeroClipboard configuration. + * + * @returns `undefined` + * @static + */ + ZeroClipboard.focus = ZeroClipboard.activate = function() { + return _focus.apply(this, _args(arguments)); + }; + /** + * Un-overlays the Flash object. This will put the global Flash object off-screen; depending on + * the setup, this may also unset the Flash object's wrapping element's title attribute based on + * the underlying HTML element and ZeroClipboard configuration. + * + * @returns `undefined` + * @static + */ + ZeroClipboard.blur = ZeroClipboard.deactivate = function() { + return _blur.apply(this, _args(arguments)); + }; + /** + * Returns the currently focused/"activated" HTML element that the Flash object is wrapping. + * + * @returns `HTMLElement` or `null` + * @static + */ + ZeroClipboard.activeElement = function() { + return _activeElement.apply(this, _args(arguments)); + }; + /** + * Keep track of the ZeroClipboard client instance counter. + */ + var _clientIdCounter = 0; + /** + * Keep track of the state of the client instances. + * + * Entry structure: + * _clientMeta[client.id] = { + * instance: client, + * elements: [], + * handlers: {} + * }; + */ + var _clientMeta = {}; + /** + * Keep track of the ZeroClipboard clipped elements counter. + */ + var _elementIdCounter = 0; + /** + * Keep track of the state of the clipped element relationships to clients. + * + * Entry structure: + * _elementMeta[element.zcClippingId] = [client1.id, client2.id]; + */ + var _elementMeta = {}; + /** + * Keep track of the state of the mouse event handlers for clipped elements. + * + * Entry structure: + * _mouseHandlers[element.zcClippingId] = { + * mouseover: function(event) {}, + * mouseout: function(event) {}, + * mouseenter: function(event) {}, + * mouseleave: function(event) {}, + * mousemove: function(event) {} + * }; + */ + var _mouseHandlers = {}; + /** + * Extending the ZeroClipboard configuration defaults for the Client module. + */ + _extend(_globalConfig, { + autoActivate: true + }); + /** + * The real constructor for `ZeroClipboard` client instances. + * @private + */ + var _clientConstructor = function(elements) { + var client = this; + client.id = "" + _clientIdCounter++; + _clientMeta[client.id] = { + instance: client, + elements: [], + handlers: {} + }; + if (elements) { + client.clip(elements); + } + ZeroClipboard.on("*", function(event) { + return client.emit(event); + }); + ZeroClipboard.on("destroy", function() { + client.destroy(); + }); + ZeroClipboard.create(); + }; + /** + * The underlying implementation of `ZeroClipboard.Client.prototype.on`. + * @private + */ + var _clientOn = function(eventType, listener) { + var i, len, events, added = {}, meta = _clientMeta[this.id], handlers = meta && meta.handlers; + if (!meta) { + throw new Error("Attempted to add new listener(s) to a destroyed ZeroClipboard client instance"); + } + if (typeof eventType === "string" && eventType) { + events = eventType.toLowerCase().split(/\s+/); + } else if (typeof eventType === "object" && eventType && typeof listener === "undefined") { + for (i in eventType) { + if (_hasOwn.call(eventType, i) && typeof i === "string" && i && typeof eventType[i] === "function") { + this.on(i, eventType[i]); + } + } + } + if (events && events.length) { + for (i = 0, len = events.length; i < len; i++) { + eventType = events[i].replace(/^on/, ""); + added[eventType] = true; + if (!handlers[eventType]) { + handlers[eventType] = []; + } + handlers[eventType].push(listener); + } + if (added.ready && _flashState.ready) { + this.emit({ + type: "ready", + client: this + }); + } + if (added.error) { + for (i = 0, len = _flashStateErrorNames.length; i < len; i++) { + if (_flashState[_flashStateErrorNames[i].replace(/^flash-/, "")]) { + this.emit({ + type: "error", + name: _flashStateErrorNames[i], + client: this + }); + break; + } + } + if (_zcSwfVersion !== undefined && ZeroClipboard.version !== _zcSwfVersion) { + this.emit({ + type: "error", + name: "version-mismatch", + jsVersion: ZeroClipboard.version, + swfVersion: _zcSwfVersion + }); + } + } + } + return this; + }; + /** + * The underlying implementation of `ZeroClipboard.Client.prototype.off`. + * @private + */ + var _clientOff = function(eventType, listener) { + var i, len, foundIndex, events, perEventHandlers, meta = _clientMeta[this.id], handlers = meta && meta.handlers; + if (!handlers) { + return this; + } + if (arguments.length === 0) { + events = _keys(handlers); + } else if (typeof eventType === "string" && eventType) { + events = eventType.split(/\s+/); + } else if (typeof eventType === "object" && eventType && typeof listener === "undefined") { + for (i in eventType) { + if (_hasOwn.call(eventType, i) && typeof i === "string" && i && typeof eventType[i] === "function") { + this.off(i, eventType[i]); + } + } + } + if (events && events.length) { + for (i = 0, len = events.length; i < len; i++) { + eventType = events[i].toLowerCase().replace(/^on/, ""); + perEventHandlers = handlers[eventType]; + if (perEventHandlers && perEventHandlers.length) { + if (listener) { + foundIndex = perEventHandlers.indexOf(listener); + while (foundIndex !== -1) { + perEventHandlers.splice(foundIndex, 1); + foundIndex = perEventHandlers.indexOf(listener, foundIndex); + } + } else { + perEventHandlers.length = 0; + } + } + } + } + return this; + }; + /** + * The underlying implementation of `ZeroClipboard.Client.prototype.handlers`. + * @private + */ + var _clientListeners = function(eventType) { + var copy = null, handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers; + if (handlers) { + if (typeof eventType === "string" && eventType) { + copy = handlers[eventType] ? handlers[eventType].slice(0) : []; + } else { + copy = _deepCopy(handlers); + } + } + return copy; + }; + /** + * The underlying implementation of `ZeroClipboard.Client.prototype.emit`. + * @private + */ + var _clientEmit = function(event) { + if (_clientShouldEmit.call(this, event)) { + if (typeof event === "object" && event && typeof event.type === "string" && event.type) { + event = _extend({}, event); + } + var eventCopy = _extend({}, _createEvent(event), { + client: this + }); + _clientDispatchCallbacks.call(this, eventCopy); + } + return this; + }; + /** + * The underlying implementation of `ZeroClipboard.Client.prototype.clip`. + * @private + */ + var _clientClip = function(elements) { + if (!_clientMeta[this.id]) { + throw new Error("Attempted to clip element(s) to a destroyed ZeroClipboard client instance"); + } + elements = _prepClip(elements); + for (var i = 0; i < elements.length; i++) { + if (_hasOwn.call(elements, i) && elements[i] && elements[i].nodeType === 1) { + if (!elements[i].zcClippingId) { + elements[i].zcClippingId = "zcClippingId_" + _elementIdCounter++; + _elementMeta[elements[i].zcClippingId] = [ this.id ]; + if (_globalConfig.autoActivate === true) { + _addMouseHandlers(elements[i]); + } + } else if (_elementMeta[elements[i].zcClippingId].indexOf(this.id) === -1) { + _elementMeta[elements[i].zcClippingId].push(this.id); + } + var clippedElements = _clientMeta[this.id] && _clientMeta[this.id].elements; + if (clippedElements.indexOf(elements[i]) === -1) { + clippedElements.push(elements[i]); + } + } + } + return this; + }; + /** + * The underlying implementation of `ZeroClipboard.Client.prototype.unclip`. + * @private + */ + var _clientUnclip = function(elements) { + var meta = _clientMeta[this.id]; + if (!meta) { + return this; + } + var clippedElements = meta.elements; + var arrayIndex; + if (typeof elements === "undefined") { + elements = clippedElements.slice(0); + } else { + elements = _prepClip(elements); + } + for (var i = elements.length; i--; ) { + if (_hasOwn.call(elements, i) && elements[i] && elements[i].nodeType === 1) { + arrayIndex = 0; + while ((arrayIndex = clippedElements.indexOf(elements[i], arrayIndex)) !== -1) { + clippedElements.splice(arrayIndex, 1); + } + var clientIds = _elementMeta[elements[i].zcClippingId]; + if (clientIds) { + arrayIndex = 0; + while ((arrayIndex = clientIds.indexOf(this.id, arrayIndex)) !== -1) { + clientIds.splice(arrayIndex, 1); + } + if (clientIds.length === 0) { + if (_globalConfig.autoActivate === true) { + _removeMouseHandlers(elements[i]); + } + delete elements[i].zcClippingId; + } + } + } + } + return this; + }; + /** + * The underlying implementation of `ZeroClipboard.Client.prototype.elements`. + * @private + */ + var _clientElements = function() { + var meta = _clientMeta[this.id]; + return meta && meta.elements ? meta.elements.slice(0) : []; + }; + /** + * The underlying implementation of `ZeroClipboard.Client.prototype.destroy`. + * @private + */ + var _clientDestroy = function() { + if (!_clientMeta[this.id]) { + return; + } + this.unclip(); + this.off(); + delete _clientMeta[this.id]; + }; + /** + * Inspect an Event to see if the Client (`this`) should honor it for emission. + * @private + */ + var _clientShouldEmit = function(event) { + if (!(event && event.type)) { + return false; + } + if (event.client && event.client !== this) { + return false; + } + var meta = _clientMeta[this.id]; + var clippedEls = meta && meta.elements; + var hasClippedEls = !!clippedEls && clippedEls.length > 0; + var goodTarget = !event.target || hasClippedEls && clippedEls.indexOf(event.target) !== -1; + var goodRelTarget = event.relatedTarget && hasClippedEls && clippedEls.indexOf(event.relatedTarget) !== -1; + var goodClient = event.client && event.client === this; + if (!meta || !(goodTarget || goodRelTarget || goodClient)) { + return false; + } + return true; + }; + /** + * Handle the actual dispatching of events to a client instance. + * + * @returns `undefined` + * @private + */ + var _clientDispatchCallbacks = function(event) { + var meta = _clientMeta[this.id]; + if (!(typeof event === "object" && event && event.type && meta)) { + return; + } + var async = _shouldPerformAsync(event); + var wildcardTypeHandlers = meta && meta.handlers["*"] || []; + var specificTypeHandlers = meta && meta.handlers[event.type] || []; + var handlers = wildcardTypeHandlers.concat(specificTypeHandlers); + if (handlers && handlers.length) { + var i, len, func, context, eventCopy, originalContext = this; + for (i = 0, len = handlers.length; i < len; i++) { + func = handlers[i]; + context = originalContext; + if (typeof func === "string" && typeof _window[func] === "function") { + func = _window[func]; + } + if (typeof func === "object" && func && typeof func.handleEvent === "function") { + context = func; + func = func.handleEvent; + } + if (typeof func === "function") { + eventCopy = _extend({}, event); + _dispatchCallback(func, context, [ eventCopy ], async); + } + } + } + }; + /** + * Prepares the elements for clipping/unclipping. + * + * @returns An Array of elements. + * @private + */ + var _prepClip = function(elements) { + if (typeof elements === "string") { + elements = []; + } + return typeof elements.length !== "number" ? [ elements ] : elements; + }; + /** + * Add a `mouseover` handler function for a clipped element. + * + * @returns `undefined` + * @private + */ + var _addMouseHandlers = function(element) { + if (!(element && element.nodeType === 1)) { + return; + } + var _suppressMouseEvents = function(event) { + if (!(event || (event = _window.event))) { + return; + } + if (event._source !== "js") { + event.stopImmediatePropagation(); + event.preventDefault(); + } + delete event._source; + }; + var _elementMouseOver = function(event) { + if (!(event || (event = _window.event))) { + return; + } + _suppressMouseEvents(event); + ZeroClipboard.focus(element); + }; + element.addEventListener("mouseover", _elementMouseOver, false); + element.addEventListener("mouseout", _suppressMouseEvents, false); + element.addEventListener("mouseenter", _suppressMouseEvents, false); + element.addEventListener("mouseleave", _suppressMouseEvents, false); + element.addEventListener("mousemove", _suppressMouseEvents, false); + _mouseHandlers[element.zcClippingId] = { + mouseover: _elementMouseOver, + mouseout: _suppressMouseEvents, + mouseenter: _suppressMouseEvents, + mouseleave: _suppressMouseEvents, + mousemove: _suppressMouseEvents + }; + }; + /** + * Remove a `mouseover` handler function for a clipped element. + * + * @returns `undefined` + * @private + */ + var _removeMouseHandlers = function(element) { + if (!(element && element.nodeType === 1)) { + return; + } + var mouseHandlers = _mouseHandlers[element.zcClippingId]; + if (!(typeof mouseHandlers === "object" && mouseHandlers)) { + return; + } + var key, val, mouseEvents = [ "move", "leave", "enter", "out", "over" ]; + for (var i = 0, len = mouseEvents.length; i < len; i++) { + key = "mouse" + mouseEvents[i]; + val = mouseHandlers[key]; + if (typeof val === "function") { + element.removeEventListener(key, val, false); + } + } + delete _mouseHandlers[element.zcClippingId]; + }; + /** + * Creates a new ZeroClipboard client instance. + * Optionally, auto-`clip` an element or collection of elements. + * + * @constructor + */ + ZeroClipboard._createClient = function() { + _clientConstructor.apply(this, _args(arguments)); + }; + /** + * Register an event listener to the client. + * + * @returns `this` + */ + ZeroClipboard.prototype.on = function() { + return _clientOn.apply(this, _args(arguments)); + }; + /** + * Unregister an event handler from the client. + * If no `listener` function/object is provided, it will unregister all handlers for the provided `eventType`. + * If no `eventType` is provided, it will unregister all handlers for every event type. + * + * @returns `this` + */ + ZeroClipboard.prototype.off = function() { + return _clientOff.apply(this, _args(arguments)); + }; + /** + * Retrieve event listeners for an `eventType` from the client. + * If no `eventType` is provided, it will retrieve all listeners for every event type. + * + * @returns array of listeners for the `eventType`; if no `eventType`, then a map/hash object of listeners for all event types; or `null` + */ + ZeroClipboard.prototype.handlers = function() { + return _clientListeners.apply(this, _args(arguments)); + }; + /** + * Event emission receiver from the Flash object for this client's registered JavaScript event listeners. + * + * @returns For the "copy" event, returns the Flash-friendly "clipData" object; otherwise `undefined`. + */ + ZeroClipboard.prototype.emit = function() { + return _clientEmit.apply(this, _args(arguments)); + }; + /** + * Register clipboard actions for new element(s) to the client. + * + * @returns `this` + */ + ZeroClipboard.prototype.clip = function() { + return _clientClip.apply(this, _args(arguments)); + }; + /** + * Unregister the clipboard actions of previously registered element(s) on the page. + * If no elements are provided, ALL registered elements will be unregistered. + * + * @returns `this` + */ + ZeroClipboard.prototype.unclip = function() { + return _clientUnclip.apply(this, _args(arguments)); + }; + /** + * Get all of the elements to which this client is clipped. + * + * @returns array of clipped elements + */ + ZeroClipboard.prototype.elements = function() { + return _clientElements.apply(this, _args(arguments)); + }; + /** + * Self-destruct and clean up everything for a single client. + * This will NOT destroy the embedded Flash object. + * + * @returns `undefined` + */ + ZeroClipboard.prototype.destroy = function() { + return _clientDestroy.apply(this, _args(arguments)); + }; + /** + * Stores the pending plain text to inject into the clipboard. + * + * @returns `this` + */ + ZeroClipboard.prototype.setText = function(text) { + if (!_clientMeta[this.id]) { + throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance"); + } + ZeroClipboard.setData("text/plain", text); + return this; + }; + /** + * Stores the pending HTML text to inject into the clipboard. + * + * @returns `this` + */ + ZeroClipboard.prototype.setHtml = function(html) { + if (!_clientMeta[this.id]) { + throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance"); + } + ZeroClipboard.setData("text/html", html); + return this; + }; + /** + * Stores the pending rich text (RTF) to inject into the clipboard. + * + * @returns `this` + */ + ZeroClipboard.prototype.setRichText = function(richText) { + if (!_clientMeta[this.id]) { + throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance"); + } + ZeroClipboard.setData("application/rtf", richText); + return this; + }; + /** + * Stores the pending data to inject into the clipboard. + * + * @returns `this` + */ + ZeroClipboard.prototype.setData = function() { + if (!_clientMeta[this.id]) { + throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance"); + } + ZeroClipboard.setData.apply(this, _args(arguments)); + return this; + }; + /** + * Clears the pending data to inject into the clipboard. + * If no `format` is provided, all pending data formats will be cleared. + * + * @returns `this` + */ + ZeroClipboard.prototype.clearData = function() { + if (!_clientMeta[this.id]) { + throw new Error("Attempted to clear pending clipboard data from a destroyed ZeroClipboard client instance"); + } + ZeroClipboard.clearData.apply(this, _args(arguments)); + return this; + }; + /** + * Gets a copy of the pending data to inject into the clipboard. + * If no `format` is provided, a copy of ALL pending data formats will be returned. + * + * @returns `String` or `Object` + */ + ZeroClipboard.prototype.getData = function() { + if (!_clientMeta[this.id]) { + throw new Error("Attempted to get pending clipboard data from a destroyed ZeroClipboard client instance"); + } + return ZeroClipboard.getData.apply(this, _args(arguments)); + }; + if (typeof define === "function" && define.amd) { + define(function() { + return ZeroClipboard; + }); + } else if (typeof module === "object" && module && typeof module.exports === "object" && module.exports) { + module.exports = ZeroClipboard; + } else { + window.ZeroClipboard = ZeroClipboard; + } +})(function() { + return this || window; +}()); +},{}]},{},[23,59,61,60,62,83,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,84,85,86,87,100,101,102,90,91,92,93,94,95,31,35,32,33,40,34,36,37,38,39])("zeroclipboard") +}); \ No newline at end of file diff --git a/package.js b/package.js index fdcade8..1fa0e19 100644 --- a/package.js +++ b/package.js @@ -1,6 +1,6 @@ Package.describe({ name: 'awsp:handsontable', - version: '0.12.2', + version: '0.12.3', summary: 'Handsontable is a data grid component with an Excel-like appearance. Built in JavaScript.', git: 'https://github.com/awsp/handsontable-meteor', documentation: 'README.md' @@ -8,16 +8,15 @@ Package.describe({ Package.onUse(function(api) { api.versionsFrom('1.0'); - api.addFiles('awsp:handsontable.js', 'client'); api.use('jquery', 'client'); api.addFiles([ 'bower_components/pikaday/css/pikaday.css', - 'lib/handsontable.meteor.0.20.2.css', + 'lib/handsontable.meteor.0.20.3.css', 'lib/handsontable-ruleJS/src/handsontable.formula.css', 'lib/rulejs/ruleJS.all.full.js', - 'lib/handsontable.meteor.0.20.2.js', + 'lib/handsontable.meteor.0.20.3.js', 'lib/rulejs/handsontable.formula.js', 'lib/handsontable-ruleJS/lib/highlight/styles/github.css', 'lib/rulejs/highlight.pack.js', From ae06cc66df7066d3c11bca477ee8756688a1c941 Mon Sep 17 00:00:00 2001 From: awsp Date: Sun, 17 Jan 2016 23:22:47 -1000 Subject: [PATCH 2/4] update readme --- README.md | 5 ++++- lib/rulejs/handsontable.formula.js | 2 +- package.js | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f95a036..33c37e5 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ $("#hot3").handsontable({ }); ``` -## Formula Support +## Formula Support (Updated Jan 17, 2016) Starting from package version 0.7.0, you could also enable formulas in Handsontable. This package uses the default styling from Handsontable and RuleJS. However, you can always customize to your own by changing the following 2 classes in CSS. @@ -75,6 +75,9 @@ For more details on usage and supported formulas, - Supported Formulas: [http://handsontable.github.io/ruleJS/](http://handsontable.github.io/ruleJS/) +#### Notes about formula support. +Formula supports does not work with autofilling with Handsontable 0.14+ + ## Release Notes diff --git a/lib/rulejs/handsontable.formula.js b/lib/rulejs/handsontable.formula.js index 8585a91..78684e5 100644 --- a/lib/rulejs/handsontable.formula.js +++ b/lib/rulejs/handsontable.formula.js @@ -153,7 +153,7 @@ var beforeAutofillInsidePopulate = function (index, direction, data, deltas, iterators, selected) { var instance = this; - +console.log(data, index); var r = index.row, c = index.col, value = data[r][c], diff --git a/package.js b/package.js index 1fa0e19..b29ce83 100644 --- a/package.js +++ b/package.js @@ -16,7 +16,7 @@ Package.onUse(function(api) { 'lib/handsontable-ruleJS/src/handsontable.formula.css', 'lib/rulejs/ruleJS.all.full.js', - 'lib/handsontable.meteor.0.20.3.js', + 'lib/handsontable.meteor.0.13.1.js', 'lib/rulejs/handsontable.formula.js', 'lib/handsontable-ruleJS/lib/highlight/styles/github.css', 'lib/rulejs/highlight.pack.js', From f9dc4e1cda7406b1ae51700bdecbf7ef4524b943 Mon Sep 17 00:00:00 2001 From: awsp Date: Sun, 17 Jan 2016 23:23:13 -1000 Subject: [PATCH 3/4] wrong version --- package.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.js b/package.js index b29ce83..1fa0e19 100644 --- a/package.js +++ b/package.js @@ -16,7 +16,7 @@ Package.onUse(function(api) { 'lib/handsontable-ruleJS/src/handsontable.formula.css', 'lib/rulejs/ruleJS.all.full.js', - 'lib/handsontable.meteor.0.13.1.js', + 'lib/handsontable.meteor.0.20.3.js', 'lib/rulejs/handsontable.formula.js', 'lib/handsontable-ruleJS/lib/highlight/styles/github.css', 'lib/rulejs/highlight.pack.js', From e58cd9bd77f6ec81bdbbe3f2167f353248755cf0 Mon Sep 17 00:00:00 2001 From: awsp Date: Sun, 17 Jan 2016 23:25:12 -1000 Subject: [PATCH 4/4] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 33c37e5..a6ed500 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ For more details on usage and supported formulas, #### Notes about formula support. -Formula supports does not work with autofilling with Handsontable 0.14+ +Formula support does not work with autofilling with Handsontable 0.14+.